HL7 v2 vs FHIR
HL7 v2 and FHIR are both HL7 standards, built a generation apart for different jobs. HL7 v2 (1989 onward) is event-driven messaging: pipe-delimited segments pushed between systems when something happens (an admit, an order, a result). FHIR R4 (2019) is a resource-oriented HTTP API: JSON or XML resources (Patient, Observation) fetched and searched over REST. Inside hospitals, v2 still carries the bulk of live interface traffic; FHIR is the standard for app-facing APIs and for federal API mandates such as CMS-0057-F. Most integration work is not choosing between them but running both.
| Paradigm | v2: event messages pushed point-to-point. FHIR: resources served over a REST API |
|---|---|
| Format | v2: delimited text segments. FHIR: JSON or XML |
| Transport | v2: MLLP over TCP, or file drops. FHIR: HTTPS |
| Unit of exchange | v2: a message (ADT^A01). FHIR: a resource (Patient) or a Bundle |
| Where each dominates | v2: intra-hospital interfaces. FHIR: patient/provider-facing APIs, payer mandates |
| Engine coverage | 279 spec-validated HL7 message-type and version combinations and 24 FHIR R4 resource types in the runtime capability matrix (a snapshot; regenerate with pidgeon capabilities) |
Example
The same patient, both standards, one engine, one seed.
HL7 v2 (one PID segment of an ADT^A01 message):
PID|1||EA1VOECPYL^9^ISO^^MS|EA1VOECPYL^9^ISO^^MS|Byrd^Rodolfo^^^^^^^|Jones^Jayne^^^^^^^|19360121||Byrd^Rodolfo^^^^^^^||258 Walnut Street^^Boston^AZ^10001^USA^H^^^|...
FHIR R4 (a Patient resource, trimmed to its first elements):
{
"resourceType": "Patient",
"id": "patient-d2b41bdcba282d7083d379d378a143c4",
"identifier": [{
"use": "usual",
"type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR", "display": "Medical Record Number" }] },
"system": "http://hospital.example.org/mrn",
"value": "8X6X22R9P3"
}],
"name": [{ "use": "official", "family": "Robinson", "given": ["Lise"] }]
}Both blocks are engine output at seed 42 (`pidgeon generate ADT^A01 --seed 42` and `pidgeon generate Patient --seed 42`), each trimmed as labeled. Note the FHIR identifier.type coding system: FHIR reuses HL7 v2 table 0203 for identifier types, one of many places the two standards deliberately interlock.
Validation context
Strict and compatibility validation notes land here with the phase-1 data export.
This answer, in your terminal
pidgeon capabilitiesWire it into your AI agent:
claude mcp add pidgeon -- npx -y @pidgeonhealth/mcpDownload Post free to browse this reference with generation attached.