Source profileQuality 86/100

maziyarpanahi/openmed/skills/building-with-openmed/SKILL.md

building-with-openmed

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.

Source repository stars
4,847
Declared platforms
0
Static risk flags
0
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

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…

Best for

  • 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):

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/maziyarpanahi/openmed --skill "skills/building-with-openmed"
Safe inspection promptEditorial

Inspect the Agent Skill "building-with-openmed" from https://github.com/maziyarpanahi/openmed/blob/e412ae8f3b04ae79b13663d34a422efc22109a3a/skills/building-with-openmed/SKILL.md at commit e412ae8f3b04ae79b13663d34a422efc22109a3a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    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):

    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):
  2. 02

    Install

    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).

    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).
  3. 03

    The three core calls

    Review the “The three core calls” section in the pinned source before continuing.

    Review and apply the “The three core calls” source section.
  4. 04

    1) Named-entity recognition (token classification)

    result = openmed.analyzetext( "Patient prescribed 500 mg metformin for type 2 diabetes.", modelname="diseasedetectionsuperclinical", registry key, HF id, or local path outputformat="dict", dict | json | html | csv )

    result = openmed.analyzetext( "Patient prescribed 500 mg metformin for type 2 diabetes.", modelname="diseasedetectionsuperclinical", registry key, HF id, or local path outputformat="dict", dict | json | html | csv )
  5. 05

    2) De-identify PHI (mask | remove | replace | hash | shiftdates)

    deid = openmed.deidentify( "John Doe (MRN 12345) seen on 2024-03-02.", method="replace", policy="hipaasafeharbor", bundled policy profile ) print(deid.deidentifiedtext) PHI removed; deid.piientities lists the spans

    deid = openmed.deidentify( "John Doe (MRN 12345) seen on 2024-03-02.", method="replace", policy="hipaasafeharbor", bundled policy profile ) print(deid.deidentifiedtext) PHI removed; deid.piientities lists the spans

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score86/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars4,847SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
maziyarpanahi/openmed
Skill path
skills/building-with-openmed/SKILL.md
Commit
e412ae8f3b04ae79b13663d34a422efc22109a3a
License
Apache-2.0
Collected
2026-08-04
Default branch
master
View the original SKILL.md

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):

TaskSkill / API
Find and load a modelloading-openmed-models, choosing-openmed-models
Run clinical/biomedical NERextracting-clinical-entities (openmed.analyze_text)
Zero-shot NER (no fine-tune)running-zeroshot-ner (openmed zero)
Remove / mask PHIdeidentifying-clinical-text (openmed.deidentify)
Detect PHI spans onlyextracting-pii-entities (openmed.extract_pii)
Restore masked PHIreidentifying-text (openmed.reidentify)
Pick a privacy policyconfiguring-privacy-policies (7 bundled profiles)
Non-English PHIdeidentifying-multilingual-text
Signed, no-PHI auditauditing-deidentification-runs (audit=True)
Negation / temporalityresolving-clinical-context (openmed.clinical)
Evaluate with leakage gatesevaluating-with-leakage-gates (openmed.eval)
FHIR R4 exportexporting-to-fhir (openmed.interop)
Serve REST / MCPserving-openmed-rest-api, deploying-openmed-mcp
Run on Apple Silicon / edgerunning-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=True for 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's own credentials.
  • De-identification is verified, not assumed. Gate on leakage with openmed.eval, not on F1 alone (see evaluating-with-leakage-gates).
  • Clinical safety. OpenMed assists; it does not make autonomous clinical decisions. Surface disclaimers for any borderline medical-device behavior.

A typical pipeline

ingest (HL7v2 / FHIR / C-CDA / OCR)
   → de-identify (openmed.deidentify, policy=…)
   → extract entities (openmed.analyze_text)
   → ground to terminology (out-of-process: RxNorm / LOINC / SNOMED)
   → assemble FHIR (openmed.interop)
   → evaluate (openmed.eval leakage gates)

Each stage has a companion skill in this directory. Start here, then jump to the stage you need.