Agent skill

Resolving Clinical Context

by maziyarpanahi in maziyarpanahi/openmed

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…

Apache-2.0Auto-check passedResearch & Science

Install Resolving Clinical Context

skills CLI
$ npx skills add maziyarpanahi/openmed --skill resolving-clinical-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed resolving-clinical-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/resolving-clinical-context .claude/skills/resolving-clinical-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
resolving-clinical-context
GitHub stars
5.5k
Token cost
~1.8k tokens
SKILL.md length
606 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

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…

  • Works in 5 steps: Get entities and their context window.… → Resolve negation with… → Resolve temporality with… → …
  • Needs assertion status
  • SKILL.md covers When to use, Quick start, Workflow and Hand-off to / from OpenMed, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Resolving Clinical Context is an agent skill from maziyarpanahi/openmed. 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.resolvenegation / resolvetemporality / resolveuncertainty /…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Clinical and healthcare research and Accessibility. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • Needs assertion status
  • Negation detection
  • Family-history / hypothetical / historical flags
  • ConText/NegEx-style classification before grounding entities to FHIR

Example prompts

  • “denies chest pain”
  • “history of MI”
  • “/resolving-clinical-context”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Get entities and their context window. From analyze_text, take each
  2. Resolve negation with resolve_negation(span, window) → AFFIRMED or
  3. Resolve temporality with resolve_temporality(span, window) → RECENT
  4. Resolve uncertainty with resolve_uncertainty(span, window) → CERTAIN
  5. Apply the axes downstream. Drop or refute NEGATED spans; route

What it can do on your machine

Read from SKILL.md and the folder at commit 9dca507. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • doi.org
    • hl7.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Resolving Clinical Context loads about 1.8k tokens when it runs. Until then it costs about 183 tokens; SKILL.md has 606 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~183
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maziyarpanahi/openmed at commit 9dca507, republished under its Apache-2.0 licence (© maziyarpanahi). 606 words, ~1,762 tokens.

Download SKILL.mdSave it as .claude/skills/resolving-clinical-context/SKILL.md (or your agent's skills folder).
name
resolving-clinical-context
description
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/NEGATED, RECENT/HISTORICAL/HYPOTHETICAL, CERTAIN/UNCERTAIN constants. Pairs after extracting-clinical-entities.
license
Apache-2.0
metadata.project
OpenMed
metadata.category
clinical-nlp
metadata.pairs
after
metadata.version
1.0

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

python
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.
Show full SKILL.md (264 more words)Show less

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 → verificationStatus=refuted; temporality=historical → inactive/resolved clinicalStatus; certainty=uncertain → verificationStatus=provisional. The layer emits the axis; it does not build the FHIR record.

Edge cases & gotchas

  • Window scoping matters. Pass a sentence-sized window, not the whole document — a negation cue three sentences away should not flip an affirmed finding. Segment first (segmenting-clinical-sections) for long notes.
  • Pseudo-negation is handled, double-check anyway. "Cannot exclude PE" is affirmed-but-uncertain, not negated. The negation layer masks these cues; the uncertainty layer is what flags the hedge.
  • Experiencer (family history) is a separate axis. These helpers cover negation/temporality/uncertainty; "mother with breast cancer" being about a relative is the experiencer axis and is out of scope here — handle it before attributing the finding to the patient.
  • Deterministic, not ML. ConText is a rule layer: fast, transparent, auditable — but cue-list bound. Novel phrasings may need lexicon tuning; it will not infer assertion from semantics the way a model might.
  • Advisory only. Outputs are annotations for review and downstream grounding, not autonomous clinical decisions.

Standards & references

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/resolving-clinical-context of maziyarpanahi/openmed.

Open the folder on GitHubat commit 9dca507

Compare with similar skills

Resolving Clinical Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Resolving Clinical Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Resolving Clinical Context this skillmaziyarpanahi/openmed5.5k—~1.8kAutomated safety check: PassApache-2.0
Bio Atac Seq Motif DeviationGPTomics/bioSkills1.2k2 repos~5.2kAutomated safety check: PassMIT
Bio Fragment AnalysisGPTomics/bioSkills1.2k1 repos~4.3kAutomated safety check: PassMIT
Bio Atac Seq Motif DeviationFreedomIntelligence/OpenClaw-Medical-Skills3.1k—~2.3kAutomated safety check: PassNone
Viennarna Structure Predictionjaechang-hits/SciAgent-Skills3741 repos~5.4kAutomated safety check: PassMIT
Ppsych Revisionbrycewang-stanford/Awesome-Journal-Skills1.2k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Analyze TF motif accessibility variability across samples or single cells using chromVAR.

    1.2k GitHub starsUsed in 2 repos~5.2k tokens
    Research & ScienceAuto-check passed
  • Bio Fragment Analysis

    GPTomics/bioSkills

    Extracts cfDNA fragmentomics features (DELFI genome-wide short/long ratios, WPS nucleosome positioning, Griffin GC-corrected accessibility profiles, end-motifs/MDS, OCF) for cancer detection and…

    1.2k GitHub starsUsed in 1 repo~4.3k tokens
    Research & ScienceAuto-check passed
  • Bio Atac Seq Motif Deviation

    FreedomIntelligence/OpenClaw-Medical-Skills

    Analyze transcription factor motif accessibility variability using chromVAR.

    3.1k GitHub stars~2.3k tokensUpdated 2 mo ago
    Research & ScienceAuto-check passed
  • Viennarna Structure Prediction

    jaechang-hits/SciAgent-Skills

    Predict RNA secondary structure, MFE folding, base-pair probabilities, RNA-RNA interactions via ViennaRNA Python bindings.

    374 GitHub starsUsed in 1 repo~5.4k tokens
    Research & ScienceAuto-check passed
  • Ppsych Revision

    brycewang-stanford/Awesome-Journal-Skills

    A skill your agent uses when responding to a Perspectives on Psychological Science (PoPS) editor and reviewer decision letter — coverage gaps, balance/fairness complaints, framework/argument asks…

    1.2k GitHub stars~1.5k tokensUpdated 13 days ago
    Research & ScienceAuto-check passed
  • Video Description Oversight

    calesthio/generative-media-skills

    Provider-independent governance workflow for verifying and correcting human- or model-generated video descriptions.

    197 GitHub stars~3.5k tokensUpdated 2 mo ago
    Research & ScienceAuto-check passed

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.

    5.5k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed

Questions about Resolving Clinical Context

What does Resolving Clinical Context do?

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…. Resolving Clinical Context is an agent skill from maziyarpanahi/openmed. 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.

When should I use Resolving Clinical Context?

Resolving Clinical Context fits situations like: needs assertion status; negation detection; family-history / hypothetical / historical flags; conText/NegEx-style classification before grounding entities to FHIR.

How do I install Resolving Clinical Context in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill resolving-clinical-context -a claude-code`. Or copy the skill folder (skills/resolving-clinical-context in maziyarpanahi/openmed) into .claude/skills/resolving-clinical-context in your project. Claude Code loads it when a task matches its description.

How do I install Resolving Clinical Context in Codex?

Run `npx skills add maziyarpanahi/openmed --skill resolving-clinical-context -a codex`. Or copy the skill folder (skills/resolving-clinical-context in maziyarpanahi/openmed) into .agents/skills/resolving-clinical-context in your project. Codex loads it when a task matches its description.

Can I use Resolving Clinical Context in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill resolving-clinical-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/resolving-clinical-context, .gemini/skills/resolving-clinical-context, .github/skills/resolving-clinical-context and .opencode/skills/resolving-clinical-context in your project.

What does Resolving Clinical Context need to run?

SKILL.md names no scripts, command-line tools or credentials: Resolving Clinical Context is instructions for the agent only. Our summary lists: Python 3.

Does Resolving Clinical Context access the network?

SKILL.md names 2 domains. As links in the text: doi.org and hl7.org. This is read from the text; nothing was executed.

Is Resolving Clinical Context safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Resolving Clinical Context use?

Resolving Clinical Context is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Resolving Clinical Context use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Resolving Clinical Context?

Skills that share tags, products or a category with Resolving Clinical Context: Bio Atac Seq Motif Deviation (GPTomics/bioSkills, 1.2k stars), Bio Fragment Analysis (GPTomics/bioSkills, 1.2k stars), Bio Atac Seq Motif Deviation (FreedomIntelligence/OpenClaw-Medical-Skills, 3.1k stars) and Viennarna Structure Prediction (jaechang-hits/SciAgent-Skills, 374 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Resolving Clinical Context?

maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,500 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 9, 2026.

Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.