Skills

Exporting Bulk Fhir

Kick off and harvest a FHIR Bulk Data $export (system-, group-, or patient-level) and...

Install

npx skills add maziyarpanahi/openmed --skill exporting-bulk-fhir -g -a claude-code -y
Repository
maziyarpanahi/openmed5.8k
Category
Writing
Updated
4d ago
License
Apache-2.0
Context cost
Mediumabout 1,694 tokens
Runs scripts
No, instructions only

What it does

Kick off and harvest a FHIR Bulk Data $export (system-, group-, or patient-level) and stream the resulting NDJSON into a batch OpenMed de-identification + NER pipeline at cohort scale. Covers the async kickoff (Prefer respond-async) -> poll Content-Location -> download NDJSON flow, the Bulk Data Access IG, _type/_since filters, and feeding DocumentReference/DiagnosticReport notes into openmed.deidentify in batch. Use when the user needs population-scale note extraction from an EHR or data warehouse to feed OpenMed, mentions bulk export, $export, NDJSON, Flat FHIR, or cohort de-identification. Pairs before the OpenMed de-id/NER pipeline.

Exporting Bulk FHIR

When you need cohort-scale clinical text, not one patient in a UI, you use the FHIR Bulk Data Access ($export) operation: an async job that emits NDJSON files of resources you then stream into OpenMed for batch de-identification and NER. This skill sits before the OpenMed pipeline: it is how the notes arrive.

When to use

Reach for it when the source is an EHR or FHIR data warehouse and the volume is a population/group (thousands of patients), the workload is headless (no clinician UI), and the goal is to batch-feed openmed.deidentify / openmed.analyze_text. Triggers: "bulk export", "$export", "NDJSON", "Flat FHIR", "cohort de-identification", "export all notes". For a single in-chart patient with a UI, use scaffolding-smart-on-fhir instead.

Three export levels

  • System, GET [base]/$export, everything the client is authorized for.
  • Group, GET [base]/Group/[id]/$export, a defined cohort (most common).
  • Patient, GET [base]/Patient/$export, all patients in scope.

Bulk export uses SMART Backend Services auth (a system/*.read-scoped client-credentials token via a signed JWT assertion), not an interactive launch.

Quick start: kickoff → poll → download

# 1) Kickoff (async). Ask for clinical-note-bearing resource types.
curl -s -X GET \
  'https://ehr.example/fhir/Group/cohort-42/$export?_type=DocumentReference,DiagnosticReport&_since=2024-01-01T00:00:00Z' \
  -H 'Authorization: Bearer <backend-services-token>' \
  -H 'Accept: application/fhir+json' \
  -H 'Prefer: respond-async' -D -
# -> 202 Accepted
#    Content-Location: https://ehr.example/fhir/bulkstatus/JOB123
Read the whole SKILL.md on GitHub

More in Writing