http://www.interfaceware.com/hl7_segments.html
Example HL7 Message
Sections:
HL7 messages are in human-readable (ASCII) format, though they may require some effort to interpret.
Each HL7 message consists of one or more segments. A carriage return character (\r, which is 0D in hexadecimal) separates one segment from another. Each segment is displayed on a different line of text. (as seen in the sample HL7 message below)
Each HL7 segment consists of one or more composites (also known as fields). A pipe (|) character is used to separate one composite from another.
If a composite contains other composites, these sub-composites (or sub-fields) are normally separated by ^ characters.
Sample HL7 message:
MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|
PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|
NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC|||||||||||||||||||||||||||
PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853
The segments
In an HL7 message, each segment of the message contains one specific category of information, such as patient information or patient visit data. For example, consider the sample HL7 message that you saw in the previous section:
In an HL7 message, the name of each segment in the message is specified by the first field of the segment, which is always three characters long. This example message contains four segments: MSH, PID, NK1 and PV1. Different types of HL7 messages contain different segments. (For more information on the type of an HL7 message, see Determining the HL7 Message Type.)
Here is an example of a typical HL7 message:
The segments in this example contain the following information:
- The MSH (Message Header) segment contains information about the message itself. This information includes the sender and receiver of the message, the type of message this is, and the date and time it was sent. Every HL7 message specifies MSH as its first segment.
- The PID (Patient Information) segment contains demographic information about the patient, such as name, patient ID and address.
- The NK1 (Next of Kin) segment contains contact information for the patient's next of kin.
- The PV1 (Patient Visit) segment contains information about the patient's hospital stay, such as the assigned location and the referring doctor.
Over 120 different segments are available for use in HL7 messages.
The Segment Library that is included with Chameleon contains all of the segments that are available. See Importing Segments From the Segment Library for more information.
composites (also known as fields)
Each segment of an HL7 message consists of one or more composites (also known as fields). By default, the | (pipe) character is used to separate one composite from another.
A composite can be a primitive data type (such as a character string or a number), or can contain other composites.
If a composite contains other composites, these sub-composites (or sub-fields) are normally separated by ^ characters. If a sub-composite also contains composites, these sub-sub-composites are normally separated by & characters. Sub-sub-composites must be primitive data types.
For an example of a typical composite, consider the PID segment of the sample message that you have seen in the previous sections:
...
In this segment, the fifth composite is the patient name, which is DOE^JOHN^^^^. (The four ^^^^ characters at the end of this composite indicates that it has a total of six sub-composites, and that only the first two of the sub-composites are defined.) In this composite, DOE represents the family name of the patient, and JOHN is the patient's given name.
In order to be as flexible as possible and achieve a consensus, the HL7 committees were forced to define many segment fields as optional. The downside of this decision is that you cannot be certain that particular information will be present in a given message. This is one of the reasons why the same message may vary significantly from vendor to vendor.
Determining the HL7 Message Type
Each HL7 message is of a particular message type. This HL7 message type indicates what health-related information is being provided in this message. The message type also determines what segments can be included as part of the message.
To determine the message type of an HL7 message, examine its MSH segment. The message type is normally the ninth field of this segment. For example, consider this MSH segment, which you have seen before:
MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|
Here, the HL7 message type is ADT^A04, which is "Register a Patient".
The Message Library that is included with Chameleon contains all of the message types that are available. See Importing Message Definitions From the Library for more information.
'메모' 카테고리의 다른 글
매출 5억이상 세금 성실신고...펌 (0) | 2013.06.16 |
---|---|
hl7 msh - message header segment...펌 (0) | 2013.06.10 |
HL7 gateway...펌 (0) | 2013.06.09 |
dicom worklist gateway 논문...펌 (0) | 2013.06.09 |
Worklist Gateway...펌 (0) | 2013.06.09 |