This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Creating an HL7 Proxy Service

If you want to try the example configurations on this page, you must have an HL7 client and HL7 back-end application set up and running. To see a sample that illustrates how to create an HL7 client and back-end application, see:
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/business-messaging/hl7/org.wso2.carbon.business.messaging.hl7.samples/4.1.0/.

To create the HL7 proxy service:

  1. In the Management Console, create a custom proxy service (see Adding a Proxy Service).
  2. In the transports list, specify https, http, and hl7.

  3. Create an Address Endpoint with the URL of the HL7 server host and port, such as: hl7://localhost:9988
  4. Add the following parameter to the proxy service (required to enable the transport):
    <parameter name="transport.hl7.Port">9292</parameter>

For example:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="hl7testproxy" transports="https,http,hl7" statistics="disable" trace="disable" startOnLoad="true">
       <target>
          <inSequence>
             <log level="full" />
          </inSequence>
          <outSequence>
             <log level="full" />
             <send />
          </outSequence>
          <endpoint name="endpoint_urn_uuid_9CB8D06C91A1E996796270828144799-1418795938">
             <address uri="hl7://localhost:9988" />
          </endpoint>
       </target>
       <parameter name="transport.hl7.Port">9292</parameter>
    </proxy>

For information on additional configuration you can set on the HL7 transport, see HL7 Transport.

Accept acknowledgement

If user doesn't want to wait for the back-end service to process the message and only needs acknowledgment from the system that the message was received, you can configure the proxy service to send an ACK/NACK message after the message is received. For example:

<proxy name="HL7Proxy" transports="hl7" startOnLoad="true" trace="disable">
    <description/>
    <target>
        <inSequence>
            <property name="HL7_RESULT_MODE" value="ACK" scope="axis2"/>
            <property name="HL7_GENERATE_ACK" value="true" scope="axis2"/>
            <send>
               <endpoint name="endpoint_urn_uuid_9CB8D06C91A1E996796270828144799-1418795938">
                    <address uri="hl7://localhost:9988"/>
                </endpoint>
            </send>
        </inSequence>
        <outSequence>
            <log level="custom">
                <property name="OUT" value="***********out sequence proxy2***********"/>
            </log>
           <drop/>
        </outSequence>
     </target>
     <parameter name="transport.hl7.AutoAck">false</parameter>
     <parameter name="transport.hl7.ValidateMessage">false</parameter>
</proxy>

Application acknowledgement

If you want to wait for the application's response before sending the acknowledgment message (see Configuring application acknowledgement), you add the HL7_APPLICATION_ACK property to the inSequence and any additional HL7 properties and transport parameters as needed. For example:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="HL7Proxy" transports="hl7" statistics="disable" trace="disable" startOnLoad="true"> 
  <target> 
      <inSequence> 
           <property name="HL7_APPLICATION_ACK" value="true" scope="axis2"/>  
            <send> 
                  <endpoint name="endpoint_urn_uuid_9CB8D06C91A1E996796270828144799-1418795938"> 
                          <address uri="hl7://localhost:9988"/> 
                   </endpoint> 
             </send> 
      </inSequence> 
      <outSequence>  
           <property name="HL7_RESULT_MODE" value="NACK" scope="axis2"/> 
           <property name="HL7_NACK_MESSAGE" value="error msg" scope="axis2"/> 
           <send/> 
      </outSequence> 
  </target> 
  <parameter name="transport.hl7.AutoAck">false</parameter> 
  <parameter name="transport.hl7.ValidateMessage">true</parameter> 
  <description></description> 
</proxy>