
Machine learning against FHIR data is production reality in 2026 — not experimental. The four patterns below cover how teams actually build clinical prediction models on top of FHIR-backed EHR data, without the friction that plagued early efforts.
Pattern 1: Bulk data to feature store. Bulk Data Access IG $export streams FHIR resources into NDJSON, downstream Spark/dbt/Databricks pipelines flatten them into ML feature stores. This is the pattern most enterprise ML teams settle on because it decouples model training from EHR runtime.
The operational challenge is freshness — $export runs nightly typically, so features are 24 hours stale. For real-time predictions, layer this with pattern 2 below.
Pattern 2: Subscription for streaming inference. FHIR Subscription delivers resource-change events to inference services. A new lab result Observation triggers a sepsis-risk model; the prediction gets written back as a new Observation or a Task for clinician review. Latency is seconds, not hours.
Pattern 3: CQL for feature engineering. Clinical Quality Language (CQL) is a declarative language for expressing clinical logic on FHIR data. Feature engineering that would be tricky in raw SQL — "patients with two elevated HbA1c readings > 8.0 in a rolling 6-month window" — reads clearly in CQL and runs against a FHIR store. MITRE's cqf-ruler is the reference implementation.
Pattern 4: FHIR-based decision support hooks. CDS Hooks fires clinician-facing prompts at defined workflow points (patient-view, order-select, order-sign). The hook payload includes relevant FHIR resources; the CDS service returns cards with recommendations. Best for real-time clinical decision support in-workflow.
Data-quality prerequisites
ML on FHIR fails silently if data quality is poor. Before training:
1. Terminology validation pass rate must be >95%. 2. Reference integrity (Observation.subject resolves) must be >99%. 3. Timestamp coherence (effectiveDateTime <= lastUpdated) must be >99%. 4. Duplicate rate must be <2%.
Vendor tooling state, mid-2026
| Layer | Tool |
|---|---|
| Bulk export | Any US Core-conformant FHIR server |
| Streaming inference | Medplum bots, Aidbox subscriptions |
| CQL execution | MITRE cqf-ruler, Google cql-execution |
| CDS Hooks server | Any HL7 implementation |
ML on FHIR is not a research topic in 2026 — it's a delivery topic. Teams that treat it as an integration project (with data quality gates and clean patterns) ship faster than teams that treat it as a research project.
