FHIR R4 Integration Guide for HealthTech Startups: 2026 Edition

In this guide, you’ll learn:
- What FHIR R4 actually takes in production
- When to use SMART on FHIR, CDS Hooks, or HL7 v2
- How Epic, Cerner, and AthenaHealth integrations differ
- Why integrations get delayed and how to avoid it
- How FHIR R5 and R6 impact future architecture
If you are a CTO or VP of Engineering at a post-Series A health tech company, you have almost certainly heard a version of this sentence in a sales call:
"We would love to move forward, but we need to confirm your product integrates with our Epic environment first."
And if you have tried to do that, you already know that "integrates with Epic" is not a single task. It is a six-month project minimum, involving multiple standards, hospital-specific configurations, security reviews, and a queue you have very little control over.
FHIR R4 sits at the centre of all of it.
But FHIR R4 alone does not tell the whole story. The real work includes
- HL7 v2 messaging that still handles roughly 85% of real-time intra-hospital data exchange globally,
- CDS Hooks for clinical decision support that fires inside a clinician's live workflow,
- SMART on FHIR for app authorization, and EHR-specific implementation choices.
That means your Epic integration will not work in Cerner without a rebuild.
This guide covers all of it. Not as a surface-level overview, but as a practical technical reference for teams who are actively building or about to start.
What FHIR R4 Actually Is and Why R4 Specifically Matters
FHIR stands for Fast Healthcare Interoperability Resources. It is a standard published by HL7 International that defines how clinical data is structured and exchanged between systems using modern REST APIs and JSON or XML formats.
There have been multiple versions of FHIR. Here is where each one sits in 2026:
| FHIR Version | Status | What You Need to Know |
|---|---|---|
| DSTU 1 and 2 | Retired or being retired | Do not build on these. Epic and Cerner are actively dropping DSTU2 support |
| STU 3 | Legacy, limited support | Some older EHR instances still run it. Avoid for new builds |
| R4 | Current production standard | Mandatory for US ONC compliance, required by Epic, Cerner, and Athena for new integrations |
| R4B | Minor patch on R4 | Mostly affects FHIR Questionnaire and Citation resources. Most teams stay on R4 |
| R5 | Published January 2023, slow adoption | Some features in R5 are backported into R4 implementations. Not yet required by major EHRs |
| R6 | Expected late 2026 | Plan for a direct migration from R4 to R6 when it arrives. Skip R5 entirely |
Why R4 specifically:
The US 21st Century Cures Act and ONC interoperability rules mandate FHIR R4 as the baseline standard for certified EHR systems. Every major EHR in the US market: Epic, Oracle Health (formerly Cerner), and AthenaHealth must expose FHIR R4 APIs. This is not optional for them, which means it is not optional for you either.
If your product connects to any certified EHR in the US, UK NHS systems, or major GCC hospital groups, FHIR R4 is your baseline. Build anything below it and you will be rebuilding before the end of 2026.
Top 4 Standards Your Product Needs to Understand
Most teams treat FHIR as one thing. In practice, there are four distinct standards working together in any real EHR integration. Getting confused between them is one of the most common reasons integrations stall.
1. FHIR R4 (The Data Standard)
FHIR R4 defines the data resources: Patient, Encounter, Observation, Condition, MedicationRequest, DiagnosticReport, and over 140 others. It also defines how you query and write those resources using RESTful HTTP calls.
Key FHIR R4 concepts your engineering team must be solid on:
- Resource types and their relationships (Patient links to Encounter, Encounter links to Condition, etc.)
- The FHIR search parameter system (how you query for specific patients, date ranges, clinical codes)
- Must-Support flags (US Core Profile defines which fields EHRs must populate and which your app must handle)
- Extensions (how hospitals add custom fields that are not in the base standard)
- Bundles (how to request or send multiple resources in a single transaction)
2. SMART on FHIR (The Authorization Layer)
SMART on FHIR is not a data standard. It is an authorization framework that defines how your application gets permission to access patient data inside an EHR.
It sits on top of OAuth 2.0 and OpenID Connect. When a clinician launches your app from inside Epic or Cerner, SMART on FHIR handles the authentication handshake and controls what data your app can access.
There are two SMART on FHIR launch contexts that behave differently and require separate implementations:
- EHR Launch: Your app launches from inside the EHR interface. The EHR passes a launch token and context (which patient, which encounter) to your app at startup. Common for clinical decision support tools.
- Standalone Launch: Your app launches independently and initiates the OAuth flow itself, redirecting to the EHR authorization server. Common for patient-facing apps and population health tools.
3. CDS Hooks (The Real-Time Decision Support Layer)
CDS Hooks is a separate but complementary standard that allows your service to deliver real-time alerts and recommendations directly inside a clinician's EHR workflow at the moment a clinical event happens.
How it works:
- The EHR sends a "hook" (a trigger event) to your service. Common hooks include: patient-view (clinician opens a patient chart), order-select (clinician begins ordering a medication or test), order-sign (clinician signs off on an order).
- Your service receives the hook, processes the relevant patient data, and sends back "cards" which are structured response objects containing a summary, a detail section, and optional suggestions or links.
- The EHR renders the cards inside the clinician's screen without them having to leave their workflow.
Where CDS Hooks Fits In Your Product Strategy
If your product delivers alerts, risk scores, protocol recommendations, or drug interaction warnings at the point of care, CDS Hooks is the right pathway.
It is how you get clinical intelligence in front of a clinician at the exact moment they need it rather than buried in a separate dashboard they never open.
CDS Hooks is growing fast. As of 2026, Epic, Cerner, and a growing number of NHS-connected systems support CDS Hooks in production.
4. HL7 v2 (The Legacy Backbone That Will Not Go Away)
HL7 v2 is the older, pipe-delimited messaging standard that still handles roughly 85% of real-time intra-hospital data exchange globally. Lab results, ADT (admit, discharge, transfer) notifications, scheduling updates, and pharmacy data move through HL7 v2 in virtually every hospital in operation.
Here is the practical reality: you cannot ignore HL7 v2 even in 2026.
Most hospital environments run both FHIR R4 APIs for modern application connectivity and HL7 v2 messaging for core operational data flows. The two systems run in parallel. Some data that your product needs: real-time bed status, lab results as they come in, or pharmacy orders will only be available via HL7 v2 messaging in many hospitals.
HL7 v2 vs FHIR R4: Key Differences
| Factor | HL7 v2 | FHIR R4 |
|---|---|---|
| Format | Pipe-delimited text segments | JSON or XML resources |
| Transport | MLLP over TCP/IP | HTTPS REST |
| Data granularity | Sends entire messages | Sends individual resources |
| Real-time capability | Strong (push-based) | Pull-based (polling or subscriptions) |
| Standardization | High variation between hospitals | More standardized but extensions vary |
| EHR coverage | Universal (every hospital) | All certified US EHRs, most UK systems |
| Developer experience | Requires specialist knowledge | Familiar to any REST API developer |
For HL7 v2 to FHIR migration, the key mapping challenges are:
- Patient identification: HL7 PID segment maps to FHIR Patient resource but identifier systems need explicit mapping
- Provider data: HL7 PV1 attending physician maps to FHIR Practitioner references within Encounter resources
- Diagnoses: HL7 DG1 segments become FHIR Condition resources with ICD-10 coding system mappings
- Medications: RXA segments convert to MedicationAdministration resources
- Lab results: HL7 OBX segments map to FHIR Observation resources with LOINC codes
Using an integration engine like Mirth Connect or Rhapsody handles HL7 v2 parsing and transformation. For any product that needs to connect to hospital operational systems rather than just read from an FHIR endpoint, plan for HL7 v2 capability from the start.
EHR Reality: Epic, Cerner, and AthenaHealth Are Not the Same Problem
This is where most teams waste the most time. They build an integration for Epic, assume Cerner will work the same way, and then spend three months discovering it does not. Here is what is actually different.
Epic
Epic is installed in 41.3% of US hospital facilities as of 2025 and processes 10 billion FHIR API calls monthly. It covers 250 million patient records in the US.
Technical characteristics:
- FHIR R4 via Epic Interconnect (the FHIR server layer)
- HL7 v2 via Epic Bridges (the HL7 interface engine)
- SMART on FHIR: Fully supported for both EHR Launch and Standalone Launch
- CDS Hooks: Supported in production
- App marketplace: Epic Showroom (formerly App Orchard). Listing requires formal review and testing
What makes Epic different:
- Per-site activation: Each hospital that runs Epic has its own instance. Being approved for one Epic customer does not mean you are approved for all. Every new hospital requires separate go-live testing.
- Epic-specific FHIR extensions: Epic adds custom extensions to many FHIR resources. Your app needs to handle these gracefully without breaking when extensions are absent.
- Custom flowsheets: Epic hospitals create custom data fields called flowsheets. Data your product needs may be in a custom flowsheet rather than a standard FHIR resource.
- Access token behavior: Epic access tokens follow specific expiry patterns. Token refresh logic needs to match Epic's implementation.
Timeline reality: 2 to 4 months for sandbox approval. Per-site go-live testing on top of that.
Read More: Epic EHR Integration for Startups: Timeline, Cost, and What Actually Breaks
Oracle Health (Cerner)
Oracle Health (the rebrand of Cerner, completed in 2022) covers roughly 23% of the US acute care market with strong presence in the UK, Middle East, and Australia.
Technical characteristics:
- FHIR R4 via Ignite APIs (the primary pathway for all new integrations in 2026)
- HL7 v2 via Cerner Open Interface (COI): the HL7 v2 messaging engine comparable to Epic Bridges
- SMART on FHIR: Fully supported via code.cerner.com developer portal
- CDS Hooks: Supported but with configuration differences from Epic
- DSTU2 support being dropped: Cerner is actively removing DSTU2 support in favor of R4
What makes Cerner different from Epic:
- Cerner Code Value system: Cerner uses an internal coding system for many clinical values. When you receive a FHIR resource from Cerner, coded fields often contain Cerner-specific codes rather than standard SNOMED or LOINC codes. You need a resolution layer to translate these into standard terminology.
- Centralized hosting advantage: Unlike Epic where each hospital manages its own instance, many Cerner customers use Oracle-managed hosting. This means less per-site infrastructure variation and integrations that are typically 15 to 20% faster to deploy than equivalent Epic integrations.
- Token refresh differences: Cerner access tokens expire on a shorter cycle than Epic. Older Cerner instances have inconsistent refresh token support. If your OAuth token refresh logic is built around Epic's behavior, it will cause silent data gaps in Cerner.
- Developer portal access: code.cerner.com provides sandbox access without the lengthy pre-approval process Epic requires, which means you can start building and testing faster.
AthenaHealth
AthenaHealth is dominant in ambulatory care and specialty practices rather than hospital systems. If your product targets physician groups, outpatient clinics, or specialty networks, AthenaHealth is a higher priority than Cerner.
Technical characteristics:
- FHIR R4 support exists but is less complete than Epic or Oracle Health, particularly for complex resource types
- Proprietary APIs alongside FHIR: AthenaHealth has a tiered partner program with both FHIR and proprietary API access
- HL7 v2 interfaces are common in Athena integrations and often more reliable than FHIR for scheduling and ADT data
- Developer access is available without a lengthy review process
What makes AthenaHealth different:
- The mix of FHIR and proprietary APIs means you need to evaluate per use case which pathway is more reliable
- Documentation is extensive but parts of it are outdated for specific endpoints. Build time into your schedule for finding the current behavior through testing rather than documentation
- For scheduling and appointment data, HL7 v2 integration through Athena's interface is often more reliable than the FHIR pathway
FHIR R4 Implementation Patterns That Matter
Pattern 1: Read-Only Patient Data Access
The simplest integration pattern. Your product pulls patient demographics, conditions, medications, lab results, and observations from the EHR.
Use this when: Your product needs clinical context to do its job but does not write data back to the EHR. Common in analytics platforms, population health tools, and care management dashboards.
Technical approach:
- Register as a SMART on FHIR app (Standalone Launch)
- Request read scopes for the resource types you need: patient/*.read, observation.read, condition.read, etc.
- Build a FHIR query layer using the EHR's endpoint
- Handle missing data: in production, not all resources will be populated. Build for the absence of expected data from the start
Pattern 2: Bidirectional Data Sync
Your product reads from the EHR and writes structured data back. This is significantly more complex than read-only access and requires additional approval steps at every EHR.
Use this when: Your product generates clinical data that needs to live in the patient's primary record. Remote monitoring values, structured assessment results, care plan updates.
Technical approach:
- Request write scopes in addition to read scopes: patient/*.write for specific resource types
- EHR write access requires more rigorous security review. Epic in particular reviews write-access applications more closely than read-only
- Implement conflict resolution logic: what happens when data in your system and data in the EHR disagree
- Build idempotent write operations: the same data written twice should not create duplicate records
Pattern 3: CDS Hooks Integration
Your product delivers real-time recommendations inside the EHR's clinical workflow.
Use this when: Your product's value is in the moment of clinical decision-making, not in a separate dashboard. Drug interaction checking, risk stratification alerts, protocol recommendations.
Technical approach:
- Register your service with the EHR as a CDS Hooks provider
- Define which hooks you subscribe to: patient-view, order-select, order-sign are the most common
- Your service must respond within a defined timeout. Epic requires responses within 5 seconds. If your service exceeds this, Epic will suppress your cards and may disable your service
- Handle the prefetch mechanism: you can declare in your registration which FHIR resources the EHR should send with each hook call, reducing the need for your service to make additional FHIR queries at hook time
- Cards must follow the CDS Hooks card schema: summary (under 140 characters), detail (markdown supported), source attribution, and optional suggestions
Pattern 4: HL7 v2 to FHIR Bridge
You are connecting to hospital systems that send HL7 v2 messages and need to translate that data into FHIR resources for your platform.
Use this when: You need real-time operational data (lab results, ADT events, orders) that is only available via HL7 v2 in your target hospitals.
Technical approach:
- Deploy an integration engine: Mirth Connect (open source), Rhapsody, or Iguana are the most common choices
- Map the incoming HL7 v2 message types to FHIR resources using the mappings referenced earlier in this guide
- Handle the MLLP protocol: HL7 v2 uses MLLP (Minimum Lower Layer Protocol) over TCP/IP, not HTTP. Your integration engine handles this, but your network and firewall configuration needs to support inbound TCP connections on the defined port
- Build acknowledgment handling: HL7 v2 uses ACK messages to confirm receipt. Your system needs to send ACKs correctly or the sending system will retry and flood you with duplicate messages
FHIR US Core Profile: What You Cannot Skip
The US Core Implementation Guide sits on top of FHIR R4 and defines which resource profiles, extensions, and terminology bindings are required for US market compliance under the ONC 21st Century Cures rule.
If you are building for US health systems, US Core is not optional. It defines:
- Which FHIR resources must be supported by certified EHRs (and therefore available to your app)
- Which data elements within each resource are Must-Support (the EHR must populate them, your app must handle them)
- Which terminology systems must be used (SNOMED CT for clinical terms, LOINC for lab results, RxNorm for medications, ICD-10 for diagnoses)
Key US Core profiles your product will interact with most:
| US Core Profile | What It Covers | Common Use Cases |
|---|---|---|
| US Core Patient | Demographics, identifiers, contact info | Patient matching, identity verification |
| US Core Condition | Diagnoses, problem list entries | Clinical context, risk stratification |
| US Core MedicationRequest | Prescriptions and medication orders | Medication management, reconciliation |
| US Core Observation (Lab) | Laboratory results | Diagnostic tools, monitoring |
| US Core DiagnosticReport | Radiology and pathology reports | Imaging integrations, report distribution |
| US Core Encounter | Visit records and care episodes | Population health, care coordination |
| US Core Procedure | Clinical procedures performed | Surgical tools, procedure tracking |
| US Core DocumentReference | Clinical documents (CDA, PDF) | Document exchange, referrals |
For UK-based teams: The NHS uses the UK Core Implementation Guide (built on FHIR R4) rather than US Core. The profiles differ. If you are building for both markets, your FHIR layer needs to handle both profile sets, ideally through a profile-aware translation layer rather than hard-coded field mappings.
EHR Sandbox Approval: Timeline Most Teams Get Wrong
The sandbox approval process is where most FHIR integration timelines collapse. Here is the reality by EHR:
| EHR | Sandbox Access | Production Approval | Per-Site Activation |
|---|---|---|---|
| Epic | Application required. 2 to 6 weeks for access | 2 to 4 months after sandbox testing. App Showroom listing adds further review | Required for every hospital customer |
| Oracle Health (Cerner) | Self-service via code.cerner.com. Access typically within days | Faster than Epic. 6 to 10 weeks for most integrations | Less variation than Epic due to centralized hosting |
| AthenaHealth | Self-service developer portal. Reasonably fast access | Tiered partner program. Standard and premium tiers with different API access | Less common as AthenaHealth is more standardized |
Hidden timeline factor: hospital IT queues
Beyond EHR vendor approval, every hospital has its own IT security review process. Even after Epic approves your app, each hospital that wants to use it must review and activate it. This review involves:
- Security questionnaire completion (sometimes 50 to 100 questions)
- SOC 2 Type II report review
- HIPAA Business Associate Agreement execution
- Penetration test results review
- Data flow diagram review
- Sometimes a separate clinical governance review
Each hospital does this on their own schedule. Plan for 4 to 16 weeks per hospital for this process alone.
What you can do to reduce delays:
- Complete SOC 2 Type II before approaching any hospital. Not Type I. Hospital procurement teams expect Type II.
- Have a data flow diagram ready that shows exactly where patient data goes, how it is encrypted, who can access it, and where it is stored
- Prepare a completed security questionnaire in advance so you are not answering each hospital's 80 questions from scratch each time
- Request sandbox access as early as possible, even if your product is not ready for production testing yet
Common FHIR Integration Failure Patterns
These are not theoretical. They are the actual reasons integrations stall or fail in production.
1. Building against Epic and assuming Cerner works the same way
Epic and Cerner are both FHIR R4. But their implementations diverge in ways that break code written for one when run against the other. Cerner's Code Value system, different token expiry patterns, and different extension structures all require Cerner-specific handling.
Build an abstraction layer between your product logic and the EHR-specific FHIR implementation from the start.
2. Not handling missing or incomplete data
In production FHIR environments, resources are frequently missing expected fields. A patient resource may have no address. A condition resource may have no onset date. An observation may have no interpretation code.
Code that assumes fields are always present will throw null pointer exceptions in production at the worst possible moment: during a hospital pilot review.
3. Scoping too broadly in the OAuth authorization request
Requesting patient/*.read when you only need Observation.read and MedicationRequest.read is a common mistake. Hospital security reviewers see overbroad scope requests as a red flag.
Request the minimum scopes your product genuinely requires and document why each scope is needed.
4. Not handling pagination
FHIR servers return large result sets in pages, using Bundle resources with next links. If your query returns more than 10 to 50 resources (the default page size varies by EHR), your product will only see the first page unless it implements pagination. Missing this means your product silently works with incomplete data in production.
5. Ignoring CDS Hooks response time requirements
If you are implementing CDS Hooks, your service must respond within 5 seconds for Epic. A service that times out is suppressed by the EHR and may be disabled entirely.
Build your CDS service to respond fast even when the underlying data processing takes longer, using a fast preliminary response followed by an update pattern where the EHR supports it.
6. Building a single integration rather than an integration framework
The first EHR integration your team builds always takes the longest. But if you build it as a single point solution rather than a reusable framework, the second integration takes nearly as long as the first.
Invest in an abstraction layer, a FHIR resource normalization layer, and a configuration-driven approach so that each new EHR integration reuses 60 to 80% of the existing code.
FHIR R5 and R6: What Your Architecture Should Prepare For
FHIR R5 was published in March 2023. Adoption has been slow. As of mid-2026, none of the major EHRs require R5 and most developers are not building on it. The guidance from the field is clear: skip R5 as a migration target.
FHIR R6 is expected in late 2026. This matters for architecture decisions you are making right now.
Key changes coming in R6 that affect health tech builders:
- Subscriptions overhaul: R6 will significantly improve the FHIR Subscriptions framework, making real-time event-driven architectures much more practical than the current R4 subscription model
- Terminology services improvements: Better support for SNOMED CT, LOINC, and RxNorm bindings in the base specification
- Security tagging changes: How sensitive data categories (mental health, substance use, reproductive health) are tagged and handled will change
What to do now:
- Build your FHIR layer with clean separation between data transport (the FHIR resources and queries) and your product logic
- Avoid building deep dependencies on R4-specific quirks that you know are changing in R6
- Follow the HL7 R6 ballot process to understand the timeline and flag breaking changes for your architecture
FHIR Compliance Checklist for Health IT Teams
Before you go to market or into your next EHR negotiation, work through this.
Standards and Architecture
FHIR R4 confirmed as the base standard for all new integration work
FHIR R4 confirmed as the base standard for all new integration work.
US Core Implementation Guide profiles mapped to your data model (or UK Core for NHS-focused products)
US Core Implementation Guide profiles mapped to your data model (or UK Core for NHS-focused products).
HL7 v2 capability assessed: identify which data your product needs that is only available via v2 in target hospitals
HL7 v2 capability assessed: identify which data your product needs that is only available via v2 in target hospitals.
SMART on FHIR implemented: both EHR Launch and Standalone Launch tested in sandbox
SMART on FHIR implemented: both EHR Launch and Standalone Launch tested in sandbox.
CDS Hooks implemented (if applicable): response time tested under 5 seconds, card schema validated
CDS Hooks implemented (if applicable): response time tested under 5 seconds, card schema validated.
EHR-Specific Readiness
Epic sandbox access requested and active
Epic sandbox access requested and active.
Oracle Health sandbox registered at code.cerner.com
Oracle Health sandbox registered at code.cerner.com.
AthenaHealth developer portal registration complete (if ambulatory market is a target)
AthenaHealth developer portal registration complete (if ambulatory market is a target).
EHR-specific extension handling built and tested for each target EHR
EHR-specific extension handling built and tested for each target EHR.
Token refresh logic tested for each EHR's specific expiry behavior
Token refresh logic tested for each EHR's specific expiry behavior.
Cerner Code Value resolution layer built (if Cerner is a target)
Cerner Code Value resolution layer built (if Cerner is a target).
Security and Compliance
SOC 2 Type II report completed
SOC 2 Type II report completed.
HIPAA Business Associate Agreement template ready
HIPAA Business Associate Agreement template ready.
Penetration test completed within the last 12 months
Penetration test completed within the last 12 months.
Data flow diagram current and showing all PHI handling
Data flow diagram current and showing all PHI handling.
Minimum necessary OAuth scopes defined and documented
Minimum necessary OAuth scopes defined and documented.
Audit logging in place for all FHIR resource access
Audit logging in place for all FHIR resource access.
Data residency confirmed for UK (NHS DSP Toolkit) and GCC markets (PDPL, MOHAP)
Data residency confirmed for UK (NHS DSP Toolkit) and GCC markets (PDPL, MOHAP).
Operational Readiness
FHIR abstraction layer in place so EHR-specific implementations are isolated from product logic
FHIR abstraction layer in place so EHR-specific implementations are isolated from product logic.
Pagination handling implemented and tested
Pagination handling implemented and tested.
Error handling built for missing, malformed, or unexpected FHIR data
Error handling built for missing, malformed, or unexpected FHIR data.
Integration monitoring in place: alerts when FHIR endpoints return unexpected errors
Integration monitoring in place: alerts when FHIR endpoints return unexpected errors.
Per-site activation process documented and resourced for hospital rollouts
Per-site activation process documented and resourced for hospital rollouts.
Conclusion
FHIR R4 is not a checkbox. It is the foundation your entire EHR integration strategy sits on. And getting it right means understanding that SMART on FHIR, CDS Hooks, and HL7 v2 each play a different role, that Epic, Cerner, and Athena behave differently despite sharing the same standard.
The teams who move fastest are the ones who build a proper integration framework the first time rather than a one-off connection. The hospitals you want as customers are already asking the right questions. Make sure your answers are ready.
Frequently Asked Questions
Not Sure Where Your FHIR Integration Stands?
A 45-minute audit with the SanoWorks engineering team covers all your questions and the specific gaps that are most likely to slow down your next hospital deal.