HL7 to XML device
The HL7 to XML device allows you to convert a message in an HL7 schema to XML before sending it to the next device in the channel. This is useful if the eventual target destination does not accept, or cannot read HL7 messages.
To add the device, click on the Edit Channel Settings button. Then choose HL7 > HL7 to XML Device from the drop-down.
Selecting the HL7 schema
Before you can convert incoming messages, you must specify the schema that the HL7 message is based on.
Select the device in the queue. On the Device Panel, choose the appropriate HL7 schema from the drop-down.
The standard HL7 schemas cannot be edited or removed. If you need to customize a schema, you must create one. Only one HL7 schema can be specified per device.
If the device should output the message as an XML string, select the Output as string option.
Using a custom schema
You can create a custom HL7 schema to use with the incoming HL7 message. The scheme can be based on several different versions of the standard HL7 schema.
To create a custom HL7 schema:
- From the Device panel for the HL7 to XML device click Add Schema.
- Enter a schema name, select the version of the HL7 schema you want to use as a base, and enter a description for the new schema (optional).
- Click Add.
- A screen will appear listing all of the segments, fields, data types, and code tables associate with the base schema. You can use the toolbar buttons to modify the standard schema elements as follows:
- Add a new segment/field/data type and members/code table.
- Removed a segment/field/data type and members/code table.
- Edit a segment/field/data type and members/code table.
- Clone (copy) a segment/field/data type and members/code table.
- For some elements, you can use the arrow buttons to reorder the values (for fields and data type members). You can copy values from another source and paste them into the table.
Close the window to save the schema. It will now appear in the HL7 Schema drop-down field and can be used by the device.
Editing a schema
If needed, you can edit a schema if the layout of the HL7 messages received changes.
You can only edit schemas you create, not standard HL7 schemas.
To edit a schema:
- Select the schema from the HL7 Schema drop-down filed.
- Click Edit Schema.
- Edit the schema layout using the same screen you used during schema creation (see above).
- Close the window to save.
Removing a schema
If a schema is no longer being used, you can remove it from the device. You can only remove schemas you create, not standard HL7 schemas.
Schema removal is permanent and cannot be undone. Use this function with caution.
To remove a schema:
- Select the schema from the HL7 Schema drop-down field.
- Click Remove.
- Type yes in the confirmation box and click continue.
Checking message conversion
Once the device is configured, you can preview the XML conversion to make sure it is accurate - as long as there are messages in the queue.
To preview the message conversion:
- Load messages into the queue.
- Select the HL7 to XML device.
- Select a message in the Input pane. The XML conversion results will be shown in the Output pane.
If the conversion is correct, you can unpause any devices/channels and continue processing. If it is incorrect, edit the HL7 to XML device as needed and preview the message conversion again.