Skip to content

X12 271 · 005010X279A1

edi*ocracy~

X12 271 eligibility responses, explained, and a TypeScript parser to read them.

quick-start.tspnpm add @ediocracy/parser
ts
import { readFile } from 'node:fs/promises';

import { readX12 } from '@ediocracy/parser';
import { read271s } from '@ediocracy/parser/271';

const text = await readFile('response.x12', 'utf8');

for (const { response } of read271s(readX12(text))) {
    for (const subscriber of response.subscribers) {
        const lastName = subscriber.name?.element(3);
        const firstName = subscriber.name?.element(4);
        console.log(`${firstName} ${lastName}: ${subscriber.benefits.length} benefits`);
    }
}
$JORDAN REED: 1 benefits

One line from a 271. Every segment starts with an ID, then elements separated by *, then ends with ~.

  • ISA GS STEnvelope
  • BHT TRNTransaction context
  • HL NM1 LS LEParty hierarchy
  • EB HSD DTP REF MSGBenefit
EBSegment IDBenefit
*
1EB01Active coverage
*
 EB02Empty
*
30EB03Health benefit plan coverage
*
 EB04Empty
*
SILVER PPOEB05Plan description
~