Inferensys

Glossary

FHIR Bulk Data Access

An HL7 FHIR specification for exporting large, flat datasets of patient-level data asynchronously, typically in NDJSON format, for analytics and population health.
Large-scale analytics wall displaying performance trends and system relationships.
POPULATION HEALTH ANALYTICS

What is FHIR Bulk Data Access?

A FHIR specification for exporting large, flat datasets of patient-level data asynchronously, typically in NDJSON format, for analytics and population health.

FHIR Bulk Data Access, formally defined by the HL7 FHIR Bulk Data Access IG, is an API specification designed to export large, flat datasets of FHIR resources asynchronously. Unlike the standard RESTful API optimized for point-of-care queries, this mechanism triggers a long-running operation that generates compressed NDJSON files, enabling the efficient movement of entire patient panels for analytics, machine learning, and population health management without overwhelming the server.

The process begins with a client requesting a Group export, initiating a kick-off request that returns a polling status URL. The server asynchronously generates a manifest file containing download links for each resource type, such as Patient, Observation, or MedicationRequest. This stateless, backend-driven approach decouples data generation from retrieval, ensuring that exporting millions of records does not degrade the performance of the transactional FHIR server serving clinical users.

POPULATION HEALTH INTEROPERABILITY

Key Features of FHIR Bulk Data Access

The FHIR Bulk Data Access specification (Flat FHIR) defines an asynchronous, pre-coordinated approach for exporting large, flat datasets of patient-level data. Designed for analytics and population health, it moves beyond transactional RESTful queries to enable efficient, bulk extraction of standardized resources.

01

Asynchronous Export Pattern

Unlike real-time FHIR searches, Bulk Data Access uses a kick-off and poll architecture. A client requests an export, and the server initiates a long-running job. The client then polls a status endpoint until the job is complete, at which point it receives a manifest of download URLs. This prevents timeouts when exporting millions of records.

202
HTTP Status for Accepted Job
02

NDJSON Output Format

Exported data is formatted as Newline Delimited JSON (NDJSON) , a flat file format where each line is a valid JSON object. This format is ideal for streaming large datasets because it is:

  • Splittable: Files can be partitioned for parallel processing.
  • Appendable: New data can be added without rewriting the entire file.
  • Line-Processable: Tools can read one record at a time without loading the full dataset into memory.
03

Three Export Levels

The specification defines three distinct scopes for data extraction, each serving a different analytical need:

  • System-Level Export: Exports data for all patients on a server. Requires powerful authorization.
  • Patient-Level Export: Exports all data for a specific, pre-defined list of patients.
  • Group-Level Export: Exports data for all members of a defined Group resource, such as a cohort of diabetic patients. This is the most common mechanism for population health analytics.
04

Pre-Coordinated Resource Types

To simplify implementation, the specification defines a Flat FHIR profile. Instead of complex, nested resource graphs, servers export a pre-defined set of resource types as flat, independent files. The standard types include:

  • Patient: Demographics.
  • Observation: Vital signs and lab results.
  • Condition: Diagnoses and problems.
  • MedicationRequest: Prescribed medications.
  • AllergyIntolerance: Documented allergies. This flat structure is optimized for direct loading into analytical databases.
05

Backend Services Authorization

Bulk data access is secured using the SMART Backend Services authorization profile, not user-facing OAuth. This machine-to-machine flow relies on:

  • JSON Web Keys (JWK) : For client authentication.
  • Signed JWT Assertions: To request access tokens.
  • OAuth 2.0 Client Credentials Grant: To obtain a token scoped to the requested export level. This ensures that only registered, non-interactive systems can initiate large-scale data transfers.
06

Error Handling and Retry

The specification includes robust error handling for long-running jobs. If an export fails, the server returns an OperationOutcome resource detailing the error. Files are generated transactionally; a download URL is only provided for a file that was fully written. Clients must implement exponential backoff when polling the status endpoint and handle partial failures gracefully by re-requesting only the failed files.

FHIR BULK DATA ACCESS

Frequently Asked Questions

Clear, technical answers to the most common questions about the FHIR Bulk Data Access specification for population-level analytics and data export.

FHIR Bulk Data Access is an HL7 specification that defines a standardized, asynchronous API for exporting large, flat datasets of patient-level data from a FHIR server. Unlike the standard FHIR RESTful API, which is designed for point-of-care access to individual resources, Bulk Data Access uses the Group resource to define a cohort of patients and initiates a long-running export job. The server processes the request asynchronously, generating compressed NDJSON (Newline Delimited JSON) files for each requested resource type—such as Patient, Observation, or MedicationRequest. The client polls a status endpoint until the job is complete, then downloads the files from a secure location. This mechanism is foundational for population health analytics, machine learning model training, and regulatory reporting under the ONC Cures Act Final Rule.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.