Class: Hl7Segment
The Hl7Segment class represents one HL7 segment. A segment is a collection of fields. The name field is the first field.
Properties
context
• Readonly
context: Hl7Context
Defined in
packages/core/src/hl7.ts:155
name
• Readonly
name: string
Defined in
packages/core/src/hl7.ts:156
fields
• Readonly
fields: Hl7Field
[]
Defined in
packages/core/src/hl7.ts:157
Constructors
constructor
• new Hl7Segment(fields
, context?
)
Creates a new HL7 segment.
Parameters
Name | Type | Description |
---|---|---|
fields | string [] | Hl7Field [] | The HL7 fields. |
context | Hl7Context | Optional HL7 parsing context. |
Defined in
packages/core/src/hl7.ts:164
Methods
get
▸ get(index
): Hl7Field
Returns an HL7 field by index.
Parameters
Name | Type | Description |
---|---|---|
index | number | The HL7 field index. |
Returns
The HL7 field.
Defined in
packages/core/src/hl7.ts:179
toString
▸ toString(): string
Returns the HL7 segment as a string.
Returns
string
The HL7 segment as a string.
Defined in
packages/core/src/hl7.ts:187
parse
▸ Static
parse(text
, context?
): Hl7Segment
Parses an HL7 segment string into an Hl7Segment object.
Parameters
Name | Type | Description |
---|---|---|
text | string | The HL7 segment text. |
context | Hl7Context | Optional HL7 parsing context. |
Returns
The parsed HL7 segment.
Defined in
packages/core/src/hl7.ts:197