HL7 v2 vs FHIR: what is the difference?
Two standards from the same organisation for moving health data between systems: how each one works, where each one is used, and how the exam tells them apart.
What is HL7?
HL7 International (Health Level Seven) is a not-for-profit standards organisation founded in 1987. "Level Seven" refers to the seventh layer of the OSI network model, the application layer: HL7 standards define what the data means and how it is arranged, not the cables or the network that carry it. HL7 publishes several standards; the two the exam asks about most are version 2 and FHIR.
How does HL7 v2 work?
HL7 v2 is a standard for exchanging messages. When an event happens in one system (a trigger event), that system sends a message to the systems that need to know.
- The message type states its purpose: ADT (admission, discharge, transfer), ORM and OML (orders), ORU (results), SIU (scheduling), DFT (charges). An admission is the event
ADT^A01. - Segments are the lines of a message: MSH (the header: who sends, who receives, which event), PID (patient identification), PV1 (the visit), OBR (the order), OBX (one result).
- Fields are separated by the pipe character
|and their parts by^. A line looks likePID|1||123456^^^HOSP^MR||DOE^JANE. - The receiving system answers with an acknowledgement (ACK) that it got the message.
Messages usually travel through an interface engine, which receives each message, translates it for each receiving system and routes it. v2 has been used since the early 1990s and is still the most common way hospital systems talk to each other: registration feeds the lab, the lab sends results back to the EHR, the EHR sends charges to billing.
Its weakness is flexibility: many fields are optional and sites use them differently, so every v2 interface needs its own mapping and testing. Two hospitals that both "use HL7 v2" can rarely connect without that work.
How does FHIR work?
FHIR (Fast Healthcare Interoperability Resources, pronounced "fire") was first published by HL7 as a draft in 2014. Release 4, from 2019, was the first with parts marked normative (stable), and it is the version US rules require of certified systems (see the Cures Act below).
- Data is split into resources, small building blocks with a defined structure: Patient, Encounter, Observation, Condition, AllergyIntolerance, MedicationRequest: about 145 resources in all in R4.
- Each resource has its own web address and is read or written with the ordinary methods of the web (a RESTful API):
GET /Patient/123returns one patient,GET /Observation?patient=123&code=…returns that patient's results for one test. - The format is JSON or XML, over HTTPS: the same tools that build any web or mobile app can use it.
- Profiles and implementation guides narrow the base resources for one country or one use (US Core in the United States).
- SMART on FHIR adds permissions through OAuth 2.0 and sign-in through OpenID Connect, so an app can open inside the EHR or on a patient's phone and see only what it is allowed to.
In the United States, the rules under the 21st Century Cures Act require certified EHRs to offer a standard FHIR-based API, so that patients and other authorised parties can get the data "without special effort". That is a large part of why FHIR spread so fast.
FHIR is not only an API: the same resources can also be sent as messages or bundled into documents. But the API is what makes it different from v2.
HL7 v2 and FHIR side by side
| HL7 v2 | FHIR | |
|---|---|---|
| Basic idea | A message about an event | Resources reached through an API |
| Who starts the exchange | The sender sends when the event happens | Usually the app asks when it needs the data; subscriptions can also notify of updates |
| Format | Text separated by | and ^ | JSON or XML |
| Transport | Usually a direct connection through an interface engine | HTTPS, like any website |
| Size of each exchange | The whole message, with every segment for the event | Only the resources asked for |
| Typical use | Inside the hospital: registration, orders, results, charges | Patient apps, apps inside the EHR, sharing with other organisations, payers |
| Since | The early 1990s | 2014 (Release 4 in 2019) |
FHIR does not replace v2 overnight. Interfaces that work well are rarely rewritten; new needs, above all anything a patient or an outside app touches, are built on FHIR.
Where does CDA fit?
Between the two sits HL7's Clinical Document Architecture (CDA): a whole clinical document in XML, such as a discharge summary, readable by people and by machines. Its US form, C-CDA, is what systems exchange at a transition of care. Think of it this way: v2 tells another system that something happened, CDA hands over a signed document, FHIR answers a precise question.
If HL7 gives the structure, what gives the meaning?
HL7 standards say where each piece of data goes. They do not decide which code to use for a diagnosis or a test: that is the job of the code sets (terminologies), which both v2 and FHIR carry inside their fields.
- LOINC: laboratory tests and clinical observations.
- SNOMED CT: clinical terms such as findings, problems and procedures.
- RxNorm: medications (in the United States).
- ICD-10 (ICD-10-CM in the United States): diagnoses, for statistics and billing.
- CPT: procedures, for billing in the United States.
This is the difference HIMSS draws between levels of interoperability: structural (the format, which HL7 provides) and semantic (the shared meaning, which the code sets provide). Two systems can exchange perfectly formed FHIR resources and still misunderstand each other if one writes "Hb" in free text and the other expects a LOINC code. The other two levels in the HIMSS definition are foundational (one system can send data to another at all) and organisational (the policies, agreements and trust that let organisations share).
Other standards appear in the same questions: DICOM for medical images, NCPDP SCRIPT for electronic prescriptions to pharmacies, and X12 for claims and eligibility checks with payers in the United States.
What do candidates get wrong?
- "HL7 is a code set." No: HL7 defines structure. The codes inside come from LOINC, SNOMED CT and the others.
- "FHIR is the new version of HL7 v2, so v2 is gone." FHIR is a separate standard, and HL7 v2 is still widely used to integrate systems inside hospitals.
- "Using the same standard means the systems understand each other." That is structural interoperability only; without the same codes there is no semantic interoperability.
- Picking v2 for a patient's mobile app. An app that reads a patient's record calls for a FHIR API with SMART on FHIR permissions, not a v2 feed.
- Picking FHIR to send images. The images themselves travel by DICOM; FHIR can point to them.
Summary for revision
- HL7 v2: event messages (ADT, ORU and the others), text separated by
|, through an interface engine, mostly inside the hospital. - FHIR: resources through a RESTful API, JSON or XML over HTTPS, for apps and outside sharing, with SMART on FHIR for permissions.
- CDA: a whole clinical document in XML, such as a discharge summary.
- HL7 gives the structure (structural); code sets such as LOINC and SNOMED CT give the meaning (semantic).
- Images travel by DICOM, prescriptions to pharmacies by NCPDP SCRIPT, claims by X12.
Sources
- HL7 International (hl7.org): the HL7 version 2 and FHIR specifications, and the SMART App Launch guide.
- HIMSS: the definition of interoperability and its four levels.
- Office of the National Coordinator for Health IT (ONC, now ASTP/ONC): the 21st Century Cures Act Final Rule (2020), standardized API for certified health IT.
Related free practice questions
The site files this concept under the domain Healthcare and Technology Environments.
Try exam-style questions
A 20-question trial exam with an explanation for every option and a score per domain, drawn from 40 free questions. No payment method needed.
Start the trial examQuestions about the exam: CPHIMS guide · What is CPHIMS? · Exam cost · Eligibility · Passing score · Renewal · Exam day · How long to study · Is it worth it? · What is CAHIMS?
Concepts explained: Capitation vs fee-for-service · Safe Harbor vs Expert Determination · Incident vs problem vs change · Backup types, RTO and RPO · Privacy Rule vs Security Rule · CDS five rights · Lewin vs Kotter · SDLC and go-live strategies · Testing types · Earned value (SPI, CPI) · Structure, process, outcome · HIE models · Six Sigma vs Lean · Levels of interoperability · Bandwidth vs latency · EMTALA · Risk responses · RACI matrix · Build vs buy · Sunk vs opportunity cost · Data governance
The four domains: Healthcare and Technology Environments · Clinical Informatics · Healthcare Information and Systems Management · Management and Leadership
Written by Adel Moustafa, About us
Written and checked against the sources above on 22 October 2026. An independent site, not affiliated with or endorsed by HIMSS. CPHIMS® is a registered trademark of HIMSS.