Skip to main content
Version: v0.0.3

Type Alias: NackReason

NackReason = "handler-rejected" | "uncorrelatable-inbound" | "discarded-bytes"

Why the server sent a negative acknowledgement instead of AA on the auto-ACK path. A stable, PHI-free enum (no payload bytes, no control ID), safe to log and to key metrics on.

  • 'handler-rejected', a commit-gated onMessage handler threw/rejected (the commit contract: a positive ACK cannot precede a successful commit).
  • 'uncorrelatable-inbound', the inbound could not carry a correlatable positive ACK (no readable MSH, an empty MSH-10, or a batch/concatenated-message shape). A positive AA here names a control ID the sender cannot match → timeout → resend → duplicate clinical message. See rawAckUncorrelatable.
  • 'discarded-bytes', the decoder flagged MLLP_TRAILING_BYTES for this frame: a mid-payload VT made it discard accumulated bytes and deliver only the fragment after it. The clinical message was destroyed in transit; a positive AA would tell the sender a message we never received was delivered.