Skip to main content

core.hl7field

Home > @medplum/core > Hl7Field

Hl7Field class

The Hl7Field class represents one HL7 field. A field is a collection of components.

Signature:

export declare class Hl7Field 

Constructors

ConstructorModifiersDescription
(constructor)(components, context)Creates a new HL7 field.

Properties

PropertyModifiersTypeDescription
componentsreadonlystring[][]
contextreadonlyHl7Context

Methods

MethodModifiersDescription
get(component, subcomponent, repetition)Returns an HL7 component by index.
getComponent(component, subcomponent, repetition)

Returns an HL7 component by index.

Note that the index is 1-based, not 0-based.

For example, to get the first component, use getComponent(1).

This aligns with HL7 component names such as MSH.9.2.

parse(text, context)staticParses an HL7 field string into an Hl7Field object.
toString()Returns the HL7 field as a string.