HL7 vs FHIR compares an organization with one of its standards: HL7 International publishes both. HL7 v2 is a pipe-delimited messaging standard, most often pushed over TCP feeds between hospital and lab systems. FHIR is an API standard built from resources, usually exchanged as JSON over REST, and US certification and payer rules now require it.
A typical health software company ends up touching both, plus C-CDA documents for referrals. Which one a given interface uses depends on who sits on the other end and which rule, if any, names a standard for it.
Is HL7 the same thing as FHIR?
No. HL7 International publishes several standard families, and FHIR is the newest of them. When people say "HL7" in an integration conversation, they almost always mean HL7 Version 2 messages.
US health IT runs mainly on three of those families:
- HL7 Version 2, first released in October 1987. HL7 calls it "the workhorse of electronic data exchange in the clinical domain" and reports that 95% of US healthcare organizations use it. The latest version, v2.9.1, was published in 2024. Interfaces in the field often run much older versions, so check MSH-12 on a real message before you assume anything.
- CDA Release 2, an XML document standard, and its US implementation guide C-CDA (Consolidated CDA). C-CDA is how a continuity of care document or referral note moves between organizations.
- FHIR (Fast Healthcare Interoperability Resources), built from modular "resources" and designed around web standards: HTTP, JSON, XML, and OAuth.
HL7 v2 vs FHIR vs C-CDA side by side
v2 is event messaging between systems that already know each other. C-CDA moves finished documents between organizations, and FHIR is an API that apps and other systems query. The rows below are the differences that usually decide an interface design.
| Dimension | HL7 v2 | C-CDA (CDA R2) | FHIR R4 |
|---|---|---|---|
| Unit of exchange | Message triggered by an event (ADT^A01, ORM^O01, ORU^R01) | Complete clinical document | Resource (Patient, Observation) or Bundle |
| Format | Delimited text: segments, fields, components | XML with templated sections | JSON or XML; RDF also defined |
| Typical transport | MLLP over TCP, often inside a VPN | Direct secure messaging, HIE query, file | HTTPS REST with OAuth 2.0 (SMART) |
| Interaction style | Push, sender decides when | Push or query for a document | Pull by query; push with Subscriptions |
| Self-describing | No; meaning comes from field position | Partly; templates and coded entries | Yes; named elements and profiles |
| Variation between sites | High unless partners agree on a message profile; Z-segments are common | Moderate; template conformance is testable | Lower when a profile like US Core is enforced, but server capabilities still differ |
| Where it dominates | Inside hospitals and labs: ADT, orders, results, charges | Transitions of care, referrals, HIE | Patient apps, payer APIs, population export, new integrations |
| US regulatory anchor | Immunization and lab reporting to public health (§170.315(f)) | Transitions of care (§170.315(b)(1)) | Standardized API (§170.315(g)(10)), CMS-0057-F payer APIs |
How HL7 v2 works: segments, pipes, and MLLP
An HL7 v2 message is a block of text made of segments, each split into fields by the pipe character and ended by a carriage return. A system sends it when something happens (a patient is admitted, an order is placed, a result is final) and the receiver replies with an acknowledgment.
MSH declares the delimiters, the sending and receiving applications, the message type, and the version. Then come PID for the patient, PV1 for the visit, ORC and OBR for orders, and OBX for each result value. Fields split into components with ^ and repetitions with ~.
Here is an illustrative ADT^A01 (admit) message with fake data. Each segment is shown on its own line for reading; on the wire the terminator is a carriage return (0x0D), not a line feed.
MSH|^~\&|SENDAPP|SENDFAC|RECVAPP|RECVFAC|20261031083000||ADT^A01^ADT_A01|MSG00001|P|2.5.1
EVN|A01|20261031083000
PID|1||123456^^^HOSP^MR||TEST^PATIENT^A||19800101|F|||123 MAIN ST^^SPRINGFIELD^IL^62701||^PRN^PH^^^217^5550100
PV1|1|I|4W^401^A^HOSP||||1234^DOCTOR^TEST|||MED|||||||||V0001^^^HOSP^VN
Field positions carry the meaning. PID-3 is the identifier list, PID-5 the name, PID-7 the birth date, PID-8 administrative sex. Nothing in the message labels them, so both sides need the same interface agreement to read it correctly.
On the wire, v2 usually travels over a persistent TCP connection using the Minimal Lower Layer Protocol. MLLP wraps each message in a start block byte (0x0B), an end block byte (0x1C), and a carriage return (0x0D). In original acknowledgment mode, the receiver returns an ACK whose MSA segment echoes the control ID (here MSG00001) with AA, AE, or AR for accept, error, or reject; enhanced mode adds commit acknowledgments (CA, CE, CR). If an ACK times out, most senders resend, so the receiver should treat the control ID as a duplicate check. MLLP is framing only, with no encryption or authentication, so production feeds run over a VPN or a TLS tunnel.
v2 messages are small and quick to parse, and most hospital and lab systems can send and receive them. The weak point is optionality. Many fields are optional, sites add local Z-segments, and two vendors' ADT feeds often differ unless the partners agree on a conformance profile up front. We go deeper on lab orders and results in our guide to HL7 lab interfaces.
How FHIR works: resources over a REST API
FHIR models healthcare data as typed resources (Patient, Encounter, Observation, MedicationRequest, and many others) at predictable URLs. A client reads, searches, creates, and updates them with ordinary HTTP calls.
The FHIR RESTful API defines a read as GET [base]/[type]/[id] and a search as GET [base]/[type]?parameters, with the content types application/fhir+json and application/fhir+xml. Searching for the patient above by medical record number looks like this (illustrative):
GET https://fhir.example.org/r4/Patient?identifier=https://hospital.example.org/mrn%7C123456
Accept: application/fhir+json
Authorization: Bearer eyJ...
The server answers a search with a Bundle of type searchset. The Patient resource inside that Bundle's entry carries the same data as the PID segment:
{
"resourceType": "Patient",
"id": "example-123456",
"identifier": [{
"type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "MR" }] },
"system": "https://hospital.example.org/mrn",
"value": "123456"
}],
"name": [{ "family": "TEST", "given": ["PATIENT", "A"] }],
"gender": "female",
"birthDate": "1980-01-01",
"address": [{ "line": ["123 MAIN ST"], "city": "SPRINGFIELD", "state": "IL", "postalCode": "62701" }],
"telecom": [{ "system": "phone", "value": "(217) 555-0100", "use": "home" }]
}
Every element is named, the date is ISO 8601, and the v2 sex code F has become the FHIR code female. A developer can read this without the spec open, and a FHIR validator can check it against a profile. Every server must also answer GET [base]/metadata with a CapabilityStatement, which tells you which resources, searches, and writes that particular server supports. Check it before you design against a partner's API, because FHIR does not require a server to implement everything.
Several specifications sit on top of the base standard. SMART App Launch uses OAuth 2.0 scopes: patient/ scopes cover one patient's data, user/ scopes cover what the signed-in user can access, and system/ scopes cover backend services with no user present. Bulk Data Access adds Patient/$export and Group/[id]/$export; the client sends Prefer: respond-async, polls the status URL returned in Content-Location, and downloads newline-delimited JSON files when the job is done. US Core constrains the base resources for US use, with required profiles, terminology bindings, and search parameters.
FHIR also supports messaging and documents as Bundles, but the REST API is what nearly everyone means by "FHIR API." Neither FHIR nor v2 makes an interface secure or HIPAA compliant on its own; the FHIR security guidance leaves transport security, authentication, and audit to the implementer.
On versions, the R4 version history lists R4 (4.0.0) on December 27, 2018 as the first release with normative content, and 4.0.1, a technical correction, on October 30, 2019. US regulation pins 4.0.1. The FHIR version directory lists R4B (4.3.0) on May 28, 2022 and R5 (5.0.0) on March 26, 2023, both trial use, and shows R6 still in draft, with its second full ballot posted July 17, 2026. Build on R4 unless a partner tells you otherwise; R4B and R5 are not what ONC certification tests.
How does C-CDA compare with FHIR?
C-CDA is for whole clinical documents: a continuity of care document, a referral note, a discharge summary. FHIR's REST API is for discrete data that an application queries on demand.
A C-CDA document is a signed-off XML snapshot with a header and coded sections (problems, medications, allergies, results). It usually moves by Direct secure messaging or a health information exchange query, and the receiver parses and reconciles it. HL7's CDA R2 product page says Sequoia and eHealth Exchange "support exchange of billions of CDA documents annually."
HL7 lists C-CDA 5.0.0, from June 2026, as the current published version. ONC certification still references C-CDA R2.1 in 45 CFR 170.205(a)(4) and the C-CDA Companion Guide Release 4.1 in §170.205(a)(6).
ONC wants to move document exchange to FHIR, but on a long timeline. In the HTI-5 final rule (published October 28, 2026, effective December 28, 2026), ONC had proposed narrowing the transitions of care criterion to C-CDA receipt and validation. Commenters said no mature FHIR replacement exists yet, so ONC set January 1, 2030 for removing the Direct "send and receive," C-CDA "create," "display," and "display section views" requirements in §170.315(b)(1). The requirement to validate received C-CDA documents stays. ONC also wrote that the removal "does not prevent the use of C-CDA-based exchange standards."
What US regulation requires as of October 2026
For health IT certified to the relevant criteria, FHIR R4 is required for the patient and population API, C-CDA for transitions of care, and HL7 v2.5.1 for several public health feeds. For impacted payers, CMS-0057-F requires FHIR APIs, generally from January 1, 2027.
The certification side comes from the current text of 45 CFR 170.215 and §170.315. A requirement applies only to a product certified to that criterion.
| Requirement | Standard it names | Status as of October 31, 2026 |
|---|---|---|
| §170.315(g)(10) standardized API for patient and population services | FHIR R4.0.1 (§170.215(a)(1)), US Core 6.1.0 (§170.215(b)(1)(ii)), SMART App Launch 2.0.0 (§170.215(c)(2)), Bulk Data Access v1.0.0 with group export (§170.215(d)(1)), OpenID Connect Core 1.0 (§170.215(e)(1)) | In force. US Core 3.1.1 and SMART 1.0.0 expired January 1, 2026; HTI-5 removes those paragraphs effective December 28, 2026 |
| §170.315(b)(1) transitions of care | C-CDA R2.1 and Companion Guide R4.1 (§170.205(a)(4), (a)(6)) | In force; create, send and receive, and display requirements end January 1, 2030 |
| §170.315(f)(1) immunization registries | HL7 2.5.1 with the Immunization Messaging IG R1.5 (§170.205(e)(4)) | In force |
| §170.315(f)(3) reportable lab results | HL7 2.5.1 with the ELR IG (§170.205(g)) | In force |
| Event notifications and prior authorization standards | FHIR Subscriptions R5 Backport (§170.215(h)); Da Vinci CRD, DTR, PAS (§170.215(j)) | Adopted by ONC |
| CMS-0057-F payer APIs | FHIR; CMS recommends, but does not require, specific Da Vinci and CARIN IGs | API requirements generally from January 1, 2027 |
ONC's Standards Version Advancement Process lets developers voluntarily certify to newer approved versions, such as US Core 8.0.0 for (g)(10), so the versions above are the floor. If you are certifying, the (g)(10) test is where most FHIR work goes; our post on passing (g)(10) with the Inferno test kit walks through it.
On the payer side, the CMS Interoperability and Prior Authorization final rule (CMS-0057-F), published February 8, 2024, applies to Medicare Advantage organizations, state Medicaid and CHIP programs and their managed care plans, and QHP issuers on the federally facilitated exchanges. Per the CMS fact sheet, it adds prior authorization data to the Patient Access API that payers already had to run under the 2020 rule, and it requires new Provider Access, Payer-to-Payer, and Prior Authorization APIs. The prior authorization provisions exclude drugs. Decision timeframes of 72 hours for expedited requests and seven calendar days for standard ones began January 1, 2026 for impacted payers other than QHP issuers on the exchanges.
FHIR does not replace X12 everywhere. Under an HHS enforcement discretion statement, covered entities that use a FHIR Prior Authorization API as described in CMS-0057-F will not face HIPAA enforcement for skipping the X12 278. It applies to no other X12 278 situation, and a health plan cannot force a provider to use the FHIR alternative. Claims and remittance still run on the HIPAA X12 transactions covered in our guide to 837 and 835 EDI.
None of these rules tells you to retire a working v2 interface. Hospital ADT and lab feeds are likely to stay on v2 for years, which is why most integration work ends up bridging the two.
Which should you use? A decision table by use case
Use the standard your counterparty and your regulator already expect. For a feed inside a hospital or to a lab, that is usually v2. For a patient app, a certification test, or a CMS-0057-F payer API, it is FHIR. For a referral or care summary between organizations, it is still C-CDA, and payer claims stay on X12.
| Use case | Default choice | Why | Watch for |
|---|---|---|---|
| Lab orders and results between an EHR and a lab system | HL7 v2 (ORM or OML out, ORU^R01 back) | Lab systems widely support it; result volume suits a push feed | Lab-specific OBX codes, LOINC mapping, result corrections |
| Admissions, discharges, transfers (ADT) to downstream systems | HL7 v2 ADT | Event push from the registration system; near real time | A08 update storms, merge (A40) handling, Z-segments |
| Patient-facing app access to records | FHIR R4 with SMART App Launch and US Core | Required by §170.315(g)(10) for certified EHRs | Scopes, refresh token rules, US Core must-support elements |
| Population export for analytics or a value-based contract | FHIR Bulk Data ($export) | Asynchronous ndjson files built for whole groups | Export times on large groups, _since for incremental pulls |
| Payer clinical data exchange and prior authorization | FHIR APIs under CMS-0057-F | Required for impacted payers, generally from January 2027 | Which IG version each payer implements; drug prior auth is out of scope; X12 278 coexistence |
| Claims, eligibility, and remittance | HIPAA X12 (837, 270/271, 835) | Adopted HIPAA transaction standards (X12 5010) | Payer companion guides |
| Referrals and transitions of care between organizations | C-CDA over Direct or HIE | What receiving EHRs and §170.315(b)(1) expect today | Template validation errors, duplicate reconciliation |
| New point-to-point integration with a modern SaaS EHR | The EHR's FHIR or REST API | Query on demand without standing up MLLP infrastructure | Check the CapabilityStatement; write support is often narrower than read |
| Immunization or reportable lab feeds to public health | HL7 v2, per the state's own guide | ONC names HL7 2.5.1 in §170.205(e)(4) and (g) | State-specific onboarding and validation rules |
Ambulatory practice management systems are a common exception to the FHIR-first row. Their FHIR tiers are mostly read-only, so scheduling and billing writes go through each vendor's proprietary API, as our athenahealth, AdvancedMD, and Tebra API guide explains. Orisan Connect's practice management sync takes that route for those three systems.
How v2 and FHIR work together in one architecture
The usual pattern is translation. An interface engine or integration service receives v2 messages from the hospital side, maps them to FHIR resources, and serves or forwards those resources to apps and APIs. The reverse path turns a FHIR write into an outbound v2 order or update.
HL7 now publishes the mapping rules. The HL7 Version 2 to FHIR implementation guide is at v1.0.0 (STU 1, maturity level 1), based on FHIR R4, and contains message, segment, data type, and coding system maps published as ConceptMap resources. It describes itself as "a cumulative mapping of the standard, not any HL7 v2 based implementation guide," so you still have to account for each partner's local variations, and it does not promise a lossless round trip. Some of its segment maps, from the segment map index:
| v2 segment or field | FHIR target |
|---|---|
| MSH | MessageHeader, Provenance, Bundle |
| PID-3 patient identifier list | Patient.identifier |
| PID-5 patient name | Patient.name (HumanName) |
| PID-7 date of birth | Patient.birthDate |
| PID-8 administrative sex | Patient.gender, through the AdministrativeSex vocabulary map |
| PV1 | Encounter (also Coverage and Patient elements) |
| OBR | DiagnosticReport, ServiceRequest, Specimen |
| OBX | Observation (or DocumentReference for embedded documents) |
The field-level PID mappings come from the PID to Patient concept map.
Identity tends to cause the most trouble. A v2 feed sends an MRN scoped to one facility, while the FHIR side needs a stable logical ID and an identifier system, so you need a rule for merges and for patients seen at more than one facility. State is next. v2 sends events, so an A08 that follows an A01 may carry only part of the record, and v2.5.1 chapter 2 says an omitted field leaves the old value unchanged while "" clears it. Senders do not always follow that rule. The bridge has to decide whether to replace or patch the FHIR resource, and it has to drop resent duplicates. Codes show up on most lab feeds: local test codes in OBX-3 often arrive without LOINC, and US Core uses an extensible binding that requires a LOINC code when one exists for the test. Our HL7 interface audit checklist covers how to test for each of these before go-live.
What to inventory before you choose
List every interface you run or plan to run, one row each: counterparty, direction, standard and version, message types or resources, transport, volume, and whether a regulation names the standard. Mark which rows carry a certification or CMS-0057-F obligation and its date. The rows with no obligation and a working v2 feed are usually the ones to leave alone.
Then pull a week of real traffic from each v2 feed and compare it with the spec your partner says it sends: MSH-12 version, Z-segments, empty required fields, local codes in OBX-3. For FHIR partners, fetch the CapabilityStatement and compare it with the searches you plan to run. Those differences are what a mapping has to absorb. If you want a second set of eyes on the inventory or the mapping, that is the work our HL7, FHIR, and EDI integration team does.