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
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(segments, context) | Creates a new HL7 message. |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| context | readonly | Hl7Context | |
| header | readonly | Hl7Segment | Returns the HL7 message header. |
| segments | readonly | Hl7Segment[] |
Methods
| Method | Modifiers | Description |
|---|---|---|
| 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) | static | Parses an HL7 message string into an Hl7Message object. |
| toString() | Returns the HL7 message as a string. |