Skip to main content

core.hl7segment.getfield

Home > @medplum/core > Hl7Segment > getField

Hl7Segment.getField() method

Returns an HL7 field by index.

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

For example, to get the first field, use getField(1).

This aligns with HL7 field names such as PID.1, PID.2, etc.

Field zero is the segment name.

Signature:

getField(index: number): Hl7Field;

Parameters

Parameter

Type

Description

index

number

The HL7 field index.

Returns:

Hl7Field

The HL7 field.