HL7 Response
Sends an HL7 v2 ACK (acknowledgment) or NACK back to the hospital on the original MLLP socket. This is a terminal node — analogous to Node-RED's built-in http response node.
Details
When an inbound message arrives via HL7 In, the MLLP server attaches a socket ACK callback
to msg._hl7SendAck. This node calls that callback with the configured (or overridden)
ACK code, which sends an MLLP-framed MSH + MSA response back to the hospital.
The ACK is sent on the exact same TCP socket that received the original message — matching the HL7 v2 MLLP protocol requirement.
Inputs
ACK Codes
AA— Application Accept: message received and processed successfullyAE— Application Error: message received but processing failedAR— Application Reject: message rejected (bad format, unknown type, etc.)CA/CE/CR— Enhanced mode commit equivalents
Typical Flow
┌──────────┐ ┌────────────┐ ┌──────────────┐ ┌──────────────┐
│ HL7 In │──▶│ HL7 Parser │──▶│ Your Logic │──▶│ HL7 Response │
└──────────┘ └────────────┘ └──────────────┘ └──────────────┘
(terminal)
Dynamic ACK Code Example
// In a Function node before HL7 Response:
if (processingFailed) {
msg.ackCode = 'AE';
msg.errorMessage = 'Patient ID not found in EHR';
}
return msg;
Error Handling
If this node receives a message without msg._hl7SendAck, it means it was not wired
after an HL7 In node. The node will log an error and do nothing.
A safety timeout in the MLLP server will auto-send AE after 30 seconds if this node
is never reached (e.g. the flow throws an error).
Best Practices
- Always wire HL7 Response at the end of every flow that starts with HL7 In
- Add a catch node scoped to the flow, set
msg.ackCode = 'AE', and wire to HL7 Response for error safety - Use
AAonly after you have successfully processed the message - Include a meaningful
msg.errorMessagewithAE/ARfor hospital-side diagnostics