Skip to main content
Version: v0.0.4

Function: formatHl7Position()

formatHl7Position(pos): string

Render an HL7 warning position as a value-free locator string built only from its numeric indices: e.g. seg[3].field[5].comp[1]. No segment content, no field value, ever appears; only the structural coordinates the parser reported.

Parameters

pos

Hl7PositionLike

The HL7 position (segment/field/repetition/component/subcomponent indices).

Returns

string

A value-free locator, e.g. "seg[3].field[5]".

Example

import { formatHl7Position } from "@cosyte/cli";

formatHl7Position({ segmentIndex: 3, fieldIndex: 5 }); // => "seg[3].field[5]"
formatHl7Position({ segmentIndex: 0 }); // => "seg[0]"