HL7 Viewer

Paste an HL7 v2 message to read it field by field Paste HL7

Paste an HL7 message into the editor and its fields show up here, one row each.

Or drop a .hl7 file on this box, , or .

HL7 fields, full screen

An HL7 viewer for the messages your interface engine logs

Anyone who has worked on a hospital interface knows the moment: an ADT feed stops matching patients, someone pastes a message from the engine log into a ticket, and you are left counting pipes to find out which field is PID-18. This HL7 viewer does the counting. Paste a HL7 version 2 message and every segment becomes a block of rows: the field position (PID-5), a plain name (Patient name) and the value. Dates such as 20261203091500-0800 get a readable form next to them, and the message type in MSH-9 gets a short label like "admit / visit notification".

Under the hood it is an HL7 message parser written for this page. It reads the encoding characters from MSH-1 and MSH-2 instead of assuming |^~\&, so a feed that uses # as the field separator parses just as well. It splits fields into repetitions, components and subcomponents, decodes the escape sequences (\F\, \S\, \T\, \R\, \E\, hex and \.br\ line breaks), and copes with what real logs contain: \r, \n or \r\n between segments, MLLP framing bytes, a byte order mark, and lines indented by whoever pasted them. If HL7 itself is new to you, the Health Level Seven article on Wikipedia gives the background.

The whole job runs in your browser tab. The message is not sent anywhere, which matters when the thing you are debugging carries a real patient's name and MRN. The table is the same one our JSON parser draws, so the column filters, the full-screen view and the Excel export all work here too.

How to read an HL7 message with this viewer

1

Paste or drop the message

Paste one message, or a whole batch, into the editor on the left, or drop a .hl7 or .txt file onto the tool. Sample loads a fictional ADT^A01 admit so you can see the layout first.

2

Read the status line

Above the table you get the HL7 version from MSH-12, the message type and the number of segments. Problems are listed by line: no MSH segment, an empty MSH-9, MSH-10, MSH-11 or MSH-12, or a line that doesn't start with a three-character segment ID (usually a long PID that was wrapped when it was copied out of an email).

3

Open the components

By default a field shows its value as written. Press Expand components to split it: PID-5 becomes PID-5.1 Family name, PID-5.2 Given name and so on, and repetitions sit side by side in a nested table. Show empty fields lists the positions the sender left blank, which helps when you are checking a spec that says a field is required.

4

Filter, export or take it as JSON

Type in the filter boxes to keep only the rows you care about (OBX in Field, or date in Name). Excel downloads the table as you see it, and Copy as JSON puts the parsed message on your clipboard in the same shape the HL7 to JSON converter produces.

When an HL7 message viewer saves time

An ADT feed that stopped matching patients

Check PID-3 field by field: which repetition carries the MR identifier, what the assigning authority is, and whether the receiving system expects the account number in PID-18 or the visit number in PV1-19.

A lab result that never reached the chart

Look at the OBR and OBX rows of an ORU^R01. OBX-3 holds the test code, often a LOINC code, OBX-5 the value, OBX-6 the units and OBX-8 the abnormal flag. A result filed as preliminary (OBX-11 = P) instead of final is a common reason for "missing" results.

Reviewing a vendor's sample messages

Before go-live, paste the sample file from the interface spec and compare it with what the spec promised. An empty MSH-9 to MSH-12, a wrapped line or an odd segment ID shows up in the warnings, and Show empty fields tells you which positions the vendor leaves blank, before anyone builds a mapping on top of them.

Planning a move to FHIR

When you map v2 fields to FHIR resources, it helps to see which fields a feed really fills. The HL7 v2 to FHIR mapping guide lists the targets; this viewer shows what your messages actually carry.

Frequently Asked Questions

Is my HL7 message sent to a server?

No. The parsing and the table happen in your browser, and the page makes no request with your message in it. That said, this is a debugging tool, not a system your compliance team has reviewed, so follow your own organization's rules about where patient data may be pasted.

Why does MSH start at MSH-1 with the pipe character?

Because in HL7 v2 the field separator right after "MSH" is itself field MSH-1, and the encoding characters (^~\&) are MSH-2. So the sending application is MSH-3, not MSH-2 as you would get by splitting the line on pipes. Every other segment counts normally: in PID|1||48213 the 48213 is PID-3. The viewer applies this for you, and does the same for the FHS and BHS batch headers.

Which segments does it know by name?

MSH, EVN, PID, PD1, NK1, PV1, PV2, ORC, OBR, OBX, NTE, AL1, DG1, PR1, IN1, GT1, SCH, TXA and MRG, plus MSA, ERR, FT1 and the batch segments. The names are our own short wording, not text from the standard. Any other segment, including your Z-segments, is still parsed and shown by position (ZPI-1, ZPI-2...), so nothing in the message is hidden.

How are escape sequences and line breaks shown?

A field that holds one plain value, such as the comment in NTE-3, is shown decoded: \T\ becomes the subcomponent separator, \F\ a pipe, \.br\ a line break, and hex such as \X41\ turns back into text. A field with components is shown as written until you press Expand components, which decodes each component on its own row. The raw form is handy when you are hunting for a stray separator.

Can it read several messages, or a whole batch file?

Yes. Every MSH starts a new message, and FHS, BHS, BTS and FTS batch segments are shown too. Each message can even use its own encoding characters. The input is capped at 2 MB. A long batch is drawn 1,000 rows at a time with a Show more button under the table, and the filter boxes search every row, not just the ones on screen.

I have HL7 to parse into JSON for a script. Can this do that?

Press Copy as JSON for the message in front of you, or use the HL7 to JSON page (linked below), which shows the JSON next to the message and lets you download it. Values stay strings exactly as written, so an MRN like 00048213 keeps its leading zeros.

Does it check the message against the HL7 standard or a profile?

Only the structure: the MSH header, the encoding characters, the fields most receivers need (MSH-9 to MSH-12) and segment IDs. It does not check data types, value tables or conformance profiles, so a clean status line means the message is readable, not that a receiver will accept it. For units in OBX-6, the UCUM unit codes are the usual reference.

Related tools

Once the message is parsed, these help with the JSON side of the work.