Pullng HL7 out of Soap envelope #5168
Replies: 3 comments 3 replies
-
LOL. The safe word is "elephant". Using code tags is important so the browser displays code and XML nicely. https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code you can edit your original post. Try wildcard namespaces, one should use namespaces when handling XML, but it may help make some progress:
Yea it almost looks like something is stripping or escaping an XML element and you should be doing:
|
Beta Was this translation helpful? Give feedback.
-
I would paste that response envelope in the inbound message template of the response transformer and not the destination transformer, and then try to logger.info a particular node, and see what I can find. If it returns empty, then toggle Strip Namespace option. |
Beta Was this translation helpful? Give feedback.
-
@BruceTripPop are you able to share your channel here? |
Beta Was this translation helpful? Give feedback.
-
Hi all,
To start I've never worked with Web Services or SOAP envelopes before so be gentle. I've searched both Git and the old forums and just can't seem to find what I'm looking for. I am getting a SOAP response back from a web service that contains HL7 info that I need to pull out of the envelope and do some database processing with HL7 data. This is the soap envelope I'm getting back. I've gotten close to getting the HL7, but just can't quite figure out what else I need to do. I'm sure it's something simple....
<soapenv:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">env:Header/<soapenv:Body xmlns:ns4="urn:cdc:iisb:2011">ns4:submitSingleMessageResponsens4:returnMSH|^~&|ALERTIIS|ALERTIIS||xxxxxx|20220502153240-0700||RSP^K11^RSP_K11|48a8979a-e0b6-403d-b496-132f12b2bb41|T|2.5.1|||NE|NE|||||Z33^CDCPHINVS|ALERTIIS|xxxxxx
MSA|AA|48a8979a-e0b6-403d-b496-132f12b2bb41||0
QAK|71a13b6a-befc-410c-9aaf-933e4bfd5697|NF|Z44^Request Evaluated History and Forecast^HL70471
QPD|Z44^Request Evaluated History and Forecast^HL70471|71a13b6a-befc-410c-9aaf-933e4bfd5697|DOEJ000^^^COOS^COOS|DOE^JOHN||19761226|M|25 Some Street^^SmallTown^CA^99999^USA^P|^P^PH
</ns4:return></ns4:submitSingleMessageResponse></soapenv:Body></soapenv:Envelope>
This is what I have in my destination transformer...
msg = new XML(responseMap.get('Destination 1').getMessage());
logger.info(msg.toString());
//Namespaces
var soapenv = new Namespace('http://www.w3.org/2003/05/soap-envelope');
var ns4 = new Namespace('urn:cdc:iisb:2011');
var hl7 = msg.soapenv::Body.ns4::submitSingleMessageResponse.toString();
logger.info("hl7:" + hl7.toString());
What I end up with in the hl7 variable is...
<ns4:submitSingleMessageResponse xmlns:ns4="urn:cdc:iisb:2011">ns4:returnMSH|^~&|ALERTIIS|ALERTIIS||AL5630|20220502154316-0700||RSP^K11^RSP_K11|c184b903-3a29-4f21-a912-c4d0051bd858|T|2.5.1|||NE|NE|||||Z33^CDCPHINVS|ALERTIIS|AL5630
MSA|AA|c184b903-3a29-4f21-a912-c4d0051bd858||0
QAK|8d272fc6-adb2-422a-bde4-353b5e451ca6|NF|Z44^Request Evaluated History and Forecast^HL70471
QPD|Z44^Request Evaluated History and Forecast^HL70471|8d272fc6-adb2-422a-bde4-353b5e451ca6|EILJ000^^^COOS^COOS|EILERTSON^JAYLENE||19661226|F|1201 SHELLY RD APT 3^^COQUILLE^OR^97423^USA^P|^P^PH
</ns4:return></ns4:submitSingleMessageResponse>
I know I have to do something with the ns4:return I just don't know what!
Any help would be greatly appreciated. Thanks
Beta Was this translation helpful? Give feedback.
All reactions