Skip to main content
Version: v0.0.2

Function: build278Response()

build278Response(spec): X12Interchange

build278Response - assemble a 005010X216 278 Response around the supplied spec. The HCR actionCode on each review's decision is emitted VERBATIM (never inferred), so the response round-trips the exact certification outcome through "./get-278.js".get278Response.

Parameters

spec

Build278Spec

Returns

X12Interchange

Example

import { build278Response } from "@cosyte/x12";
declare const base: import("@cosyte/x12").Build278Spec;
const ix = build278Response({
...base,
subscriber: {
...base.subscriber,
reviews: [{ requestCategoryCode: "HS", certificationTypeCode: "I", decision: { actionCode: "A1", reviewIdentificationNumber: "AUTH123456" } }],
},
}); // ST-03 = 005010X216, HCR*A1*AUTH123456