Quest and Mirth – 1

Using Mirth for Quest lab, I felt the most difficult thing in Mirth. It took me long to finalize the things. Basically we have been given two works for Quest:
1. Sending an order file (HL7-ORM) to Quest lab
2. Receving the result file (HL7-ORU) from Quest lab.

I will be dealing them into two different posts.
This post is for sending the order file to Quest lab.
Mirth Version : 1.8 ( Mirth 2.0 will have a slight different approach)

To note here :
Note#1. Quest expected the order file using WSDL. Hence you need to use SOAP sender as destination to send the ORM file to Quest.
Note#2. Quest expects an encoded message. [Dont send a plain HL7 message]

Lets create a channel in Mirth:
1. Channel Name : Quest-Order
2. Configuring Source : Source can be anything which provides a ORM to Mirth engine. Say its a file reader from D:/Quest/Orders/In
  Because of Note#2, we must use a transformer to encode the message.
  Use a JavaScript transformer at source level with below code to it:

  var encodedMsg = FileUtil.encode(messageObject.getRawData().getBytes());
  channelMap.put("EncodedMsg", encodedMsg);

3. Configuring Destination : Destionation
    Connector Type : SOAP Sender

    While implementing, Quest will be sending you the WSDL URL (or just a web url) and you may get an implementation guide as well. Its huge and will take a lot time to understand and crack the things according to your need. If they dont send you need to ask them.
    Irrespective what you get the URL you need to modify it in below manner to fit right with Mirth. Once you choose SOAP Sender under destination fill the things as below:
    a) WSDL Path : https://<UserName>:<Password>
    b) Service Endpoint URI : https://<UserName>:<Password> [This will be filled automatically – But I think modify it as I mentioned here]
        SOAP Action URI : Leave blank
    c) Click on “Get Methods” – this should show you all the methods defined in above WSDL
        Select the “SubmitOrder”
    d) Select YES for Generate Envelope
    e) Modify the generated XML as below – Just one change I did under tag  <hl7Order>${EncodedMsg}</hl7Order> – Putting your endcoded variable

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="" xmlns:soapenc="" xmlns:xsi="" xmlns:xsd="">
  <submitOrder xmlns="">
    <order xmlns="java:com.medplus.serviceHub.orders.webservice">