resolving-clinical-context
Skill này làm gì
Skill này dạy agent cách đọc các từ xung quanh thuật ngữ y khoa trong ghi chú. Nó đánh dấu xem từng phát hiện là bị phủ định, thuộc quá khứ, giả định hay chưa chắc, để không bị tính nhầm là đang hoạt động.
Khi nào nên dùng
- ✓Khi người dùng có ghi chú lâm sàng trong đó một số triệu chứng bị phủ nhận và không được ghi là có.
- ✓Khi người dùng cần tách bệnh quá khứ khỏi bệnh đang hoạt động trước khi lập danh sách.
- ✓Khi người dùng muốn các phát hiện chưa chắc hoặc để loại trừ được gắn cờ thay vì tính là chẩn đoán.
Liên kết skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra ghi chú khám của tôi để các triệu chứng bệnh nhân phủ nhận không bị tính là có không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc các từ gần mỗi thuật ngữ y khoa, như denies hoặc history of. Nó gán nhãn đơn giản cho phủ định, thời gian và mức chắc chắn, sau khi các thuật ngữ đã được tìm thấy.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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→ `
Câu hỏi thường gặp
Phủ định nghĩa là gì ở đây?
Nghĩa là ghi chú nói bệnh nhân không có phát hiện đó, như denies chest pain (bệnh nhân phủ nhận đau ngực).
Nó có đánh dấu tiền sử gia đình không?
Có. Skill liệt kê tiền sử gia đình là một trong các cờ mà nó xử lý.
Bước nào đứng trước bước này?
Trích xuất thực thể chạy trước, để skill biết thuật ngữ nào cần kiểm tra.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14726
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
annotating-variants
5.8kGiúp agent dự đoán tác động của biến thể di truyền, đổi tên HGVS sang vị trí bộ gen và gắn tần suất quần thể bằng công cụ chú giải miễn phí.
ask-openmed
5.8kGiúp agent chọn đúng quy trình OpenMed cho yêu cầu về văn bản lâm sàng, luôn kiểm tra quyền riêng tư trước khi có thể có dữ liệu bệnh nhân.
assembling-fhir-bundles
5.8kGói nhiều bản ghi y tế FHIR thành một Bundle giao dịch để gửi tới EHR, với các tham chiếu nội bộ được liên kết đúng.
auditing-deid-leakage
5.8kQuét văn bản lâm sàng đã khử nhận dạng để tìm định danh còn sót như SSN, số thẻ, email và ngày tháng, và chặn phát hành nếu còn sót.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.