Function: hlParentLevelInvalid()
hlParentLevelInvalid(
position,hlId,hlLevel,parentHlId,parentLevel,expectedParentLevel):X12ParseWarning
Build an X12_HL_PARENT_LEVEL_INVALID warning. Emitted when an HL's
level code (HL-03) is inconsistent with its declared parent's level
code per the 837 TR3 (e.g. a 22 Subscriber claiming a 22
Subscriber as its parent - the parent must be 20 Information
Source). The verbatim level codes are shape-validated before echoing.
Parameters
position
hlId
string
hlLevel
string
parentHlId
string
parentLevel
string
expectedParentLevel
string
Returns
Example
import { hlParentLevelInvalid } from "@cosyte/x12";
const w = hlParentLevelInvalid(
{ segmentIndex: 14, interchangeIndex: 0, groupIndex: 0, transactionIndex: 0 },
"3",
"23",
"2",
"22",
"20",
);