Skip to main content
Version: v0.0.2

Function: controlNumberMismatch()

controlNumberMismatch(position, pair, header, trailer): X12ParseWarning

Build an X12_CONTROL_NUMBER_MISMATCH warning. Emitted when an envelope-trailer control number does not match its matching header - ISA-13 ↔ IEA-02, GS-06 ↔ GE-02, or ST-02 ↔ SE-02. Message carries the field pair label and the expected-vs-actual values bounded to the 9-char (interchange) / variable (group/transaction) numeric forms - these are control numbers, not PHI.

Parameters

position

X12Position

pair

string

string

trailer

string

Returns

X12ParseWarning

Example

import { controlNumberMismatch } from "@cosyte/x12";
const w = controlNumberMismatch(
{ segmentIndex: 1, interchangeIndex: 0, elementIndex: 2 },
"ISA-13/IEA-02",
"000000001",
"000000002",
);