Data Services Repository > Data service reference > HL7
  

HL7

The HL7 data services implement the Health Level Seven version 2.x messaging standard used in the health services industry. The HL7 standard is used world-wide in hospital and medical information systems.

HL7 message structure

An HL7 message contains segments that are separated by line breaks. Each segment has a three-character label, such as MSH (message header) or PID (patient identification). Each segment contains a predefined hierarchy of fields and sub-fields. The fields are delimited by the characters immediately following the MSH designator, typically |^~\&. The message type is specified by a field in the MSH segment.
The following example shows a message of type ADT and subtype A01, which is an Admit a Patient message:
MSH|^~\&|ADT1|MCM|FINGER|MCM|198808181126|SECURITY|ADT^A01|MSG00001|P|2.3.1
EVN|A01|198808181123
PID|1||PATID1234^5^M11^ADT1^MR^MCM~123456789^^^USSSA^SS||
SMITH^WILLIAM^A^III||19610615|M||C|1200 N ELM STREET^^JERUSALEM^TN^99999?
1020|GL|(999)999?1212|(999)999?3333||S||PATID12345001^2^M10^ADT1^AN^A|
123456789|987654^NC
NK1|1|SMITH^OREGANO^K|WI^WIFE||||NK^NEXT OF KIN
PV1|1|I|2000^2012^01||||004777^CASTRO^FRANK^J.|||SUR||||ADM|A0
The patient's name, Smith^William^A, follows the PID label by five | delimiters. The last and first names, Smith and William, are separated by a ^ delimiter.
For readability, the sample message contains extra line breaks in addition to the line breaks that are in the original message.

HL7 message in XML format

The HL7 parser data services can convert HL7 messages into HL7 version 2.x XML schemas. The following example shows an HL7 message in XML format:
<HL7:ADT_A01 xmlns:HL7="http://www.informatica.com/B2B/HL7">
<HL7:MSH>
<MSH.1>|</MSH.1>
<MSH.2>^~\&</MSH.2>
<MSH.3>
<HD.1>ADT1</HD.1>
</MSH.3>
<MSH.4>
<HD.1>MCM</HD.1>
</MSH.4>
<MSH.5>
<HD.1>LABADT</HD.1>
</MSH.5>
<MSH.6>
<HD.1>MCM</HD.1>
</MSH.6>
<MSH.7>
<TS.1>198808181126</TS.1>
</MSH.7>
<MSH.8>SECURITY</MSH.8>
<MSH.9>
<MSG.1>ADT</MSG.1>
<MSG.2>A01</MSG.2>
</MSH.9>
<MSH.10>MSG00001</MSH.10>