Perform a FHIR Bulk Data system-level $export to export all resources across all patients from a FHIR server
domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Confirm the calling credential has system-level scope (e.g., system/*.read or system/Patient.read etc.) and that the server supports system-level export via CapabilityStatement
Initiate the export with GET [base]/$export with Accept: application/fhir+json and Prefer: respond-async; add _type to limit resource types if needed to reduce volume
Capture the Content-Location from the 202 response and begin polling at a reasonable interval (e.g., every 30–60 seconds) rather than aggressively
On 200 completion parse the manifest; note that system-level exports may produce very large manifests with many output file entries across many resource types
Download NDJSON files in parallel with bounded concurrency; implement retry logic with exponential backoff for transient download failures
Validate resource counts against expected population size and cross-check a sample against direct FHIR API queries to detect manifest or download integrity issues
Known gotchas
System-level export requires system/ scopes obtained via SMART Backend Services; attempting with patient/ or user/ scopes will be rejected
Very large system exports may have file URLs that expire; download promptly after the manifest is available rather than storing URLs for later retrieval
Some servers impose rate limits or quotas on concurrent downloads from export manifests; check server documentation for download concurrency limits
Give your agent this knowledge — and 6,400+ more routes
One MCP install gives any agent live access to the full route map across 2,100+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp