building-with-openmed
What it does
This skill is a starting map for OpenMed, a library that analyzes and de-identifies clinical text on your own computer. It is for teams beginning a clinical or medical text project who need the right entry point.
When to use it
- ✓When you want to install OpenMed or start a clinical text pipeline with it.
- ✓When you are not sure which OpenMed capability or model fits your task.
- ✓When you need to find the right focused OpenMed skill for extraction, de-identification or evaluation.
Skill link
https://github.com/maziyarpanahi/openmed/blob/master/skills/building-with-openmed/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“I am starting a clinical notes project. Which OpenMed features should I use to extract diagnoses and remove patient names?”
5 new skills a week. 1 minute to read.
How it works
The agent identifies your goal, maps it to the matching OpenMed capability or focused skill, and points you to the right first step.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Building with OpenMed
OpenMed is an Apache-2.0, local-first Python library for clinical and biomedical NLP. Models download once from the Hugging Face Hub and then run fully on-device — no network calls, no telemetry, no raw PHI in logs, caches, or temp files. This skill is the map: it tells you what OpenMed can do and which focused skill (or API) to reach for next.
When to use this skill
Use it to scope a task and pick an entry point. For the actual work, hand off to the focused OpenMed skills (each is grounded in the real API):
| Task | Skill / API |
|---|---|
| Find and load a model | loading-openmed-models, choosing-openmed-models |
| Run clinical/biomedical NER | extracting-clinical-entities (openmed.analyze_text) |
| Zero-shot NER (no fine-tune) | running-zeroshot-ner (openmed zero) |
| Remove / mask PHI | deidentifying-clinical-text (openmed.deidentify) |
| Detect PHI spans only | extracting-pii-entities (openmed.extract_pii) |
| Restore masked PHI | reidentifying-text (openmed.reidentify) |
| Pick a privacy policy | configuring-privacy-policies (7 bundled profiles) |
| Non-English PHI | deidentifying-multilingual-text |
| Signed, no-PHI audit | auditing-deidentification-runs (audit=True) |
| Negation / temporality | resolving-clinical-context (openmed.clinical) |
| Evaluate with leakage gates | evaluating-with-leakage-gates (openmed.eval) |
| FHIR R4 export | exporting-to-fhir (openmed.interop) |
| Serve REST / MCP | serving-openmed-rest-api, deploying-openmed-mcp |
| Run on Apple Silicon / edge | running-openmed-ondevice (MLX / CoreML / ONNX) |
Install
pip install openmed # core: NER + de-identification
pip install "openmed[hf]" # add Hugging Face model downloads
pip install "openmed[mcp]" # Model Context Protocol server
pip install "openmed[service]" # FastAPI REST service
pip install "openmed[mlx]" # Apple Silicon acceleration
pip install "openmed[presidio]" # Microsoft Presidio bridge
Extras map to capabilities: cli, mcp, service, presidio, spacy,
langchain, gliner (zero-shot), multimodal/ocr-paddle (document intake),
mlx/coreml/onnx (on-device backends), hf (model hub), dev (tests/lint).
The three core calls
import openmed
# 1) Named-entity recognition (token classification)
result = openmed.analyze_text(
"Patient prescribed 500 mg metformin for type 2 diabetes.",
model_name="disease_detection_superclinical", # registry key, HF id, or local path
output_format="dict", # dict | json | html | csv
)
# 2) De-identify PHI (mask | remove | replace | hash | shift_dates)
deid = openmed.deidentify(
"John Doe (MRN 12345) seen on 2024-03-02.",
method="replace",
policy="hipaa_safe_harbor", # bundled policy profile
)
print(deid.deidentified_text) # PHI removed; deid.pii_entities lists the spans
# 3) Detect PHI spans without changing the text
pii = openmed.extract_pii("Call Dr. Smith at 617-555-0123.") # PredictionResult
spans = pii.entities # the PHI spans
analyze_text and deidentify are the workhorses. Everything else
(multilingual, audit, policies, FHIR, eval) layers on top of these.
Discover what is available at runtime
Never hardcode model lists or language counts — query them:
import openmed
openmed.list_model_categories() # e.g. Privacy, Disease, Oncology, Genomics ...
openmed.get_models_by_category("Disease")
openmed.get_pii_models_by_language("es")
from openmed.core.pii_i18n import SUPPORTED_LANGUAGES # de-id language set
CLI equivalents: openmed models list, openmed models info <key>,
openmed analyze --text "<text>" --model <key> --format json. MCP/REST expose
the same surface as tools (openmed_analyze_text, openmed_deidentify,
openmed_list_models, …).
Non-negotiable rules when building with OpenMed
- Local-first. Do not add cloud calls to PHI workflows. Models run on-device after a one-time download.
- No raw PHI in artifacts. Logs, caches, audit reports, and error messages
must use offsets, hashes, and labels — never plaintext identifiers. Use
audit=Truefor tamper-evident, no-PHI audit output. - Permissive licensing only. Do not bundle UMLS, SNOMED CT, CPT, MIMIC, i2b2, or n2c2 assets. Call restricted terminologies out-of-process with the user'
FAQ
Does OpenMed send my data to the internet?
No. Models download once from the model hub, and processing then runs on your device with no network calls.
Does it call a cloud service?
No. Processing runs locally, and the only download is the model from the model hub.
Is OpenMed free to use?
It is an Apache-2.0 licensed library, so it is open source.
Details
Original description by the author
Orient and bootstrap any project that uses OpenMed, the on-device clinical and biomedical NLP library, for named-entity recognition, PHI de-identification, FHIR export, and evaluation. Use when the user mentions OpenMed, wants to install it, asks which OpenMed capability or model fits a task, or is starting to build a clinical/medical text pipeline and needs the right entry point.
repo: maziyarpanahi/openmed
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14680
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
annotating-variants
5.8kHelps your agent predict what a genetic variant does, convert HGVS names to genome positions and attach population frequencies, using free public annotators.
ask-openmed
5.8kHelps your agent pick the right OpenMed workflow for a clinical text request, starting with a privacy check whenever patient data may be present.
assembling-fhir-bundles
5.8kPackages several FHIR health records into one transaction Bundle ready to send to an EHR, with the internal references linked correctly.
auditing-deid-leakage
5.8kScans de-identified clinical text for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if any remain.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.