Publishing ER7 Events via HL7
Purpose¶
This application demonstrates how to configure WSO2 Integrator: SI Tooling to send Hl7 events in ER7 format via MLLP protocol and log the events in hl7Stream and the acknowledgement message to the output console.
Prerequisites¶
- Install the HAPI testpanel.
- Save this sample. If there are no syntax errors, the following message will be shown on the console:
Siddhi App PublishHl7InER7Format successfully deployed.
Executing the Sample¶
- In the HAPI testpanel create a receiving connection with the port that is provided in the Siddhi app.
- Start the listener.
- Start the Siddhi application by clicking on 'Run'.
- If the Siddhi application starts successfully, the following messages are shown on the console:
PublishHl7InER7Format.siddhi - Started Successfully!'Hl7' sink at 'hl7Stream' stream successfully connected to 'localhost:4000'.Executing HL7Sender: HOST: localhost, PORT: 4000 for stream PublishHl7InER7Format:hl7Stream.
Testing the Sample¶
- Open the event simulator by clicking on the second icon or pressing Ctrl+Shift+I.
- In the Single Simulation tab of the panel, specify the values as follows:
Siddhi App Name:PublishHl7InER7FormatStream Name:er7Stream
- In the payload, enter
MSH|^~\&|||||20190211145413.131+0530||ADT^A01|10601|T|2.3and then clickSendto send the event. - Send more events as desired.
@App:name('PublishHl7InER7Format')
@App:description('This publishes the HL7 messages in ER7 format, receives and logs the acknowledgement message in the console using MLLP protocol and custom text mapping.')
define stream er7Stream (payload string);
@sink(type = 'hl7', uri='localhost:4000', tls.enabled='false', hl7.encoding='er7', @map(type='text', @payload('{{ payload }}')))
define stream hl7Stream (payload String);
@info(name='query1')
from er7Stream
select payload
insert into hl7Stream;