HL71 input → 1 output
HL7 Parser
Parses HL7 messages into structured objects with metadata extraction.
Inputs
Outputs
Details
This node parses HL7 v2.x messages into structured objects using the node-hl7-client library.
The node extracts metadata from the MSH (Message Header) segment and patient information from the PID (Patient Identification) segment if available. The parsed message object provides methods to access any segment and field in the HL7 message.
Working with Parsed Message
The parsed message is a node-hl7-client Message object. You can access segments and fields using:
msg.payload.message.get('PID')- Get a specific segmentmsg.payload.message.get('PID.5.1')- Get a specific field (e.g., patient last name)msg.payload.message.get('OBX').toArray()- Get all instances of a repeating segmentmsg.payload.message.toString()- Convert back to HL7 string format
Error Handling
The node will report errors for:
- Missing HL7 message in input
- Invalid HL7 message format
- Missing MSH segment
Best Practices
- Validate HL7 message structure before parsing
- Use
msg.payload.metadatato quickly identify message type - Handle parsing errors with a catch node
- Log original message for debugging failed parses
- Use
msg.payload.patientfor quick access to patient info - Connect to HL7 Acknowledgement node to send ACK responses