Skip to main content
Version: v0.0.2

Interface: X12ProfileQuirk

A single trading-partner deviation captured by a profile. Every quirk is fixture-grounded: fixture points at a real Tier-2 corpus file that demonstrates the deviation, and sourceCategory records where the quirk was observed. This is the locked hard rule - a quirk without a demonstrating fixture is forbidden, enforced both by this required field and by the accuracy test.

Example

import type { X12ProfileQuirk } from "@cosyte/x12";
const quirk: X12ProfileQuirk = {
id: "payer-loop-ref-2u",
effect: "adds",
summary: "Payer Loop 1000A carries a REF*2U additional payer identifier.",
fixture: "remit/835-availity-quirk.edi",
sourceCategory: "Availity 835 ERA companion guide - payer-loop REF",
};

Properties

effect

readonly effect: X12ProfileEffect

Which describe() bucket this quirk renders into.


expectedWarnings?

readonly optional expectedWarnings?: readonly X12WarningCode[]

Warning codes this quirk leads a consumer to EXPECT when the deviation is present. Drives partitionWarnings. Often empty: the lenient parser absorbs most corpus deviations with zero warnings, and that "lossless, no warning" outcome is itself the documented behavior.


fixture

readonly fixture: string

Path to the Tier-2 fixture demonstrating the deviation, relative to test/fixtures/ (e.g. "remit/835-availity-quirk.edi"). REQUIRED - the locked hard rule. The accuracy test parses this file and asserts the claimed deviation is present.


id

readonly id: string

Stable, kebab-case identifier - unique within a profile's quirk set.


sourceCategory

readonly sourceCategory: string

Where the deviation was observed (companion guide / corpus category).


summary

readonly summary: string

One-line human summary. NEVER contains PHI - describes structure only.