Skip to main content

Using the HL7 Message Viewer Page

InterSystems provides a Message Viewer page for HL7. You can use this page to display, transform, and export HL7 messages (either external files or messages from the production message archives).

To access this page, select Interoperability > Interoperate > HL7 v2.x > HL7 v2.x Message Viewer.

Selecting Options

To specify the document to display:

  1. For Document Source, select File, Message Header ID, or Message Body ID.

  2. Specify the document to display:

    • If you selected File, use Browse to choose a file. For Document Number in File, type the number of the document to display.

    • If you selected Message Header ID or Message Body ID, type the ID of the message header or message body to display.

  3. Specify how to parse the document. To do so, select one of the following options for Document Structure or Schema:

    • As received by a business service — Use the schema as assigned by a business service. If you select this, select a business service from the drop-down list.

      This option enables you to determine the DocType to which a particular business service would assign this document.

    • Use a specific Schema Category/Version — Choose a document category from the drop-down list.

    • Use a specific DocType — Enter the name of an document structure (<MessageStructure>) in the format category:structure. The parser uses this document structure.

    • Use content-declared Version:Name — Use the document structure associated with the document type declared in the document.

    • Use object's stored DocType — Use the DocType as declared in the document body object. (This option does not apply to stored documents loaded from a file.)

    • None — Do not use any DocType to parse the document. Instead, display the raw segments without transforming any of them into links.

    This option enables you to try interpreting documents from a particular data source as different schema category types to determine which DocType is the right one to use when handling documents from that source. There are a variety of reasons why you might need to do this. For example, you might find when you update an external application that it has changed the actual version of the documents it sends, but has neglected to update the type declaration that it sends in these documents. It is also useful in determining which of the built-in categories to use as a schema base, when a document uses a custom document structure.

  4. Optionally click Transform Document? and specify the transformation details. See Testing a Transformation.

  5. Click OK.

Parsing the Message

The Message Viewer displays the following on the right side of the screen after completing the steps above:

  • Summary Report, which contains following basic information about the document:

    • The Data Transformation applied, if applicable

    • The Message ID

    • The DocType

    • The DocType Category

    • The DocType description, if available

    • The number of segments

    • The number of child and parent documents, if applicable

  • Message Data, which has one row for each segment in the message structure. Each row contains:

    • Segment number

    • Segment name, such as PID or NTE

    • Field contents and separators, as contained in the message

    If the message matches the schema you have selected, segments and elements will appear in blue, as seen below. Clicking on the segments or fields will link to the relevant structure page.

    blue segments and elements when message matches the selected schema

Displaying the Segment Address

To display the segment address, hover the cursor over a segment name in the shaded column. The tooltip displays the following:

  • Segment address to use in a virtual property path

  • Descriptive name of this segment

tooltip showing segment address

Displaying the Field Address

To display the field address, hover the cursor over a field within the message structure. The tooltip displays the following:

  • The field address to use in a virtual property path (as a number)

  • The field address to use in a virtual property path (as a name)

  • Characters that indicate the syntax rules for this field. The characters can begin with:

    Symbol Meaning
    ! (1 only) The field is required; it must occur only once.
    ? (0 or 1) The field is optional, but if it occurs, it may occur only once.
    + (1 or more) The field may repeat one or more times.
    * (0 or more) The field may repeat zero or more times.
    & The field may be present, and may repeat, but only under certain conditions.
    n* (0 to n) The field repeats a maximum of n times.
    (m) m is the maximum number of characters in the field. Each repeat of the field may contain this number of characters.

tooltip showing field address

Batch Messages

If a field is enclosed with angle brackets (<,>) it is a link to a sub-document. Click on it to view that document’s summary report and message data.

Also see Viewing Batch Messages.

Testing a Transformation

To test a transformation:

  1. Click Transform Document?.

  2. For Choose Data Transformation, select a data transformation.

  3. For Choose Display Option, select one of the following:

    • Transformation Result Only — Display only the transformed document.

    • Original Message and Result Together — Display both the original document and the transformed document.

  4. Now do either or both of the following:

    • Click OK to display the transformed document.

    • Click Save Result To File? to save the transformed document to a file. In this case, also specify a path and filename.

      The default directory is the management directory for the active namespace. For example, if you installed InterSystems IRIS into the directory C:\MyIRIS and your current namespace is MyNamespace, the file is saved as C:\MyIRIS\Mgr\MyNamespace\filename

Viewing Batch Messages

The HL7 Document page handles a message differently if it is a group of HL7 messages in batch format, rather than a single HL7 message. Specifically, it allows you to walk through the batch message structure one level at a time.

The following display is the result of asking to view a batch message that begins with an FHS segment. InterSystems parses the batch message and finds that it has 3 segments: FHS, FTS, and a block of child documents in between. The block contains two child documents; each beginning with BHS and ending with BTS. The message is a two-level batch message.

The Message Viewer assigns the child documents the identifiers <2> and <33>. It displays the top-level parent document, using links (<2> and <33>) to represent the two child documents. The display is as follows:

Message Viewer showing parent document with red links 2 and 33 indicating child documents

When you click on a child document link in an HL7 batch message display, a new browser window opens to display the child document. The Message Viewer window, with the top-level parent, remains open in the original browser window.

The next display is the result of clicking the child document link <2> in the previous display. This example is a two-level batch message, so the child document <2> has children of its own: child documents <3> through <32>.

This example highlights a useful navigation feature of the Message Viewer. If there are more than 10 child documents in a batch message, the Message Viewer displays links to the first five and last five child documents. Between the lists is a text field, into which you can enter any identifier number between the first and last numbers. After you enter a number, click Other. A new browser window opens to display the child document.

Entering 8 in the text box to navigate to the 8th child document. Selecting the Other button opens the 8th child document

The next figure is the result of clicking the child document link <6> in the previous figure. Since this is the lowest level of the batch message hierarchy, message <6> shown in the following image is a normal HL7 Version 2 message that begins with an MSH segment.

Details of an ADT_A08 message including its segments

When you are done viewing messages in the batch message hierarchy, you can close all the pop-up browser windows until the top-level parent document remains in the original Message Viewer window. From here, you may return to other Management Portal activities.

FeedbackOpens in a new tab