web stats
Need to extract MSA-1 field from SOAP response - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2017, 09:33 AM
sabidi sabidi is offline
OBX.1 Kenobi
 
Join Date: Oct 2010
Posts: 27
sabidi is on a distinguished road
Default Need to extract MSA-1 field from SOAP response

How can I extract the MSA.1 = AE from the following response, where the HL7 message is embedded inside the soap envelope.

<soap:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<soap:Body>
<ExecuteHL7MessageResponse xmlns="http://tempuri.org/">
<ExecuteHL7MessageResult>MSH|^~\&amp;||PH0000|EP IC V2015|PH0028|20170327132632-0004||ACK^V04^ACK|PH000020170327263200|T|2.5.1|||N E|NE|||||Z23^CDCPHINVS
MSA|AE|137
ERR||RXA^1^10|101^RequiredFieldMissing^HL70357|W|6 ^Required observation missing^HL70533^WEBIZ-721^Conditionally Required Observation Missing - Warning^L||NumericPath: RXA[1].10, NamePath: ORDER[0]/RXA/AdministeringProvider, RuleId: 85, ApplicationErrorCode: WEBIZ-721|RXA-10 (AdministeringProvider): Has a conditionally required element [AdministeringProvider]. Expectation: value is not empty when the first occurrence of RXA-9.1 is valued "00" and RXA-20 (CompletionStatus) is valued "CP" or "PA".
ZSA|AW^Application Warning - One or more ERR segments returned with at most a severity of W for Warning^ENV0008|15365437^^^PH0000^HL7LogIdIncommin g~6145908^^^PH0000^WebServiceLogIdIncomming~137^^^ PH0028^MessageControlId|2042913^^^PH0000^LR
</ExecuteHL7MessageResult>
</ExecuteHL7MessageResponse>
</soap:Body>
</soap:Envelope>

Thank you,

Syed
Reply With Quote
  #2  
Old 03-27-2017, 10:29 AM
sabidi sabidi is offline
OBX.1 Kenobi
 
Join Date: Oct 2010
Posts: 27
sabidi is on a distinguished road
Default

Found the answer, just needed to add these two lines:

var resp=new XML(httpResponse.getMessage());
var hl7_resp= SerializerFactory.getSerializer('HL7V2').fromXML(r esp);
logger.debug( "HTTP new ResponseMsg: " + resp);
logger.debug( "HTTP new ResponseMsg: " + hl7_resp);
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation