FHIR

FHIR Bulk Data export ($export) explained: how population data leaves a FHIR server

The FHIR Bulk Data Access IG defines $export to move data for many patients at once as NDJSON files. How the asynchronous flow works (kick-off, status polling, manifest), system, Patient and Group level exports, backend authorisation, and when bulk export is the wrong tool.

by Published 2 min read

Short answer: The Bulk Data Access implementation guide (often called Bulk FHIR or Flat FHIR) defines how to export data for many patients at once. A client calls $export at the system, Patient or Group level; the server prepares the files in the background and returns a manifest with links to NDJSON files, one resource per line. It is used for analytics, research and moving populations between systems, not for one patient's app.

The flow

  1. Kick-off: GET [base]/Group/[id]/$export with Accept: application/fhir+json and Prefer: respond-async, optionally _type and _since.
  2. The server answers 202 Accepted with a Content-Location status URL.
  3. Polling: the client calls the status URL until it returns 200 with a JSON manifest listing the output files.
  4. Download the NDJSON files.

Access is usually authorised with SMART Backend Services: a system-to-system OAuth flow with a signed JWT, no user present.

When not to use it

For one patient using an app, ordinary FHIR searches with the patient's consent are the right tool. Bulk export carries data about many people at once, so it needs a legal basis, a purpose and usually pseudonymisation; see de-identification.

In Anpheros

Anpheros does not offer bulk export of patients' records: every access is per person, with that person's consent. For population questions it publishes only anonymous aggregates for groups of at least 20 people. Developers: consent and longitudinal patient data.

Sources

Frequently asked questions

What is FHIR $export?

The operation in the Bulk Data Access IG that exports data for many patients as NDJSON files, asynchronously.

What is NDJSON?

Newline-delimited JSON: one FHIR resource per line, easy to stream and load.

How is bulk export authorised?

Usually with SMART Backend Services, a system-to-system OAuth flow with a signed JWT.

Can a patient app use bulk export?

It is not designed for that; patient apps use normal FHIR search and read with consent.

Anpheros Platform

Try it free in the sandbox

Your first FHIR call in 5 minutes. An HL7 FHIR R4 API with the patient's consent built in: try it in the sandbox, then connect your own app or clinic system.

Free · 30 synthetic patients · no card

This guide is for information and does not replace medical advice. For decisions about your health, talk to your doctor. In an emergency, call your local emergency number (112 in Europe).
Written by
The Anpheros team

Anpheros builds a medical record that the patient controls and can share with any clinic, on an HL7 FHIR R4 platform, based in the EU. These guides help you understand and organise your health; they do not replace your doctor.

About Anpheros →
Anpheros

The more you log, the clearer your record

Your health history in one place, under your control.

Symptom diaryPatterns show over time
Emergency cardQR in your phone's Wallet
All your resultsLabs and reports together
You decideWho sees what, and for how long
Create your free account

Free · Works in your browser · No card