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.
-
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.
- In the HL7 Schema Management window, click Add.
-
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).
-
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.
-
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.
-
To add an existing segment to a message
- Click Select Segment.
-
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.
-
To add a custom segment to a message
- Click Select Segment.
- Click Add Segment.
-
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.
- Select the added custom segment and then click the Add field button.
-
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.
-
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.
-
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.
-
In the Optionality field, specify whether a
field is optional or required.
- O
- The field is optional.
- R
- The field is required.
-
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.
-
Click OK.
You can also choose the options Optional and Repeating from the Segment properties.
- Choose Optional to make the selected segment as optional and choose Repeating to allow a repetition of a selected segment in a message.
-
Click OK.
The newly added message is displayed at the bottom of the list.