resolving-clinical-context
ما الذي تفعله
تعلّم هذه المهارة الوكيل كيفية قراءة الكلمات المحيطة بالمصطلحات الطبية في الملاحظة. تحدد هل الحالة منفية أو تاريخية أو افتراضية أو غير مؤكدة، حتى لا تُحسب نشطة بالخطأ.
متى تستخدمها
- ✓عندما تكون في الملاحظة السريرية أعراض يُنفيها المريض، ولا يجب تسجيلها على أنها موجودة.
- ✓عندما يحتاج المستخدم إلى فصل الحالات السابقة عن النشطة قبل بناء قائمة.
- ✓عندما يريد المستخدم وضع علامة على النتائج غير المؤكدة أو المستبعدة بدلاً من احتسابها تشخيصات.
رابط المهارة
https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل تستطيع مراجعة ملاحظة العيادة عندي حتى لا تُحسب الأعراض التي ينفيها المريض على أنها موجودة؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يقرأ وكيلك الكلمات القريبة من كل مصطلح طبي، مثل denies أو history of. ويعطي تسميات بسيطة للنفي والتوقيت واليقين، بعد أن تكون المصطلحات قد وُجدت.
المحتوى التقني (ملف 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→ `
الأسئلة الشائعة
ماذا يعني النفي هنا؟
يعني أن الملاحظة تقول إن المريض لا يعاني هذه الحالة، مثل denies chest pain.
هل تعلّم التاريخ العائلي؟
نعم. تذكر المهارة التاريخ العائلي من العلامات التي تتعامل معها.
ما الذي يسبق هذه الخطوة؟
يعمل استخراج الكيانات أولاً، فتعرف المهارة المصطلحات التي يجب فحصها.
التفاصيل
الوصف الأصلي من المؤلف
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
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
annotating-variants
5.8kيساعد وكيلك على توقع تأثير المتغير الجيني، وتحويل أسماء HGVS إلى مواضع في الجينوم، وإضافة ترددات السكان، باستخدام أدوات تعليق عامة ومجانية.
ask-openmed
5.8kيساعد وكيلك على اختيار سير عمل OpenMed المناسب لطلب نصوص سريرية، مع البدء دائمًا بفحص الخصوصية عندما تحتمل وجود بيانات مرضى.
assembling-fhir-bundles
5.8kيجمع عدة سجلات صحية بصيغة FHIR في حزمة (Bundle) واحدة للمعاملات، جاهزة للإرسال إلى EHR، مع ربط المراجع الداخلية بشكل صحيح.
auditing-deid-leakage
5.8kيفحص النصوص السريرية التي أُزيلت هويتها بحثًا عن معرّفات متبقية، مثل أرقام الضمان الاجتماعي وأرقام البطاقات والبريد الإلكتروني والتواريخ، ويوقف النشر إذا بقي أي منها.
مهارات مشابهة
gitcrawl
394kيتيح لوكيلك البحث في أرشيف محفوظ لمشكلات GitHub وطلبات السحب، وتجميع المكرر منها، والتحقق من حالتها الحالية على GitHub.
slacrawl
394kيتيح لوكيلك البحث في رسائل Slack داخل أرشيف محلي وعدّها، والتحقق من مدى حداثة الأرشيف، وتحديثه عند الحاجة.
goplaces
394kيساعد وكيلك على البحث عن الأماكن وعرض تفاصيلها وتقييماتها وتحديد أسمائها عبر Google Places، مع مخرجات JSON للسكربتات.