Skip to main content
Version: v0.0.2

Function: get278Response()

get278Response(delimiters, tx): X12ServicesReview | undefined

Extract a typed X12ServicesReview from a 278 response (005010X216). Same lenient walk as get278Request; the HCR decision under each event / service review is the response's safety-critical addition. Returns undefined only on a mis-routed ST-01.

Parameters

delimiters

Delimiters

tx

X12TransactionSet

Returns

X12ServicesReview | undefined

Example

import { parseX12, get278Response } from "@cosyte/x12";
const ix = parseX12(raw);
const tx = ix.groups[0]?.transactions.find((t) => t.st.elements[1] === "278");
if (tx !== undefined) {
const resp = get278Response(ix.delimiters, tx);
resp?.reviews[0]?.decision?.actionCode; // "A1"
resp?.reviews[0]?.decision?.reviewIdentificationNumber; // "AUTH123456"
}