resolving-clinical-context
できること
このスキルは、臨床ノートの医学用語の周りの言葉を読む方法をエージェントに教えます。各所見が否定、既往、仮定、不確かのいずれかを示すかをマークし、誤って活動中として数えられないようにします。
使う場面
- ✓ノートにある症状の一部が否定されていて、存在するものとして記録してはいけないとき。
- ✓リストを作る前に、既往の病状を活動中の病状と分ける必要があるとき。
- ✓除外のための検査や不確かな所見を、診断として数えずにフラグを立てたいとき。
スキルのリンク
https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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/clinicalStatusand 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
- 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 atext-like key, or any object exposing.text, plus optionalmodifier_hits. - Resolve negation with
resolve_negation(span, window)→AFFIRMEDorNEGATED. 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. - Resolve temporality with
resolve_temporality(span, window)→RECENT(default),HISTORICAL("history of," "h/o," "s/p," "resolved," "PMH"), orHYPOTHETICAL("if," "should," "in case of"). A conditional span is treated as hypothetical even if a historical cue is also present. - Resolve uncertainty with
resolve_uncertainty(span, window)→CERTAINorUNCERTAIN("concern for," "suspicious for," "rule out," "probable," "vs," "r/o"). Uncertain spans are flagged, not dropped. - Apply the axes downstream. Drop or refute
NEGATEDspans; routeHISTORICALto inactive/resolved status; do not recordHYPOTHETICALspans as present; markUNCERTAINspans 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 consumesanalyze_textDisease/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, ClinicalAssertionand theNEGATED/AFFIRMED,HISTORICAL/RECENT/HYPOTHETICAL,CERTAIN/UNCERTAINconstants. - To
reconciling-problem-lists: feed each entity plus itsClinicalContextResultso 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
コメント
- …
このリポジトリの他のスキル
annotating-variants
5.8kエージェントが、無料の公開アノテーターを使って、遺伝子バリアントの作用を予測し、HGVS名をゲノム上の位置に変換し、集団の頻度を付与できるよう支援します。
ask-openmed
5.8kエージェントが、臨床テキストの依頼に合ったOpenMedのワークフローを選べるよう支援します。患者データが含まれる可能性がある場合は、必ずプライバシーの確認から始めます。
assembling-fhir-bundles
5.8kエージェントが、複数のFHIR健康記録を、内部の参照を正しくつないだ一つのトランザクションBundleにまとめ、EHRに送れる状態にします。
auditing-deid-leakage
5.8kエージェントが、匿名化済みの臨床テキストに残っている識別子(SSN、カード番号、メール、日付など)をスキャンし、残っていれば公開を止めます。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。