Skip to content
FHIRVendors

FHIR vs HL7 v2: A Technical Comparison for Integration Teams

A side-by-side technical look at HL7 v2 messaging and FHIR: data structure, transport, eventing, mapping an ADT^A01 to FHIR, and how the two coexist in real architectures.

ArchitectureUpdated 4 min readBy the FHIR Vendors Editorial Team

Key takeaways

  • HL7 v2 pushes complete event messages over MLLP; FHIR exposes individual resources that clients query over HTTPS, with subscriptions for change notification.
  • An ADT^A01 admission message maps to several FHIR resources, mainly Patient and Encounter, plus Practitioner, Location and Coverage as needed.
  • HL7's v2-to-FHIR mapping guidance gives a starting point, but local Z-segments and field conventions always need site-specific analysis.
  • Most architectures keep v2 for high-volume internal feeds and add FHIR at the edge for apps, partners and analytics.

Two different models of exchange

HL7 v2 and FHIR both come from HL7 International, but they solve different problems. HL7 v2 is a messaging standard: when something happens (a patient is admitted, a result is finalized), the source system builds a message describing the event and pushes it to subscribers. FHIR is primarily a resource and API standard: data lives as addressable resources on a server, and clients read, search and write them when they need to.

That difference shapes everything else, from error handling to security to how you test. If you need the broader context of how HL7's standards relate, see HL7 vs FHIR.

Message structure: segments vs resources

A v2 message is a sequence of segments, each on its own line (separated by carriage returns on the wire). The first three characters name the segment. Fields are separated by |, components by ^, repetitions by ~, with \ as the escape character and & for subcomponents. The MSH segment declares those encoding characters, the message type, the sending and receiving applications and the v2 version.

MSH|^~\&|ADT_APP|GENHOSP|LAB_APP|GENHOSP|202611121030||ADT^A01^ADT_A01|MSG00001|P|2.5.1
EVN|A01|202611121030
PID|1||004512^^^GENHOSP^MR||Rivera^Ana||19840719|F|||12 Elm St^^Springfield^IL^62701
PV1|1|I|4WEST^412^B^GENHOSP||||1234^Patel^Raj^^^Dr|||MED||||7|||1234^Patel^Raj^^^Dr|IN||||||||||||||||||||||||||202611121015
Simplified HL7 v2.5.1 ADT^A01 (admit) message

Meaning depends on position: PID-3 is the patient identifier list, PID-5 the name, PID-7 the birth date, PV1-2 the patient class, PV1-3 the assigned location, PV1-44 the admit date/time. Every receiving system has to know those positions, and in practice each site has its own variations in which fields are populated and how.

FHIR expresses the same facts as named elements on separate resources that reference one another. The admission becomes, at minimum, a Patient and an Encounter:

{
  "resourceType": "Encounter",
  "id": "enc-7781",
  "status": "in-progress",
  "class": {
    "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
    "code": "IMP",
    "display": "inpatient encounter"
  },
  "subject": { "reference": "Patient/004512" },
  "participant": [
    { "individual": { "reference": "Practitioner/1234", "display": "Dr Raj Patel" } }
  ],
  "period": { "start": "2026-11-12T10:15:00-06:00" },
  "location": [
    { "location": { "reference": "Location/4west-412-b" } }
  ]
}
The same admission as a FHIR R4 Encounter (Patient shown by reference)

The Patient resource carries PID data (identifier with the MRN, name, gender, birthDate, address). Practitioner and Location resources represent the attending physician and bed. Self-describing element names and explicit code systems make FHIR easier to consume, at the cost of larger payloads.

Transport and eventing: push vs pull

DimensionHL7 v2FHIR
TransportMLLP over TCP, usually inside the network or over VPNHTTPS
Interaction styleSender pushes every event to configured receiversClients pull with read/search; servers can push notifications via subscriptions
AcknowledgementACK/NAK messages (MSA segment), original or enhanced modeHTTP status codes plus OperationOutcome
OrderingReceivers often depend on strict message orderEach request stands alone; versioning and ETags handle concurrency
StateReceiver builds its own copy of state from the event streamServer is the source of truth; clients query current state
SecurityNetwork controls; message content rarely encrypted at the application layerTLS plus OAuth 2.0 / SMART scopes per client
Transport and interaction differences

FHIR is not only pull. R4 includes a Subscription resource, and R5 redesigned subscriptions around topics, with a backport implementation guide that brings topic-based subscriptions to R4. FHIR messaging (Bundles with a MessageHeader) also exists for event-style exchange. In practice, however, EHR support for FHIR subscriptions varies, so many teams still rely on v2 feeds or vendor-specific event mechanisms for real-time triggers and use FHIR to fetch the details.

Mapping v2 to FHIR

HL7 has published v2-to-FHIR mapping guidance that defines how common message structures, segments and data types translate into FHIR resources. It is the right starting point, but plan for these realities:

  • One message, many resources. An ADT^A01 can yield Patient, Encounter, Practitioner, Location, RelatedPerson (NK1), Coverage (IN1) and AllergyIntolerance (AL1).
  • Identity resolution. You must decide whether an incoming PID matches an existing Patient, typically using identifier systems, and handle merges (ADT^A40) carefully.
  • Event semantics. A08 (update), A03 (discharge) and A11 (cancel admit) translate into updates of existing resources, not new ones, so you need stable, deterministic resource ids.
  • Z-segments and local conventions. Custom segments and repurposed fields need extensions or local profiles and a documented decision for each.
  • Terminology. Local codes in OBX-3 or PV1-10 must be mapped to standard systems such as LOINC or to agreed value sets.

Do not assume a clean one-to-one mapping

v2 messages describe events; FHIR resources describe current state. Translating a stream of events into correct resource state, including corrections, cancellations and out-of-order delivery, is usually the hardest part of a v2-to-FHIR project.

Coexistence patterns

Few organizations can retire v2. The common patterns are:

  • FHIR facade: an integration layer consumes v2 feeds and keeps a FHIR server or cache current, so apps and partners query FHIR while upstream systems keep sending v2. See FHIR server architecture for design options.
  • Dual interfaces: the EHR's native FHIR API serves apps, while v2 continues to feed departmental systems that only speak v2.
  • Trigger plus fetch: a lightweight v2 event or notification tells a service that something changed; the service then calls the FHIR API for authoritative data.
  • Gradual migration: new consumers are onboarded on FHIR, and v2 interfaces are retired as downstream systems gain FHIR support. The FHIR migration service page outlines this work.

When each standard fits

ScenarioBetter fitWhy
Real-time ADT to lab, pharmacy, or bed board inside the hospitalHL7 v2Established, high-volume, both ends already support it
Patient-facing or clinician-facing appFHIRSMART on FHIR launch and granular, authorized access
Partner organization needs on-demand dataFHIRInternet-friendly HTTPS with OAuth instead of VPN tunnels
Population analytics or payer data extractsFHIR Bulk DataStandard asynchronous export of large datasets
Lab results from a reference labOften HL7 v2ORU messaging is mature and widely supported by labs
Regulatory API requirements (ONC, CMS)FHIRRules specify FHIR-based APIs and implementation guides
Choosing between HL7 v2 and FHIR

If your roadmap involves both, an experienced FHIR integration partner can help decide where a translation layer pays off and where direct v2 interfaces are still the simplest answer.

Frequently asked questions

Is FHIR faster than HL7 v2?

Not inherently. v2 messages are compact and MLLP has little overhead, so v2 is efficient for streams of events. FHIR is more efficient when a client needs only specific data on demand, because it avoids processing every event.

Can an interface engine convert HL7 v2 to FHIR?

Yes. Most modern interface engines and integration platforms can transform v2 messages into FHIR resources, but the mapping logic, identity handling and local customizations still have to be designed and tested.

What is the FHIR equivalent of an ADT^A01?

There is no single equivalent. The admission is represented by creating or updating an Encounter with status in-progress that references the Patient, plus related Practitioner and Location resources. If event notification is needed, a FHIR subscription or a FHIR message can signal it.

Does FHIR have acknowledgements like v2 ACK messages?

For RESTful exchange, the HTTP response is the acknowledgement: a 2xx status for success, or a 4xx/5xx status, usually with an OperationOutcome describing the problem. FHIR messaging has its own response mechanism through MessageHeader.response.

References

  1. HL7 FHIR R4: Encounter resource
  2. HL7 FHIR R4: Patient resource
  3. HL7 FHIR R4: Subscription resource
  4. HL7 v2-to-FHIR Implementation Guide (build)
  5. HL7 FHIR R5 specification

FHIR® is a registered trademark of HL7 International. This guide is independent educational content and is not legal or compliance advice.

Related guides

Related FHIR services

Find the Right FHIR Integration Partner for Your Healthcare Project

Tell us what you need to build or connect. We review every request and share a short list of relevant vendors from our directory — no obligation.