Class: Hl7Message
The Hl7Message class represents one HL7 message. A message is a collection of segments.
Constructors
constructor
• new Hl7Message(segments
, context?
)
Creates a new HL7 message.
Parameters
Name | Type | Description |
---|---|---|
segments | Hl7Segment [] | The HL7 segments. |
context | Hl7Context | Optional HL7 parsing context. |
Defined in
packages/core/src/hl7.ts:53
Properties
context
• Readonly
context: Hl7Context
Defined in
packages/core/src/hl7.ts:45
segments
• Readonly
segments: Hl7Segment
[]
Defined in
packages/core/src/hl7.ts:46
Methods
get
▸ get(index
): undefined
| Hl7Segment
Returns an HL7 segment by index or by name.
Parameters
Name | Type | Description |
---|---|---|
index | string | number | The HL7 segment index or name. |
Returns
undefined
| Hl7Segment
The HL7 segment if found; otherwise, undefined.
Defined in
packages/core/src/hl7.ts:63
getAll
▸ getAll(name
): Hl7Segment
[]
Returns all HL7 segments of a given name.
Parameters
Name | Type | Description |
---|---|---|
name | string | The HL7 segment name. |
Returns
An array of HL7 segments with the specified name.
Defined in
packages/core/src/hl7.ts:75
toString
▸ toString(): string
Returns the HL7 message as a string.
Returns
string
The HL7 message as a string.
Defined in
packages/core/src/hl7.ts:83
buildAck
▸ buildAck(): Hl7Message
Returns an HL7 "ACK" (acknowledgement) message for this message.
Returns
The HL7 "ACK" message.
Defined in
packages/core/src/hl7.ts:91
parse
▸ Static
parse(text
): Hl7Message
Parses an HL7 message string into an Hl7Message object.
Parameters
Name | Type | Description |
---|---|---|
text | string | The HL7 message text. |
Returns
The parsed HL7 message.
Defined in
packages/core/src/hl7.ts:128