FHIR vs HL7v2: which standard for which integration

HL7 v2 carries the event feeds inside hospitals; FHIR is the API that certified EHRs and health plans must now expose. Each kind of integration fits one of them better, and most US projects will run both for years.

In short

  • Use HL7 v2 for event feeds between systems that already speak it, such as admissions, orders and results inside a hospital, and use FHIR when an app needs to query or write discrete data through an API.
  • US rules point new APIs at FHIR R4: certified EHRs must offer a FHIR R4 API with US Core and SMART App Launch, and CMS-0057-F requires FHIR APIs from many payers by January 1, 2027.
  • FHIR is not a drop-in replacement for v2, so most integrations will run both, with an interface engine or platform translating between them.

Use HL7 v2 for real-time event feeds between systems that already speak it, such as admissions, orders and results moving inside a hospital. Use FHIR when an app needs to query or write discrete data through an API, which is what US rules now require certified EHRs and many health plans to offer.

The mistake to avoid is treating the two as old and new versions of the same thing, with a migration in between. They were built for different jobs. In most US integrations you will run both and pick one for each data flow.

FHIR vs HL7v2: what is the difference?

HL7 v2 is a messaging standard. The FHIR specification describes it this way: v2 uses messages composed of reusable segments to communicate healthcare information. One system sends a message when something happens, and the receiving system processes it. HL7 calls v2 its first information exchange standard and one of its most widely adopted.

MSH|^~\&|ADT|HOSPITAL|APP|VENDOR|202611190830||ADT^A01|MSG0001|P|2.5
PID|1||123456^^^HOSPITAL^MR||DOE^JANE||19800101|F
PV1|1|I|4WEST^401^1

That is a simplified example of an admission message: a header, a patient segment and a visit segment, separated by pipes. It is compact and fast, but the meaning of each field depends on how the sending system was configured.

FHIR is built around resources. The FHIR overview says the basic building block is a resource and all exchangeable content is defined as one: a Patient, an Observation, an Encounter. Each resource can be read, searched, created or updated through a web API, in JSON or XML. FHIR also supports documents and an event-based messaging style similar to v2, and the specification says there is no expectation that a system offering the API also offers messaging, or the reverse. The US rules below are written around the API.

{
  "resourceType": "Patient",
  "id": "123456",
  "name": [{ "family": "Doe", "given": ["Jane"] }],
  "gender": "female",
  "birthDate": "1980-01-01"
}
HL7 v2 and FHIR compared
QuestionHL7 v2FHIR
Building blockMessages made of segmentsResources such as Patient and Observation
How data movesA message sent when something happensRead, search, create or update through a web API
FormatPipe-separated segmentsJSON or XML
Update modeTypically snapshot, some messages send only changesSnapshot only, out of the box
Site variationHigh: optional elements, Z-segmentsReduced by profiles such as US Core
Best fitEvent feeds inside a hospitalApps that query or write discrete data
US API rulesNot banned, not the API standardFHIR R4 for certified EHR and payer APIs

When should you use HL7 v2?

  • The other side already sends or accepts v2. Many hospital systems exchange admissions, orders, results and scheduling events this way, and the interface may already exist.
  • You need a push feed of events as they happen, and the source does not offer an equivalent FHIR subscription for that event.
  • You are connecting systems inside one organization through an interface engine that the hospital's integration team already runs and monitors.
  • Volume is high and the data is a stream of updates rather than questions your app asks on demand.

When should you use FHIR?

  • Your app asks questions: show this patient's medications, find their recent lab results, pull their problem list.
  • You are building a patient-facing app or a SMART app that launches inside the EHR. Certified EHRs must support SMART App Launch for this.
  • You need population-level exports. The ONC criterion requires FHIR Bulk Data for multiple-patient requests.
  • You work with a health plan. CMS-0057-F requires Patient Access, Provider Access, Payer-to-Payer and Prior Authorization APIs, all based on HL7 FHIR.
  • You want an interface that behaves the same across customers. FHIR profiles such as US Core reduce, though they do not remove, site-by-site variation.

What do US rules require?

Two rules matter most for buyers. First, ONC's certification criterion §170.315(g)(10) requires certified EHRs to offer a standardized API for patient and population services. It references FHIR R4 (4.0.1), US Core, SMART App Launch for patient and user access, and Bulk Data with SMART Backend Services for system access. It also requires that a patient can revoke an app's access, with the authorization server acting within one hour of the request.

Second, the CMS Interoperability and Prior Authorization Final Rule (CMS-0057-F) applies to Medicare Advantage organizations, state Medicaid and CHIP fee-for-service programs, Medicaid managed care plans, CHIP managed care entities and QHP issuers on the federally facilitated exchanges. Its API requirements must be implemented by January 1, 2027, and they rest on FHIR R4.0.1, US Core, SMART App Launch and Bulk Data.

Neither rule bans HL7 v2. They set FHIR as the standard for the APIs that patients, apps and other organizations use. The v2 interfaces inside a hospital keep running alongside.

Is FHIR replacing HL7 v2?

Not in any way that changes your next project. FHIR is where new APIs go, and the rules above make that clear. But v2 interfaces are deeply embedded, and the FHIR specification itself notes that consistent mapping rules between v2 and FHIR are not realistic at a broad level. Its mappings are a starting point, and each interface still needs its own mapping work.

There is also a real difference in how updates work. The FHIR comparison page says v2 data is typically exchanged in snapshot mode, though some v2 messages send only changed data, while FHIR out of the box only works in snapshot mode. If a source relies on incremental updates, translating to FHIR takes design work.

Which FHIR version should you build on?

For US work, build on FHIR R4 (4.0.1). It is the version the ONC criterion and CMS-0057-F reference. HL7's site lists R5 (5.0.0) as the current published version, but US regulations and certified EHR APIs are still R4-based. The FHIR R4 overview marks R4 as mixed normative and trial-use content, and core resources such as Patient and Observation are normative, which means they are stable.

The profile matters as much as the version. US Core sets the minimum rules for each resource in the US, and the ONC criterion moves its required US Core version forward over time through its standards update process. Ask each EHR which US Core version its API supports.

Why are HL7 v2 interfaces hard to reuse?

The FHIR specification names the problem directly: one of the biggest challenges with v2 interoperability is the variation of implementation. Most v2 data elements are optional, and even in similar settings, the data elements supported can vary. Sites add custom Z-segments whose meaning is opaque without manual explanation from the sender. So v2 mappings usually have to be done implementation by implementation.

Budget for that. Each new hospital on v2 means a fresh look at its specification, test messages from its environment, and mapping changes. FHIR extensions have the same risk in principle, but they are defined in a structured way and can appear at any level, which makes them easier to discover and document.

How do you run both?

The common pattern is an interface engine or integration platform in the middle. It receives v2 feeds, maps them into your internal model, and exposes or consumes FHIR where the other side needs it. Your app sees one model; the engine absorbs each site's differences.

  • Hosted platform: someone else runs the engine and maintains connections. You pay per connection or volume and depend on their roadmap.
  • Self-hosted engine: you control everything and own every upgrade. Note that NextGen moved Mirth Connect to a single commercial, proprietary license starting with version 4.6; the last open-source release is 4.5.2.
  • Direct FHIR only: works when every source exposes the FHIR data you need, which is more common for patient-facing apps than for in-hospital workflows.

Which standard for which integration?

  • Real-time admission, discharge and transfer events from a hospital: HL7 v2, usually.
  • Lab orders and results with a hospital or reference lab: HL7 v2 is common; confirm what the lab supports.
  • A patient app pulling records from certified EHRs: FHIR R4 with SMART App Launch.
  • A clinician app that opens inside the EHR: a SMART on FHIR launch, with FHIR reads and writes.
  • Population exports for analytics or quality: FHIR Bulk Data.
  • Health plan data exchange under CMS-0057-F: FHIR APIs.
  • Decision support shown at the moment of ordering: CDS Hooks, which uses FHIR data (see our CDS Hooks guide).

Questions to ask before you scope the work

  • For each data flow: is it an event to push or a question to ask?
  • What does the source system expose today, v2, FHIR or both, and in which version?
  • Which US Core version does the EHR's FHIR API support, and which resources allow writes?
  • Who on the hospital side owns the v2 interface, and how do you get test messages from their environment?
  • Where will translation happen, and who maintains it when a site changes its configuration?

We have shipped Epic and athenahealth integrations, and for any vendor platform we work from the vendor's documentation and sandbox. If you are deciding between v2, FHIR or both for a specific workflow, talk to one of our engineers. Our 5-day free technical audit ends with a written report on what each data flow needs.