Code Monkey home page Code Monkey logo

berryworkssoftware / edireader Goto Github PK

View Code? Open in Web Editor NEW
119.0 20.0 45.0 1.18 MB

EDIReader is a flexible and lightweight EDI parser, written in pure Java with many integration options. It has handled millions of transactions in a wide variety of products, services, industries, platforms, and custom integrations. Available as the open source Community Edition and the Premium Edition with added-value modules.

License: GNU General Public License v3.0

Java 97.92% HTML 2.05% Shell 0.03%
edi edireader sax x12 edifact 837 835 834 270 271

edireader's Introduction

EDIReader Community Edition

Introduction

EDIReader is a flexible and lightweight EDI parser, written in pure Java using the SAX API allowing for many integration options. Released as open source (GPL3) in 2004 and enhanced steadily since then, it has handled millions of transactions in a wide variety of products, services, industries, platforms, and custom integrations.

Features Summary

The EDI parser supports:

  • Automatic detection of EDI standard and syntax characters (terminators, delimiters, separators)
  • X12 and EDIFACT
  • Segment loops:
    • detects segment loops/groups within a transaction/message
    • using EDIReader plugins
    • reflected in XML as nested elements
  • Handles multiple:
    • interchanges per input stream
    • functional groups per interchange
    • transactions/messages per functional group
  • Command line tools:
    • EDI to XML
    • splitting EDI input into multiple XML single-transaction output files
    • scanning EDI input to produce a summary of transactions
  • Java API
    • based on XML push-parser patterns
    • can be configured with custom SAX content handlers
  • Detailed error messages for EDI syntax issues
    • for example: Segment count error in UNT segment. Expected 8 instead of 88 at segment 9, field 2
    • option to continue parsing after recoverable errors
  • High performance
    • parses arbitrarily large input streams
    • without growing in-memory data structures or file I/O
  • Acknowledgments as a by-product of parsing
    • 997, 999 (X12)
    • CONTRL (EDIFACT)
  • Binary sequences
    • BIN segment (X12)
    • UNO/UNP (EDIFACT)

Primary Interfaces

EDIReader may be easily integrated using:

  • Command line interface tools accepting filename arguments
  • Java API for embedding in your own Java system

Technical Notes

  • Pure Java, with no dependence on third-party libraries
    • except for SLF4J as described below
    • avoids dependency version issues
    • avoids licensing issues
    • compatible with a wide variety of Java platforms, including Android
  • Uses Simple Logging Facade for Java (SLF4J)
    • an ultra-thin logging API
    • allows deployment-time binding with log4j, java.util.logging, and other logging frameworks
  • Thread safe, used in multi-threading applications
  • Compatible with Java 8 syntax
  • Runnable with Java 8 and later

License and Ownership

  • Intellectual property of BerryWorks Software
  • Published as open source software under the GPL
  • Can be licensed without GPL constraints
    • along with the EDIReader Framework containing value-added extensions
    • including support/maintenance agreement
    • for either End Users or Service Providers

The EDIReader Framework

The EDIReader Framework is a set of Java modules built on top of the Community Edition. Unlike the Community Edition, it is not released as open source but may be licensed from BerryWorks Software. It adds many additional EDI features such as:

  • EDIWriter, producing EDI output from XML of the style produced by EDIReader
  • EDI Annotations, augmenting the XML from EDIReader with
    • transaction/message descriptions
    • segment descriptions
    • element and sub-element descriptions
    • code value descriptions
  • Enhanced support for HIPAA transactions
    • 270, 271, 276, 277, 278, 834, 835, 837
    • Loop qualifiers included in XML (for example: 1000A, 2010AB)
    • HL hierarchies reflected via nested XML elements
  • Segment loop awareness via an extensive library of version-specific plugins
  • Splitting EDI input containing many transactions into many single-transaction EDI output files
  • EDI validation and compliance checking, using XSDs purchased from X12
  • Support for additional EDI and EDI-like formats:
    • HL7
    • NCPDP
    • TRADACOMS
  • JSON support
    • EDI to JSON, analogous to EDI to XML
    • JSON to EDI, analogous to EDIWriter
    • see the edi-json project also at GitHub
  • YAML support
    • EDI to YAML, annotated for human readability
  • Includes EDI samples for many transactions/versions
  • Includes suite of JUnit test cases
  • Available with full Java source code as Maven project

edireader's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edireader's Issues

Support for transaction 310 and 315 EDI

Hello team,

I attempted to parse the transactions 310 and 315 EDI files using edireader library.

However, it failed with message as

Invalid beginning of segment at segment 58

Line 58 is EOF.

If I use the sample edi file provided in another project - https://github.com/BerryWorksSoftware/edi-json/blob/master/Sample824.edi

then the program runs fine.

I suspect the support is limited to only the specific versions that are mentioned in the readme file - 270, 271, 276, 277, 278, 834, 835, 837 ?

If this is not the case, and if it is expected that edireader library should be able to parse any EDI file then probably I will add the EDI file here by removing sensitive data and the code that I am using so that the issue can be triaged.

Please let me know.
Thanks.

Trailer Records in 835 not in JSON output

Good Morning, I am using the community edition of the edireader and processing 835 messages to JSON. I'm not seeing where the SE, GE or IEA segments are being written out. Is that by design or is there an option we can enable to output those segments?

Thanks,

The 999 acknowledgement is kept in memory until parsing is ready

EDIAbstractReader.setAlternateAcknowledgment(Writer) uses a BranchingWriter when writing EDI 999 acks. There is a small inconsistency in the code, since BranchingWriter is documented as "not appropriate for arbitrarily large volumes of data" and the parsed files can be of arbitrary length.

For example, with 29k transactions, the in memory size of the trunk and branch StringWriters total to 2.4MB.

Missing Loops when parsing a 837 edi

EdiReader 5.4.3 is not creating loop when converted from edi to xml. I am using EDItoXML.java to convert a sample 837 file to xml which is generating loop structures for version 4.7.3 but not for the latest version. This is issue is caused due to the missing 837 plugin(ANSI_837.java) in 5.4.3 .

https://github.com/BerryWorksSoftware/edi-json

I saw the following project you did and I really liked a method here. ediToJson.asJson(reader); Is there a way to convert the same from edi to xml? ediToXml.asXml(String ediData); If there is, can you show it because I want to assign it directly to a variable, not to a file. So using the code below needn't for me.
SAXSource source = new SAXSource(createEDIReader(), new InputSource(inputReader));
StreamResult result = new StreamResult(generatedOutput);
TransformerFactory.newInstance().newTransformer().transform(source, result);

Do we have the ability to customize your xml file?

Hello. First of all, thank you for doing this. There is one more thing I want to add from you. I saw using your project to create an xml that handles data exchange between un edifact passenger and airlines. What I want is this. Do we have the possibility to change the XML tags that are formed, so that we can create special tags for ourselves? Please I want you to help me with this, because I'm working on a project right now and I need to convert the edifact file pnrgov to xml and then java model classes. If it is convenient for you, I can assign you what kind of xml file to create specifically. I can also pay you for it.

Edifact missing Sender & Receiver qualifier of UNG segment

So I have this EDIFACT UNG
UNG+INVOIC+LOCK:02+CBP-ACE-TEST:02+041013:1901+16+UN+D:98A:'

Expected:
<group GroupType="INVOIC" ApplSender="LOCK" ApplSenderQual="02" ApplReceiver="CBP-ACE-TEST" ApplReceiverQual="02" Date="041013" Time="1901" Control="16" StandardCode="UN" MessageVersion="D" MessageRelease="98A" Code="">

Actual:
<group GroupType="INVOIC" Control="16" StandardCode="UN">

Modify length parameters for ISA elements.

I have EDIx12 837 messages which has wrong length in ISA elements.

For ex. ISA03 should be minimum 10 characters, but in my message, it is only 3 characters.

How can I change the length properties?

Help with Setup

Any source you can point me to in terms of the Java that will be needed. I operate primarily in C# and JS.

Alternate XML output?

More of a comment about a potential extension. We load the output into a document database and use XPath to access the data. As the elements have an @Id attribute in them, the XPaths get a bit ugly. To that end, we run the output through the following XSLT which moves the @Id into the element name (when a segment or element). It would be fantastic if element naming was an option so we could stop using the XSLT.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="no"/>
    <xsl:strip-space elements="*"/>

    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="segment[@Id]">
        <xsl:element name="{normalize-space(@Id)}">
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="element[@Id]">
        <xsl:element name="{normalize-space(@Id)}">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

How to run EDIReader?

I want to install it on Ubuntu? How can I install this tool and process my EDI messages? Any guidance on this would be great.

Error on EDIScanner xample

I'm new on reading EDI Files, currently i need to understand really fast for my job. I was testing the EDIScanner project but it sends me an error.

Usage: EDIScanner inputfile [-o outputfile]
Exception in thread "main" java.lang.RuntimeException: Missing or invalid command line arguments
at com.berryworks.edireader.demo.EDIScanner.badArgs(EDIScanner.java:149)
at com.berryworks.edireader.demo.EDIScanner.main(EDIScanner.java:139)
C:\Users\Bottago SA\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1

Any suggestion what am i doing wrong?

publish release notes

Could you please publish the release notes, to provide a brief overview of the changes between each version?

Unknown Syntax Identifier in UNB segment: UNOL

I try to parse a file starting with this segments :

UNA:+,? 'UNB+UNOL:3+

I have found that the parser is expecting the "UNO" string to be followed by a character from A to K but I do not understand why ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.