Table of Contents
Definition / general | Background | Essential features | Terminology | Message types | Message segments | Implementation | Examples | Other HL7 interface standards | Additional references | Board review style question #1 | Board review style answer #1 | Board review style question #2 | Board review style answer #2Cite this page: Cheng J. HL7 V2. PathologyOutlines.com website. https://www.pathologyoutlines.com/topic/informaticsHL7V2.html. Accessed December 11th, 2024.
Definition / general
- Developed by Health Level Seven International (HL7.org); HL7 version 2.x (V2) is currently the most widely used messaging standard for electronic transmission of information across health enterprises and health information systems
Background
- HL7 V2 has been in use for over 3 decades due to its simplicity and ease of understanding (relative to HL7 V3)
- When an order or result is transmitted electronically from one hospital to another institution or clinic, the receiving institution interprets the message and loads the data into its own laboratory information system or EHR (electronic health record)
- Acknowledgement message (ACK) is sent back to the originating institution to inform that the message was sent successfully; in cases where there was a problem in processing the message, a negative acknowledgement is sent back instead (NACK)
- HL7 V2 has several message types, e.g., ADT (admit discharge transfer), ORM (order), ORU (observation result - unsolicited)
- Each message is composed of several segments, e.g., MSH (message header), ORC (common order), OBR (observation request) or NTE (notes and comments)
- Different types of messages contain a different combination of message segments
- Complete HL7 specifications can be downloaded from HL7.org
- Middleware solutions can serve as a translator between 2 incompatible HL7 messaging systems (J Med Syst 2013;37:9986)
Essential features
- Within health institutions, HL7 V2 is the most common interface messaging standard used for electronic transmission of orders, results and other types of patient data
- There are several HL7 message types, e.g., ADT (patient administration), ORU (results), ORM (orders)
- Setting up an interface between 2 medical institutions requires sharing of HL7 specifications, either an HL7 interface engine or custom built software and numerous steps of testing and validation
Terminology
- Interface: connection that enables transfer of data between instruments or computer systems; in healthcare, this usually involves HL7 messages but the data can be formatted in other ways
- HL7 interface engine: computer program dedicated to monitoring, translating and transmitting HL7 messages between health information systems
Message types
- ADT (admit discharge transfer / patient administration) does more than its name implies; it is also used for changing and merging records
- The following are some types of ADT messages:
- A01: admit patient
- A02: patient transfer
- A03: patient discharge
- A04: register patient
- A05: preadmit patient
- A06: change outpatient to inpatient
- A07: change inpatient to outpatient
- A08: update patient information
- The following are some types of ADT messages:
- ORU (unsolicited observation result)
- ORM (order message)
- ACK (acknowledgement)
- NACK (negative acknowledgement)
- HL7.org has a comprehensive list of all message types
Message segments
- The first 3 characters identify the type of segment, e.g., MSH (message header), PID (patient identifier), OBR (observation request)
- Data elements are separated by the pipe character "|" and each element is referred to by the 3 character name of the segment, followed by a dash and the numerical order in which the data element occurs
- Example of a PID (patient identifier) segment
- PID|1||MEDICALRECORDNUMBER||LASTNAME^FIRSTNAME||19550922|F|999888004|||||||||A55555||||||||||||||||
- PID-5 pertains to the patient's name ("LASTNAME^FIRSTNAME" in the example)
- PID-6 is empty
- PID-7 refers to the patient's birthday ("19550922" in the example)
- PID|1||MEDICALRECORDNUMBER||LASTNAME^FIRSTNAME||19550922|F|999888004|||||||||A55555||||||||||||||||
- MSH (message header): included in every message and describes the contents of the message, including the time it was sent, the sender and recipient and the purpose of the message, e.g., order, result or a type of ADT (admit discharge transfer) message
- Example: MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|201906140836||ORM^O01|586 60050-20190614083|D|2.4
- The value for MSH-9 "ORM^O01" tells us it is the header for an ORM (order message)
- MSH-1 defines the field separator "|", which technically can be any character but "|" is normally used in practice
- Example: MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|201906140836||ORM^O01|586 60050-20190614083|D|2.4
- MSA (message acknowledgement)
- OBR (observation request)
- Contains information about a test being ordered or resulted
- Component of ORU (unsolicited observation result) and ORM (order message)
- OBX (observation / result segment): contains test result data
- NTE (notes and comments segment)
- Reference: HL7: Data Definition Tables [Accessed 26 May 2022]
Implementation
- Each interface project presents its own unique set of challenges; oftentimes, a large amount of effort is needed to set up the interface due to unique requirements on each side
- If properly implemented, interfaces reduce errors, repetition and provide considerable work and time savings over a manual workflow (Stud Health Technol Inform 2017;234:188)
- Not every HL7 message is formatted exactly the same way
- Escape sequences - certain characters within message fields, such as the field separator (usually "|") - have to be replaced by a set of characters ("\F\") for an HL7 parser to interpret the message correctly (HL7 V2+: Control [Accessed 17 May 2022])
- \F\ |
- \S\ ^
- \T\ &
- \R\ ~
- \E\ \
- Test codes may not match between 2 places; dictionaries are created to map the test codes of one institution to another
- LOINC (Logical Observation Identifiers Names and Codes), which has standardized codes for laboratory and clinical observations, is one solution to this problem but presents its own set of challenges, since 2 places may also use different LOINC codes for the same test (Clin Chem 2003;49:624)
- Example LOINC code: 2339-0 for blood glucose
- LOINC (Logical Observation Identifiers Names and Codes), which has standardized codes for laboratory and clinical observations, is one solution to this problem but presents its own set of challenges, since 2 places may also use different LOINC codes for the same test (Clin Chem 2003;49:624)
- Before 2 parties start building an interface, an interface specification has to be shared; this specifies what each field in the message contains
- Minor differences, such as the location of a particular field, must be taken into account and either the sender or receiver must perform the necessary transformations to the message to maintain compatibility
- Messages are reformatted to meet specifications by using an HL7 interface engine or through custom programming development
- GUI (graphical user interface) based interface engines are helpful to people with no programming background; these can be used to map equivalent data elements from multiple sources (Healthc Inform Res 2011;17:214)
- Transmitting PDFs: it is possible to transmit files such as PDFs within an HL7 message
- File will have to be converted to Base64 format and inserted into a message segment location specified by the receiving party
- Testing: a lot of testing will have to be done using different scenarios and types of tests to make sure the interface is working properly and to uncover any interface defects
Examples
- Acknowledgement message (ACK)
- MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|||ACK|18659670-2019061408
- MSA|AA|18659670-20190614083
- AA in the MSA (message acknowledgement) segment stands for application accept; other potential values are AE (application error) and AR (application reject)
- 18659670-20190614083 is the ID of the message that was received, which can be found in the MSH (message header) segment of every message
- MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|||ACK|18659670-2019061408
- Order message (ORM)
- MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|201906140836||ORM^O01|586 60050-20190614083|D|2.4
- PID|1||MEDICALRECORDNUMBER||LASTNAME^FIRSTNAME||19550922|F|999888004|||||||||A55555||||||||||||||||PV1||C|TEST||||ATTENDINGDOCTOR |||||||||||||||||||||||||||||||||||||201906140534
- ORC|SC|00235501|51400000|61500000^LAB|||^^^201906140834^^R||201906140824|ENTEREDBYNAME||^2552^ORDERING^PROVIDER^MD| LOCATION
- OBR|1|00235501|51400000|GLUC^GlucoseLevel^^23457|||201906140824|||ENTEREDBYNAME||||||^2552^ORDERING^PROVIDER^MD|||||||| DXSECID|||1^^^201906140824
- An order for a glucose level test
- Made up of 4 segments: MSH (message header), PID (patient identifier), ORC (common order), OBR (observation request)
- MSH|^~\\&|SENDAPP|SENDFACILITY|RECEIVEAPP|RECFACILITY|201906140836||ORM^O01|586 60050-20190614083|D|2.4
Other HL7 interface standards
- HL7 V3
- Based on RIM (Reference Information Model) that specifies how data should be represented using 3 main classes (Act, Role, Entity) and 3 association classes (Participation, ActRelationship, RoleLink)
- Encoded in XML (Extensible Markup Language)
- FHIR (Fast Healthcare Interoperability Resources)
- In 2011, it was recognized that HL7 version 3 was being minimally adopted, which led to the creation of a new task force and eventually the development of FHIR, HL7's latest approach to interoperability (J Am Med Inform Assoc 2016;23:899)
- Uses RESTful methods to transmit data, which are made up of resources
- Components of resources:
- Human readable narrative
- Specified data types
- Metadata
- Components of resources:
- Formatted in XML or JSON (JavaScript Object Notation), both of which are human readable
Additional references
Board review style question #1
Board review style answer #1
A. HL7, specifically HL7 V2, is currently the most commonly used messaging standard for transmission of data between health information systems.
Comment Here
Reference: HL7 V2
Comment Here
Reference: HL7 V2
Board review style question #2
Which HL7 message segment contains patient related information, such as name and birthday?
- MSH
- NTE
- OBX
- PID
Board review style answer #2