Skip to main content

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

NameTypeDescription
componentsstring[][]The HL7 components.
contextHl7ContextOptional 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

NameTypeDefault valueDescription
componentnumberundefinedThe component index.
subcomponent?numberundefinedOptional subcomponent index.
repetitionnumber0Optional 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

NameTypeDescription
textstringThe HL7 field text.
contextHl7ContextOptional HL7 parsing context.

Returns

Hl7Field

The parsed HL7 field.

Defined in

packages/core/src/hl7.ts:254