Summarizing Clinical Notes logo

Summarizing Clinical Notes

CommunityPopular
maziyarpanahi
summarizing-clinical-notes

Produces structured, citation-anchored summaries of clinical notes — one-liner, hospital course, and problem-oriented views — where every claim cites a source span so nothing is hallucinated. Use after de-identifying notes when the user wants a discharge summary draft, handoff/SBAR, problem list, or chart-abstraction summary. De-identify FIRST with openmed.deidentify, then anchor summary claims to entity spans from openmed.analyze_text. Trigger keywords: summarize note, discharge summary, hospital course, problem-oriented, one-liner, SOAP, SBAR, handoff, chart abstraction.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill namesummarizing-clinical-notes
Stars
5.6K
Forks
708
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Summarizing Clinical Notes AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/maziyarpanahi/openmed/tree/master/skills/summarizing-clinical-notes
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/summarizing-clinical-notes .claude/skills/summarizing-clinical-notes
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Summarizing Clinical Notes in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Summarizing Clinical Notes on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Summarizing Clinical Notes is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Summarizing Clinical Notes with Span Citations

A clinical summary is only useful if it is faithful: every statement must trace back to something the chart actually says. The failure mode for note summarization is the confident hallucination — an invented dose, a fabricated allergy, a discharge diagnosis that was never made. This skill produces summaries where each line cites the source span that supports it, so a clinician can verify in one glance and catch any fabrication.

Not a medical device. OpenMed and this skill assist documentation; they do not diagnose, triage, or make autonomous clinical decisions. Every summary is a draft for clinician review and editing. Surface that disclaimer in any UI that renders these summaries.

When to use

  • Drafting a discharge summary, transfer note, or SBAR/handoff from a long encounter.
  • Building a problem-oriented view (problem list with supporting evidence).
  • Generating a "one-liner" (the single-sentence patient summary) for rounds.
  • Chart abstraction where reviewers need quick, verifiable evidence pointers.

Quick start

De-identify before anything else, extract entities to anchor against, then compose the summary with citations:

python
import openmed

note = """\
HPI: 68M with HTN, T2DM presents with 3 days of productive cough and fever to
38.9C. CXR shows RLL infiltrate. Started on ceftriaxone and azithromycin.
Hospital course: improved on IV antibiotics, transitioned to PO. Discharged on
amoxicillin-clavulanate. Follow up with PCP in 1 week.
"""

# 1) ALWAYS de-identify before summarizing or sending text anywhere.
deid = openmed.deidentify(note, method="replace", policy="hipaa_safe_harbor")

# 2) Extract entities; their offsets become your citation anchors.
ner = openmed.analyze_text(deid.text, output_format="dict")
spans = {
    (e["start"], e["end"]): e["text"]
    for e in ner["entities"]
}

# 3) Compose the summary. Every bullet references a (start, end) span so a
#    reviewer can click back to the exact evidence.
def cite(start, end):
    return f"[{start}:{end}] {deid.text[start:end]!r}"

# Example problem-oriented line, grounded in detected spans:
# "Community-acquired pneumonia (RLL infiltrate) — treated with ceftriaxone +
#  azithromycin." with cite(...) anchors for each entity.

analyze_text returns entities as {"text", "label", "confidence", "start", "end", "metadata"}; the start/end offsets index the de-identified text, giving you exact, verifiable citation anchors.

Workflow

  1. De-identify with openmed.deidentify. Summaries are often shared or logged; PHI must be gone before this stage. Keep the mapping (keep_mapping=True) only if a downstream clinician must re-identify in a controlled context — never persist the mapping with the summary.
  2. Extract grounding spans with openmed.analyze_text (problems, meds, labs, procedures). These define the allowed evidence set: a summary claim that cannot point at a span is unsupported.
  3. Resolve context with openmed.clinical (negation, temporality, subject) so "no chest pain" and "father had MI" are not summarized as active patient problems. See resolving-clinical-context.
  4. Compose by view:
    • One-liner: age/sex + key chronic problems + reason for encounter.
    • Hospital course: ordered problems → intervention → response, each line citing the spans it summarizes.
    • Problem-oriented: group entities into problems; attach supporting med/lab/procedure spans under each.
  5. Enforce citation coverage. Reject or flag any output sentence with zero span citations. This is the anti-hallucination gate — keep it strict.
  6. Mark it a draft. Render the medical-device disclaimer and require human sign-off before the summary enters the record.

Hand-off to / from OpenMed

  • From OpenMed: consumes openmed.deidentify(...) output (de-identified text + entity spans) and openmed.analyze_text(...) (PredictionResult dict). Entity start/end offsets are the citation anchors.
  • To OpenMed: the summary text itself can be re-run through openmed.analyze_text for a coded problem list, or through openmed.eval leakage gates to confirm no PHI leaked into the generated summary.
  • Citation rendering: analyze_text(..., output_format="html") produces a span-highlighted view of the source — handy for a click-to-evidence UI.

Edge cases & gotchas

  • Hallucination is the failure mode. If your summary backbone is an LLM, constrain it to the entity/span set and require a citation per sentence; do not let it introduce facts (doses, diagnoses, dates) absent from the spans.
  • Negation & family history. Always run context resolution first; "denies", "ruled out", "FH of" must not become patient problems.
  • Copy-forward / note bloat. EHR notes carry stale copy-pasted blocks. Cite the most recent supporting span and prefer the current encounter's text.
  • Conflicting statements. When the chart contradicts itself (two different discharge diagnoses), surface both with citations rather than silently picking one.
  • No autonomous action. Never auto-finalize, auto-sign, or auto-route a summary; it is decision support, not a clinical decision.
  • PHI in the summary. A summary can re-introduce identifiers the model missed in the source. Run the output through openmed.extract_pii or an openmed.eval leakage gate before display or storage.

Standards & references

Frequently asked questions

What does the Summarizing Clinical Notes AI skill do?

Produces structured, citation-anchored summaries of clinical notes — one-liner, hospital course, and problem-oriented views — where every claim cites a source span so nothing is hallucinated. Use after de-identifying notes when the user wants a discharge summary draft, handoff/SBAR, problem list, or chart-abstraction summary. De-identify FIRST with openmed.deidentify, then anchor summary claims to entity spans from openmed.analyze_text. Trigger keywords: summarize note, discharge summary, hospital course, problem-oriented, one-liner, SOAP, SBAR, handoff, chart abstraction.

Why use Summarizing Clinical Notes on TypingMind?

Because you install it once and use it with any model. Summarizing Clinical Notes is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Summarizing Clinical Notes in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/summarizing-clinical-notes. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Summarizing Clinical Notes?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Summarizing Clinical Notes?

As many as you like. As long as a model supports skills, you can use Summarizing Clinical Notes with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Summarizing Clinical Notes AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇