core.hl7segment.getfield | Medplum

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.
Fields are lazily parsed; the requested field is parsed and cached on demand.

Signature:

getField(index: number): Hl7Field;

Parameters

Parameter Type Description
index number The HL7 field index.

Returns:
Hl7Field
The HL7 field.