building-patient-timelines

building-patient-timelines is a skill for Claude Code from maziyarpanahi/openmed. It costs 154 tokens per session (1,950 once invoked), scanned A, original, Apache-2.0.

A tool for turning clinical events from medical notes into a dated, chronological patient history. It normalizes exact dates and phrases such as “yesterday” or “two days later.”

In plain words
What is it for?
Use it to build longitudinal histories, show the course of an illness, prepare summary cards, or organize data before exporting it to FHIR, a standard format for exchanging health records.
Why use it?
It removes the need to manually sort events and interpret relative dates across one or more notes. It runs on the device, which helps keep sensitive patient information local.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use it to build longitudinal histories, show the course of an illness, prepare summary cards, or organize data before exporting it to FHIR, a standard format for exchanging health records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/building-patient-timelines
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,290 stars · on GitHub · openmed.life

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maziyarpanahi/openmed --skill building-patient-timelines
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for building-patient-timelines

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/building-patient-timelines/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/building-patient-timelines)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/building-patient-timelines"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/building-patient-timelines/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for building-patient-timelines

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/building-patient-timelines"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/building-patient-timelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,950 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00154 $0.01950
Opus 5 $0.00077 $0.00975
Sonnet 5 $0.00031 $0.00390
Haiku 4.5 $0.00015 $0.00195

Measured 12d ago against content hash 99ba4e467729, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

building-patient-timelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/building-patient-timelines/SKILL.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Building patient timelines

A patient timeline is a chronologically ordered list of clinical events — diagnoses, medications, procedures, encounters — each carrying a normalized date. OpenMed gives you the events (via analyze_text) and the clinical temporality of each mention (current vs. historical, see resolving-clinical-context); this skill turns those into a sorted timeline. Everything runs on-device — de-identify first if the source notes contain PHI, and keep raw identifiers out of logs.

When to use this skill

After you have extracted entities from one or more notes and want them ordered in time: a longitudinal history, a "course of illness" view, a feed for a summary card, or a pre-step before FHIR export. If you only need to extract entities, use extracting-clinical-entities. If you need negation/temporality on a single mention, use resolving-clinical-context.

Quick start

import datetime as dt
import openmed

note = (
    "Discharge summary, 2024-03-12. Patient admitted 2024-03-08 with chest pain. "
    "History of type 2 diabetes diagnosed in 2019. Started on metformin two days "
    "after admission. Cardiac catheterization performed yesterday."
)

# 1) Extract clinical events (entities carry char offsets: start/end)
result = openmed.analyze_text(note, output_format="dict")
events = result["entities"]   # each: {text, label, confidence, start, end}

# 2) Normalize the temporal frame: an explicit document/anchor date drives
#    resolution of relative expressions ("two days after", "yesterday").
anchor = dt.date(2024, 3, 12)  # parsed from the note header or document metadata

analyze_text returns {text, entities, model_name, timestamp, ...}; each entity is {text, label, confidence, start, end}. Use start/end to locate each event in the source and to find the nearest date expression.

Workflow

  1. De-identify if needed. If notes carry PHI, run openmed.deidentify(...) first, or keep the timeline keyed by stable internal IDs — never log raw names/MRNs.
  2. Extract events. openmed.analyze_text(note) for conditions, drugs, procedures; pick the model that matches your target entities (choosing-openmed-models).
  3. Resolve temporality. For each event, use resolving-clinical-context to tag it current / historical / hypothetical and to drop negated or family-history mentions that should not appear on the patient's own line.
  4. Normalize dates. Map each event to a date:
    • Absolute (2024-03-08, March 2019) → parse directly. Record the granularity (day / month / year) — a year-only event sorts to a coarse bucket, not a fake Jan 1.
    • Relative (two days after admission, yesterday, on POD 2) → resolve against an anchor: the document date, admission date, or a prior event's date. Without an anchor, relative expressions are unresolvable — flag them, don't guess.
  5. Build event records. One record per event: (date, granularity, label, surface_text, char_span, temporality, confidence, source_note_id).
  6. Sort and de-duplicate. Sort by (date, granularity); merge repeated mentions of the same event across notes (same label + overlapping date).
  7. Emit. A sorted list for a UI, or FHIR resources (see hand-off).

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 144 lines · 154 tokens per session scan A 99ba4e467729

Subscribe to this mod's changes

building-patient-timelines is a skill published in the GitHub repository maziyarpanahi/openmed (5,290 stars, last pushed yesterday), licensed Apache-2.0. It adds 154 tokens to every session and 1,950 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

drug-discovery

Drug discovery: ChEMBL search, drug-likeness, interactions.

NousResearch/hermes-agent · 19 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens

imaging-data-commons

Query and download public cancer imaging data from NCI Imaging Data Commons using idc-index. Use for accessing large-scale radiology (CT, MR, PET) and pathology datasets for AI training or research. No authentication required. Query by metadata, visualize in browser, check licenses.

synthetic-sciences/openscience · 62 tokens

paper-revision-author

Revise independently drafted paper sections into one coherent LaTeX body before the abstract is written.

opensquilla/opensquilla · 24 tokens

molecular-cloning

Molecular cloning simulation and design. PCR amplicon prediction, restriction enzyme digestion, Golden Gate and Gibson assembly simulation, primer design, CRISPR sgRNA design, and plasmid annotation. For protein-level sequence analysis use biopython or esm; for database lookups use gene-database or ensembl-database.

synthetic-sciences/openscience · 70 tokens