HL7 to FHIR Converter
Paste an HL7 v2 message and get FHIR R4 JSON back. The message stays in your browser.
HL7 message
FHIR R4 JSON
Paste your HL7 on the leftabove and the FHIR shows up here.
Or drop a file on this box, , or .
Moving an HL7 v2 feed to FHIR
Most hospitals still send admissions, lab results and orders as pipe-delimited HL7 v2, while newer apps and APIs expect FHIR resources. This HL7 to FHIR converter takes a v2 message and builds FHIR R4 JSON from it: a Patient from PID, an Encounter from PV1, a DiagnosticReport with one Observation per OBX for an ORU^R01, and a ServiceRequest for an ORM^O01 or OML^O21 order. It is meant for the part of an interface project where you want to see what a real message turns into before you write the production mapping.
Field choices follow HL7's own v2-to-FHIR mapping guide: PID-3 becomes Patient.identifier with the identifier type from CX-5, OBX-11 becomes Observation.status, OBR-25 becomes DiagnosticReport.status, and codes from HL7 tables such as administrative sex or name type are translated to their FHIR values. A site's own value in a field with an HL7 table, such as an admit source of "NHS Provider-General", is kept as text instead of being filed under that table. Where the guide asks for extra resources we keep things simpler: the bed and room from PV1-3 go into Encounter.location as display text rather than separate Location resources. A numeric OBX turns into a valueQuantity with a UCUM unit code when the unit is one we recognise (beats/min becomes /min, mmHg becomes mm[Hg]), and the number keeps its digits, so 5.40 stays 5.40. An OBX whose value can't be converted gets a dataAbsentReason that says why.
Nothing is dropped quietly. Any segment the converter does not map, such as IN1, SPM or a Z-segment, is listed under the output with its line number. The conversion runs in your browser and the message is not sent anywhere, which matters when you are poking at a feed that might hold real patient data. To read the resulting JSON as a table, paste it into our JSON parser.
How to convert HL7 to FHIR
Paste a message
Paste one message or a batch into the left pane, upload a .hl7 file, or drop one onto the tool. Sample loads a fictional ADT^A01 admission; press it again for an ORU^R01 lab result and then an ORM^O01 order.
Check the mapping
The output updates as you type. Each segment becomes the resource you would expect, linked to the others by urn:uuid references. A result line like this one:
OBX|3|NM|2823-3^Potassium [Moles/volume] in Serum or Plasma^LN||5.40|mmol/L^mmol/L^UCUM|3.5-5.1|H|||F|||20261203080000-0800 becomes this Observation in the Bundle:
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "2823-3"
}
],
"text": "Potassium [Moles/volume] in Serum or Plasma"
},
"subject": {
"reference": "urn:uuid:7dc79c8e-1c3e-452e-96f6-a13ff70f289f"
},
"effectiveDateTime": "2026-12-03T08:00:00-08:00",
"valueQuantity": {
"value": 5.40,
"unit": "mmol/L",
"system": "http://unitsofmeasure.org",
"code": "mmol/L"
},
"interpretation": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code": "H"
}
]
}
],
"referenceRange": [
{
"low": {
"value": 3.5,
"unit": "mmol/L",
"system": "http://unitsofmeasure.org",
"code": "mmol/L"
},
"high": {
"value": 5.1,
"unit": "mmol/L",
"system": "http://unitsofmeasure.org",
"code": "mmol/L"
},
"text": "3.5-5.1"
}
]
} Pick the output and copy it
Bundle gives one FHIR message Bundle, the shape a server's $process-message operation takes. Resources only gives a plain array of resources with ids and Patient/<id> style references, which is handier if you want to send them to a server one at a time. If your feed writes times without a UTC offset, pick the sender's zone so the times are kept. Then press Copy, or Download to save hl7-fhir.json.
What people use it for
Planning an interface migration
Run a handful of real (de-identified) messages from each feed and you see right away which segments carry data your FHIR side has no place for yet. The "Not converted" line is your to-do list.
Fixtures for a FHIR server
Need a Patient with an Encounter, an allergy and a lab panel to load into a test server? Write the message the way your hospital sends it, convert it, and post the Bundle. The ids are worked out from the message text, so the same message gives the same ids every time.
Checking an integration engine
If your engine already turns v2 into FHIR, put its output next to ours for the same message. Differences in status codes, identifier types or units point at mapping rules worth a second look.
Learning how the two standards line up
Seeing PID-5 land in Patient.name and OBX-7 split into a referenceRange low and high is a quicker way in than reading the spec. The FHIR article on Wikipedia gives the background on why FHIR was made in the first place.
Frequently Asked Questions
Which HL7 messages and segments does it convert?
ADT messages (A01, A04, A08 and the related A02, A03, A05, A06, A07, A13, A14, A28, A31) give a Patient from PID, an Encounter from PV1, a RelatedPerson per NK1, an AllergyIntolerance per AL1, a Condition per DG1 and an Observation per OBX. ORU^R01 gives a DiagnosticReport per OBR, an Observation per OBX and a ServiceRequest for the order behind the report. ORM^O01 and OML^O21 give a ServiceRequest per ORC/OBR pair. Doctors in PV1, ORC, OBR and OBX become Practitioner resources, and NTE comments go into the note of the resource above them where FHIR has one.
Why a message Bundle, and what does Resources only change?
An HL7 v2 message is a message, so the default output is a Bundle of type message with the MessageHeader first, built from MSH. Every entry has a urn:uuid fullUrl and references point at those. A batch of several messages gives a collection Bundle holding one message Bundle each. Resources only leaves out the Bundle, the MessageHeader and the sender and receiver Organizations, and returns an array of resources, each with an id and references such as Patient/<id>.
What happens to segments and message types it can't map?
They are named under the output, with line numbers, for example "Not converted: IN1 (line 9), ZPI (line 10)". For a message type outside the list above, such as SIU^S12 or MDM^T02, you still get the MessageHeader and the Patient, and every other segment is listed as not converted.
Why did some of my times turn into dates?
FHIR only allows a time of day together with a UTC offset, and many HL7 feeds write 20261203091500 with no zone. Rather than guess, the converter keeps just the date and says so under the output. If you know the sender's zone, pick it in "Times without a zone" and the full times come back. Bundle.timestamp and DiagnosticReport.issued are instants, so they are left out when the zone is missing.
Where do code labels such as "Glucose" end up?
In CodeableConcept.text. The code and its system (LOINC, SNOMED CT, ICD-10, an HL7 table) go into coding, but the label the sender typed after the code goes into text, because coding.display has to match the code system's own wording and a sender's label rarely does. Coding systems we have no URI for keep their code without a system, and the note under the output names them.
Is the output valid FHIR?
We ran the output for 84 test messages from public HL7 sample sets (ADT, ORU, ORM, MDM, VXU and others) through the FHIR R4 JSON schema and the official HL7 FHIR validator with its terminology server, and fixed what they reported, until neither found an error. A required element the message leaves empty, such as MessageHeader.source.endpoint, gets the data-absent-reason extension instead of a made-up value. Your own feed can still produce codes or values a validator or a profile complains about, so validate before you rely on it.
Is the message uploaded anywhere?
No. The converter runs in your browser and the page does not send the message to a server. Still, handle real patient data the way your organization requires and use de-identified messages when you can.
Can I see the HL7 message itself field by field?
Yes, the HL7 viewer shows each field with its name, and HL7 to JSON gives a plain JSON copy of the segments if FHIR is more than you need.
Related tools
Read the message before you convert it, or work with the JSON you got.