Hl7 Connector for WSO2 Stream Processor
Hl7 connector enables WSO2 stream processor to send and receive hl7 message type which is used to pass health related data using HL7 Version 2 API.

This connector uses Single port MLLP (Minimum Low Layer Protocol) Protocol to transfer the messages and has the transport layer security facility. This defaultly uses wso2carbon keystore to secure the data and user has the facility to customise it.
HL7 MLLP Transport
MLLP is the Minimum Low Layer Protocol used to transmit HL7 messages using TCP/IP. Because TCP transfer data as a continuous stream of bytes. So a wrapping protocol is required to recognize the start and end of the message. So It Is used as a wrapping protocol.
MLLP often use non-printable characters to serve as wrapping characters around the core HL7 messages and MLLP has no knowledge about the HL7 content insight. This wrapping characters envelop the HL7 message payload effectively as a block of data and then transmit to the receiving system.
Then the receiving system unwrap the message payload and parses the message content and acknowledge the receipt of the message by returning a response message by wrapping its message content as well.
How to handle Hl7 Transport using Siddhi
As a system, when a publisher with the @sink(type= ‘hl7’) annotation defined on top of a Siddhi Streams, it creates a Hl7 client and allows to send the HL7 messages using the MLLP protocol and receive the acknowledgement message.

You can use a sample syntax as follows to send a Hl7 message to Hl7 Receiver .
@sink(type="hl7", uri="<STRING>", hl7.encoding="<STRING>", hl7.ack.encoding="<STRING>", charset="<STRING>", tls.enabled="<BOOL>", tls.keystore.type="<STRING>", tls.keystore.filepath="<STRING>", tls.keystore.passphrase="<STRING>", hl7.timeout="<INT>", @map(...)))
As a system, when a consumer with the @source(type= ‘hl7’) annotation defined on top of a Siddhi Streams, it creates a Hl7 server and allows to receive HL7 messages through MLLP protocol and send the Acknowledgement message to the sender.

You can use a sample syntax as follows to consume a message from Hl7 Sender.
@source(type="hl7", port="<INT>", hl7.encoding="<STRING>", hl7.ack.encoding="<STRING>", charset="<STRING>", tls.enabled="<BOOL>", tls.keystore.type="<STRING>", tls.keystore.filepath="<STRING>", tls.keystore.passphrase="<STRING>", hl7.conformance.profile.used="<BOOL>", hl7.conformance.profile.file.path="<STRING>", @map(...)))
It accepts both ER7 and XML Hl7 Encoding types and uses parsers to parse the messages. User should define the actual encoding type of the message itself.
siddhi hl7 connector allows the user to validate the incoming messages as the user expected using Conformance Profile.
A conformance profile framework presents a method for users of the standard to write a more detailed, less loose message specification. A profile must be based on one of the standard HL7 message specifications, but it is much more specific, in that it tightly constrains the optionality of fields, length of data, constant values, and number of repetitions of segments in messages. Profiles are written in XML. This feature enables automatic validation of a message against a profile.