Skip to main content
Version: v0.0.2

Type Alias: X12_837ServiceLine

X12_837ServiceLine = X12_837ServiceLineProfessional | X12_837ServiceLineInstitutional | X12_837ServiceLineDental

Service-line discriminated union - one variant per TR3. The walker picks the variant from the segment id (SV1 → P, SV2 → I, SV3 → D). When an LX opens a service line with no SVx segment that follows before the next LX / SE, the line is dropped (an X12_UNEXPECTED_SEGMENT warning will have already fired if the body content was structurally impossible).

Example

import type { X12_837ServiceLine } from "@cosyte/x12";
declare const sl: X12_837ServiceLine;
switch (sl.variant) {
case "P": sl.procedureCode; sl.diagnosisPointers; break;
case "I": sl.revenueCode; break;
case "D": sl.toothInformation; break;
}