FHIR and HL7

FHIR vs HL7: Key Differences for Healthcare Integration

HL7 v2 and FHIR solve different interoperability problems. Understanding the difference helps teams choose the right pattern for messages, APIs, ETL pipelines, and clinical data platforms.

Disclaimer: This guide is provided by Efneze for educational and technical reference purposes only. HL7®, FHIR®, and related standards are trademarks of Health Level Seven International. Efnezeis not affiliated with or endorsed by Health Level Seven International. For official requirements, always refer to the applicable official specification and your organization's implementation guidance.

Quick answer: HL7 vs FHIR

HL7 v2 is a message standard optimized for real-time operational events inside healthcare environments. FHIR is a resource and API standard optimized for modern applications, patient access, analytics, and cross-organization data exchange.

In practice, HL7 v2 and FHIR are often used together. A hospital may receive ADT, ORU, ORM, and SIU messages through an interface engine, parse those feeds into a staging layer, and expose selected values through FHIR Patient, Encounter, Observation, Condition, and Medication resources.

DimensionHL7 v2FHIR
Primary modelEvent-driven messages such as ADT, ORU, ORM, and SIUResource-based data such as Patient, Observation, Encounter, and Condition
Common formatPipe-delimited text with segments and fieldsJSON or XML with named properties
TransportMLLP over TCP and interface enginesREST APIs, OAuth, SMART on FHIR, subscriptions
Commonly evaluatedInternal hospital interfaces and real-time operational feedsAPIs, apps, payer exchange, analytics, and modern data platforms
Implementation complexityFast but site-specific; custom Z-segments are commonMore standardized, but profiles and implementation guides still matter
Human readabilityLow without an HL7 parserHigh for JSON-literate developers

What is HL7 v2?

HL7 v2 is the dominant messaging standard for hospital operational interfaces. It uses event-driven messages such as ADT for patient movement, ORU for lab results, ORM for orders, SIU for scheduling, and DFT for financial transactions. Messages are compact and fast, but field meaning depends heavily on segment position, local interface guides, and sometimes site-specific Z-segments.

What is FHIR?

FHIR, or Fast Healthcare Interoperability Resources, models healthcare data as resources such as Patient, Encounter, Observation, DiagnosticReport, Condition, AllergyIntolerance, and MedicationRequest. FHIR is commonly exchanged through REST APIs using JSON, OAuth, and SMART on FHIR application patterns.

HL7 v2 Message Example

HL7 v2 messages are made of segments. Each segment contains fields separated by pipe characters. This compact format is efficient, but it is difficult to read without an HL7 parser.

MSH|^~\&|EHR|HOSPITAL|LAB|LABSYS|202606011030||ORU^R01|MSG123|P|2.5
PID|1||12345^^^MRN||DOE^JANE||19800101|F
OBR|1||ORDER123|718-7^Hemoglobin^LN
OBX|1|NM|718-7^Hemoglobin^LN||13.2|g/dL|12.0-16.0|||F

FHIR Resource Example

FHIR represents clinical data as named resources. The same lab result may become an Observation resource that can be validated with a FHIR validator.

{
  "resourceType": "Observation",
  "status": "final",
  "code": {
    "coding": [{ "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin" }]
  },
  "subject": { "reference": "Patient/12345" },
  "valueQuantity": { "value": 13.2, "unit": "g/dL" }
}

How Teams Use Both Standards

Most healthcare organizations do not choose only one standard. HL7 v2 remains common for ADT, lab, scheduling, orders, and billing-adjacent operational events. FHIR is often used for patient access APIs, partner integrations, analytics platforms, and canonical resource stores. Integration teams frequently parse HL7 v2, normalize key fields, and map selected data into FHIR resources for downstream systems.

HL7 v2 vs HL7 v3 vs FHIR

StandardModelCommon usePractical note
HL7 v2Pipe-delimited messagesHospital interfaces, ADT feeds, labs, orders, schedulingStill widely used for operational integration
HL7 v3XML/RIM-based modelSome legacy document and messaging ecosystemsLess common for new implementation work than v2 or FHIR
CDA / C-CDAXML clinical documentsClinical summaries, CCD, discharge summaries, referralsDocument exchange, often mapped into FHIR for APIs
FHIRResources and REST APIsPatient access, apps, payer exchange, analytics, modern platformsCommonly evaluated for resource-level APIs and app ecosystems

CDA / C-CDA vs HL7 vs FHIR

CDA and C-CDA are clinical document standards, not event-message standards. A C-CDA CCD or Discharge Summary can summarize a patient record across problems, medications, allergies, vitals, encounters, and results. HL7 v2 is better suited to transactional feeds, while FHIR is better suited to APIs and resource-level exchange. Use the CCDA viewer to inspect clinical documents and the HL7 parser to inspect interface messages.

HL7 v2 to FHIR mapping considerations

Mapping HL7 v2 to FHIR is not just a field-to-field conversion. Teams need to preserve message context, trigger event meaning, local code systems, patient identity rules, and encounter lifecycle. PID often maps to Patient, PV1 to Encounter, OBR and OBX to ServiceRequest, DiagnosticReport, or Observation, DG1 to Condition, and AL1 to AllergyIntolerance. Validate produced resources with the FHIR validator.

Practical migration approach for healthcare data teams

A practical migration keeps HL7 v2 feeds running while creating a canonical data layer. Parse messages, preserve source payloads for audit and replay, normalize key fields into staging tables, then publish selected normalized data as FHIR resources. This hybrid path supports existing hospital operations while enabling modern APIs and analytics. Review broader healthcare ETL architecture patterns before committing to a data-platform design.

Tools for working with HL7 and FHIR

Start with readable source inspection: use the HL7 parser to break messages into HL7 segments, use the FHIR validator to validate JSON resources, and use the CCDA viewer when the source is a clinical XML document.

Parse HL7 v2 Messages

Open the HL7 message parser

Validate FHIR Resources

Open FHIR Validator

Frequently Asked Questions

What is the main difference between HL7 v2 and FHIR?

HL7 v2 is a message standard built around events and pipe-delimited segments. FHIR is a resource and API standard built around discrete healthcare data resources commonly exchanged as JSON.

Is FHIR the same as HL7?

FHIR is part of the HL7 standards family, but it is not the same as HL7 v2. HL7 v2 is a pipe-delimited messaging standard, while FHIR is a resource and API standard.

Is FHIR replacing HL7 v2?

FHIR is expanding rapidly for APIs and cross-organization exchange, but HL7 v2 remains deeply embedded in hospital operations. Most organizations bridge both standards rather than replacing HL7 v2 overnight.

When should I use HL7 v2?

Use HL7 v2 for internal operational interfaces such as ADT feeds, lab results, scheduling, orders, and legacy EHR or LIS integrations.

When should I use FHIR?

Use FHIR for API access, patient-facing applications, payer-provider data exchange, resource-level analytics, and modern interoperability platforms.

How does HL7 v2 map to FHIR?

HL7 v2 fields are mapped into FHIR resources based on meaning and workflow context. PID fields often map to Patient, PV1 to Encounter, OBR and OBX to ServiceRequest or Observation, and DG1 to Condition.

Where does CDA or C-CDA fit?

CDA and C-CDA are XML clinical document standards. They are useful for summaries and transitions of care, while FHIR is often used to expose selected clinical data as discrete API resources.

Can HL7 and FHIR be used together?

Yes. Many healthcare data teams ingest HL7 v2 messages for operational events, preserve source messages for audit, and map selected fields into FHIR resources for APIs, apps, and analytics.