0

I am creating an HL7 interface. When the messages that are recieved are correct, i reply to HIS with a ACK message like this:

msg.generateACK();

How do i send a NACK message, indicating that the message was recieved but it's content was not correct? I am using ca.uhn.hl7v2.model.Message.

Stimpson Cat
  • 1,444
  • 19
  • 44

1 Answers1

0

To generate a NACK, you need to

msg.generateACK(theAcknowlegementCode,theException);

Parameters:

  1. theAcknowlegementCode - If null, defaults to AcknowledgmentCode.AA. To generate a typical NAK, use AcknowledgmentCode.AE
  2. theException - The exceptions used to populate the ERR segment (if any)

See https://hapifhir.github.io/hapi-hl7v2/base/apidocs/index.html for more details

Also Why NACK message misses to create the Fields 3,4 and 5 in Hapi has an example

BlessedHIT
  • 1,849
  • 1
  • 14
  • 21