Search in sources :

Example 6 with ACK

use of ca.uhn.hl7v2.model.v24.message.ACK in project streamsx.health by IBMStreams.

the class HapiMessageHandler method processMessage.

@Override
public Message processMessage(Message theMessage, Map<String, Object> arg1) throws ReceivingApplicationException, HL7Exception {
    server.messageArrived(theMessage);
    Message ack;
    try {
        // Always use the default parser to generate an ack
        // HAPI seems to get into trouble if the ADT_AXX superstructure
        // is used.  
        // Internally, when it tries to generate an ack message
        // the super structure setting in the model class factory causes the ADT_AXX message
        // to get created instead of the ACK getting created.  This is to override the model
        // class factory so that the proper class can be generated.
        theMessage.setParser(ackParser);
        ack = theMessage.generateACK();
        return ack;
    } catch (IOException e) {
        TRACE.log(TraceLevel.ERROR, "Unable to generate ack message", e);
    }
    return theMessage;
}
Also used : Message(ca.uhn.hl7v2.model.Message) IOException(java.io.IOException)

Aggregations

ACK (ca.uhn.hl7v2.model.v24.message.ACK)5 ADT_A01 (ca.uhn.hl7v2.model.v24.message.ADT_A01)5 Test (org.junit.Test)5 Message (ca.uhn.hl7v2.model.Message)1 IOException (java.io.IOException)1