Skip to main content

HL7 v2 vs FHIR R4 for laboratory integration in 2026

· 13 min read
Ahsan Mahmood
Engineer and author of LabFlow

Most lab-to-EMR integrations in 2026 still use HL7 v2. That sentence is mildly controversial — every industry conference, every vendor demo, every standards-body roadmap names FHIR R4 as "the modern standard". The roadmap is real; the production reality is that the majority of clinical-lab traffic still moves over HL7 v2 messages because Epic, Cerner, Meditech, Allscripts, athenahealth, and eClinicalWorks all support v2 as their primary integration mode, and the lab on the other end already speaks v2. FHIR R4 adoption is climbing meaningfully — most major EMRs now expose FHIR endpoints — but the bulk of orders and results still cross the wire as ORM^O01 and ORU^R01 messages. This post is the side-by-side comparison: wire format, message types, transport, tooling, real-world coverage, and the migration trade-offs every lab eventually faces.


TL;DR

DimensionHL7 v2FHIR R4
First published1989 (v2.1); 2.5.1 is the most-deployed dialect2019 (R4)
Wire formatPipe-delimited segmentsJSON or XML
TransportMLLP (TCP), file drop, or HTTPS webhookREST over HTTPS
SchemaLoosely typed; vendor extensions everywhereStrictly typed via FHIR resources + StructureDefinitions
Versioningv2.x; minor versions break compatibility in practiceR4 is the stable LTS; R5 emerging
Real-world EMR coverage (2026)Universal — every clinical EMR supports v2Climbing — most major EMRs expose FHIR but coverage varies
Lab message typesORM^O01 (order), ORU^R01 (result), ADT^A08 (patient update)ServiceRequest (order), Observation + DiagnosticReport (result), Patient, Specimen
Learning curvePainful — non-self-documenting, requires the spec on screenMild — self-documenting, JSON Schema-friendly
Vendor toolingMature (Mirth Connect, Rhapsody, Iguana, Cloverleaf)Growing (FHIR servers like HAPI, Aidbox, Medplum)
Use it forProduction todayProduction tomorrow + value-based-care + patient apps

The pragmatic 2026 stance: support both in the LIMS, prefer v2 when the partner offers both, plan a multi-year migration to FHIR for new integrations. This post explains why.

:::note LabFlow has no integration module today This is a domain primer, not a product page. LabFlow implements neither HL7 v2 nor FHIR. Interoperability is planned work — see the roadmap. :::


What HL7 v2 looks like on the wire

An ORM^O01 order message:

MSH|^~\&|EMR_SYS|MERCY_HOSPITAL|LAB_SYS|MERCY_LAB|20260511093045||ORM^O01|MSG00123|P|2.5.1
PID|1||MRN12345^^^MERCY^MR||GARCIA^MARIA^^^||19850712|F|||123 MAIN ST^^BOSTON^MA^02101||(617)555-1234
PV1|1|O|ER^01^A|||||||||||||||V00078
ORC|NW|ORD789012||GRP456||||||||||DOE^JOHN^^^MD
OBR|1|ORD789012|||GLUCOSE^GLUCOSE TOLERANCE^L|||20260511090000|||||||||DOE^JOHN^^^MD
NTE|1||Patient fasted for 12h.

The structure is segment-line / field-pipe / component-caret / subcomponent-ampersand. The MSH (Message Header) declares the message type (ORM^O01), version (2.5.1), and routing. PID carries patient identification. PV1 carries the patient visit (encounter). ORC is the common order. OBR is the test request. NTE is a note.

The same message in FHIR R4 (as a ServiceRequest bundle):

{
"resourceType": "Bundle",
"type": "message",
"entry": [
{
"resource": {
"resourceType": "ServiceRequest",
"status": "active",
"intent": "order",
"code": {
"coding": [{"system": "http://loinc.org", "code": "2345-7", "display": "Glucose [Mass/volume] in Serum or Plasma"}]
},
"subject": {"reference": "Patient/pat_001"},
"requester": {"reference": "Practitioner/prov_123"},
"encounter": {"reference": "Encounter/enc_456"},
"note": [{"text": "Patient fasted for 12h."}]
}
},
{
"resource": {
"resourceType": "Patient",
"id": "pat_001",
"identifier": [{"system": "urn:mercy:mrn", "value": "MRN12345"}],
"name": [{"family": "Garcia", "given": ["Maria"]}],
"birthDate": "1985-07-12",
"gender": "female"
}
}
]
}

The same information, twice the verbosity. FHIR's resource-and-bundle model is self-documenting (every field has a published StructureDefinition) at the cost of a bigger wire footprint. The trade-off is intentional — FHIR was designed to be human-readable and to be parsed by generic JSON tooling without needing the HL7 spec on screen.


Why HL7 v2 still dominates clinical traffic

Three reasons, in order of impact.

The first is inertia. Every clinical EMR has an HL7 v2 integration team that's been running for 20+ years. The order-to-result loop with the local lab is wired through v2; switching to FHIR means re-engineering an integration that already works. The cost is high; the immediate benefit is unclear.

The second is completeness. The HL7 v2 spec covers every clinical-message scenario through 30+ years of accumulated revisions — patient registration (ADT), orders (ORM), results (ORU), scheduling (SIU), pharmacy (RDS), billing (DFT). FHIR R4 covers the equivalent but the equivalents are newer; some edge cases (specific instrument-result patterns, specific reimbursement workflows) still have richer v2 coverage than FHIR coverage.

The third is fall-back tooling. The ecosystem of HL7 v2 integration engines (Mirth Connect, Rhapsody, Iguana, Cloverleaf, NextGen Connect) is mature, well-staffed, and operationally stable. A lab that runs into a v2 integration issue at 2am has documented paths to fix it. The FHIR equivalent (HAPI FHIR Server, Aidbox, Medplum, Microsoft FHIR Server) is competitive on technical merits but the operational depth — the runbook for 2am — is shallower.

The net is that clinical-lab integrations in 2026 are predominantly v2 in production, with FHIR endpoints sitting alongside as a secondary surface. The roadmap is FHIR-everywhere; the production reality is v2-with-FHIR-alongside.


Where FHIR R4 has won

The FHIR R4 wins are concentrated in three areas.

Patient-facing apps and APIs. The 21st Century Cures Act in the United States (2020) mandated that EMRs expose FHIR-based patient APIs. Every certified EMR now does. Patient-facing apps (the patient portal, third-party health apps) connect via FHIR, not v2. A LIMS that wants to be readable by a patient app via the EMR's FHIR endpoint must speak FHIR.

Value-based-care reporting. CMS quality-measure submissions and HL7's eCQI reporting use FHIR. A laboratory whose data feeds value-based-care metrics must export FHIR-shaped data.

New integrations. A greenfield integration in 2026 — a new lab onboarding to a new EMR, a research collaboration, a public-health surveillance feed — is usually written in FHIR rather than v2. The new code defaults to FHIR; the old code stays on v2.

This is why a modern LIMS supports both surfaces — production traffic on v2, patient-app and reporting traffic on FHIR. Neither protocol is going away; the boundary between them is workflow-dependent.


Message-type mapping

The canonical mapping between v2 messages and FHIR resources for laboratory workflows:

v2 MessageFHIR Resource(s)Direction (typical)
ORM^O01 (new order)ServiceRequestEMR → Lab
ORU^R01 (result-ready)Observation + DiagnosticReportLab → EMR
ADT^A04 / A08 (patient registration / update)PatientEMR → Lab
ADT^A03 (discharge)Encounter.status = finishedEMR → Lab
SIU^S12 (appointment schedule)AppointmentEither direction
DFT^P03 (billing event)ChargeItem + InvoiceLab → EMR billing
ACK (acknowledgement)HTTP status code or OperationOutcomeEither direction
(no direct equivalent)Subscription (push notification)Lab → EMR

The mapping isn't always one-to-one. An ORU^R01 with multiple OBX segments (one per analyte) maps to one DiagnosticReport with many Observation resources. An OBR carries a test panel; the FHIR equivalent is the ServiceRequest.code with a panel LOINC and the constituent ServiceRequest.replaces references.

A lab that supports both protocols typically maintains a per-connection mapping table that translates partner test codes to LOINC and vice-versa.


Transport differences

HL7 v2 typically transports over MLLP (Minimal Lower Layer Protocol) — a raw TCP connection with start-of-block and end-of-block markers around each message. Sometimes v2 is also delivered via SFTP file drops, or via HTTPS as a webhook payload. The transport is a separate decision from the message format.

FHIR R4 is almost always REST over HTTPSPOST /ServiceRequest to create an order, GET /Observation?subject=Patient/123 to query results. Authentication is OAuth 2.0 (typically with SMART on FHIR profile) or mTLS. The transport is part of the spec.

The transport difference matters operationally. MLLP needs network-level access (often a VPN or a dedicated leased line); it doesn't traverse corporate proxies cleanly; it requires firewall rules per partner. FHIR's HTTPS transport rides existing internet infrastructure — much simpler to set up, easier to monitor, more amenable to mutual TLS or OAuth.


Tooling comparison

ConcernHL7 v2 mature toolsFHIR R4 mature tools
Integration engineMirth Connect (NextGen Connect), Rhapsody, Iguana, CloverleafNone equivalent yet — typically rolled by hand
Server(Not a thing — v2 doesn't have a server)HAPI FHIR Server, Aidbox, Medplum, Microsoft FHIR Server
Parser libraryhl7apy (Python), hapi-hl7v2 (Java), nhapi (.NET)fhir.js, hapi-fhir, fhir-py, firely-net-sdk
ValidatorSeveral commercial + the HL7 v2 validator from each EMR's docs teamThe official FHIR validator from HL7 + the Inferno test suite
Test data generatorSynthea-HL7v2 (limited)Synthea (mature, public)
Schema introspectionPainful — segment-position-numbered fields with no inline docsSelf-documenting via FHIR's published JSON Schema and StructureDefinitions
Learning curveSteep — non-self-documenting; relies on the v2 referenceMild — JSON-native, browseable on the FHIR website

The tooling gap explains a real part of why labs prefer to do new work in FHIR — the tools are nicer to use, the validator is published by the standards body itself, and the data shape is documented inline rather than requiring a separate reference.


Migration strategy — the canonical pattern

A lab that wants to migrate from v2-dominant to FHIR-dominant typically goes through five phases over 2-5 years.

Phase 1 — accept FHIR inbound. Start by accepting FHIR ServiceRequest for new orders alongside v2 ORM^O01. Both produce the same canonical order in the LIMS. The EMR partners that already speak FHIR can switch; the v2-only partners are unaffected.

Phase 2 — emit FHIR outbound for new partners. Any partner onboarded after a certain date defaults to FHIR Observation + DiagnosticReport outbound. Existing partners continue receiving v2 ORU^R01.

Phase 3 — dual-emit for transitional partners. Existing v2 partners get FHIR emission added in parallel; both wires carry the same data. The partner's clinical team validates the FHIR side against the v2 side over several months. Once validated, the v2 side is retired for that partner.

Phase 4 — patient-facing FHIR. The patient portal (and any third-party patient apps) connect via FHIR. By this phase, FHIR coverage is broad enough that the patient app is the primary use case for FHIR-emit on the lab side.

Phase 5 — v2 maintenance mode. v2 is still supported for the long-tail partners that haven't migrated, but new development stops on v2. The integration engine continues to run; engineering attention shifts to FHIR.

Most large labs in 2026 are between Phase 2 and Phase 4. Phase 5 is rare; even labs that consider themselves "FHIR-first" still emit v2 for legacy partners.


The honest framing — neither is going away

A common mistake when reading about HL7 v2 and FHIR R4 is to assume one will replace the other. The realistic 2026 view:

  • HL7 v2 is not going away soon. The installed base is too large; the migration cost per partner is too high; the immediate benefit per partner is too small. v2 will continue to carry the majority of clinical-lab production traffic through 2030 at least.
  • FHIR R4 is not optional. Every modern EMR exposes FHIR; every patient-facing app connects via FHIR; every value-based-care reporting flow uses FHIR. A LIMS without FHIR support is unbookable for new integrations and unable to serve patient apps.
  • The two coexist. A modern LIMS speaks both, maps between them at the canonical-data-model layer, and routes inbound and outbound traffic per-partner. The boundary is workflow-dependent, not technology-dependent.

A system that takes this stance explicitly treats both protocols as first-class: a per-connection field-mapping dictionary handles the translation, and one canonical order produces v2 or FHIR output according to the partner's connection record.


Frequently asked questions

Is HL7 v2 deprecated by the HL7 standards body?

No. HL7 v2 is still actively maintained by HL7 International. The current version is v2.9 (released 2019); v2.10 is in development. The standards body recognises that v2 is in production everywhere and continues to evolve it alongside FHIR.

Can I run an EMR integration over FHIR alone, with no HL7 v2 at all?

For greenfield deployments with a new EMR partner that supports FHIR-write fully, yes. For most production scenarios — where the partner's clinical workflow already runs on v2 — practical answer is no, you'll still need v2 for the existing path. The pragmatic stance is "FHIR-where-possible, v2-where-required".

What about HL7 v3 and CDA documents?

HL7 v3 (the predecessor to FHIR) is rarely seen in lab integrations today; it was complex enough that most vendors skipped it and went straight to v2-or-FHIR. CDA (Clinical Document Architecture) is a separate concern — it's used for clinical document exchange (discharge summaries, care plans) rather than for the order-result lab loop. A lab integration almost never touches v3 or CDA directly; if a partner only speaks them, a transformation layer (Mirth Connect with a custom transformer) typically sits between.

Does FHIR R4 cover every clinical use case v2 covers?

For the lab-EMR loop, yes — orders, results, patient updates, scheduling, billing all have FHIR resources. For some specific edge cases (instrument-specific result formats, certain pharmacy workflows), v2 still has richer real-world coverage because the v2 specs accumulated 30+ years of vendor extensions. For new integrations, FHIR is sufficient; for migrating an existing integration with vendor extensions, the gap analysis is per-partner.

How does SMART on FHIR fit in?

SMART on FHIR is a security profile for FHIR — it specifies how an OAuth 2.0 flow works between an EMR (acting as authorization server) and a third-party app (the FHIR client). The 21st Century Cures Act in the US mandates SMART on FHIR for patient-facing apps. From the LIMS perspective, SMART on FHIR governs how patient-facing surfaces (the patient portal, mobile apps) authenticate to the EMR's FHIR endpoint; the LIMS-to-EMR backend integration usually uses a separate machine-to-machine auth (typically OAuth client credentials or mTLS).

What about cost — is FHIR cheaper to integrate than v2?

The unit economics tilt toward FHIR for greenfield: less specialist talent needed, no MLLP infrastructure, simpler validation. For migrating an existing v2 integration, FHIR is more expensive in the short term (re-engineering cost) and cheaper in the long term (lower ongoing maintenance). The break-even is usually 12-24 months, but varies wildly by integration complexity.

Should I learn HL7 v2 if I'm starting in lab informatics in 2026?

Yes, despite the steep learning curve. v2 is what's running in production today; if your work touches lab integrations at all, you'll see v2. Learning FHIR first is easier (it's self-documenting); learning v2 second extends the skill set. The combination is durable — both protocols will be relevant through the 2020s and beyond.

Does LabFlow support either?

No — neither, today. LabFlow implements no HL7 v2 messaging and no FHIR resources, and it exposes no public API of any kind. Interoperability is planned and unbuilt; the sequence is on the roadmap. What LabFlow does have today is the coded catalogue any future mapping would need — see the test catalogue.


Where to read more


About the author: Ahsan Mahmood is the engineer behind LabFlow. Contact at aoneahsan@gmail.com or via aoneahsan.com.