Agent skill

Extract Clinical Entities To Fhir

by maziyarpanahi in 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.

Apache-2.0Auto-check passedResearch & Science

Install Extract Clinical Entities To Fhir

skills CLI
$ npx skills add maziyarpanahi/openmed --skill extract-clinical-entities-to-fhir -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed extract-clinical-entities-to-fhir --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/extract-clinical-entities-to-fhir .claude/skills/extract-clinical-entities-to-fhir && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extract-clinical-entities-to-fhir
GitHub stars
5.5k
Token cost
~940 tokens
SKILL.md length
206 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle.

  • Works in 6 steps: Keep the source synthetic, or… → Run openmed.analyze_text with the… → Filter predictions by label and… → …
  • An agent must turn local clinical NER output into Conditions
  • SKILL.md covers Procedure, Runnable synthetic example, Safety checks and Repository example
  • Calls python; reaches terminology.hl7.org

What it does

Extract Clinical Entities To Fhir is an agent 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.

Its SKILL.md is about 940 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Clinical and healthcare research. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • An agent must turn local clinical NER output into Conditions
  • MedicationStatements
  • Other FHIR resources without inventing terminology codes

Example prompts

  • “/extract-clinical-entities-to-fhir”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

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

What it can do on your machine

Read from SKILL.md and the folder at commit 34d7b8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • terminology.hl7.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extract Clinical Entities To Fhir loads about 940 tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 206 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~940

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maziyarpanahi/openmed at commit 34d7b8c, republished under its Apache-2.0 licence (© maziyarpanahi). 206 words, ~940 tokens.

Download SKILL.mdSave it as .claude/skills/extract-clinical-entities-to-fhir/SKILL.md (or your agent's skills folder).
name
extract-clinical-entities-to-fhir
description
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.

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

resources = [{"resourceType": "Patient", "id": "synthetic-patient"}]
for index, entity in enumerate(result.entities, start=1):
    if entity.label.upper() not in {"CONDITION", "DIAGNOSIS", "DISEASE"}:
        continue
    resources.append(
        {
            "resourceType": "Condition",
            "id": f"condition-{index}",
            "clinicalStatus": {
                "coding": [
                    {
                        "system": (
                            "http://terminology.hl7.org/CodeSystem/"
                            "condition-clinical"
                        ),
                        "code": "active",
                    }
                ]
            },
            "verificationStatus": {
                "coding": [
                    {
                        "system": (
                            "http://terminology.hl7.org/CodeSystem/"
                            "condition-ver-status"
                        ),
                        "code": "confirmed",
                    }
                ]
            },
            # A text-only CodeableConcept is preferable to an invented code.
            "code": {"text": entity.text},
            "subject": {"reference": "Patient/synthetic-patient"},
        }
    )

if len(resources) == 1:
    raise RuntimeError("No condition spans met the label and confidence rules")

bundle = to_bundle(resources, doc_id="synthetic-note-001")
print(json.dumps(bundle, indent=2))

Safety checks

  • Do not put raw identifiers, source text, or reversible mappings in logs, OperationOutcome.diagnostics, or trace metadata.
  • Keep a patient identity service separate from extracted clinical facts.
  • Preserve negation, temporality, and experiencer context before asserting a resource as active or confirmed.
  • Use a text-only CodeableConcept when no approved code is available.
  • Validate the Bundle against the receiver's FHIR and profile requirements.
  • Do not bundle restricted terminologies; use the user's licensed service.

Repository example

Read and run the redaction-to-FHIR walkthrough for an offline-friendly pipeline with deterministic extraction.

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/extract-clinical-entities-to-fhir of maziyarpanahi/openmed.

Open the folder on GitHubat commit 34d7b8c

Compare with similar skills

Extract Clinical Entities To Fhir next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extract Clinical Entities To Fhir compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extract Clinical Entities To Fhir this skillmaziyarpanahi/openmed5.5k—~940Automated safety check: PassApache-2.0
Clinical Trials Databasegoogle-deepmind/science-skills3.2k2 repos~3.2kAutomated safety check: PassApache-2.0
CHARLS Paper Reproduction Guidexjtulyc/MedgeClaw6171 repos~1.8kAutomated safety check: PassNone
Biomedical Analysis Dispatchxjtulyc/MedgeClaw6171 repos~2kAutomated safety check: PassNone
Research Paperluwill/research-skills862—~1.9kAutomated safety check: PassNone
Research Proposalluwill/research-skills862—~4.5kAutomated safety check: NotesNone

Similar skills

  • Clinical Trials Database

    google-deepmind/science-skills

    Query ClinicalTrials.gov via APIv2. An agent skill from google-deepmind/science-skills.

    3.2k GitHub starsUsed in 2 repos~3.2k tokens
    Research & ScienceAuto-check passed
  • Guides an agent through reproducing papers built on the CHARLS health and retirement survey, from variable mapping to cognition, depression and isolation scores.

    617 GitHub starsUsed in 1 repo~1.8k tokens
    Research & ScienceAuto-check passed
  • Routes bioinformatics, drug discovery, clinical and multi-omics tasks from a chat interface to Claude Code sessions running K-Dense scientific skills, with a live dashboard per task.

    617 GitHub starsUsed in 1 repo~2k tokens
    Research & ScienceAuto-check passed
  • Research Paper

    luwill/research-skills

    A skill your agent uses when the user asks to write or draft an ORIGINAL RESEARCH ARTICLE — IMRaD paper, conference paper, short/workshop paper, 研究论文/期刊论文/会议论文 — reporting their own completed…

    862 GitHub stars~1.9k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Research Proposal

    luwill/research-skills

    A skill your agent uses when the user asks to write or draft a PhD / doctoral research proposal, research plan, 研究计划书, or 开题报告 — a forward-looking plan of background, gap, research questions…

    862 GitHub stars~4.5k tokensUpdated yesterday
    Research & ScienceAuto-check: notes
  • Medical Imaging Review

    LeonChaoX/qinyan-academic-skills

    Write comprehensive literature reviews for medical imaging AI research.

    944 GitHub starsUsed in 3 repos~1.1k tokens
    Research & ScienceAuto-check: notes

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Extract Clinical Entities To Fhir

What does Extract Clinical Entities To Fhir do?

Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle. Extract Clinical Entities To Fhir is an agent 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.

When should I use Extract Clinical Entities To Fhir?

Extract Clinical Entities To Fhir fits situations like: an agent must turn local clinical NER output into Conditions; medicationStatements; other FHIR resources without inventing terminology codes.

How do I install Extract Clinical Entities To Fhir in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill extract-clinical-entities-to-fhir -a claude-code`. Or copy the skill folder (skills/extract-clinical-entities-to-fhir in maziyarpanahi/openmed) into .claude/skills/extract-clinical-entities-to-fhir in your project. Claude Code loads it when a task matches its description.

How do I install Extract Clinical Entities To Fhir in Codex?

Run `npx skills add maziyarpanahi/openmed --skill extract-clinical-entities-to-fhir -a codex`. Or copy the skill folder (skills/extract-clinical-entities-to-fhir in maziyarpanahi/openmed) into .agents/skills/extract-clinical-entities-to-fhir in your project. Codex loads it when a task matches its description.

Can I use Extract Clinical Entities To Fhir in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill extract-clinical-entities-to-fhir -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extract-clinical-entities-to-fhir, .gemini/skills/extract-clinical-entities-to-fhir, .github/skills/extract-clinical-entities-to-fhir and .opencode/skills/extract-clinical-entities-to-fhir in your project.

What does Extract Clinical Entities To Fhir need to run?

Going by SKILL.md and its folder, Extract Clinical Entities To Fhir needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Extract Clinical Entities To Fhir access the network?

SKILL.md names 1 domain. In commands or code: terminology.hl7.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Extract Clinical Entities To Fhir safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Extract Clinical Entities To Fhir use?

Extract Clinical Entities To Fhir is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extract Clinical Entities To Fhir use?

About 940 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Extract Clinical Entities To Fhir?

Skills that share tags, products or a category with Extract Clinical Entities To Fhir: Clinical Trials Database (google-deepmind/science-skills, 3.2k stars), CHARLS Paper Reproduction Guide (xjtulyc/MedgeClaw, 617 stars), Biomedical Analysis Dispatch (xjtulyc/MedgeClaw, 617 stars) and Research Paper (luwill/research-skills, 862 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extract Clinical Entities To Fhir?

maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,506 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.

Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.