Search in sources :

Example 1 with AcknowledgmentCode

use of ca.uhn.hl7v2.AcknowledgmentCode in project camel by apache.

the class AckExpression method evaluate.

@Override
public Object evaluate(Exchange exchange) {
    Throwable t = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
    Message msg = exchange.getIn().getBody(Message.class);
    try {
        HL7Exception hl7e = generateHL7Exception(t);
        AcknowledgmentCode code = acknowledgementCode;
        if (t != null && code == null) {
            code = AcknowledgmentCode.AE;
        }
        return msg.generateACK(code == null ? AcknowledgmentCode.AA : code, hl7e);
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
Also used : Message(ca.uhn.hl7v2.model.Message) HL7Exception(ca.uhn.hl7v2.HL7Exception) AcknowledgmentCode(ca.uhn.hl7v2.AcknowledgmentCode) HL7Exception(ca.uhn.hl7v2.HL7Exception)

Aggregations

AcknowledgmentCode (ca.uhn.hl7v2.AcknowledgmentCode)1 HL7Exception (ca.uhn.hl7v2.HL7Exception)1 Message (ca.uhn.hl7v2.model.Message)1