Skip to content
On this page


The HL7 module can be used to parse content in the hats-and-pipes format and get JSON back.


The parse(...) method takes an HL7 message (as a string) and returns an object as a Javascript representation of the message. For an idea of the structure you can consult a tool like


// Read the hl7Message from e.g. a file
var hl7Object = HL7.parse(hl7Message);
// Access the first-name of the patient (if available)
// See  and
var firstName = hl7Object["PID"][0]["5"]["1"];