HL7 support for wso2esb-4.8.1

HL7 support for wso2esb-4.8.1

HL7 In summary is  "Health Level 7", a non profit organization that maintains an interoperability standard that enables to exchange, integrate and share healthcare information. To learn more in HL7 please refer to http://www.interfaceware.com/hl7.html. With ESB-4.8.1, the support for handling and processing HL7 messages has been provided with the axis2 level feature hl7. For installing HL7 please refer to the ESB4.8.1 docs.

In this blog post, I will explain how the ESB4.8.1 support for HL7 can be tested using  proxy services. The rest of this discussion will assume that the hl7 feature is installed within the ESB pack. 

Since hl7 feature is an axis2 level transport within the ESB, we need to enable the hl7 transport at axis2 level. To achieve this, go to the location [ESB-HOME]/repository/conf/axis2/axis2.xml and uncomment the following to enable HL7 flow to work with ESB.

<messageFormatter contentType="application/edi-hl7"
                      class="org.wso2.carbon.business.messaging.hl7.message.HL7MessageFormatter"/>

<messageBuilder contentType="application/edi-hl7"
                        class="org.wso2.carbon.business.messaging.hl7.message.HL7MessageBuilder"/>


<transportReceiver name="hl7" class="org.wso2.carbon.business.messaging.hl7.transport.HL7TransportListener"/>

 <transportSender name="hl7" class="org.wso2.carbon.business.messaging.hl7.transport.HL7TransportSender"/>


Once the above lines are uncommented, ESB will be able to handle HL7 based information sent and received through various HL7 clients. To verify our scenario, first  create a new proxy service that will receive a request from the HL7 client and store the message within a file system. 

As the below proxy configuration shows, the proxy in use, listens to hl7 type transports through the property transport.port. On arrival of a HL7 message, the proxy will send an ACK back to the client as specified in the HL7_RESULT_MODE property. Next, the end point URL listed below directs the received HL7 message to a file system within a location /tmp/in.


<proxy xmlns="http://ws.apache.org/ns/synapse"
    name="HL7ToFileSystem"
    transports="hl7"
    statistics="disable"
    trace="disable"
    startOnLoad="true">
<target>
   <inSequence>
      <log level="full"/>
      <property name="HL7_RESULT_MODE" value="ACK" scope="axis2"/>
      <property name="OUT_ONLY" value="true"/>
      <property name="transport.vfs.ReplyFileName"
                expression="fn:concat(get-property('SYSTEM_DATE', 'yyyyMMdd.HHmmssSSS'), '.xml')"
                scope="transport"/>
      <send>
         <endpoint>
            <address uri="vfs:file:///tmp/out"/>
         </endpoint>
      </send>
   </inSequence>
</target>
<parameter name="transport.hl7.AutoAck">false</parameter>
<parameter name="transport.hl7.Port">55555</parameter>
<parameter name="transport.hl7.ValidateMessage">true</parameter>
<description/>
</proxy>

To run this scenario, download the Hapi Test Panel from hl7api.sourceforge.net/hapi-testpanel.




As shown by the above screen, we set the sending configurations by specifying a port as 55555, this is the port on which the proxy deployed within the ESB will listen to incoming messages which is specified through <parameter name="transport.hl7.Port">55555</parameter>

Once the port is specified click on the start button for the "sending connector" which will start the outgoing message sender.

To generate a message, click on the + symbol on the top left of the page to send a new hl7 message. This will load a page similar to the below screen. Once clicked, select the version and the message you wish to send and click on OK button. This will prepare the message to be sent.  As a final step, click on the "Send" button to generate the hl7 message that will be passed through the proxy service created on the previous step.




When the message is generated by the HAPI client, the proxy listing on the port 55555  configured within <parameter name="transport.hl7.Port">55555</parameter> will obtain the message and the contents will be stored within the path specified with the endpoint url. 

As a final step, to verify the output, navigate to the /tmp/in folder, an xml format file will exist that contains the hl7 type message stored in a specific format.

Comments