Academy
⌘K
Getting Started
  • Platform Overview
  • AWS Marketplace Setup
  • Quickstart Guide
Connections
  • Overview
Workflow Builder
  • Overview
  • Nodes Catalog
Helix AI Assistant
  • Overview
Mapping Engine
  • Overview
Workflow Library
  • Overview
  • HL7
  • FHIR
  • Insurance
  • Agentic
  • Mapping
Security & Infrastructure
  • Architecture
  • HIPAA Compliance
  • Performance & Scalability
← Back to ConnectHealth
Get Started
Back to Nodes
HL71 input → 0 outputs

HL7 Response

ackCode (string)errorMessage (string)_hl7SendAck (function)HL7HL7 ResponseData flowProperty

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

ackCode string
Override the node's configured ACK code at runtime. Values: AA, AE, AR. Example: set msg.ackCode = 'AE' in a function node to conditionally reject a message.
errorMessage string
Override the MSA.3 error text at runtime. Used with AE and AR codes to send a meaningful reason to the hospital.
_hl7SendAck function
Internal. ACK callback injected by HL7 In. Do not modify.

ACK Codes

  • AA — Application Accept: message received and processed successfully
  • AE — Application Error: message received but processing failed
  • AR — 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 AA only after you have successfully processed the message
  • Include a meaningful msg.errorMessage with AE/AR for hospital-side diagnostics