Adding a Custom HL7 Message

The Read from HL7 File stage validates messages using the HL7 2.7 schema. However, your HL7 data may contain messages that are not part of the HL7 standard. If you want the Read from HL7 File stage to validate your customized HL7 data, you need to create a custom HL7 schema. This topic describes how to create a custom HL7 schema using the HL7 Schema Management tool. For more information about HL7, go to www.hl7.org.

  1. In Spectrum Enterprise Designer, go to Tools > HL7 Schema Management.

    This will open the HL7 Schema Management window which contains a list of supported messages. These messages are predefined by HL7.

  2. In the HL7 Schema Management window, click Add.
  3. In the Message type field, specify a type for a custom HL7 message.

    The message type indicates what health-related information is being provided in the message. For example, an ADT (Admin Discharge Transfer) message type is used to exchange the patient state within a healthcare facility and an ORU (Observation Result) message type is used to transmit observations and results from the LIS ( Lab Information System) to the HIS (Hospital Information System).

  4. In the Trigger event field, specify an event code.

    The trigger event is a real-world event that initiates communication and the sending of a message. Both the message type and trigger event are found in the MSH-9 field of the message. For example, MSH-9 field might contain the value ADT^A01. This means that ADT is the HL7 message type, and A01 is the trigger event.

  5. In the Description field, type a description for a custom HL7 message.

    This field helps you to understand more about a message type. For example, if you are adding a XYZ message type, you can provide a description that it is used to exchange the patient state within a healthcare facility.

    You will now see a newly created message under the Definition. Click on the plus sign to expand the message. You can see the MSH segment is added automatically.

  6. To add an existing segment to a message
    1. Click Select Segment.
    2. Select the segments you want to add to the message and click OK.

      A schema of a selected segment is displayed in the Segment Schema grid and the checked messages are added in the message schema.

  7. To add a custom segment to a message
    1. Click Select Segment.
    2. Click Add Segment.
    3. In the Name field, specify a name for the segment and click OK.

      The newly added segment is displayed at the bottom of the Segments Supported list.

    4. Select the added custom segment and then click the Add field button.
    5. In the Name field, specify a field name of the selected segment.

      For example, a PID (Patient information) segment contains field names as Patient ID, Patient Name, Patient Address, County Code, and so on.

    6. In the Type field, select an appropriate data type.

      HL7 data types define the kind of data that can be included in a field, and are used throughout the HL7 message structure. For example, ST for string, TX for text data and FT for formatted data.

    7. In the Normative length field, specify the minimum and maximum length of the field using the following format: m..n. You can also specify a list of possible values for a length of the field using the following format: x,y,z.

      For example, length of 1..3 means the length of the item may be either 1, 2 or 3 and the length of 1, 3, 4 means the length of the item may be either 1, 3 or 4 but not 2. A value other than 1, 3, and 4 would be treated as invalid.

    8. In the Optionality field, specify whether a field is optional or required.
      O
      The field is optional.
      R
      The field is required.
    9. In the Repetition field, if you want to allow the field to appear more than once in the segment, check the Repetition box and specify the number of times the field can be used.

      For example, a value of 3 would mean that the field can have three occurrences. If it is unspecified, there will only be one occurrence, which means this field will not be repeated.

  8. Click OK.

    You can also choose the options Optional and Repeating from the Segment properties.

  9. Choose Optional to make the selected segment as optional and choose Repeating to allow a repetition of a selected segment in a message.
  10. Click OK.

    The newly added message is displayed at the bottom of the list.