Defining a custom message


This tutorial explains how to create a custom HL7 message definition and add a Z-segment to it.

Select Tools | Definition Editor from the main menu to start the Definition Editor.

Click the 'Add Message Definition' button.

Enter the message name and description as show below:

Click OK.

A new message definition will be added to the list.

You can see that at this moment the message definition is empty and has only one segment: MSH (Message Header). Note that the Message Header segment is the required segment, you cannot remove or modify it.

Let's now define a Z-segment and add it to the message. Go to the Segments window.

Click the 'Add Segment Definition' button.

Enter the values as show below. We are going to copy the structure from another segment (PID - Patient Identification). Copying a structure is useful when there is a standard segment available which we can use with minor modifications.

Click OK.

Notice that a new segment added to the list.

Got back to our custom message definition by selecting it.

Click the 'Add Segment' button.

Select the Z01 segment from the list.

Click OK to add the segment to the message definition.

Now we have a custom message (ZMS_Z01) which contains a custom Z-segment. Click File | Save to save the changes.

Go back to the main editor, click File | New and create a new message with the name ZMS_Z01.

Note that the message has the structure we created with the Definition Editor and includes our custom Z01 segment. We can now edit the message as usual.