Skip to main content

core.hl7message

Home > @medplum/core > Hl7Message

Hl7Message class

The Hl7Message class represents one HL7 message. A message is a collection of segments.

Signature:

export declare class Hl7Message 

Constructors

ConstructorModifiersDescription
(constructor)(segments, context)Creates a new HL7 message.

Properties

PropertyModifiersTypeDescription
contextreadonlyHl7Context
headerreadonlyHl7SegmentReturns the HL7 message header.
segmentsreadonlyHl7Segment[]

Methods

MethodModifiersDescription
buildAck()Returns an HL7 "ACK" (acknowledgement) message for this message.
get(index)Returns an HL7 segment by index or by name.
getAll(name)Returns all HL7 segments of a given name.
getAllSegments(name)Returns all HL7 segments of a given name.
getSegment(index)

Returns an HL7 segment by index or by name.

When using a numeric index, the first segment (usually the MSH header segment) is at index 0.

When using a string index, this method returns the first segment with the specified name.

parse(text)staticParses an HL7 message string into an Hl7Message object.
toString()Returns the HL7 message as a string.