Home / maziyarpanahi / openmed · skills/extract-clinical-entities-to-fhir/SKILL.md · GitHub

extract-clinical-entities-to-fhir skillA

extract-clinical-entities-to-fhir is agent-read markdown (skill) from maziyarpanahi/openmed: Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle. Use when an agent must turn local clinical NER output into Conditions, MedicationStatements, Observations, or other FHIR resources without inventing terminology codes..

Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified before it reaches your agent: the main file against the SHA-256 recorded here, the others against the git hashes of its source commit. The deterministic audit below grades the latest version, and the same checks always give the same file the same grade.

What the file says

# Extract clinical entities to FHIR

Separate extraction from clinical coding. OpenMed finds spans and supplies the
mechanical FHIR builders; the application decides which resource type and
status are clinically appropriate.

## Procedure

1. Keep the source synthetic, or de-identify it inside the trusted boundary
   before extraction.
2. Run `openmed.analyze_text` with the task-appropriate clinical model.
3. Filter predictions by label and confidence; preserve offsets in a
   PHI-safe audit record.
4. Map each accepted span to the correct FHIR resource type.
5. Add terminology codes only from a user-approved mapping or terminology
   service. Never invent a code.
6. Assemble resources with `to_bundle` and validate against the target profile.

## Runnable synthetic example

Install the model runtime first with `python -m pip install "openmed[hf]"`.

```python
import json

from openmed import analyze_text
from openmed.clinical.exporters.fhir import to_bundle

note = "Assessment: type 2 diabetes mellitus is stable on metformin."
result = analyze_text(
    note,
    model_name="disease_detection_superclinical",
    confidence_threshold=0.5,
)
…

Read the whole file at its exact version.

How to install

Latest version
mdr add maziyarpanahi/openmed/extract-clinical-entities-to-fhir@git:20260727.9d7b5a2
Exact content
mdr add maziyarpanahi/openmed/extract-clinical-entities-to-fhir@sha256:4fbaf956da64b6e9

Pin to a label to follow the author's releases, or to a sha256 for exact bytes. Either way the resolved hash is written to mdr.lock, and mdr install fetches those bytes again and checks them, so it installs them exactly or fails.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_7ynci6uq4njbkgee.svg)](https://markdownregistry.com/a/art_7ynci6uq4njbkgee)

1 badge views in 30 days

Versions

versioncommittedcommitsizeaudit
git:20260727.9d7b5a2 latest2026-07-27 9d7b5a2 3,758 BA view

Audit of the latest version

A  17 of 17 checks passed. Deterministic, no model, same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (3758 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

maziyarpanahi/openmed · 5,401 stars · license Apache-2.0 · pushed 2026-09-25 · branch master

API

GET https://markdownregistry.com/api/v1/artifacts/art_7ynci6uq4njbkgee
GET https://markdownregistry.com/api/v1/resolve?ref=maziyarpanahi/openmed/extract-clinical-entities-to-fhir
GET https://markdownregistry.com/api/v1/blob/4fbaf956da64b6e9ee67339f2a6ea30afa1b36b98633867821cd4518fd7a0563

Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

More from maziyarpanahi/openmed

AGENTS.md agents
maziyarpanahi/openmed · AGENTS.md
git:20260709.7b3dcba · audit A · 5,401 stars
annotating-variants skill
maziyarpanahi/openmed · skills/annotating-variants/SKILL.md · Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST…
v1.0 · audit A · 5,401 stars
ask-openmed skill
maziyarpanahi/openmed · skills/ask-openmed/SKILL.md · Choose the first OpenMed workflow skill for an intake, privacy, extraction, exchange, or verification request using…
v1.0 · audit A · 5,401 stars
assembling-fhir-bundles skill
maziyarpanahi/openmed · skills/assembling-fhir-bundles/SKILL.md · Package multiple FHIR R4 resources produced from OpenMed output into a single valid transaction Bundle ready to POST to…
v1.0 · audit A · 5,401 stars
auditing-deid-leakage skill
maziyarpanahi/openmed · skills/auditing-deid-leakage/SKILL.md · Adversarially scan already-de-identified clinical text for residual identifiers and emit a leakage report that blocks…
v1.0 · audit A · 5,401 stars
auditing-deidentification-runs skill
maziyarpanahi/openmed · skills/auditing-deidentification-runs/SKILL.md · Produce a signed, reproducible, no-PHI audit trail for an OpenMed de-identification run via deidentify(audit=True). Use…
v1.0 · audit A · 5,401 stars
auditing-part11-trails skill
maziyarpanahi/openmed · skills/auditing-part11-trails/SKILL.md · Generates and verifies 21 CFR Part 11-style audit trails — who/what/when, electronic signatures, and tamper-evidence —…
v1.0 · audit A · 5,401 stars
auditing-safe-harbor-checklist skill
maziyarpanahi/openmed · skills/auditing-safe-harbor-checklist/SKILL.md · Verify OpenMed de-identified output against all 18 HIPAA Safe Harbor identifier categories and report residual…
v1.0 · audit A · 5,401 stars
auditing-subgroup-fairness skill
maziyarpanahi/openmed · skills/auditing-subgroup-fairness/SKILL.md · Audit an OpenMed NER or de-identification model for performance disparities across demographic subgroups (sex, age…
v1.0 · audit A · 5,401 stars
authoring-model-cards skill
maziyarpanahi/openmed · skills/authoring-model-cards/SKILL.md · Generate a model card for an OpenMed clinical NER or de-identification model documenting intended use, quantitative…
v1.0 · audit A · 5,401 stars
batch-processing-clinical-text skill
maziyarpanahi/openmed · skills/batch-processing-clinical-text/SKILL.md · Run large-scale batch NER, PII extraction, or de-identification over many clinical notes on-device with OpenMed, with…
v1.0 · audit A · 5,401 stars
benchmark-pii-recall skill
maziyarpanahi/openmed · skills/benchmark-pii-recall/SKILL.md · Benchmark an OpenMed PII model with synthetic gold spans and report label-aware exact-span and grapheme recall without…
git:20260727.9d7b5a2 · audit A · 5,401 stars

Every file in maziyarpanahi/openmed

Browse by kind, by grade A, or by owner.