developers.do

HL7 to FHIR Converter

Convert HL7 v2 messages to FHIR R4 Bundles

Sample: Observation result with OBR/OBX segments

FHIR R4 Bundle JSON will appear here

Guide

About this hl7 to fhir converter

Converts pipe-delimited HL7 v2 messages into FHIR R4 Bundles you can inspect or post to a server. Supported messages include ADT^A01/A02/A03/A04/A08 (admit, transfer, discharge, registration, update), ORM^O01 orders, ORU^R01 lab results, SIU scheduling messages, and VXU^V04 immunization updates. The output is a transaction Bundle containing Patient, Encounter, DiagnosticReport, Observation, ServiceRequest, Appointment, or Immunization resources as applicable, with a summary of what was generated and warnings for anything that did not map. Sample messages are built in.

How to use the hl7 to fhir converter

  1. 1.Paste an HL7 v2 message with segments on separate lines (MSH, PID, PV1, and so on).
  2. 2.Choose Convert — or load a sample message first to see the mapping.
  3. 3.Check the summary card for the message type, resource count, and bundle type.
  4. 4.Review warnings for unmapped segments, then copy the FHIR R4 Bundle JSON.

Important details

How segments become resources

The MSH-9 message type drives the mapping. PID becomes a Patient, PV1 an Encounter, OBR a DiagnosticReport, each OBX an Observation under its report, an ORM order becomes a ServiceRequest, SCH an Appointment, and RXA an Immunization. Segments with no FHIR R4 counterpart are reported as warnings rather than silently dropped.

v2 and FHIR think differently

HL7 v2 is event messaging — “something happened, here is a snapshot”. FHIR is resource-based — discrete, addressable clinical objects. One ADT message can expand into several linked resources, and some v2 content — like site-specific Z-segments — has no standard R4 home at all.

The bundle is a transaction

Entries carry PUT requests with stable fullUrls, giving upsert semantics: posting the bundle to a FHIR R4 server’s base URL creates or updates the resources. For production feeds, validate against your server’s implementation guide first — real deployments enforce profiles beyond base R4.

Frequently asked questions

Which FHIR version does this produce?

FHIR R4 (4.0.1), the most widely deployed version and the one the US Core implementation guides are built on.

What format does the input need?

Standard ER7 pipe format: segments separated by carriage returns or newlines, fields separated by | — exactly as produced by integration engines like Mirth or Rhapsody.

Why did I get warnings alongside a successful conversion?

The converter maps what it knows and lists what it skipped — typically Z-segments or fields without an R4 equivalent. The bundle is still usable; the warnings tell you what to review.

References: HL7 FHIR R4