HL7 vs FHIR: A Practical Guide to Healthcare Integration
A practical HL7 vs FHIR guide covering HL7 v2 messages, FHIR resources and APIs, SMART on FHIR, R4 vs R5, mapping, coexistence architecture, testing, security, and production integration lessons.
HL7 vs FHIR: A Practical Guide to Healthcare Integration
HL7 v2 and FHIR solve different interoperability problems. HL7 v2 remains deeply useful for event-driven exchange such as admissions, orders, results, and scheduling, while FHIR provides standardized healthcare resources and modern API patterns for granular data access, apps, and newer integration workflows. In most real healthcare environments, the right architecture uses both.
The direct answer
HL7 v2 is usually the better fit when an existing healthcare system already emits event-driven messages for admissions, orders, results, scheduling, or other operational workflows. FHIR is usually the better fit when an application needs standardized, resource-level API access, modern authorization, patient-facing apps, granular queries, or new interoperability products.
FHIR does not simply replace HL7 v2. Many hospitals, laboratories, imaging systems, and EHR environments will continue to use v2 interfaces while exposing FHIR APIs for different use cases. A practical integration strategy starts with the workflow and source-system capabilities, then chooses the standard and version that fit the actual exchange.
The event-driven workhorse
What is HL7 v2?
HL7 Version 2 is a family of healthcare messaging standards designed to exchange clinical and administrative events between systems. In day-to-day integration work, "HL7" often means HL7 v2 pipe-delimited messages moving through an interface engine or point-to-point interface.
Messages are organized into segments such as MSH for message metadata, PID for patient identity, PV1 for encounter context, OBR for order or observation request information, and OBX for observation values. The exact structure depends on the message type, version, implementation guide, trading-partner agreement, and local conventions.
MSH|^~\&|EHR|CLINIC|LAB|NETWORK|20260819||ORU^R01|MSG123|P|2.5
PID|||P12345||DOE^JANE||19840408|F
OBR|1||LAB7788|718-7^Hemoglobin
OBX|1|NM|718-7^Hemoglobin||13.4|g/dLEvent:
laboratory result available
Patient:
local patient identifier P12345
Observation:
Hemoglobin = 13.4 g/dL
Workflow:
route result to receiving systemHL7's current v2-to-FHIR implementation guide focuses on commonly exchanged v2 message structures including admission and transfer events, orders, results, vaccinations, medical-document events, and scheduling. That is a useful reflection of where v2 remains operationally important.
Healthcare data as reusable resources
What is FHIR?
FHIR, or Fast Healthcare Interoperability Resources, is an HL7 standard for exchanging healthcare information electronically. Its core building blocks are resources such as Patient, Practitioner, Encounter, Observation, Condition, MedicationRequest, ServiceRequest, DiagnosticReport, Appointment, and DocumentReference.
FHIR is often discussed as a REST API standard, but it is broader than REST. The specification includes resource models plus exchange approaches that include RESTful APIs, search, documents, messaging, services, subscriptions, and other patterns. JSON is common in application development, but FHIR also defines other representations.
Simplified FHIR resource
One observation as a structured resource.
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "718-7",
"display": "Hemoglobin"
}]
},
"subject": { "reference": "Patient/P12345" },
"valueQuantity": {
"value": 13.4,
"unit": "g/dL"
}
}FHIR standardizes data structures and exchange interfaces. It does not guarantee that every vendor supports every resource, search parameter, write operation, profile, extension, or workflow.
The practical comparison
HL7 vs FHIR: what are the main differences?
| Dimension | HL7 v2 | FHIR |
|---|---|---|
| Primary mental model | Events packaged as messages | Standardized resources plus multiple exchange paradigms |
| Common transport | MLLP/TCP, files, interface engines, vendor-specific channels | HTTPS REST APIs, messaging, documents, subscriptions, and other FHIR patterns |
| Typical integration | System A sends an ADT, order, result, or scheduling event to System B | App reads, searches, creates, updates, or exchanges specific healthcare resources |
| Data shape | Segments and fields inside message structures | Resources with defined elements, references, profiles, terminology, and extensions |
| Web/mobile developer experience | Usually requires an interface layer or specialized parser | Designed to work naturally with modern API development |
| Customization | Local Z-segments and site conventions are common | Profiles and extensions formalize constrained use, but implementation variation still exists |
| Security model | Transport and application security are commonly defined outside the message itself | FHIR API security is also external to the core REST semantics; SMART provides widely used OAuth-based authorization patterns |
| Best fit | Established operational event feeds and legacy interoperability | New APIs, apps, granular data access, standardized resources, and modern interoperability programs |
The architectural difference that matters
How are HL7 messages different from FHIR resources?
HL7 v2 messages usually describe an event in context. A single result message may include message metadata, patient identity, encounter information, order context, and multiple observations. The receiver processes the message as an event and updates its local state.
FHIR decomposes healthcare information into resources that reference one another. A Patient can be read independently. An Encounter can reference that Patient. An Observation can reference the Patient and Encounter. A DiagnosticReport can reference multiple Observations.
ADT
Communicates patient administration events such as admission, transfer, discharge, or demographic updates.
Patient + Encounter
Represent identity and encounter state as addressable resources that can be searched or exchanged.
ORU
Communicates observations and results in an event-driven message.
Observation + DiagnosticReport
Represent individual measurements and grouped diagnostic results with explicit references.
SIU
Communicates scheduling events in many installed environments.
Appointment + Schedule + Slot
Represent scheduling data through resource-level structures when supported by the server and workflow.
Do not assume a v2 segment maps one-to-one to one FHIR resource. Mapping depends on message context, semantics, identifiers, terminology, and the target implementation guide. HL7 now publishes a dedicated v2-to-FHIR implementation guide because consistent transformation requires more than renaming fields.
Do not replace a working event feed without a reason
When is HL7 v2 still the better integration choice?
The EHR already publishes a stable v2 feed
If the required ADT, order, result, or scheduling event is available and well-supported, using it may be lower-risk than building a parallel mechanism.
The receiving system needs to react immediately
Admission, discharge, transfer, order, and result events often fit naturally into message-driven processing.
Downstream systems already expect v2
Laboratory, radiology, billing, interface-engine, and hospital systems may have mature v2 interfaces with years of operational hardening.
The FHIR API does not expose the needed operation
A vendor may support patient data retrieval through FHIR while still requiring v2 or a proprietary interface for orders, results, or scheduling workflows.
The organization already has transformation infrastructure
A mature integration engine can route, transform, validate, monitor, replay, and reconcile v2 traffic across many systems.
The business value of migration is low
Replacing a stable interface only to modernize the syntax can create project risk without improving patient or operational outcomes.
Use the modern resource model where it creates leverage
When is FHIR the better integration choice?
Web or mobile applications need granular data
FHIR resources and RESTful interactions are much easier to consume from modern application stacks than raw v2 feeds.
A patient-facing application needs authorized records
FHIR plus SMART authorization provides standardized patterns for app access to health data where the server supports the required profiles and scopes.
The application needs current state, not only events
Search and read interactions allow applications to request resources directly rather than reconstructing state from a historical message stream.
You control a new interoperability layer
A FHIR-first internal model can make APIs, analytics, apps, and future partner integrations easier to standardize.
An ecosystem requires a specific FHIR implementation guide
US Core, SMART App Launch, and other implementation guides define narrower expectations for particular use cases.
The same resource needs several consumers
Resource-level APIs can support multiple workflows without creating a new message format for each consumer.
"FHIR support" is not specific enough
Which FHIR version should you implement?
As of August 2026, HL7 lists FHIR R5, version 5.0.0, as the current published base specification. That does not mean every production EHR or U.S. interoperability program has moved to R5.
The current published US Core Implementation Guide, version 9.0.0, is still based on FHIR R4 and meets USCDI v6 requirements. The current published SMART App Launch guide, version 2.2.0, is also published against FHIR R4, while documenting compatibility with FHIR versions from DSTU2 onward.
| Question | What to verify | Why it matters |
|---|---|---|
| Base version | R4, R4B, R5, or another supported version | Resource definitions and compatibility differ between releases |
| Implementation guide | US Core or another jurisdiction/use-case profile | Profiles add required elements, terminology, search behavior, and conformance rules |
| CapabilityStatement | Resources, search parameters, interactions, and operations actually supported by the server | The base FHIR specification does not require every server to implement everything |
| Authorization | SMART version, scopes, backend-service support, launch context, token behavior | Data availability means little if the application cannot obtain appropriate access |
| Write support | Create, update, conditional operations, transaction behavior, proprietary restrictions | Many practical integrations need more than read-only data |
| Vendor profile | Extensions, proprietary endpoints, required identifiers, partner-program constraints | Real implementations often add vendor-specific requirements |
Current FHIR core and current production implementation guides can be on different release families.
That is why "we support FHIR R5" is not automatically better than "we support the R4 profile your EHR and implementation guide require." Interoperability is about matching the ecosystem, not chasing the newest version number.
FHIR defines data exchange, SMART defines common authorization patterns
What is SMART on FHIR?
SMART App Launch is an HL7 implementation guide that defines OAuth 2.0 based patterns for applications to authorize, authenticate, and integrate with FHIR-based systems. It supports EHR-launched apps, standalone apps, scopes for limiting access, discovery of server configuration, and backend-service patterns.
SMART does not mean "the app may read everything." Requested scopes, user privileges, patient context, server policy, consent, organizational policy, and applicable law all affect what data and actions should be available.
Translation is semantic work
How do you map HL7 v2 messages to FHIR resources?
HL7's v2-to-FHIR implementation guide provides standardized mappings for messages, segments, data types, and vocabularies into FHIR R4 concepts. It is an important starting point, but each production transformation still needs local implementation rules.
Mapping rule
Preserve the original message and transformation trace.
When v2 becomes FHIR, store enough provenance to reproduce the transformation: source message ID, source version, mapping version, terminology map, generated resource IDs, validation results, timestamp, and downstream outcome. Without that trace, reconciliation becomes guesswork when the source and target disagree.
The most common architecture is hybrid
How should HL7 v2 and FHIR coexist in one healthcare platform?
A practical architecture often keeps v2 at the system boundary where legacy or operational systems already use it, then normalizes data into an internal model or FHIR layer for modern applications. Other systems may remain FHIR-native end to end.
Decide which system owns each domain
The EMR may own demographics and encounters while a scheduling platform owns availability. Do not let each integration invent authority independently.
Normalize identifiers before data
Patient, provider, encounter, order, accession, and organization identifiers need durable cross-system mapping.
Map codes explicitly
LOINC, SNOMED CT, RxNorm, ICD, local codes, units, and organization-specific vocabularies need controlled translation.
Preserve ordering and idempotency
Duplicate and out-of-order v2 messages can corrupt FHIR state if the transformation layer assumes every event is new.
Prefer the authoritative current source
Do not rebuild current state from an incomplete event history if the source system offers a reliable query or API.
Use the supported transactional path
A FHIR read API does not imply that the same vendor accepts FHIR writes for every workflow.
Integration starts with a workflow contract
What should an HL7/FHIR implementation process include?
Define the business event
State exactly what should happen when a patient registers, an order is created, a result arrives, an appointment changes, or an app requests data.
Inventory vendor capabilities
Obtain interface specifications, CapabilityStatements, FHIR version, implementation guides, SMART configuration, sandboxes, and write restrictions.
Define identifiers and source ownership
Document patient, encounter, order, provider, location, organization, and external-system identifiers before mapping fields.
Design mapping and terminology
Map v2 fields, FHIR profiles, extensions, codes, units, null behavior, repeated values, and local conventions.
Define delivery semantics
Specify acknowledgements, retries, idempotency, duplicate detection, out-of-order events, timeout behavior, and replay rules.
Build test fixtures
Include normal messages, missing fields, unknown codes, malformed payloads, duplicate events, mismatched patients, and unavailable dependencies.
Pilot with reconciliation
Compare source and destination records for real traffic before allowing the interface to operate without close review.
Monitor every boundary
Track rejected messages, FHIR errors, authorization failures, mapping drift, queue depth, replay, and downstream corrections.
Version the contract
Control changes to source message versions, FHIR profiles, vendor APIs, terminology maps, and implementation-guide releases.
Planning an EMR, lab, portal, or AI integration?
Start with the real interface contract, not the standard's marketing page.
Trilops designs healthcare integrations around vendor capabilities, HL7 v2, FHIR, SMART authorization, identity, terminology, reconciliation, and operational monitoring.
A valid payload can still create the wrong record
How should HL7 and FHIR integrations be tested?
Standards do not remove security responsibility
What security and governance controls do HL7/FHIR integrations need?
FHIR's REST API specification explicitly notes that authentication, authorization, and audit collection are not solved by the REST interactions themselves. SMART provides authorization patterns for FHIR applications, but implementation still needs organizational policy, appropriate scopes, identity, consent where applicable, logging, secrets, network controls, and incident response.
Do not give an integration broad database or API access merely because it is easier to configure.
Use appropriate encrypted transport, network controls, certificates, key rotation, and secure channel configuration for the architecture.
OAuth clients, private keys, API secrets, interface credentials, and certificates need rotation and audited access.
Keep enough context to reconstruct who or what moved which data and why.
Interface logs, dead-letter queues, message archives, API traces, and test fixtures can all contain sensitive data.
Define who handles mapping changes, downtime, data corrections, access approvals, incident response, and vendor escalation.
For the broader healthcare software controls, read HIPAA-Compliant Software Development. Technical interoperability does not by itself establish HIPAA compliance or any other legal or regulatory status.
What healthcare integration work taught us
What have we learned from integrating healthcare systems?
The standard name did not tell us what the vendor actually supported
"FHIR available" often meant a defined subset of resources, searches, scopes, and read/write operations. The CapabilityStatement, sandbox, partner documentation, and real test calls mattered more than the checkbox.
Identity problems caused more risk than serialization problems
Parsing JSON or pipe-delimited text is straightforward compared with deciding whether two identifiers refer to the same patient, encounter, provider, order, or location.
Terminology had to be treated as production data
Local codes, units, order catalogs, provider types, locations, and clinical terminology changed over time. Mapping tables needed versioning, owners, tests, and rollback.
FHIR did not remove the need for an interface layer
Modern APIs reduced friction for applications, but production systems still needed authorization, normalization, orchestration, retries, reconciliation, monitoring, and vendor-specific adaptation.
Event and state models often needed both standards
v2 was effective for operational events while FHIR provided resource-level access for portals, apps, analytics, and newer workflows. Forcing one standard everywhere increased complexity rather than reducing it.
The best integration had a visible recovery path
Dead-letter queues, replay, idempotency, reconciliation, and human correction were not edge features. They were how the system stayed trustworthy when a partner interface failed.
The hardest interoperability bugs are rarely about whether the payload is valid. They are about whether the payload means the same thing on both sides.
Trilops healthcare integration principleA practical decision framework
How do you decide between HL7 v2, FHIR, or both?
Integration decision scorecard
Choose the narrowest standard path that satisfies the workflow and ecosystem.
Need an interoperability architecture review?
Bring the workflow, vendor docs, and sample payloads.
We can help map the actual exchange path across HL7 v2, FHIR, SMART, proprietary APIs, identity, terminology, monitoring, and downstream workflows.
Frequently asked questions
HL7 vs FHIR: FAQ
Is FHIR replacing HL7 v2?+
Not in the simple sense. FHIR is the modern standard for many API and application workflows, while HL7 v2 remains deeply installed for operational messaging. Most large healthcare ecosystems will support both for years because they serve different workflows and source systems.
Is FHIR only a REST API?+
No. RESTful APIs are one prominent FHIR exchange pattern, but the specification also includes messaging, documents, services, subscriptions, and other mechanisms. FHIR's broader foundation is its standardized resource model.
Which FHIR version should a U.S. healthcare application use in 2026?+
Use the version required by the target ecosystem and implementation guide. FHIR R5 is the current published base specification, but the current US Core 9.0.0 guide is based on FHIR R4. Verify the EHR's CapabilityStatement and required profile rather than choosing by recency alone.
What is SMART on FHIR?+
SMART App Launch defines OAuth-based patterns for applications to authorize and integrate with FHIR servers. It covers capabilities such as EHR launch, standalone launch, scopes, configuration discovery, token exchange, and backend services.
Can you convert any HL7 v2 message into FHIR?+
Many common v2 concepts can be mapped into FHIR, and HL7 publishes a v2-to-FHIR implementation guide. Production conversion still requires local semantic decisions, terminology mapping, identifier rules, target profiles, validation, and testing. A mechanical field rename is not enough.
Do we still need an interface engine if we use FHIR?+
Possibly. FHIR reduces custom data-format work, but organizations may still need routing, transformations, authorization, orchestration, monitoring, retries, terminology, identity matching, and reconciliation across several vendors and standards.
What should we ask an EHR vendor before starting a FHIR integration?+
Ask for the supported FHIR version, implementation guides, CapabilityStatement, SMART configuration, available resources and search parameters, read/write operations, sandbox access, rate limits, event options, partner requirements, fees, support process, and version-change policy.
Authoritative references
- HL7: FHIR Release 5, current published base specification
- HL7 FHIR: RESTful API
- HL7: Version 2 to FHIR Implementation Guide
- HL7: v2 to FHIR message maps
- HL7: SMART App Launch 2.2.0
- HL7: US Core Implementation Guide 9.0.0
- HL7: US Core 9.0.0 change log and USCDI v6 alignment
FHIR versions, implementation guides, vendor support, regulatory programs, and certification requirements evolve. Verify the exact target ecosystem immediately before implementation. This article is technical guidance, not legal, regulatory, or compliance advice.
Build the integration around healthcare meaning, not just message transport.
Trilops builds healthcare integration layers across HL7 v2, FHIR, SMART authorization, vendor APIs, identity, terminology, auditability, monitoring, and recovery workflows.

Let's start a project together