Skip to main content
Version: v0.0.8

Function: controlNumberMismatch()

controlNumberMismatch(position, pair): 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.

Neither side is echoed, not truncated and not hashed. A control number is free-form trading-partner text on five of the six slots (only ISA-13 is fixed-width), routinely carries a batch or patient-account identifier in the field, and is entirely sender-controlled. Read isa.elements[13], iea.elements[2], gs.elements[6], ge.elements[2], st.elements[2] and se.elements[2] off the model when you need the values.

Parameters

position

X12Position

pair

X12ControlNumberPair

Returns

X12ParseWarning

Example

import { controlNumberMismatch, CONTROL_NUMBER_PAIRS } from "@cosyte/x12";
const w = controlNumberMismatch(
{ segmentIndex: 6, interchangeIndex: 0, elementIndex: 2 },
CONTROL_NUMBER_PAIRS.INTERCHANGE,
);