X12 EDI Parser and Generator for Java
Parse incoming X12 EDI into typed Java objects and generate outbound healthcare EDI from the same object model. Add one dependency to your application to parse, generate, validate, and convert EDI without running a separate API server.
- Parse
837,835,834, and277CAtransactions into business objects - Generate
835,837P, and837IEDI directly from Java - Validate EDI while parsing or generating it
- Convert one or many EDI files to JSON, JSON Lines, CSV, or Excel
- Process large files in chunks with predictable memory use
- Keep EDI and PHI inside your application and environment
One Object Model for Parsing and Generation
Work with familiar Java objects such as Claim, Payment, ServiceLine, PatientSubscriber, MemberCoverage, and OrgOrPerson instead of manually navigating X12 loops, segments, and elements.
The same model works in both directions:
- Parse inbound EDI into typed objects
- Create Java objects and write new EDI
- Parse an existing transaction, update it, and generate a revised transaction
The object model retains the data mapped from the source EDI and provides transaction-specific structures for:
837P,837I, and837Dclaims835claim payments and provider-level adjustments834member enrollment and coverage277CAclaim, provider, service-line, and receiver acknowledgments
See the Java parser user guide, EDI schemas, and Javadoc API for complete object and field definitions.
Generate 835 and 837 EDI from Java
Use EdiWriter to generate outbound X12 transactions without HTTP calls or JSON serialization:
- Generate
835healthcare payment and remittance advice transactions - Generate
837Pprofessional and837Iinstitutional claim transactions - Write interchange, functional-group, and transaction envelopes
- Automatically create control numbers and required closing segments
- Validate transactions, claims, and payments while writing
The generation API supports both new EDI creation and parse-modify-generate workflows. Your application can read an existing claim, update fields or service lines, recalculate totals, and write the result as a new EDI file.
Read the Java EDI generation guide or review the complete generation examples on GitHub.
Parse EDI into Typed Java Objects
The parser returns transaction-specific root objects in the same order they appear in the EDI file. Shared objects expose ISA, GS, and ST transaction data, while business roots expose claims, payments, enrollment, and acknowledgment details.
Use typed result collections when you only need one object type, or iterate over rootObjs() when you need to preserve file order across envelopes, transactions, business objects, and validation issues.
- Read claims, providers, subscribers, patients, diagnoses, and service lines
- Read payments, claim and line adjustments, remark codes, and provider-level adjustments
- Read members, sponsors, insurers, and health coverage records
- Read claim, provider, service-line, and receiver acknowledgment statuses
- Translate X12 qualifiers and selected codes into type-safe Java enums
View complete parsing examples on GitHub.
Validate as You Parse or Generate
Turn on validation when creating EdiParser, then retrieve structured issues from each parsing chunk or business object. EdiWriter also returns validation issues while it writes transactions, claims, and payments.
Use validation to identify problems with transaction structure, required data, data types, balancing, and supported healthcare code sets before data enters your application or leaves for a trading partner.
Validation issues include the affected loop, segment, element, source location, invalid value, and a descriptive message. Your application can log, store, display, filter, or reject records based on those results.
Convert EDI to JSON, CSV, or Excel
The bulk conversion API provides the same output and capabilities as the EDI Converter command-line tool, but runs directly inside your Java process.
- Convert individual files or entire directories
- Produce JSON, JSON Lines, CSV, or Excel
- Write each input to a separate output or combine multiple files
- Use predefined or customized CSV layouts
- Send converted output to a file or your own Java
Writer
Process Large Files Efficiently
The parser reads large files and transactions in configurable chunks. Process each batch and release it before reading the next one instead of loading the complete file into memory.
There is no parser-imposed limit on the number of claims in a transaction, the number of transactions in a file, or the input file size.
Use the Right Level of Abstraction
The business object model is the simplest option for supported healthcare transactions. When you need direct access to X12 structures, use the lower-level segment API to:
- Find segments by type, loop, or qualifier
- Navigate parent and child segment relationships
- Read elements by position or descriptive name
- Inspect element metadata and source values
- Convert the segment tree to Jackson JSON nodes
The segment API supports additional healthcare and non-healthcare X12 transactions, including 810, 850, 204, 820, and 210. The library also supports the NCPDP Telecom standard for pharmacy transactions.
Add It to Any Java Application
The library requires Java 17 or later and is distributed through our Maven repository. Add the dependency with Gradle or Maven; no separate server installation or network API integration is required.
The parser runs inside your application, has a small dependency footprint, and works in desktop applications, backend services, batch pipelines, and other Java environments.
Review the installation instructions or start with the runnable Java examples on GitHub.
Not using Java? Our EDI Converter and Generator provides API, command-line, and AWS Lambda options for other languages and deployment models.