Function: missingRequiredLoop()
missingRequiredLoop(
position,loopId,rationale):X12ParseWarning
Build an X12_MISSING_REQUIRED_LOOP warning. Emitted when a TR3-required
loop is structurally absent (e.g. no Loop 2010BB Payer Name inside a
Subscriber HL). The parser does not enforce situational rules - only
loops marked usage: "required" in the loop spec fire this warning.
The loop id is shape-validated before echoing.
Parameters
position
loopId
string
rationale
string
Returns
Example
import { missingRequiredLoop } from "@cosyte/x12";
const w = missingRequiredLoop(
{ segmentIndex: 12, interchangeIndex: 0, groupIndex: 0, transactionIndex: 0 },
"2010BB",
"Loop 2010BB Payer Name required when Loop 2000B (Subscriber HL) is present",
);