Announcement

Collapse
No announcement yet.

Need to extract MSA-1 field from SOAP response

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

  • 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

  • #2
    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);

    Comment

    Working...
    X