HL7v2 Parser

HL7v2 messages are usually encoded in ER7 (Encoding Rules 7) which can be hard to understand, inspect, or edit.

This HL7v2 Parser allows you to quickly inspect ER7-encoded HL7v2 messages and view the detailed structure of each segment.

Get ready to explore some HL7v2!

The ER7-encoded (pipe-delimited) HL7v2 message.
Message Header
MSH
Field Separator (String)
MSH-1: {
String Data
MSH-1.1: "|"
}
Encoding Characters (String)
MSH-2: {
String Data
MSH-2.1: "^~\&"
}
Sending Application (Hierarchic designator)
MSH-3: {
Namespace ID
MSH-3.1: "MegaReg"
}
Sending Facility (Hierarchic designator)
MSH-4: {
Namespace ID
MSH-4.1: "XYZHospC"
}
Receiving Application (Hierarchic designator)
MSH-5: {
Namespace ID
MSH-5.1: "SuperOE"
}
Receiving Facility (Hierarchic designator)
MSH-6: {
Namespace ID
MSH-6.1: "XYZImgCtr"
}
Date/Time Of Message (Time stamp)
MSH-7: {
Time
MSH-7.1: "20060529090131-0500"
}
Message Type (Message type)
MSH-9: {
Message Code
MSH-9.1: "ADT"
Trigger Event
MSH-9.2: "A01"
Message Structure
MSH-9.3: "ADT_A01"
}
Message Control ID (String)
MSH-10: {
String Data
MSH-10.1: "01052901"
}
Processing ID (Processing type)
MSH-11: {
Processing ID
MSH-11.1: "P"
}
Version ID (Version identifier)
MSH-12: {
Version ID
MSH-12.1: "2.5"
}
Event Type
EVN
Recorded Date/Time (Time stamp)
EVN-2: {
Time
EVN-2.1: "200605290901"
}
Patient Identification
PID
Patient Identifier List (Extended composite ID with check digit)
PID-3: {
Number
PID-3.1: "56782445"
Assigning Authority
PID-3.4: "UAReg"
Identifier Type Code
PID-3.5: "PI"
}
Patient Name (Extended person name)
PID-5: {
Family Name
PID-5.1: "KLEINSAMPLE"
Given Name
PID-5.2: "BARRY"
Second and Further Given Names or Initials Thereof
PID-5.3: "Q"
Suffix (e.g., JR or III)
PID-5.4: "JR"
}
Date/Time of Birth (Time stamp)
PID-7: {
Time
PID-7.1: "19620910"
}
Administrative Sex (Coded value for user-defined tables)
PID-8: {
Coded Value for User-Defined Tables
PID-8.1: "M" (Male)
}
Race (Coded element)
PID-10: {
Identifier
PID-10.1: "2028-9"
Name of Coding System
PID-10.3: "HL70005"
Alternate Identifier
PID-10.4: "RA99113"
Name of Alternate Coding Syste
PID-10.6: "XYZ"
}
Patient Address (Extended address)
PID-11: {
Street Address
PID-11.1: "260 GOODWIN CREST DRIVE"
City
PID-11.3: "BIRMINGHAM"
State or Province
PID-11.4: "AL"
Zip or Postal Code
PID-11.5: "35209"
Address Type
PID-11.7: "M"
}
Patient Address (Extended address)
PID-11: {
Street Address
PID-11.1: "NICKELL’S PICKLES"
Other Designation
PID-11.2: "10000 W 100TH AVE"
City
PID-11.3: "BIRMINGHAM"
State or Province
PID-11.4: "AL"
Zip or Postal Code
PID-11.5: "35200"
Address Type
PID-11.7: "O"
}
Patient Account Number (Extended composite ID with check digit)
PID-18: {
Number
PID-18.1: "0105I30001"
Assigning Authority
PID-18.4: "99DEF"
Identifier Type Code
PID-18.5: "AN"
}
Patient Visit
PV1
Patient Class (Coded value for user-defined tables)
PV1-2: {
Coded Value for User-Defined Tables
PV1-2.1: "I" (Inpatient)
}
Assigned Patient Location (Person location)
PV1-3: {
Point of Care
PV1-3.1: "W"
Room
PV1-3.2: "389"
Bed
PV1-3.3: "1"
Facility
PV1-3.4: "UABH"
Floor
PV1-3.8: "3"
}
Attending Doctor (Extended composite ID number and name)
PV1-7: {
Number
PV1-7.1: "12345"
Family Name
PV1-7.2: "MORGAN"
Given Name
PV1-7.3: "REX"
Second and Further Given Names or Initials Thereof
PV1-7.4: "J"
Degree (e.g., MD) deprecated as of v 2.5
PV1-7.7: "MD"
Source Table
PV1-7.8: "0010"
Assigning Authority
PV1-7.9: "UAMC"
Name Type Code
PV1-7.10: "L"
}
Consulting Doctor (Extended composite ID number and name)
PV1-9: {
Number
PV1-9.1: "67890"
Family Name
PV1-9.2: "GRAINGER"
Given Name
PV1-9.3: "LUCY"
Second and Further Given Names or Initials Thereof
PV1-9.4: "X"
Degree (e.g., MD) deprecated as of v 2.5
PV1-9.7: "MD"
Source Table
PV1-9.8: "0010"
Assigning Authority
PV1-9.9: "UAMC"
Name Type Code
PV1-9.10: "L"
}
Hospital Service (Coded value for user-defined tables)
PV1-10: {
Coded Value for User-Defined Tables
PV1-10.1: "MED" (Medical Service)
}
Ambulatory Status (Coded value for user-defined tables)
PV1-15: {
Coded Value for User-Defined Tables
PV1-15.1: "A0" (No functional limitations)
}
Admitting Doctor (Extended composite ID number and name)
PV1-17: {
Number
PV1-17.1: "13579"
Family Name
PV1-17.2: "POTTER"
Given Name
PV1-17.3: "SHERMAN"
Second and Further Given Names or Initials Thereof
PV1-17.4: "T"
Degree (e.g., MD) deprecated as of v 2.5
PV1-17.7: "MD"
Source Table
PV1-17.8: "0010"
Assigning Authority
PV1-17.9: "UAMC"
Name Type Code
PV1-17.10: "L"
}
Admit Date/Time (Time stamp)
PV1-44: {
Time
PV1-44.1: "200605290900"
}
Observation / Result
OBX
Set ID - OBX (Sequence ID)
OBX-1: {
Sequence ID
OBX-1.1: "1"
}
Value Type (Coded values for HL7 tables)
OBX-2: {
Coded Value for HL7-Defined Tables
OBX-2.1: "NM" (Numeric)
}
Observation Identifier (Coded element)
OBX-3: {
Text
OBX-3.2: "Body Height"
}
Observation Value
OBX-5: {
"1.80"
}
Units (Coded element)
OBX-6: {
Identifier
OBX-6.1: "m"
Text
OBX-6.2: "Meter"
Name of Coding System
OBX-6.3: "ISO+"
}
Observation Result Status (Coded values for HL7 tables)
OBX-11: {
Coded Value for HL7-Defined Tables
OBX-11.1: "F" (Final results; Can only be changed with a corrected result.)
}
Observation / Result
OBX
Set ID - OBX (Sequence ID)
OBX-1: {
Sequence ID
OBX-1.1: "2"
}
Value Type (Coded values for HL7 tables)
OBX-2: {
Coded Value for HL7-Defined Tables
OBX-2.1: "NM" (Numeric)
}
Observation Identifier (Coded element)
OBX-3: {
Text
OBX-3.2: "Body Weight"
}
Observation Value
OBX-5: {
"79"
}
Units (Coded element)
OBX-6: {
Identifier
OBX-6.1: "kg"
Text
OBX-6.2: "Kilogram"
Name of Coding System
OBX-6.3: "ISO+"
}
Observation Result Status (Coded values for HL7 tables)
OBX-11: {
Coded Value for HL7-Defined Tables
OBX-11.1: "F" (Final results; Can only be changed with a corrected result.)
}
Patient Allergy Information
AL1
Set ID - AL1 (Sequence ID)
AL1-1: {
Sequence ID
AL1-1.1: "1"
}
Allergen Code/Mnemonic/Description (Coded element)
AL1-3: {
Text
AL1-3.2: "ASPIRIN"
}
Diagnosis
DG1
Set ID - DG1 (Sequence ID)
DG1-1: {
Sequence ID
DG1-1.1: "1"
}
Diagnosis Code - DG1 (Coded element)
DG1-3: {
Identifier
DG1-3.1: "786.50"
Text
DG1-3.2: "CHEST PAIN, UNSPECIFIED"
Name of Coding System
DG1-3.3: "I9"
}
Diagnosis Type (Coded value for user-defined tables)
DG1-6: {
Coded Value for User-Defined Tables
DG1-6.1: "A" (Admitting)
}

See also

Made by Anton Vasetenkov.