rigami.
All insights
/// EDI · 2026-02-12 · 8 min read

HL7 vs X12 — the two EDI worlds inside healthcare

The same claim moves through both. HL7 handles clinical data; X12 handles the money. Confusing the two is one of the fastest ways to lose credibility in a healthcare integration meeting.

Every healthcare integration project eventually hits the same wall: HL7 and X12 are both called 'healthcare EDI', they both exist inside the same organisations, they're both mandated by regulators, and they do completely different things. This is the plain-language sorting of them.

The one-line difference

**HL7** carries clinical data — patient records, lab results, discharge summaries, orders. **X12** carries administrative and financial data — claims, eligibility, remittance, prior authorisations. If the message is about the patient's health, it's HL7. If it's about the patient's bill, it's X12.

What HL7 actually is

HL7 is a family of standards from Health Level Seven International. Three generations coexist today:

**HL7 v2** — Pipe-delimited text messages. Still by far the most widely deployed HL7 flavour, particularly in EMRs, LIS, RIS and PACS integrations. If you've ever seen an ADT^A01 (patient admission) message, that's HL7 v2.

**HL7 v3 / CDA** — XML-based clinical documents. Never achieved v2's dominance in messaging, but the CDA (Clinical Document Architecture) subset is widely used for continuity-of-care documents.

**HL7 FHIR** — RESTful, JSON-native, modern. The direction of the industry. Mandated for US patient-access APIs. Every serious healthcare integration project in 2026 is at least partly on FHIR.

What X12 actually is

X12 in healthcare (specifically the X12N subset) is what HIPAA mandates for all electronic administrative transactions between payers and providers in the US. The core transaction sets:

**837** — Healthcare Claim (Professional, Institutional, or Dental). The bill.

**835** — Claim Payment / Remittance Advice. The response to the bill.

**270 / 271** — Eligibility inquiry and response. 'Is this patient covered?'

**276 / 277** — Claim Status inquiry and response. 'Has my claim been processed yet?'

**278** — Prior Authorisation.

**820** — Premium Payment / Enrollment.

**834** — Benefit Enrollment and Maintenance.

**999** — Implementation Acknowledgment (the rejection message).

How the same encounter flows through both

Consider a routine visit. The patient arrives, is admitted (HL7 ADT^A01 fires from the EMR to the LIS and PACS), receives lab tests (HL7 OML^O21 order, ORU^R01 result), is discharged (HL7 ADT^A03 with associated CDA discharge summary), and then goes home. That entire clinical journey is HL7.

Meanwhile, the billing office batches up the encounter and submits an 837 Professional to the payer. The payer runs eligibility (270 sent, 271 received), adjudicates the claim, and returns an 835 with either a payment or a denial reason code. That entire financial journey is X12.

Neither system usually knows the other exists. That's a feature — clinical data and financial data have different privacy, retention and access requirements — but it's also the source of most of the pain in health-tech integration work.

The integration patterns that come up over and over

**FHIR-to-X12 bridging.** Modern patient-access apps (built on FHIR) that also need billing context. The pattern: pull clinical FHIR from the EMR, correlate to the X12-based claims history from a clearinghouse, present a unified view to the patient.

**HL7 v2 to FHIR migration.** Legacy EMR emits v2, downstream consumer wants FHIR. A translation layer (Mirth, Rhapsody, or a bespoke build) sits between them.

**X12 837 generation from clinical events.** The EMR knows what happened; the billing system needs to submit the claim. A rules engine translates encounter data into an 837, catches obvious errors (missing modifiers, invalid CPT combinations) before submission.

**AI-assisted prior auth (X12 278).** The single most soul-crushing task in US healthcare admin. Modern implementations use LLMs to draft prior-auth documentation from clinical notes, then a human reviewer approves before the 278 goes on the wire.

The regulatory backdrop

HIPAA mandates the X12N transactions. The 21st Century Cures Act and CMS Interoperability Rules mandate FHIR-based patient-access APIs. The Info-Blocking Rule requires providers to share clinical data with the patient on request. All of this is why every US healthcare organisation is running both stacks simultaneously in 2026 — you can't ignore either one.

How Origami thinks about healthcare integrations

Two rules we bring into every healthcare engagement: 1) never treat HL7 and X12 as the same thing (even though the org may call it all 'EDI'), and 2) build the modern layer — observability, AI-assisted mapping, rejection triage — as first-class, because the underlying standards aren't changing but the tooling around them is where the actual leverage lives.

For an example of the RAG-grounded, cited, cost-transparent architecture we've applied to healthcare policy Q&A, see our Document Intelligence product. The same architectural pattern maps cleanly to X12 claim triage and HL7 encounter summarisation.

Want this kind of work on your roadmap?
Work with us