본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트5.8k · #14726

resolving-clinical-context

하는 일

이 스킬은 노트에서 의학 용어 주변의 단어를 읽는 방법을 에이전트에게 가르칩니다. 각 소견이 부정, 과거, 가정, 불확실 중 무엇인지 표시해, 활성으로 잘못 세지 않도록 합니다.

사용하는 경우

  • ✓증상 일부가 부정된 임상 노트에서 그것이 존재하는 것으로 기록되면 안 될 때.
  • ✓목록을 만들기 전에 과거 질환을 활성 질환과 구분해야 할 때.
  • ✓확실하지 않은 소견이나 배제 진단은 진단으로 세지 않고 표시하고 싶을 때.

스킬 링크

https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 진료 노트를 확인해서 환자가 부인한 증상이 있는 것으로 세어지지 않도록 해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 '부인함', '병력 있음' 같은 표현 주변의 단어를 읽습니다. 용어가 이미 찾아진 뒤에, 부정, 시점, 확실성에 대한 간단한 라벨을 붙입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Resolving clinical context

NER finds that a condition was mentioned; it does not tell you whether the patient has it. "Patient denies chest pain," "history of MI," and "rule out PE" all surface entities that must not be recorded as active, present findings. OpenMed's openmed.clinical ConText layer assigns three deterministic axes to each span — negation, temporality, uncertainty — turning raw mentions into clinically faithful assertions before they reach a problem list or FHIR Condition.

When to use

  • Immediately after extracting-clinical-entities, before grounding, problem-list building, or analytics.
  • The user asks for assertion status, negation handling, "is this affirmed?", family-history vs. patient, historical vs. active, or hedged/uncertain findings.
  • You are about to map entities to FHIR verificationStatus /clinicalStatus and need the upstream signal.

Quick start

import openmed
from openmed.clinical import (
    resolve_span_context, assert_context_axes,
    NEGATED, HISTORICAL, HYPOTHETICAL, UNCERTAIN,
)

note = "Patient denies chest pain. History of MI. Concern for PE; rule out DVT."

# 1) Extract entities (registry key, HF id, or local path).
ents = openmed.analyze_text(note, model_name="disease_detection_superclinical",
                            output_format="dict")

# 2) Assign ConText axes per entity. Pass the span text plus a window of cues.
for e in ents:
    span = e["word"]                      # entity surface text
    window = note                         # full sentence/note as modifier context
    ctx = resolve_span_context(span, window)
    print(span, "->", ctx.negation, ctx.temporality, ctx.certainty)

# "chest pain" -> negated   recent      certain     (do NOT record as present)
# "MI"         -> affirmed  historical  certain     (past, not active)
# "PE"         -> affirmed  recent      uncertain   (hedged; flag, don't drop)

resolve_span_context returns a ClinicalContextResult(negation, temporality, certainty). For a downstream-grounding-shaped record use assert_context_axes, which returns a ClinicalAssertion with a .to_dict() that omits unset axes.

Workflow

  1. Get entities and their context window. From analyze_text, take each entity's surface text and the surrounding sentence (or the whole short note) as the modifier window. The ConText helpers accept a string, a span mapping with a text-like key, or any object exposing .text, plus optional modifier_hits.
  2. Resolve negation with resolve_negation(span, window) → AFFIRMED or NEGATED. It uses a NegEx/ConText cue lexicon ("denies," "no evidence of," "without," "negative for"), masks pseudo-negation ("not ruled out," "cannot be excluded") so those don't refute the concept, and counts true cues with even/odd parity so double-negation is deterministic.
  3. Resolve temporality with resolve_temporality(span, window) → RECENT (default), HISTORICAL ("history of," "h/o," "s/p," "resolved," "PMH"), or HYPOTHETICAL ("if," "should," "in case of"). A conditional span is treated as hypothetical even if a historical cue is also present.
  4. Resolve uncertainty with resolve_uncertainty(span, window) → CERTAIN or UNCERTAIN ("concern for," "suspicious for," "rule out," "probable," "vs," "r/o"). Uncertain spans are flagged, not dropped.
  5. Apply the axes downstream. Drop or refute NEGATED spans; route HISTORICAL to inactive/resolved status; do not record HYPOTHETICAL spans as present; mark UNCERTAIN spans provisional. Use the constants, not string literals, so a vocabulary change doesn't silently break comparisons.

Hand-off to / from OpenMed

  • From extracting-clinical-entities: this skill consumes analyze_text Disease/Finding entities. Without context resolution, every mention — including negated and historical ones — would be (wrongly) treated as present.
  • OpenMed calls: from openmed.clinical import resolve_negation, resolve_temporality, resolve_uncertainty, resolve_span_context, assert_context_axes, ClinicalAssertion and the NEGATED/AFFIRMED, HISTORICAL/RECENT/HYPOTHETICAL, CERTAIN/UNCERTAIN constants.
  • To reconciling-problem-lists: feed each entity plus its ClinicalContextResult so active vs. resolved vs. historical is decided correctly and negated mentions are excluded.
  • To FHIR grounding: negation=negated → `
자주 묻는 질문

부정은 무슨 뜻인가요?

노트에 환자가 그 소견을 가지고 있지 않다고 적혀 있다는 뜻입니다. 예를 들어 흉통을 부인한 경우입니다.

가족력도 표시하나요?

네. 스킬이 다루는 표시 중 하나로 가족력을 다룹니다.

이 단계 전에 무엇이 오나요?

개체 추출이 먼저 실행되므로, 스킬은 확인할 용어를 이미 알고 있습니다.

상세 정보

작성자의 원본 설명

Assign negation, temporality, and uncertainty (the ConText axes) to clinical entities extracted by OpenMed, so \"denies chest pain\" is not counted as chest pain and \"history of MI\" is not counted as an active MI. Use after NER when the user needs assertion status, negation detection, family-history / hypothetical / historical flags, or ConText/NegEx-style classification before grounding entities to FHIR or a problem list. Covers openmed.clinical.resolve_negation / resolve_temporality / resolve_uncertainty / resolve_span_context / assert_context_axes, ClinicalAssertion, and the AFFIRMED/NEGA

repo: maziyarpanahi/openmed

인기도

GitHub 스타
5.8k
순위
#14726
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬