An HL7 Medical Document Management (MDM) message provides information about new or updated notes or documents. MDM messages are typically used by Radiology departments to communicate provider transcriptions, order information and document contents. This message type is covered in Chapter 9 of the HL7 standard.
Applications shall use the Minimal Lower Layer Protocol (MLLP) defined in Appendix C of the HL7 Implementation Guide.
An application that wants to send a message (initiate a transaction) will initiate a network connection to start the transaction.
The receiver application will respond with an acknowledgment or response to query but will not initiate new transactions on this network connection.
Applications that receive HL7 messages shall send acknowledgments using the HL7 Original Mode (versus Enhanced Acknowledgment Mode) unless otherwise specified.
According to the HL7 standard, if the value of a field is not present, the receiver shall not change corresponding data in its database.
However, if the sender includes explicit NULL value (i.e., two double-quotes ""
), it shall cause removal of any values for that field in the receiver's database.
Since the transactions are self-contained communications, the implementation of each HL7 transaction may possibly use a different version of HL7.
An application implementing an HL7 messages must comply with the message structure and contents defined by the specified version(s) of the HL7 standard.
Segment | Meaning | Usage | Card. | HL7 Chapter | |
---|---|---|---|---|---|
MSH | Message Header | R | [1..1] | 2 | |
MSA | Message Acknowledgment | R | [1..1] | 2 | |
ERR | Error | C | [0..*] | 2 |
SEQ | LEN | DT | Usage | Card. | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|---|
1 | 1 | SI | R | [1..1] | 00001 | Field Separator | |
2 | 4 | ST | R | [1..1] | 00002 | Encoding Characters | |
3 | 227 | HD | R | [1..1] | 00003 | Sending Application | |
4 | 227 | HD | R | [1..1] | 00004 | Sending Facility | |
5 | 227 | HD | R | [1..1] | 00005 | Receiving Application | |
6 | 227 | HD | R | [1..1] | 00006 | Receiving Facility | |
7 | 26 | TS | R | [1..1] | 00007 | Date/Time of Message | |
8 | 40 | ST | X | [0..0] | 00008 | Security | |
9 | 15 | MSG | R | [1..1] | 00009 | Message Type | |
10 | 20 | ST | R | [1..1] | 00010 | Message Control ID | |
11 | 3 | PT | R | [1..1] | 00011 | Processing ID | |
12 | 60 | VID | R | [1..1] | 00012 | Version ID | |
13 | 15 | NM | O | [0..1] | 00013 | Sequence Number | |
14 | 180 | ST | X | [0..0] | 00014 | Continuation Pointer | |
15 | 2 | ID | O | [0..0] | 0155 | 00015 | Accept Acknowledgment Type |
16 | 2 | ID | O | [0..0] | 0155 | 00016 | Application Acknowledgment Type |
17 | 3 | ID | RE | [1..1] | 0399 | 00017 | Country Code |
18 | 16 | ID | C | [1..1] | 0211 | 00692 | Character Set |
19 | 250 | CE | RE | [1..1] | 00693 | Principal Language of Message | |
20 | 20 | ID | X | [1..1] | 0356 | 01317 | Alternate Character Set Handling Scheme |
21 | 427 | EI | RE | [0..*] | 01598 | Alternate Character Set Handling Scheme |
|
(ASCII 124).^~\&
(ASCII 94, 126, 92, and 38, respectively).MSH-9 Message Type (MSG), required.
Components: <Message Code (ID)> ^ <Trigger Event (ID)> ^ <Message Structure (ID)>
This field contains the message type, trigger event, and the message structure ID for the message. All three components are required.
MSH-10 Message Control Id (ST), required. This field contains a number or other identifier that uniquely identifies the message in the context of exchange between trading partners. Each message should be given a unique identifier by the sending system. The receiving system will echo this ID back to the sending system in the Message Acknowledgment segment (MSA). The combination of this identifier and the name of the sending application (MSH-3) should be unique across the message exchange environment.
MSH-12 Version ID (VID), required.
Components: <Version ID (ID)> ^ <Internationalization Code (CE)> ^ <International Version ID (CE)>
This field is matched by the receiving system to its supported version(s) to be sure that the message will be interpreted correctly. The first component should be populated with the value "2.5.1" or higher, representing HL7 Version 2.5.1 or higher.
MSH-17 Country Code (ID), required if available. This field contains the country of origin for the message. The values to be used are those of ISO 3166, using the 3-character alphabetic form. Refer to HL7 Table 0399 - Country code.
MSH-18 Character Set (ID), conditional. This field contains the character set for the entire message. Refer to HL7 Table 0211 - Alternate character sets for valid values.
Condition predicate: This field shall only be valued if the message uses a character set other than the 7-bit ASCII character set. IHE authorizes only one occurrence (i.e., one character set).
Examples of valid values:
ASCII
: The printable 7-bit ASCII character set.UNICODE UTF-8
: UCS Transformation Format, 8-bit form.MSH-19 Principal Language of Message (CE), required if available. Coded from ISO 639. Examples:
DE = German, EN = English, ES = Spanish, JA = Japanese, FR = French, NL = Dutch, IT = Italian
MSH-20 Alternate Character Set Handling Scheme (ID), not supported: Character set switching is not allowed.
SEQ | LEN | DT | Usage | Card. | TBL# | ITEM# | ELEMENT NAME | |
---|---|---|---|---|---|---|---|---|
1 | 2 | ID | R | [1..1] | 0008 | 00018 | Acknowledgment Code | |
2 | 20 | ST | R | [1..1] | 00010 | Message Control ID | ||
3 | 80 | ST | X | [0..0] | 00020 | Text Message | ||
4 | 15 | NM | O | [0..1] | 00021 | Expected Sequence Number | ||
5 | X | [0..0] | 00022 | Delayed Acknowledgment Type | ||||
6 | 250 | CE | X | [0..0] | 0357 | 00023 | Error Condition |
SEQ | LEN | DT | Usage | Card. | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|---|
1 | 493 | ELD | X | [0..0] | 00024 | Error Code and Location | |
2 | 18 | ERL | RE | [0..*] | 01812 | Error Location | |
3 | 705 | CWE | R | [1..1] | 0357 | 01813 | HL7 Error Code |
4 | 2 | ID | R | [1..1] | 0516 | 01814 | Severity |
5 | 705 | CWE | O | [0..1] | 0533 | 01815 | Application Error Code |
6 | 80 | ST | O | [0..10] | 01816 | Application Error Parameter | |
7 | 2048 | TX | O | [0..1] | 01817 | Diagnostic Information | |
8 | 250 | TX | O | [0..1] | 01818 | User Message | |
9 | 20 | IS | O | [0..*] | 0517 | 01819 | Inform Person Indicator |
10 | 705 | CWE | O | [0..1] | 0518 | 01820 | Override Type |
11 | 705 | CWE | O | [0..*] | 0519 | 01821 | Override Reason Code |
12 | 652 | XTN | O | [0..*] | 01822 | Help Desk Contact Point |
ERR-2 is populated except when the error is not within an HL7 field, component or subcomponent. For example, if the receiver returns an acknowledgment containing MSA-1-acknowledgment code value AR or CR to indicate that the receiving application was unavailable, ERR-2 is not populated.
In case that the receiving application does not recognize either the message type (MSH-9.1) or the trigger event (MSH-9.2) in a message, the components of Field ERR-2 of the acknowledgment shall be populated as follows:
ERR-3 HL7 Error Code (CWE) is required. It identifies the HL7 (communication) error code. Valid values are given by HL7 Table 0357.
The components of Field ERR-3 of the acknowledgment shall be populated as follows:
Segment | Meaning | HL7 Chapter |
---|---|---|
MSH | Message Header | 2 |
MSA | Message Acknowledgment | 2 |
[ERR] | Error | 2 |
SEQ | LEN | DT | OPT | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|
1 | 1 | ST | R | 00001 | Field Separator | |
2 | 4 | ST | R | 00002 | Encoding Characters | |
3 | 180 | HD | R+ | 00003 | Sending Application | |
4 | 180 | HD | R+ | 00004 | Sending Facility | |
5 | 180 | HD | R+ | 00005 | Receiving Application | |
6 | 180 | HD | R+ | 00006 | Receiving Facility | |
7 | 26 | TS | R | 00007 | Date/Time of Message | |
8 | 40 | ST | O | 00008 | Security | |
9 | 13 | CM | R | 0076/0003 | 00009 | Message Type |
10 | 20 | ST | R | 00010 | Message Control ID | |
11 | 3 | PT | R | 00011 | Processing ID | |
12 | 60 | VID | R | 0104 | 00012 | Version ID |
13 | 15 | NM | O | 00013 | Sequence Number | |
14 | 180 | ST | O | 00014 | Continuation Pointer | |
15 | 2 | ID | O | 0155 | 00015 | Accept Acknowledgment Type |
16 | 2 | ID | O | 0155 | 00016 | Application Acknowledgment Type |
17 | 3 | ID | O | 0399 | 00017 | Country Code |
18 | 16 | ID | C | 0211 | 00692 | Character Set |
19 | 250 | CE | O | 00693 | Principal Language of Message | |
20 | 20 | ID | O | 0356 | 01317 | Alternate Character Set Handling Scheme |
Implementations supporting sequence number protocol (and using the field MSH-13-Sequence Number) shall be configurable to allow them to perform transactions without such protocol.
SEQ | LEN | DT | OPT | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|
1 | 2 | ID | R | 0008 | 00018 | Acknowledgment Code |
2 | 20 | ST | R | 00010 | Message Control ID | |
3 | 80 | ST | O | 00020 | Text Message | |
4 | 15 | NM | O | 00021 | Expected Sequence Number | |
5 | 1 | ID | O | 0102 | 00022 | Delayed Acknowledgment Type |
6 | 100 | CE | O | 00023 | Error Condition |
AA
, AE
or AR
when using Original Acknowledgment Mode, or CA
, CE
or CR
when using Enhanced Acknowledgment Mode. See HL7 v2.3.1 Chapter 2 Section 2.2.2, 2.2.3 and 2.24.2.1 for details.
SEQ | LEN | DT | OPT | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|
1 | 80 | ID | R | 00024 | Error code and location |
The transaction set supports the transmission of new or updated documents or information about their status(es).
Documents are created in two distinct contexts, one of which is related to an order and describes the procedures or activities associated with that order. The other context in which an MDM message is created occurs independent of the order process.
The Common Order (ORC), Observation Request (OBR) and associated Notes and comments (NTE) segments in order provide full ordering context.
The content of a document can be represented with one or more Observation segments (OBX). Each medical concept is represented in its own OBX segment. The document notification is transmitted in the form of an unsolicited update or in response to a record-oriented query.
The trigger events and messages may be divided into two broad categories. One which describes the status of a document only and the other that describes the status and contains the document content itself.
Event | Name | Message |
---|---|---|
T01 | Original Document Notification | Document created without the accompanying content |
T02 | Original Document Notification and Content | Document created with the accompanying content |
T03 | Document Status Change Notification | Document status changed without the accompanying content |
T04 | Document Status Change Notification and Content | Document status changed with the accompanying content |
T05 | Document Addendum Notification | Addendum to a document without the accompanying content |
T06 | Document Addendum Notification and Content | Addendum to a document with the accompanying content |
T07 | Document Edit Notification | Document edited without the accompanying content |
T08 | Document Edit Notification and Content | Document edited with the accompanying content |
T09 | Document Replacement Notification | Document replaced without the accompanying content |
T10 | Document Replacement Notification and Content | Document replaced with the accompanying content |
T11 | Document Cancel Notification | Document canceled |
This field in the OBX segment contains the observation result status. It reflects the current completion status of the results for one Observation Identifier.
This is a required field. Previous versions of HL7 stated this implicitly by defining a default value of F.
Value | Description |
---|---|
C | Record coming over is a correction and thus replaces a final result (including suffix, if applicable) |
D | Deletes the OBX record |
F | Final results; can only be changed with a corrected result |
I | Specimen in lab; results pending |
N | Not asked; used to affirmatively document that the observation identified is the OBX was not sought when the universal service ID in OBR-4 implies that it would be sought |
O | Order detail description only (no result) |
P | Preliminary results |
R | Results entered - not verified |
S | Partial results |
X | Results cannot be obtained for this observation |
U | Results status change to final without retransmitting results already sent as 'preliminary' E.g., radiology changes status from preliminary to final |
W | Post original as wrong, e.g., transmitted for wrong patient. A replacement (corrected) result may be transmitted later |
When changing or deleting a result, multiple OBX segments with the same observation ID and observation sub-ID are replaced or deleted as a unit. Normal progression of results through intermediate (e.g., "gram positive cocci") to final (e.g., "staphylococcus aureus") should not be transmitted as C (correction); they should be transmitted as P or S (depending upon the specific case) until they are final.
Refer to HL7 table 0085 - Observation result status codes interpretation for valid values.
The TXA segment contains information specific to a transcribed document but does not include the text of the document. The message is created as a result of a document status change. This information updates other healthcare systems and allows them to identify reports that are available in the transcription system.
SEQ | LEN | DT | OPT | RP/# | TBL# | ITEM# | ELEMENT NAME |
---|---|---|---|---|---|---|---|
1 | 4 | SI | R | 00914 | Set ID - TXA | ||
2 | 30 | IS | R | 0270 | 00915 | Document Type | |
3 | 2 | ID | C | 0191 | 00916 | Document Content Presentation | |
4 | 26 | TS | O | 00917 | Activity Date/Time | ||
5 | 250 | XCN | C | Y | 00918 | Primary Activity Provider Code/Name | |
6 | 26 | TS | O | 00919 | Origination Date/Time | ||
7 | 26 | TS | C | 00920 | Transcription Date/Time | ||
8 | 26 | TS | C | Y | 00921 | Edit Date/Time | |
9 | 250 | XCN | O | Y | 00922 | Originator Code/Name | |
10 | 250 | XCN | O | Y | 00923 | Assigned Document Authenticator | |
11 | 250 | XCN | C | Y | 00924 | Transcriptionist Code/Name | |
12 | 30 | EI | R | 00925 | Unique Document Number | ||
13 | 30 | EI | C | 00926 | Parent Document Number | ||
14 | 22 | EI | O | Y | 00216 | Placer Order Number | |
15 | 22 | EI | O | 00217 | Filler Order Number | ||
16 | 30 | ST | O | 00927 | Unique Document File Name | ||
17 | 2 | ID | R | 0271 | 00928 | Document Completion Status | |
18 | 2 | ID | O | 0272 | 00929 | Document Confidentiality Status | |
19 | 2 | ID | O | 0273 | 00930 | Document Availability Status | |
20 | 2 | ID | O | 0275 | 00932 | Document Storage Status | |
21 | 30 | ST | C | 00933 | Document Change Reason | ||
22 | 250 | PPN | C | Y | 00934 | Authentication Person, Time Stamp | |
23 | 250 | XCN | O | Y | 00935 | Distributed Copies (Code and name of Recipients) |
Refer to Chapter 9 for massage field details.
Chapter 7 of the HL7 Standard covers transactions related to Observation reporting and HL7 Observation Result (ORU) messages.
A common use of these transaction sets will be to transmit observations and results of diagnostic studies from the producing system (e.g., clinical laboratory system, EKG system) acting as the filler, to the ordering system (e.g., HIS order entry, physician's office system) which acts as the placer.
These transaction sets allow the transmission of clinical observations including, but not limited to:
If the observation being reported meets one or more of the following criteria, then the content would qualify as an MDM message rather than an ORU message:
Examples of documents/reports would typically qualify as MDM messages:
CDA documents are to be exchanged in the OBX segment. The value of OBX-2-Value Type should be set to ED
.
OBX-5-Observation Value contains the MIME package encoded as an encapsulated data type. The components values should be set as follows:
Component | Value |
---|---|
OBX-5.2-Type | multipart |
OBX-5.3-Data | x-hl7-cda-level-one |
OBX-5.4-Encoding | A |
OBX-5.5-Data | Equal to the MIME package |
Every entity within the MIME package must be Base64
-encoded.
As stated in Chapter 2 of the standard,
The data component must be scanned before transmission for HL7 delimiter characters (and other non-printing ASCII or non-ASCII characters such as LineFeed), and any found must be escaped by using the HL7 escape sequences defined in Section 2.7 'Use of escape sequences in text fields'. On the receiving application, the data field must be de-escaped after being parsed.
As a result, CR/LF sequences required in the MIME package need to be escaped (i.e., converted to \X0D0A\
) prior to transmission. The content type of the first MIME entity is set to application/x-hl7-cda-level-one+xml
, and should contain the CDA document itself.
Multimedia objects referenced by the CDA document that need to be transmitted within the CDA document are to be placed in successive entities of the MIME package.
Note that a MIME package is not itself Base64-encoded. Rather entities within the MIME package are Base64-encoded. A MIME package is sent as ASCII text. Therefore, the correct value is A
not Base64
.
The export of DICOM SR is described in volume 2 of the IHE Radiology (RAD) Technical Framework in section 4.28: Structured Report Export [RAD-28]. This is done using an ORU^R01
message.