Kick off a FHIR Bulk Data patient-level $export, poll for completion, and download NDJSON output

domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Send GET [base]/Patient/$export with headers Accept: application/fhir+json and Prefer: respond-async; optionally include _type, _since, and _outputFormat query parameters
  2. Expect a 202 Accepted response; capture the Content-Location header — this is the polling URL for the export status
  3. Poll the Content-Location URL with GET; while the export is in progress the server returns 202 with an optional X-Progress header describing status
  4. When the export is complete the server returns 200 with a JSON manifest body; parse the output array, each element containing type and url fields pointing to NDJSON files
  5. Download each NDJSON file using authenticated GET requests; each line is a valid FHIR resource JSON object of the indicated type
  6. After processing, send DELETE to the Content-Location URL to signal the server it may clean up the export artifacts

Known gotchas

Related routes

Initiate and poll a FHIR bulk data export ($export) to retrieve patient data as NDJSON files
fhir · 6 steps · unrated
run a FHIR bulk data export using $export and retrieve ndjson output asynchronously
fhir · 6 steps · unrated
Initiate a FHIR Bulk Data $export with Prefer: respond-async header and poll for completion
healthcare-fhir · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans