Skip to main content
Version: v0.0.3

Interface: DotPath

Parsed representation of a dot-path string. Produced by parsePath, consumed by resolvePath. All numeric indices are normalized to the internal convention (segmentIndex = 0-based occurrence, fieldIndex = 1-based HL7 field number, repetitionIndex = 0-based rep, componentIndex and subcomponentIndex = 1-based HL7 positions).

Example

import { parsePath } from "@cosyte/hl7";
parsePath("OBX[2].5.1");
// { segmentType: "OBX", segmentIndex: 2, fieldIndex: 5,
// repetitionIndex: 0, componentIndex: 1 }

Properties

componentIndex?

readonly optional componentIndex?: number

1-based HL7 component position (within a repetition).


fieldIndex

readonly fieldIndex: number

1-based HL7 field number; maps to RawSegment.fields[fieldIndex].


repetitionIndex?

readonly optional repetitionIndex?: number

0-based repetition index; defaults to 0 when [N] is omitted.


segmentIndex

readonly segmentIndex: number

0-based occurrence of this segment type in the message.


segmentType

readonly segmentType: string

3-char segment identifier (e.g. "PID", "OBX", "ZPI").


subcomponentIndex?

readonly optional subcomponentIndex?: number

1-based HL7 subcomponent position (within a component).