Explore Folio3

Explore Folio3 Network

×

AI & Data

Agentic AI, computer vision, generative AI

App Development

Web, mobile, and custom software

Security

Engineering, warehousing, analytics

Agtech

Farm, livestock, and crop software

Foodtech

Traceability and food supply chain

Digital Health

EHR, telehealth, and interoperability

Netsuite

ERP implementation and support

Dynamics

Dynamics 365 and Business Central

Salesforce

CRM consulting and integration

Ecommerce

B2B ecommerce, ERP Integrations and migrations

HL7 vs FHIR: Key Differences, Examples, and When to Use Each

Get the inside scoop on the latest healthcare trends and receive sneak peeks at new updates, exclusive content, and helpful tips.

Posted in Healthcare Integration

Last Updated | November 10, 2026

HL7 and FHIR are both standards from HL7 International, but they work differently. HL7 v2 (1989) sends pipe-delimited text messages between systems inside a hospital. FHIR (2014) exposes data as resources over REST APIs in JSON or XML, which is what web and mobile apps expect. Most US hospitals run both: HL7 v2 for internal feeds like admissions and lab results, and FHIR for apps, patient access, and anything that has to work outside the firewall. This guide shows the differences side by side, a real message in each format, and which one to use for a given integration.

HL7 vs FHIR: Key Differences, Examples, and When to Use Each

What Is HL7?

HL7 International publishes several standards. When people say “HL7” in a comparison with FHIR, they usually mean HL7 Version 2 (v2): a message standard released in 1989 that still carries most hospital data traffic, with roughly 95% of US healthcare organizations running it. 

A v2 message is plain text split into segments (MSH, PID, PV1, OBX) with pipes and carets as delimiters. HL7 Version 3 and its Clinical Document Architecture (CDA) came later, use XML, and are used mainly for documents such as C-CDA summaries rather than live messaging.

What Is FHIR?

FHIR, or Fast Healthcare Interoperability Resources, is a standard set of rules for exchanging electronic healthcare data. HL7 International released it in 2014 as a web-native alternative to v2 and v3. 

FHIR represents data as resources (Patient, Observation, Encounter, Medication, and about 150 others), each with a URL, and exchanges them over standard HTTP using REST, with JSON or XML as the format. Because it uses the same tools as any web API, developers who have never worked in healthcare can build against it. In the US, FHIR is required by the ONC Cures Act and CMS Interoperability rules for patient-access and payer APIs.

HL7 vs FHIR: Differences at a Glance

Parameter

HL7 v2

FHIR

Released 1989 2014
Data format Pipe-delimited text (ER7); XML optional JSON or XML
Structure Messages built from segments (MSH, PID, OBX) Resources (Patient, Observation) with URLs
Transport MLLP over TCP, point-to-point HTTPS REST (GET, POST, PUT, DELETE); also messaging and documents
Exchange model Push: one system sends, one receives Pull or push: any client queries the server
Versioning Backward compatible, many local variations Normative core since R4; extensions are standardized
Tooling Interface engines, custom parsers Any web stack; open-source servers (HAPI FHIR)
Security Handled at network level (VPN) OAuth 2.0 and SMART on FHIR built in
Main use today Hospital-internal feeds: ADT, orders, results Apps, patient access, payer APIs, cross-organization exchange

FHIR Vs HL7: Differences Explained 

FHIR standard was released as an alternative to HL7 v2 to improve interoperability and communication by enabling new apps and legacy systems to exchange data easily. It leverages modern web technologies like RESTful APIs and JSON. JSON, a lightweight data-interchange format, is more concise and efficient than XML, making it a popular choice for data exchange over the internet.

HL7 is a clinical messaging format that supports the secure exchange of healthcare data between medical organizations. It uses ASCII text-based messages to communicate between different systems, such as patient management systems, healthcare information systems, EMRs, laboratory information systems, and billing systems. 

Structure: Segments vs Resources

An HL7 v2 message is one block of text with segments in a fixed order. A FHIR resource is a self-contained object with its own ID and URL, so a lab result can be fetched, updated or linked on its own without re-sending the whole message.

Transport and Exchange Model

HL7 v2 is push-only: the sending system fires a message over MLLP to a known receiver. FHIR is request-based: a client asks the server for /Patient/123 and gets it back. That is why FHIR works for mobile apps and HL7 v2 does not.

Tooling and Learning Curve

HL7 v2 needs an interface engine and someone who knows the segment layouts. FHIR uses the same HTTP, JSON, and OAuth stack as any web API, so a general developer can be productive in days.

Security

HL7 v2 has no security layer of its own; it relies on the network (VPNs, private links). FHIR specifies OAuth 2.0 and SMART on FHIR for app authorization, which is what patient-facing apps and payer APIs require.

The Same Patient in HL7 v2 and FHIR 

Here is the same admission, first as the PID segment of an HL7 v2 ADT message, then as a FHIR Patient resource:

MSH|^~\&|EPIC|HOSP|LAB|HOSP|202611051030||ADT^A01|MSG0001|P|2.5

PID|1||123456^^^HOSP^MR||DOE^JANE^A||19850212|F|||42 MAIN ST^^BOSTON^MA^02108

{ “resourceType”: “Patient”,

  “id”: “123456”,

  “identifier”: [{ “system”: “urn:hosp:mrn”, “value”: “123456” }],

  “name”: [{ “family”: “Doe”, “given”: [“Jane”, “A”] }],

  “gender”: “female”,

  “birthDate”: “1985-02-12”,

  “address”: [{ “line”: [“42 Main St”], “city”: “Boston”, “state”: “MA”, “postalCode”: “02108” }]}

In v2, the meaning of each field comes from its position (field 5 is the name, field 7 the birth date), so a parser has to know the layout. In FHIR, each value is labeled, the resource has a URL, and any HTTP client can read it.

HL7 v2 vs FHIR

HL7 v2 and FHIR both come from HL7 International and both move clinical data between systems, but they were built for different jobs. HL7 v2 (1989) is a message standard for hospital-internal workflows: admissions, orders, results, scheduling, billing. FHIR (2014) is a web standard for apps, APIs, and exchange across organizations. The differences below are the ones that decide which you use.

Data format and structure

An HL7 v2 message is pipe-delimited text split into segments (MSH, PID, PV1, OBX). Meaning comes from position: field 5 of PID is the name, field 7 is the birth date. A parser has to know the layout, and every site adds its own variations.

FHIR represents the same data as resources (Patient, Encounter, Observation) in JSON or XML. Every value is labeled, every resource has an ID and a URL, and any HTTP client can read it without a healthcare-specific parser.

Extensibility and transparency

HL7 v2 handles custom data through Z-segments: vendor-specific fields that are not in the standard. They work, but the receiving side has to be told what they mean out of band.

FHIR uses extensions defined by a URI. Anyone receiving the data can resolve the URI and read the definition, so custom fields stay interoperable across organizations. Profiles such as US Core constrain base resources further (required fields, value sets) so that two implementers produce the same shape of data.

Reusability

In HL7 v2, the same provider or patient appears in multiple messages and multiple segments, with no shared identifier. A provider might carry a name and ID in one message and only a name in the next.

In FHIR, each entity is one resource with one identifier. A Practitioner created once is referenced from every appointment, prescription and observation that involves them. FHIR also distinguishes contained resources (embedded in a parent, not addressable on their own) from fully identified ones (standalone, queryable), which lets you decide what to expose externally and what to keep internal.

Human readability

HL7 v2 messages are not readable without tooling. Some sites add NTE segments with free text, but nothing requires it.

Every FHIR resource must include a human-readable narrative summarising its clinical content. That makes error tracing easier in production and gives clinicians something to check against.

Version compatibility

HL7 v2 is backward compatible: new fields are added at the end of segments, so old systems keep working. FHIR follows the same principle (fields are added without changing paths) and adds version-aware parsing, so a client can tell which version a resource conforms to.

Transport and security

HL7 v2 is push-only: a sending system fires a message over MLLP to a known receiver on a private network. Security is the network’s job.

FHIR is request-based over HTTPS: a client asks for /Patient/123 and gets it back. OAuth 2.0 and SMART on FHIR handle authorization, which is what patient-facing apps and payer APIs require.

Where Each One Wins

HL7 v2 wins inside the hospital. Every EHR, lab system, and ADT feed already speaks it, and there is no reason to rebuild those interfaces.

FHIR wins at the edge: mobile apps, patient access, payer-to-provider exchange, bulk export for analytics, and anything that has to work for a developer who does not know healthcare. In the US, it is also mandated for patient access and payer APIs under the ONC Cures Act and CMS Interoperability rules.

For most health systems, the answer is both: keep v2 for internal feeds and add FHIR where the data has to leave the building.

worried about integration costs and complexities?

When to Use HL7 vs FHIR 

Integration

Use

Why

Feeding ADT, orders and results between hospital systems HL7 v2 Every EHR and lab system already speaks it; no reason to rebuild
Patient-facing or mobile app reading EHR data FHIR REST, JSON and OAuth are what app developers use; required for patient access
Payer-to-provider or payer-to-payer data exchange FHIR CMS Interoperability rules mandate FHIR APIs
Connecting a medical device to an EHR Either v2 if the EHR exposes a results interface; FHIR if it exposes an API (Epic, Cerner both do)
Population health, analytics, bulk export FHIR Bulk Data (Flat FHIR) exports whole cohorts; v2 has no equivalent
Exchanging a clinical summary document HL7 CDA or FHIR Documents C-CDA is still the common format; FHIR Documents are growing

How to Convert HL7 to FHIR

Converting HL7 v2 to FHIR means mapping each segment and field to a resource: PID to Patient, PV1 to Encounter, OBX to Observation, ORC/OBR to ServiceRequest. 

Three things make it harder than it looks: v2 sites customize segments (Z-segments), the same entity can appear in several places with no shared ID, and code systems have to be translated. Most teams run the conversion inside an interface engine rather than writing one-off scripts. 

HL7 v3 vs FHIR 

HL7 v3 (2005) tried to fix v2’s inconsistency with a strict XML model built on the Reference Information Model (RIM). It was too complex for most vendors and saw little adoption outside its CDA document standard. FHIR kept v3’s data definitions but dropped the RIM-based messaging in favor of REST. 

HL7 and FHIR Integration With Folio3 Digital Health 

Most integrations we build touch both standards: an HL7 v2 feed from the hospital on one side and a FHIR API for the product on the other. Folio3 Digital Health’s HL7 FHIR integration services cover v2 interface development, FHIR API build-out, v2-to-FHIR mapping through Decode Health, and Epic and Cerner connections as an Epic Vendor Services Program member. 

Explore HL7 Integration Solutions Today

Closing Note 

HL7 v2 moves data between systems inside a hospital; FHIR exposes that data to apps and outside parties over a web API. Neither replaces the other. If the integration stays inside the hospital network, v2 is usually already there. If it faces a patient, a payer, or an app, it is FHIR.Both HL7 and FHIR are crucial standards for healthcare data exchange. HL7 is a traditional rule structure that offers a framework for data exchange, while FHIR, a modern standard, provides a more flexible and interoperable solution. By adopting these standards, healthcare organizations improve patient care, reduce operational costs, and contribute towards better decision-making. However, successful implementation requires careful planning, robust security measures, and ongoing maintenance. As healthcare continues to evolve, these standards will play a critical role in shaping the future of healthcare delivery.

Frequently Asked Questions

What is the difference between HL7 and FHIR? 

HL7 v2 sends pipe-delimited text messages point-to-point; FHIR exposes data as JSON resources over REST APIs. v2 is older and runs most hospital feeds; FHIR is newer and is required for patient-access and payer APIs in the US.

Does FHIR replace HL7? 

No. FHIR is itself an HL7 standard, and HL7 v2 still carries most internal hospital traffic. FHIR is added alongside v2 for apps and external exchange, not swapped in for it.

Does Epic use HL7 or FHIR? 

Both. Epic exchanges ADT, orders, and results with other systems over HL7 v2 and exposes FHIR R4 APIs through open. Epic and the Epic App Market for apps and patient access.

Is HL7 outdated? 

No. HL7 v2 is old but not outdated. Around 95% of US healthcare organizations still use it, and no EHR vendor has announced plans to drop it. It is being supplemented by FHIR, not retired.

What is the difference between HL7 and EDI? 

HL7 carries clinical data (admissions, orders, results). EDI X12 carries administrative and financial transactions (claims, eligibility, remittance) and is mandated by HIPAA for those. A hospital uses both for different data.

About the Author

Ahmed Sufyan Samee

Ahmed Sufyan Samee

Ahmed Sufyan Samee is a seasoned digital marketer with 4+ years of experience. Specializing in SEO, he excels in optimizing online content and managing display campaigns. His expertise extends to YouTube SEO, enhancing brand visibility and engagement. Sufyan is known for his strategic approach, leveraging PPC and SEO to drive measurable results. Committed to staying ahead in the dynamic digital landscape.

Gather Patient Vitals and Clinical Data Real Time

Folio3 integrates diverse IoT devices into your healthcare practice and ensure their interoperability with your existing healthcare systems.

Get In Touch