resolving-clinical-context
O que ela faz
Esta skill ensina um agente a interpretar as palavras ao redor dos termos médicos em uma nota. Ela marca se cada achado é negado, histórico, hipotético ou incerto, para que não seja contado como ativo por engano.
Quando usar
- ✓Quando um usuário tem uma nota clínica em que alguns sintomas são negados e não podem ser registrados como presentes.
- ✓Quando um usuário precisa separar condições passadas das ativas antes de montar uma lista.
- ✓Quando um usuário quer que achados incertos ou de exclusão sejam sinalizados em vez de contados como diagnósticos.
Link da skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/resolving-clinical-context/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Você pode revisar a nota da minha clínica para que os sintomas que o paciente nega não sejam contados como presentes?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente lê as palavras próximas a cada termo médico, como nega ou história de. Ele atribui rótulos simples de negação, tempo e certeza, depois que os termos já foram encontrados.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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→ `
Perguntas frequentes
O que significa negação aqui?
Significa que a nota afirma que o paciente não tem o achado, como nega dor torácica.
Ela marca história familiar?
Sim. A skill lista a história familiar entre os marcadores que trata.
O que vem antes desta etapa?
A extração de entidades roda primeiro, para que a skill saiba quais termos verificar.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 5,8 mil
- Posição no ranking
- #14726
- Licença
- Apache-2.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
annotating-variants
5,8 milAjuda seu agente a prever o efeito de variantes genéticas, converter nomes HGVS em posições do genoma e incluir frequências populacionais, com anotadores gratuitos.
ask-openmed
5,8 milAjuda seu agente a escolher o fluxo de trabalho certo do OpenMed para um pedido de texto clínico, começando por uma verificação de privacidade sempre que houver dados de pacientes.
assembling-fhir-bundles
5,8 milAgrupa vários registros de saúde FHIR em um único Bundle de transação pronto para ser enviado a um prontuário eletrônico, com as referências internas ligadas corretamente.
auditing-deid-leakage
5,8 milProcura em textos clínicos desidentificados identificadores que sobraram, como SSN, números de cartão, e-mails e datas, e bloqueia a liberação se restar algum.
Skills parecidas
gitcrawl
394 milPermite que seu agente pesquise um arquivo salvo de issues e pull requests do GitHub, agrupe os duplicados e verifique o status atual deles no GitHub.
slacrawl
394 milPermite que seu agente pesquise e conte mensagens em um arquivo local do Slack, verifique quão atualizado ele está e o atualize quando necessário.
goplaces
394 milAjuda seu agente a buscar lugares, obter detalhes e avaliações e identificar nomes de lugares usando o Google Places, com saída em JSON para scripts.