Announcement

Collapse
No announcement yet.

Add custom Z segment to HL7

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add custom Z segment to HL7

    I have a channel that accepts HL7 as the source. I take values from that message and pass them to a web service reader destination. I am reading the SOAP response in a second destination. My goal is to take values from the web service response and add them to a custom Z segment (which does not exist), then add the segment to the original source HL7 message. This seems like it would easy to do, but I can not seem to figure it out. I am new to Mirth and could use some help. Please let me know if I am not clear enough.

  • #2
    Originally posted by eric_landry View Post
    I have a channel that accepts HL7 as the source. I take values from that message and pass them to a web service reader destination. I am reading the SOAP response in a second destination. My goal is to take values from the web service response and add them to a custom Z segment (which does not exist), then add the segment to the original source HL7 message. This seems like it would easy to do, but I can not seem to figure it out. I am new to Mirth and could use some help. Please let me know if I am not clear enough.
    Seems clear enough; are you having any specific problems with the channel you're using? Here's an example:

    Web Service Sender Destination
    • Name: Consume Web Service
    • WSDL: http://graphical.weather.gov/xml/DWM...l/ndfdXML.wsdl
    • SOAP Envelope:
      Code:
      <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ndf="http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl">
         <soapenv:Header/>
         <soapenv:Body>
            <ndf:LatLonListZipCode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
               <zipCodeList xsi:type="dwml:zipCodeListType" xmlns:dwml="http://graphical.weather.gov/xml/DWMLgen/schema/DWML.xsd">92618</zipCodeList>
            </ndf:LatLonListZipCode>
         </soapenv:Body>
      </soapenv:Envelope>


    Channel Writer Destination
    • Name: Parse Response and Add Z-Segment
    • Transformer:
      Code:
      var response = new XML($r('Consume Web Service').getMessage());
      var SOAPENV = new Namespace('http://schemas.xmlsoap.org/soap/envelope/');
      var ns1 = new Namespace('http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl');
      var list = (new XML(response.SOAPENV::Body.ns1::LatLonListZipCodeResponse.listLatLonOut.toString())).latLonList.toString();
      var zll = <ZLL/>;
      zll['ZLL.1']['ZLL.1.1'] = list.split(',')[0];
      zll['ZLL.2']['ZLL.2.1'] = list.split(',')[1];
      msg.appendChild(zll);


    Inbound Message
    Code:
    MSH|^~\&|ADT1|SHM|SHMADT|SHM|200812091126|SECURITY|ADT^A01^ADT_A01|MSG00001|P|2.5|
    EVN|A01|200812091126||
    PID|1|1001|1001^5^M11^ADT1^MR^SHM~123456789^^^USSSA^SS||OHALLAHAN^COLLEEN^^||19850704|F||2106-3|1200 N ELM STREET^^NEWPORT BEACH^CA^92660-1020^US^H|OC|(949) 555-1234|(949) 555-5678||S||PATID1001^2^M10^ADT1^AN^A|123456789|U1234567^CA|
    NK1|1|OHALLAHAN^BRITTANY^M|SIS^SISTER||||N^NEXT-OF-KIN
    PV1|1|I|2000^2012^01||||001122^ZOIDBERG^JOHN^|||SUR||||1|A0|
    Outbound Message
    Code:
    MSH|^~\&|ADT1|SHM|SHMADT|SHM|200812091126|SECURITY|ADT^A01^ADT_A01|MSG00001|P|2.5|
    EVN|A01|200812091126||
    PID|1|1001|1001^5^M11^ADT1^MR^SHM~123456789^^^USSSA^SS||OHALLAHAN^COLLEEN^^||19850704|F||2106-3|1200 N ELM STREET^^NEWPORT BEACH^CA^92660-1020^US^H|OC|(949) 555-1234|(949) 555-5678||S||PATID1001^2^M10^ADT1^AN^A|123456789|U1234567^CA|
    NK1|1|OHALLAHAN^BRITTANY^M|SIS^SISTER||||N^NEXT-OF-KIN
    PV1|1|I|2000^2012^01||||001122^ZOIDBERG^JOHN^|||SUR||||1|A0|
    ZLL|33.6751|-117.734
    Attached Files
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      This was a great help. Thank you very much.

      Comment

      Working...
      X