The @ediocracy/parser package reads X12 text into typed interchanges, functional groups, and transaction sets. It also reads 271 eligibility responses into payers, providers, subscribers, and benefits.
INFO
The package isn't published to npm yet. After it's published, install it with the command in the following section.
Install the package
sh
pnpm add @ediocracy/parserRequirements
The package has the following requirements:
- Node.js 26 or later. The package is ECMAScript modules (ESM) only.
- The 005010X279A1 implementation guide. The 271 reader follows this guide. It also reads responses that use another version, and adds an
unexpected-versionfinding to each one.
What the package provides
The package provides the following functions and classes:
- The
readX12function reads any X12 text into interchanges, groups, transaction sets, and segments. For more information, see Read X12 envelopes. - The
read271andread271sfunctions read 271 transaction sets into theResponse271type. For more information, see Read 271 responses. - The
X12SyntaxErrorclass is the error that the parser throws for text that it can't read. The parser returns smaller problems as findings. For more information, see Errors and findings.
To get started, see the quick start.