Class: Hl7Field
The Hl7Field class represents one HL7 field. A field is a collection of components.
Constructors
constructor
• new Hl7Field(components
, context?
)
Creates a new HL7 field.
Parameters
Name | Type | Description |
---|---|---|
components | string [][] | The HL7 components. |
context | Hl7Context | Optional HL7 parsing context. |
Defined in
packages/core/src/hl7.ts:218
Properties
context
• Readonly
context: Hl7Context
Defined in
packages/core/src/hl7.ts:210
components
• Readonly
components: string
[][]
Defined in
packages/core/src/hl7.ts:211
Methods
get
▸ get(component
, subcomponent?
, repetition?
): string
Returns an HL7 component by index.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
component | number | undefined | The component index. |
subcomponent? | number | undefined | Optional subcomponent index. |
repetition | number | 0 | Optional repetition index. |
Returns
string
The string value of the specified component.
Defined in
packages/core/src/hl7.ts:230
toString
▸ toString(): string
Returns the HL7 field as a string.
Returns
string
The HL7 field as a string.
Defined in
packages/core/src/hl7.ts:244
parse
▸ Static
parse(text
, context?
): Hl7Field
Parses an HL7 field string into an Hl7Field object.
Parameters
Name | Type | Description |
---|---|---|
text | string | The HL7 field text. |
context | Hl7Context | Optional HL7 parsing context. |
Returns
The parsed HL7 field.
Defined in
packages/core/src/hl7.ts:254