"HL7 vs FHIR" is a slightly wrong question, and the answer is still useful. HL7 is an organisation, Health Level Seven International, and the family of standards it publishes. FHIR is the newest member of that family. The real comparison is between the three HL7 standards you will meet in practice: HL7 version 2 messages, CDA documents, and FHIR resources. This guide says what each is, where it lives in 2026, and which one you need.
HL7 v2: messages between hospital systems
HL7 version 2 dates from the late 1980s and is still the most widely deployed health-data standard in the world. It moves messages between systems inside and around hospitals: a patient is admitted (ADT), a test is ordered (ORM), a result comes back (ORU). A message is a pipe-delimited text with segments:
MSH|^~\&|LAB|CityLab|EHR|Clinic|20260901081000+0300||ORU^R01|MSG0001|P|2.5.1
PID|1||12345^^^Clinic^MR||Ionescu^Elena||19850903|F
OBR|1|||CBC^Complete blood count|||20260901081000+0300
OBX|1|NM|718-7^Hemoglobin^LN||13.2|g/dL|12.0-16.0|N|||F|||20260901081000+0300
It works, it is everywhere, and it is hard for a modern app to consume: the format is positional, each site has its own dialect, and there is no concept of "fetch this patient's record over HTTP".
CDA: clinical documents
Clinical Document Architecture, from the 2000s, is XML for documents: a discharge summary, a referral letter, a patient summary. A CDA document is human-readable and signed as a whole. It is what many national exchanges and the first generation of patient summaries were built on. It is a good format for a document and a poor one for a question like "what was this person's last blood pressure".
FHIR: resources over the web
Fast Healthcare Interoperability Resources, first published in 2014 and stable in R4 since 2019, describes health data as resources with a known structure, in JSON or XML, reachable over HTTP exactly like web pages. A lab result is an Observation, a diagnosis a Condition, a prescription a MedicationRequest, each with standard codes (LOINC, ICD-10 or SNOMED CT, ATC). You fetch, search and write them with the tools every programmer already knows:
GET /fhir/R4/Observation?patient=123&code=http://loinc.org|718-7&_sort=-date
FHIR is what EU and US regulation now require for patient access, what SMART on FHIR apps run on, and what the European Health Data Space builds on. A plain-language explanation is in What FHIR is and why it matters.
Side by side
| HL7 v2 | CDA | FHIR | |
|---|---|---|---|
| Unit | message | document | resource |
| Format | delimited text | XML | JSON or XML |
| Transport | MLLP, files | files, exchanges | HTTP REST |
| Best at | hospital system integration | signed documents | apps, APIs, patient access |
| Era | 1989 onward | 2005 onward | 2014 onward, R4 2019 |
| Still common in | labs, ADT feeds, devices | national exchanges | everything new |
Which one you need
- Building an app, an API or an AI assistant: FHIR, without hesitation.
- Receiving results from a laboratory or a hospital: probably HL7 v2, because that is what they send. Convert at the edge.
- Exchanging formal documents with a national system: CDA or FHIR documents, depending on the country.
The practical pattern is "HL7 v2 in, FHIR everywhere else". Anpheros Platform does exactly that for lab reports: a laboratory posts an ORU^R01 message as sent, and every OBX becomes a FHIR Observation with a LOINC code, a unit, a reference range and the laboratory named as performer. The patient's record is FHIR; the lab never has to change.
curl -X POST "$BASE/v1/patients/$PID/labs/import" \
-H "Authorization: Bearer $KEY" -H "Content-Type: x-application/hl7-v2+er7" \
--data-binary @report.hl7
Details are in Lab connector: HL7 v2 and CSV into FHIR.
Frequently asked questions
Is FHIR replacing HL7 v2?
For new work, yes. Existing v2 feeds will run for years because they work and replacing them costs money. Most real systems convert v2 to FHIR at the boundary rather than replacing the feed.
Is FHIR part of HL7?
Yes. FHIR is published by HL7 International, the same organisation behind v2 and CDA. "HL7 FHIR" is its full name.
Which FHIR version should I use?
R4 (4.0.1). It is what regulation references and what most systems implement. R5 exists but adoption is limited; Anpheros Platform implements R4.
Can FHIR carry documents too?
Yes: a DocumentReference points to a PDF or any file, and a FHIR Document Bundle can carry a composed document with its sections, which is how the International Patient Summary is delivered.
Do I need to learn HL7 v2 to use a FHIR API?
No. If you integrate with a lab or a hospital you will meet v2 on their side; a platform that converts it for you means your own code only ever sees FHIR.
Keep your medical record with you
Anpheros Daily keeps symptoms, lab results, medications and documents in one place, in a standard format, under your control. The Basic plan is free.