Compile-time validated HL7v2 path sigil.
The ~h sigil validates path syntax, segment/field existence, repetition legality,
and component bounds at compile time, catching errors before the code runs.
Returns a %HL7v2.Path{} struct that can be passed to HL7v2.get/2 and
HL7v2.fetch/2.
Usage
import HL7v2.Sigil
path = ~h"PID-5" # validated at compile time
name = HL7v2.get(msg, path)
~h"PID-55" # ** (CompileError) PID has 39 fields, got 55
~h"XXX-1" # warning: unknown segment XXX (not compile error — may be valid)Path Syntax
~h"PID" — segment
~h"PID-5" — field 5
~h"PID-5.1" — component 1 of field 5
~h"PID-3[2]" — repetition 2 of field 3
~h"OBX[*]-5" — field 5 from ALL OBX segments
~h"OBX[2]-5" — field 5 from the 2nd OBX segment
~h"PID-3[*]" — ALL repetitions of PID-3
Summary
Functions
Sigil for compile-time validated HL7v2 paths.