The Hl7Segment class represents one HL7 segment. A segment is a collection of fields. The name field is the first field.
export declare class Hl7Segment
|(constructor)(fields, context)||Creates a new HL7 segment.|
|get(index)||Returns an HL7 field by index.|
|getComponent(fieldIndex, component, subcomponent, repetition)|
Returns an HL7 component by field index and component index.
This is a shortcut for
Note that both indexex are 1-based, not 0-based.
For example, to get the first component, use
This aligns with HL7 component names such as MSH.9.2.
Returns an HL7 field by index.
Note that the index is 1-based, not 0-based.
For example, to get the first field, use
This aligns with HL7 field names such as PID.1, PID.2, etc.
Field zero is the segment name.
|parse(text, context)||Parses an HL7 segment string into an Hl7Segment object.|
|toString()||Returns the HL7 segment as a string.|