Skip to main content

Understanding HL7 and FHIR in Healthcare

How HL7 v2 and FHIR differ, why both are still in use, and how organizations bridge the two when connecting healthcare systems.

Standards, Interoperability3 min read

HL7 and FHIR are two of the most frequently mentioned terms in healthcare integration, and they are often confused. They come from the same standards organization, Health Level Seven International, but they work quite differently. Understanding both is useful because most real environments use them side by side.

HL7 version 2

HL7 v2 is a message standard that has been used in healthcare for decades. A system sends a message to another system when an event occurs, such as a patient being admitted, an order being placed or a result being finalized. Messages are text, organized into segments and fields separated by special characters.

Illustrative HL7 v2 message (fictional data)
MSH|^~\&|REG_APP|CLINIC_A|EHR_APP|CLINIC_A|20200101120000||ADT^A04|MSG00001|P|2.5
PID|1||12345^^^CLINIC_A^MR||Doe^Jane||19800101|F

The first segment, MSH, describes the message itself, including its type. The PID segment carries patient identification details. HL7 v2 is flexible, which helped it spread widely, but that flexibility means that two systems can both claim to support it and still interpret fields differently. Interfaces usually need to be agreed and tested between each pair of systems.

FHIR

FHIR, which stands for Fast Healthcare Interoperability Resources, is a newer standard. It represents healthcare information as resources, such as Patient, Encounter, Observation and Medication Request, and exposes them through a web API in the style of modern internet services. Data is typically exchanged as JSON or XML.

Illustrative FHIR Patient resource (fictional data)
{
  "resourceType": "Patient",
  "id": "example",
  "name": [{ "family": "Doe", "given": ["Jane"] }],
  "gender": "female",
  "birthDate": "1980-01-01"
}

Because FHIR uses familiar web technologies, it is generally easier for developers to learn and use. It also supports searching, reading and updating individual resources, which suits applications that need on-demand access rather than a stream of event messages.

How they compare

  • Style: HL7 v2 is message-based and event-driven; FHIR is resource-based and works over web APIs.
  • Age: HL7 v2 is long established and deeply embedded in hospital and laboratory systems; FHIR is newer and increasingly supported by modern platforms.
  • Developer experience: FHIR resembles other web APIs, while HL7 v2 requires specialized parsing and knowledge of local conventions.
  • Flexibility: HL7 v2 allows wide variation between implementations; FHIR defines resources and profiles that tighten expectations, though implementations still differ.

Why both are still in use

Many core systems were built around HL7 v2 and continue to work well, so replacing those interfaces would be costly and risky. At the same time, newer applications and regulatory expectations favor FHIR-based access. In the United States, for instance, policy has encouraged standardized, FHIR-based APIs in certified health IT. The result is a mixed environment in which both standards coexist.

Bridging the two

When an older system emits HL7 v2 messages and a newer application expects FHIR, a translation layer can convert between them. This involves deciding how each segment and field maps to a FHIR resource, handling codes and identifiers consistently, and deciding what to do when data is missing. Clear, documented mapping rules are what make such a bridge dependable.

SMART on FHIR

SMART on FHIR is a related framework that lets applications launch inside an EHR and be authorized to access FHIR data using OAuth 2.0. It gives developers a consistent way to build apps that understand the current patient and user context.

Choosing an approach

The right choice depends on what your systems support and what you need to do. Start by finding out which standards and versions each system offers. Then decide where a standard fits naturally, where translation is needed, and how you will monitor the exchange once it is live.

All resources

Planning an integration project?

Tell us which systems are involved and what you want to achieve.

Start a Conversation