interpret271()
interpret271(
response):Eligibility
Defined in: packages/parser/src/profiles/271/eligibility/interpreter.ts:298
Sorts the benefit rows of a 271 into lists, and reads their numbers and dates. Codes are returned as they appear, without names. Values that cannot be read are undefined and reported in findings; this function does not throw on payer data.
Parameters
| Parameter | Type | Description |
|---|---|---|
response | Response271 | The result of read271. |
Returns
Each member's rows, and every error the payer reported.
Example
ts
import { readX12 } from '@ediocracy/parser';
import { interpret271, read271s } from '@ediocracy/parser/271';
for (const { response } of read271s(readX12(text))) {
const eligibility = interpret271(response);
const [member] = eligibility.members;
const isActive = member?.coverage.some(
entry => entry.isActive && entry.serviceTypes.includes('30'),
);
console.log(eligibility.requestErrors.length, isActive);
}