Skip to main content
Version: v0.0.2

Interface: Build277Spec

The complete spec for "./build-277.js".build277 / "./build-277.js".build277CA: the envelope plus the nested informationSources → receivers → providers → subscribers → (dependents) tree the builder walks depth-first to compute the HL spine.

Example

import { build277, X12Decimal, type Build277Spec } from "@cosyte/x12";
const spec: Build277Spec = {
envelope: {
senderId: "MEDPAY", receiverId: "PROVIDER",
interchangeDate: "260601", interchangeTime: "1200",
interchangeControlNumber: "000000001",
groupControlNumber: "1", transactionSetControlNumber: "0001",
},
informationSources: [{
entity: { entityIdentifierCode: "PR", entityTypeQualifier: "2", name: "MEDPAY INSURANCE", idQualifier: "PI", idCode: "00123" },
receivers: [{
entity: { entityIdentifierCode: "41", entityTypeQualifier: "2", name: "CLEARINGHOUSE", idQualifier: "46", idCode: "CH001" },
providers: [{
entity: { entityIdentifierCode: "1P", entityTypeQualifier: "2", name: "ANYTOWN CLINIC", idQualifier: "XX", idCode: "1234567890" },
subscribers: [{
member: { entityIdentifierCode: "QC", entityTypeQualifier: "1", lastName: "DOE", firstName: "JANE" },
claims: [{
trace: { traceTypeCode: "2", referenceId: "CLAIM001" },
statuses: [{ statuses: [{ categoryCode: "A2", statusCode: "20" }], totalChargeAmount: X12Decimal.fromString("150.00")! }],
}],
}],
}],
}],
}],
};
const ix = build277(spec);

Properties

envelope

readonly envelope: Build277EnvelopeSpec

Interchange + group + transaction identity.


informationSources

readonly informationSources: readonly Build277InformationSourceSpec[]

Loop 2000A information sources (at least one required).