— Developer Tools

Free HL7 v2 Message Viewer

Paste an HL7 v2 message to see every segment and field named, coded values explained, and patient identifiers masked when you need to share it.

— Samples
Messages 1Segments 6Valid
Live

What is a HL7 v2 Message Viewer?

HL7 version 2 is how hospital systems still exchange most clinical data: admissions, orders, lab results, appointments and vaccinations. A message is a stack of pipe-delimited segments such as PID|1||MRN-4471. This viewer names every field and explains the codes.

It reads the delimiters from MSH, numbers fields the way the standard does, decodes escape sequences, and names the fields of common segments. Message types, patient class, value types, abnormal flags, result status and acknowledgment codes are explained, timestamps are formatted, and a de-identified view masks patient identifiers.

Key Features

Fields Named

Common fields of MSH, PID, PV1, ORC, OBR, OBX, AL1, DG1, IN1, MSA and more.

Codes Explained

ADT events, patient class, abnormal flags, result status and acknowledgment codes in words.

Escapes Decoded

\F\, \S\, \T\, \R\, \E\, \.br\ and hex escapes turned back into text.

De-Identified View

Names, MRNs, addresses, phone numbers, SSNs and birth dates masked for tickets.

Stays on Your Computer

Messages are read in your browser, so patient data is never uploaded.

Perfect for everyone

  • Interface analysts
  • Integration engineers
  • EHR and lab system support staff
  • Health IT students

How to Use the HL7 v2 Message Viewer

Paste a message from an interface engine or log.

1

Copy the Message

From Mirth, Rhapsody, Cloverleaf, an EHR’s interface log or a test file.

2

Paste or Open

Segments can be separated by carriage returns or new lines, and several messages work.

3

Read the Fields

Fields shows each segment and named field, with codes and times explained.

4

Share Safely

Switch to De-identified or JSON before copying anything into a ticket or chat.

Worked Examples

HL7 Messages, Viewed

Each row is an HL7 v2 message as an interface engine logs it, with segments on separate lines, and each answer is this viewer’s output in the mode on the chip. The patient is fictional.

REF_001An ADT^A01 admission

“MSH|^~\&|EPIC|GENERAL HOSP|LABSYS|GENERAL HOSP|20261028091500||ADT^A01^ADT_A01|MSG00042|P|2.5.1 EVN|A01|20261028091500 PID|1||MRN-4471^^^GH^MR||DOE^JANE^Q||19840312|F|||12 MAIN ST^^SPRINGFIELD^IL^62701||(217)555-0142|||||ACCT-88120|123-45-6789 PV1|1|I|4W^412^B^GH||||1234^SMITH^ALICE^^^DR|||MED||||1|||1234^SMITH^ALICE^^^DR|IN||||||||||||||||||||||||||20261028091000 NK1|1|DOE^JOHN|SPO||(217)555-0199 AL1|1|DA|70618^PENICILLIN^RXNORM|SV|HIVES”

REF_002The admission, de-identified

“MSH|^~\&|EPIC|GENERAL HOSP|LABSYS|GENERAL HOSP|20261028091500||ADT^A01^ADT_A01|MSG00042|P|2.5.1 EVN|A01|20261028091500 PID|1||MRN-4471^^^GH^MR||DOE^JANE^Q||19840312|F|||12 MAIN ST^^SPRINGFIELD^IL^62701||(217)555-0142|||||ACCT-88120|123-45-6789 PV1|1|I|4W^412^B^GH||||1234^SMITH^ALICE^^^DR|||MED||||1|||1234^SMITH^ALICE^^^DR|IN||||||||||||||||||||||||||20261028091000 NK1|1|DOE^JOHN|SPO||(217)555-0199 AL1|1|DA|70618^PENICILLIN^RXNORM|SV|HIVES”

REF_003An ORU^R01 lab result

“MSH|^~\&|LABSYS|GENERAL HOSP|EPIC|GENERAL HOSP|20261028140500||ORU^R01|LAB-9921|P|2.5.1 PID|1||MRN-4471^^^GH^MR||DOE^JANE^Q||19840312|F OBR|1|ORD-5510|LAB-9921|24323-8^Comprehensive metabolic panel^LN|||20261028103000|||||||||||||||20261028140000|||F OBX|1|NM|2345-7^Glucose^LN||182|mg/dL|70-99|H|||F|||20261028133000 OBX|2|NM|2823-3^Potassium^LN||3.1|mmol/L|3.5-5.1|L|||F|||20261028133000 OBX|3|NM|2951-2^Sodium^LN||140|mmol/L|136-145|N|||F|||20261028133000 NTE|1||Fasting sample\.br\Collected at 08:00”

REF_004An acknowledgement

“MSH|^~\&|LABSYS|GENERAL HOSP|EPIC|GENERAL HOSP|20261028140501||ACK^R01|ACK-9921|P|2.5.1 MSA|AA|LAB-9921”

REF_005The admission as JSON

“MSH|^~\&|EPIC|GENERAL HOSP|LABSYS|GENERAL HOSP|20261028091500||ADT^A01^ADT_A01|MSG00042|P|2.5.1 EVN|A01|20261028091500 PID|1||MRN-4471^^^GH^MR||DOE^JANE^Q||19840312|F|||12 MAIN ST^^SPRINGFIELD^IL^62701||(217)555-0142|||||ACCT-88120|123-45-6789 PV1|1|I|4W^412^B^GH||||1234^SMITH^ALICE^^^DR|||MED||||1|||1234^SMITH^ALICE^^^DR|IN||||||||||||||||||||||||||20261028091000 NK1|1|DOE^JOHN|SPO||(217)555-0199 AL1|1|DA|70618^PENICILLIN^RXNORM|SV|HIVES”

REF_006A test message with a Z-segment

“MSH|^~\&|REG|CLINIC|EMR|CLINIC|20261028||ADT^A08|M1|T|2.3 PID|1||MRN-1 ZPI|1|VIP”

REF_007Escape sequences in a note

“MSH|^~\&|LIS|LAB|EMR|CLINIC|20261028||ORU^R01|M2|P|2.5 NTE|1||Ratio 1\S\4 \T\ diluted\.br\Repeat if \F\ above 5”

REF_008A vaccination record

“MSH|^~\&|EHR|CLINIC|IIS|STATE|20261028||VXU^V04^VXU_V04|VX-1|P|2.5.1 RXA|0|1|20261028101500||208^COVID-19 mRNA^CVX|0.3|mL^mL^UCUM||||||||EN6201||PFR^Pfizer^MVX”

REF_009A segment without MSH

“PID|1||MRN-4471||DOE^JANE”

REF_010A lowercase segment ID

“MSH|^~\&|A|B|C|D|20261028||ADT^A01|M3|P|2.5 pid|1”

Key Segments

Segments You Will Read Most

HL7 defines over a hundred segments. These ten carry most of what interfaces exchange.

01 / MSH

MSH

The header: delimiters, sender, receiver, time, message type, control ID and version.

“Which field holds the message type?”

02 / EVN

EVN

The trigger event and when it was recorded, sent with ADT messages.

“What is EVN-1 in an admit?”

03 / PID

PID

The patient: identifiers, name, birth date, sex, address and phone.

“Which field is the patient name?”

04 / PV1

PV1

The visit: patient class, location, doctors and admit and discharge times.

“What does PV1-2 = I mean?”

05 / ORC

ORC

Common order details shared by lab, radiology and pharmacy orders.

“What does ORC-1 = NW mean?”

06 / OBR

OBR

The observation request: what was ordered and when it was observed.

“Which field holds the test code?”

07 / OBX

OBX

One result: value type, code, value, units, reference range and flags.

“What does OBX-8 = H mean?”

08 / AL1

AL1

An allergy: type, allergen, severity and reaction.

“What is AL1-2 = DA?”

09 / MSA

MSA

The acknowledgment: accepted, error or rejected, with the original control ID.

“What does AA mean?”

10 / ZSEGMENTS

Z-Segments

Custom segments starting with Z, defined by each organisation.

“Are Z-segments standard?”

How a Message Is Built

HL7 v2 is compact and positional. A few rules explain every message, whatever the version or vendor, and knowing them makes raw messages readable without a viewer.

Segments

Each segment is a line ending in a carriage return, starting with a three-character ID.

Fields

Fields are separated by |. MSH-1 is the separator itself, so MSH numbering is one ahead.

Components

^ splits a field into parts, such as family and given name in PID-5.

Repetitions

~ repeats a field, such as several identifiers in PID-3.

Subcomponents

& splits a component further, as in assigning authority details.

Escapes

\ starts escape sequences, so a literal | is written \F\ inside data.

Sharing HL7 Safely

HL7 messages are full of protected health information, which regulations such as HIPAA restrict. These habits keep it out of places it doesn’t belong when you troubleshoot an interface.

Tip 01

Use the De-Identified View

It masks names, MRNs, addresses, phones, SSNs and full birth dates before you copy.

Tip 02

Check Free Text

Notes in NTE and OBX-5 can contain names, which no automatic masking catches.

Tip 03

Prefer Test Messages

Reproduce problems with test patients in a test environment where you can.

Tip 04

Mind Your Tools

Paste real messages only into tools that run locally, like this one, not online services.

Tip 05

Delete Copies

Clear exported files and clipboards once a ticket is resolved.

When to View HL7

Whenever an interface message needs reading quickly.

Interface Troubleshooting

See why a message was rejected or mapped to the wrong field.

Validating a New Feed

Check field positions and codes against a partner’s specification.

Lab Result Questions

Read values, units, ranges and flags straight from the ORU.

Writing Support Tickets

Copy a de-identified version into the ticket instead of the raw message.

Learning HL7

See how segments, fields and components fit together.

HL7 Pitfalls

Things that trip people up with HL7 v2.

Tip 01

Line Endings

HL7 uses carriage returns. Files with only line feeds break some engines.

Tip 02

MSH Numbering

MSH-1 is the separator, so tools that count from MSH-2 are off by one.

Tip 03

Versions Differ

Fields move and change between 2.3, 2.5.1 and 2.8, so check MSH-12.

Tip 04

Vendor Variations

Every EHR fills optional fields differently, and Z-segments are local.

Tip 05

Timezones

Timestamps often lack an offset, so the sender’s local time is assumed.

Tip 06

MLLP Framing

Messages on the wire are wrapped in start and end bytes, which the viewer strips.

Frequently Asked Questions