This example will show how to configure a channel to read data from a database, form an HL7 v2.x message using the data, and send it over an LLP connection.
This example will demonstrate:
- Using the Database Reader
- Generating an HL7 v2.x message from a template
Step 1: Create a new channel.
Step 2: Set to Source connector type to Database Reader and enter the connection information. In this example, the connector is set to poll the database every 5 seconds and execute the specified SELECT query. Columns entered in the FROM clause are automatically added as available variables. Note that the On-Update SQL statement that is executed immediately after the query can make use of variables returned from the initial query.
Step 3: Edit the transformer for the Source connector and click on the Message Templates tab to paste in an example Outbound Message Template, making sure to set the Data Type to HL7 v2.x. This template will be used as the base for new outbound HL7 messages generated by the channel.
The Inbound Message Template is an example of what an inbound message resulting from the database query will look like. This shows how the XML has been generated using the columns selected.
Step 4: Click on the Message Trees tab to view the trees for both the Inbound and Outbound message templates.
Step 5: In order to map data from the database to the message template, click on a node in the Inbound tree and drag-and-drop it over the node in the Outbound tree which should be replaced. This example shows replacing the "PID.5.1 (Family Name)" field in the message template with the "last_name" variable from the database. The auto-generated name of the transformer step reflects this mapping.
Step 6: Add a new destination connector of type LLP Sender. The Template is the data that will be sent over the LLP connection to the host address and by default is set to the Encoded Data, which in this example is an HL7 v2.x message.