Back to insights
Healthcare Software·Article

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.

KS
Kamil Shah
Researcher | Writer at Trilops AI
17 min read
A Practical Guide to Healthcare Integration Blog Banner
Healthcare Interoperability 15 minute read

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.

HL7 v2event-driven messages between systems
FHIRresources, APIs, documents, messaging, and services
SMARTOAuth-based app authorization for FHIR
Realitycoexistence, mapping, monitoring, and reconciliation
HL7
Healthcare interoperability layerevents · resources · terminology · identity · authorization · workflow
Coexistence model
Integration outcomeRight data, right patient, right workflowdelivered, validated, monitored, and recoverable
01HL7 v2
02FHIR API
03Terminology
04Identity
05Authorization
06Monitoring
Architecture decisionevent or query?read or write?R4 or R5?profile?source of truth?

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.

01

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.

Simplified HL7 v2 example
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/dL
Operational meaning
Event:
  laboratory result available

Patient:
  local patient identifier P12345

Observation:
  Hemoglobin = 13.4 g/dL

Workflow:
  route result to receiving system
i

HL7'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.

02

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"
  }
}
Important distinction

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.

03

The practical comparison

HL7 vs FHIR: what are the main differences?

DimensionHL7 v2FHIR
Primary mental modelEvents packaged as messagesStandardized resources plus multiple exchange paradigms
Common transportMLLP/TCP, files, interface engines, vendor-specific channelsHTTPS REST APIs, messaging, documents, subscriptions, and other FHIR patterns
Typical integrationSystem A sends an ADT, order, result, or scheduling event to System BApp reads, searches, creates, updates, or exchanges specific healthcare resources
Data shapeSegments and fields inside message structuresResources with defined elements, references, profiles, terminology, and extensions
Web/mobile developer experienceUsually requires an interface layer or specialized parserDesigned to work naturally with modern API development
CustomizationLocal Z-segments and site conventions are commonProfiles and extensions formalize constrained use, but implementation variation still exists
Security modelTransport and application security are commonly defined outside the message itselfFHIR API security is also external to the core REST semantics; SMART provides widely used OAuth-based authorization patterns
Best fitEstablished operational event feeds and legacy interoperabilityNew APIs, apps, granular data access, standardized resources, and modern interoperability programs
Choose based onworkflow+source capabilities+required data+write authority+version/profile
04

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.

v2 event

ADT

Communicates patient administration events such as admission, transfer, discharge, or demographic updates.

FHIR resources

Patient + Encounter

Represent identity and encounter state as addressable resources that can be searched or exchanged.

v2 event

ORU

Communicates observations and results in an event-driven message.

FHIR resources

Observation + DiagnosticReport

Represent individual measurements and grouped diagnostic results with explicit references.

v2 event

SIU

Communicates scheduling events in many installed environments.

FHIR resources

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.

05

Do not replace a working event feed without a reason

When is HL7 v2 still the better integration choice?

Existing source

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.

Event-driven workflow

The receiving system needs to react immediately

Admission, discharge, transfer, order, and result events often fit naturally into message-driven processing.

Legacy ecosystem

Downstream systems already expect v2

Laboratory, radiology, billing, interface-engine, and hospital systems may have mature v2 interfaces with years of operational hardening.

Vendor reality

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.

Interface engine

The organization already has transformation infrastructure

A mature integration engine can route, transform, validate, monitor, replay, and reconcile v2 traffic across many systems.

Change risk

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.

06

Use the modern resource model where it creates leverage

When is FHIR the better integration choice?

App development

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.

Patient access

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.

Query-driven

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.

New platform

You control a new interoperability layer

A FHIR-first internal model can make APIs, analytics, apps, and future partner integrations easier to standardize.

Standard profiles

An ecosystem requires a specific FHIR implementation guide

US Core, SMART App Launch, and other implementation guides define narrower expectations for particular use cases.

Data reuse

The same resource needs several consumers

Resource-level APIs can support multiple workflows without creating a new message format for each consumer.

07

"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.

QuestionWhat to verifyWhy it matters
Base versionR4, R4B, R5, or another supported versionResource definitions and compatibility differ between releases
Implementation guideUS Core or another jurisdiction/use-case profileProfiles add required elements, terminology, search behavior, and conformance rules
CapabilityStatementResources, search parameters, interactions, and operations actually supported by the serverThe base FHIR specification does not require every server to implement everything
AuthorizationSMART version, scopes, backend-service support, launch context, token behaviorData availability means little if the application cannot obtain appropriate access
Write supportCreate, update, conditional operations, transaction behavior, proprietary restrictionsMany practical integrations need more than read-only data
Vendor profileExtensions, proprietary endpoints, required identifiers, partner-program constraintsReal implementations often add vendor-specific requirements
2026 reality

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.

08

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.

DiscoverSMART configurationfind authorization and token capabilities
AuthorizeRequest appropriate scopesuser, patient, system, and launch context
TokenObtain access tokenapply the server's authorization policy
FHIRAccess permitted resourcesread, search, or other supported interactions
!

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.

09

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.

v2 conceptPossible FHIR targetMapping concernValidation
PIDPatient, RelatedPerson, or context-dependent targetsidentifiers, assigning authority, demographicspatient matching and identifier namespaces
PV1Encounter and related contextpatient class, location, attending provider, encounter lifecyclestate transition and reference integrity
OBRServiceRequest, DiagnosticReport, or context-specific structuresorder identity, placer/filler IDs, specimen and timingorder-result correlation
OBXObservation or component structuresvalue type, units, terminology, abnormal flagscode, unit, range, and source validation
DG1Condition or encounter diagnosis representationdiagnosis role, code system, contextterminology and encounter relationship
SIUAppointment, Schedule, Slot, actorsevent semantics, status, recurrence, resourcesavailability and lifecycle reconciliation

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.

10

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.

1EHR/Lab emits v22Interface engine validates3Identity and terminology map4Normalize to resources5Apps consume FHIR/API6Writes return through supported channel
Source of truth

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.

Identity

Normalize identifiers before data

Patient, provider, encounter, order, accession, and organization identifiers need durable cross-system mapping.

Terminology

Map codes explicitly

LOINC, SNOMED CT, RxNorm, ICD, local codes, units, and organization-specific vocabularies need controlled translation.

Events

Preserve ordering and idempotency

Duplicate and out-of-order v2 messages can corrupt FHIR state if the transformation layer assumes every event is new.

Reads

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.

Writes

Use the supported transactional path

A FHIR read API does not imply that the same vendor accepts FHIR writes for every workflow.

11

Integration starts with a workflow contract

What should an HL7/FHIR implementation process include?

Phase 01

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.

Phase 02

Inventory vendor capabilities

Obtain interface specifications, CapabilityStatements, FHIR version, implementation guides, SMART configuration, sandboxes, and write restrictions.

Phase 03

Define identifiers and source ownership

Document patient, encounter, order, provider, location, organization, and external-system identifiers before mapping fields.

Phase 04

Design mapping and terminology

Map v2 fields, FHIR profiles, extensions, codes, units, null behavior, repeated values, and local conventions.

Phase 05

Define delivery semantics

Specify acknowledgements, retries, idempotency, duplicate detection, out-of-order events, timeout behavior, and replay rules.

Phase 06

Build test fixtures

Include normal messages, missing fields, unknown codes, malformed payloads, duplicate events, mismatched patients, and unavailable dependencies.

Phase 07

Pilot with reconciliation

Compare source and destination records for real traffic before allowing the interface to operate without close review.

Phase 08

Monitor every boundary

Track rejected messages, FHIR errors, authorization failures, mapping drift, queue depth, replay, and downstream corrections.

Phase 09

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.

Discuss your integration
12

A valid payload can still create the wrong record

How should HL7 and FHIR integrations be tested?

Test layerWhat to verifyExample failure
Syntaxmessage parses, JSON/XML validates, required profile elements existOBX field shifted or invalid FHIR resource
Semanticscodes, units, dates, statuses, null flavors, repetitions, and relationships preserve meaninglab unit converted incorrectly
Identitypatient, provider, encounter, order, and organization match the intended entitiesresult attached to wrong patient
Workflowevent causes the correct business transition exactly onceduplicate ADT creates duplicate encounter
Authorizationapplication receives only permitted FHIR resources and actionsscope or role exposes excessive data
Failure recoverytimeouts, retries, replay, dead-letter queues, and reconciliation workdestination outage loses orders
Performancethroughput, latency, queue growth, API limits, and batch behavior remain acceptableresult backlog during peak volume
Changenew vendor version or profile does not silently break mappingsextension or field semantics change
Integration traceORU_R01 · MSG123
Delivered and reconciled
Receivev2 message accepted and source checksum storedValidatemessage structure and required identifiers checkedMappatient, order, codes, units, and observations transformedDeliverFHIR resources written or routed through target interfaceAcknowledgesource/destination responses correlatedReconciletarget record confirmed against expected patient and order
13

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.

Least privilegeLimit interfaces to required data and actions

Do not give an integration broad database or API access merely because it is easier to configure.

TransportProtect every connection

Use appropriate encrypted transport, network controls, certificates, key rotation, and secure channel configuration for the architecture.

SecretsManage credentials centrally

OAuth clients, private keys, API secrets, interface credentials, and certificates need rotation and audited access.

AuditTrace reads, writes, transformations, and failures

Keep enough context to reconstruct who or what moved which data and why.

RetentionKnow where PHI appears

Interface logs, dead-letter queues, message archives, API traces, and test fixtures can all contain sensitive data.

GovernanceAssign ownership across organizations

Define who handles mapping changes, downtime, data corrections, access approvals, incident response, and vendor escalation.

14

What healthcare integration work taught us

What have we learned from integrating healthcare systems?

01

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.

02

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.

03

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.

04

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.

05

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.

06

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 principle
15

A 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.

Use real vendor capabilities
Existing event feedStable v2 already available?If yes, preserve it unless there is clear value in change
Granular APINeed resource-level query or app access?FHIR is usually the stronger fit
Write workflowWhich standard does the vendor accept for writes?Do not assume read support equals write support
Implementation guideIs a specific FHIR profile required?Version and conformance drive the design
Operational maturityWhich path can be monitored and supported?Existing interface engines may favor coexistence
Future appsWill several applications reuse the data?A normalized FHIR/API layer can create leverage

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.

Review your integration
16

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

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.

Interoperability is more than syntax

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.

#HL7 vs FHIR#healthcare integration#HL7 v2#FHIR API#SMART on FHIR#healthcare interoperability#EMR integration#FHIR R4#FHIR R5
Share
TrilopsLet's start a project together

Built for
what can't fail.

hello@trilops.ai

Prefer to talk? We typically reply within one business day and can hop on a call to scope your project — no obligation.