Taction Software — FHIR Integration with Mirth Connect
Blog·September 22, 2026·Taction Software

HL7 v2 to FHIR Mapping Guide: What Actually Breaks in Practice

HL7 v2 to FHIR mapping sits at the center of most real-world healthcare integration work today, since the vast majority of clinical data still originates as HL7 v2 messages from source systems, even as downstream applications and analytics platforms increasingly expect standardized FHIR resources instead.

FHIRHL7Mirth ConnectTechnical Guide
TL;DR

HL7 v2 message types map to FHIR resources fairly predictably at a high level — ADT to Patient/Encounter, ORU to Observation/DiagnosticReport, ORM to ServiceRequest, SIU to Appointment — but the real complexity is field-level: local/proprietary codes need terminology mapping to LOINC or SNOMED CT, segments don't always map one-to-one to resources, every source system implements HL7 v2 slightly differently, and missing or malformed fields need graceful fallback handling. Mirth Connect handles this well through isolated transformer steps, shared code templates for terminology lookups, testing against real messy data rather than idealized samples, and building incrementally by message type.

Quick answer

HL7 v2 to FHIR mapping sits at the center of most real-world healthcare integration work today, since the vast majority of clinical data still originates as HL7 v2 messages from source systems, even as downstream applications and analytics platforms increasingly expect standardized FHIR resources instead. The mapping itself sounds conceptually simple, an ADT message becomes a Patient and Encounter, an ORU becomes Observations, but the actual implementation involves genuine complexity around terminology translation, message segment grouping, and handling the inconsistent ways different source systems implement the same nominal HL7 v2 standard.

Below is how the core message-to-resource mapping works, where terminology and field-level translation gets genuinely difficult, and how Mirth Connect fits into building this pipeline reliably. If you're planning an HL7 v2 to FHIR mapping project, our free Mirth Health Check can scope the specific mapping complexity in your environment directly — part of the Mirth Connect support work we do for US healthcare teams.

How Core Message-to-Resource Mapping Actually Works

Each major HL7 v2 message type has a general, well-understood mapping to one or more FHIR resources, though the specific implementation details still require careful, deliberate handling.

ADT Messages Map to Patient and Encounter

Admission, discharge, and transfer messages typically map to updates on the Patient resource for demographic data and the Encounter resource for the actual visit details, with the specific ADT trigger event determining exactly which fields change.

ORU Messages Map to Observation and DiagnosticReport

Observation result messages map to individual Observation resources for each result, often grouped under a parent DiagnosticReport resource representing the overall report, particularly for panel-based lab results with multiple components. See our FHIR Observation resource guide for the resource-side details.

ORM Messages Map to ServiceRequest

Order messages generally map to the ServiceRequest resource, representing the request for a service like a lab test or imaging study, which then connects to the eventual Observation or DiagnosticReport once results are available.

SIU Messages Map to Appointment

Scheduling information unsolicited messages typically map to the Appointment resource, capturing the scheduling details that HL7 v2's SIU message type was specifically designed to communicate between systems. See our FHIR Encounter and Appointment resources guide for how that resource behaves.

Where Terminology and Field-Level Translation Gets Difficult

Beyond the general message-to-resource pattern, the actual field-level and terminology translation is where most real mapping projects encounter genuine, time-consuming complexity.

Local and Proprietary Codes Need Terminology Mapping

Source systems frequently use local or proprietary codes rather than standard terminologies like LOINC or SNOMED CT, requiring a dedicated terminology mapping layer to translate those codes into FHIR-appropriate standard coding systems.

Segment Grouping Doesn't Always Map One-to-One

A single HL7 v2 message can contain multiple segments that need careful grouping logic to correctly become either separate FHIR resources or components within one resource, rather than a naive one-segment-to-one-resource assumption.

Every Source System Implements HL7 v2 Slightly Differently

Despite HL7 v2 being a defined standard, different vendors and even different sites running the same vendor's system tend to populate fields inconsistently, requiring source-specific mapping logic rather than one universal transformation.

Handling Missing or Non-Standard Field Values Gracefully

Real HL7 v2 messages frequently have missing, malformed, or non-standard field values that a naive mapping implementation will fail on, so robust error handling and fallback logic matter as much as the core mapping logic itself.

How Mirth Connect Fits Into Building This Pipeline

Mirth Connect is a practical, purpose-built tool for exactly this kind of transformation work, and understanding how to structure the mapping logic within it matters for building a maintainable, reliable pipeline.

Transformer Steps for Structured Mapping Logic

Mirth's transformer steps let you build structured, testable mapping logic converting HL7 v2 segments into FHIR resource JSON, keeping each specific mapping concern isolated rather than one large, tangled transformation script.

Code Templates for Reusable Terminology Lookups

Terminology mapping logic used across multiple channels, translating local codes to LOINC or SNOMED, belongs in a shared code template, so a terminology update applies consistently everywhere that mapping logic is actually used. See our code templates and reuse guide for how to build these.

Testing Against Real, Messy Source Data

Test your HL7 v2 to FHIR mapping against genuinely messy, real source data rather than idealized test messages, since production data's inconsistencies are exactly what a clean test message won't reveal before go-live.

Building Incrementally by Message Type

Rather than attempting to build a complete mapping pipeline for every message type at once, build and validate incrementally by message type, starting with your highest-priority data before expanding to less critical message flows.

When to call for help

If terminology translation is turning out to be the long pole in your mapping project, that's the norm, not a sign something's wrong with your approach. Our free Mirth Connect health check assesses your specific mapping complexity as part of the standard diagnostic.

Book a Free Health Check →

Troubleshooting something specific? Send us the log, or check pricing for our support plans.

Scoping an HL7 v2 to FHIR mapping project? Free Mirth health check — a written 12-point audit report in 48 hours, no cost.

FAQ

Frequently Asked Questions

Is HL7 v2 to FHIR mapping a one-to-one, straightforward translation?
No, while the general message-to-resource pattern is well understood, actual implementation involves genuine complexity around terminology translation, segment grouping, and handling the inconsistent ways different source systems implement HL7 v2.
What's the most time-consuming part of a typical mapping project?
Terminology mapping and handling source-system-specific quirks in field population typically consume the most time, often more than the core message-to-resource structural mapping, which is comparatively well-documented and straightforward.
Do all HL7 v2 systems implement message types the same way?
No, different vendors and even different sites running the same vendor's system frequently populate fields inconsistently, meaning mapping logic often needs to be tailored per source system rather than applied universally.
Can Mirth Connect handle both the HL7 v2 parsing and FHIR resource creation?
Yes, Mirth Connect can parse incoming HL7 v2 messages and build corresponding FHIR resource JSON within its transformer logic, making it a practical single engine for this specific mapping and transformation workflow.
How should missing or malformed HL7 v2 fields be handled during mapping?
Build explicit error handling and fallback logic for missing or malformed fields rather than assuming every message will be perfectly formed, since real production data reliably includes inconsistencies a naive mapping implementation won't handle gracefully.
Should I build the entire mapping pipeline before testing anything?
No, building and validating incrementally by message type, starting with your highest-priority data, catches issues earlier and avoids the risk of discovering fundamental mapping problems only after a large amount of work is already complete.

Need expert Mirth Connect support?

Whether you have a one-time integration project or need ongoing managed support, every engagement is named, scoped, and priced upfront — productized packages, no hourly billing.

Talk to a Mirth Solutions Architect

60-second form. Senior engineer responds within one business day.

What is 6 + 5 ?