EDI Parser for Java

Our Java EDI parser handles all healthcare EDI transactions, and it does not require any EDI knowledge.

The parser returns regular business objects (POJOs) such as Claim, Payment, ServiceLine, Subscriber and so on. All X12 EDI segments and elements have been mapped to appropriate properties of the business objects.

The parser is easy to use:

var parser = new EdiParser(ediFile);
// parse all transactions in the file
EdiParsingResults results = parser.parse();
// results contains claims, payments, etc.
List<Claim> claims = results.claims();
Claim sampleClaim = claims.get(0);
// get some key attributes of the claim
BigDecimal billedAmount = sampleClaim.chargeAmount();
String patientControlNumber = sampleClaim.patientControlNumber();
LocalDate serviceDate = sampleClaim.serviceDateFrom();
// Providers
OrgOrPerson billingProvider = sampleClaim.billingProvider();
String providerNpi = billingProvider.identifier();
// Service lines
ServiceLine line1 = sampleClaim.lines().get(0);
String procedureCode = line1.procedure().code();

Claim is the root of the object graph when parsing 837s. It aggregates information from segments from the “Claim Information” loop, including “CLM”, all the “REF” segments, all the dates segments and so on. The claim also contains entities from the billing provider and the subscriber loops.

As one would expect, a claim contains a list of service lines, and each line contains line level data, such as CPT codes, amounts and providers, obtained from the appropriate segments in the “Service Line Number” loop.

The parser translates many of the EDI qualifiers and codes to Java enums. For example, patient gender code from the DMG segment is parsed as GenderType enum. Entity type qualifier is translated into EntityType enum.

Overall, our domain model is intuitive and can be easily adopted by any developer with basic familiarity of healthcare claims.

If needed, developers can work directly with X12 EDI segments and elements. The parser returns the list of segments alongside the list of claims, payments and other domain objects.

A segment can contain child segments reflecting the EDI loop hierarchy. There are various methods to search for specific segments and loops.

A segment contains the list of Elt objects representing EDI elements. Elt contains the element’s name, value, data type and so on.

Here is a simple example:

var parser = new EdiParser(ediFile837p);
EdiParsingResults results = parser.parse();
// Get the tree of all segments
List<EdiSeg> segs = results.segs();
// or you can search by type, name, etc
var clpSeg = results.findFirstSegByType(SegmentType.CLP);
// human-readable name
var segName = clpSeg.name();
// Iterate over elements
for (Elt elt : clpSeg.eltSet().elts()) {
    // element is a name/value pair
    var eltName = elt.name();
    var val = elt.val();
    // You can also access various metadata such as type
    var eltType = elt.dataType();
    if (eltType == DataType.INT) {
        var intVal = elt.intVal();

In order to parse large files, the parser can read a file in chunks consisting of the specified number of EDI transactions. The client’s application can then process each chunk in parallel if needed. For example, claims from each chunk can be persisted using reactive drivers provided by Spring Boot.

var parser = new EdiParser(ediFile);
while (true) {
    // parse 2 transactions at a time
    var results = parser.parse(2);
    if (results.isDone()) {
    // get all claims for this chunk
    var claims = results.claims();
    // your logic goes here
    // ...

Our EDI parser underpins our EDI Viewer and Claim Insight products. It has been battle-tested against many thousands of EDI files.

The parser is a regular Java library with minimal dependencies, so it can be easily incorporated into any Java application.

Please fill out the form below to get access to the parser. We’ll send you a link to our Maven repo and the instructions.