Feedback on the future path of pyx12
Pyx12 is a python based ANSI X.12 to XML EDI translator and validator
Brought to you by:
esova,
johnholland
I have started updating pyx12 to support the changes in 5010. These primarily
include new 5010 version of the maps, and enabling support for repeating
element values.
It is also time to clean up the API and modernize the libraries used. Before I
make API breaking changes, I would like some feedback on what features are
actually being used.
Here are my current plans:
Drop the dependency on libxml2. Will use the core ElementTree xml parsing
library.
Drop the method of using XSL transforms on map files to alter the validation
of transactions. This is the wrong way to handle IG versus companion guide
differences, and one which will not work well with the 999 transaction
response.
Drop usage of psyco. Can use PyPy if needed.
Target Python 2.7
Convert command line parsing from getopt to argparse.
I anyone using the X12 <-> XML document conversion utilities? I have not used
those methods in a long time. My current path is the development of an
iterator based API for value inspection and extraction. x12context implements
some of this functionality.
I will likely restructure the map schema somewhat. Some XML elements may be
made attributes instead. Some superfluous elements may be removed. This should
not affect you unless you are using the XML maps directly.
Comments and feedback would be quite helpful.
I want to thank you for this project. I have used it for the last 2 years and
found it works wonderfully. I have a small office and can submit
electronically without paying a fortune for an EMR - just the monthly fee for
the clearinghouse.
I do use the XML to X12 conversion since I find it easy to build the XML file.
If that support went away I could just build the X12 directly - it would take
less storage (I save the XML in my db for reference) but it would be harder to
read. So I use xmlx12.py to convert, then x12norm.py, then x12html.py to scan
for errors. If there is a better way, please let me know.
Hello All,
I am implementing an EDI X12 834 parser for which I am using Python pyx12. I
have downloaded the installation package for pyx12 and was able to
successfully convert a sample EDI X12 834 file into an xml which was using ISA
version 00401 provided with pyx12. I have received some sample files from my
client which requires 00501 support. When I tried to convert them into an xml,
I got an error which is mentioned below. I guess the mapping for 00501 is not
available. Can you please guide me where can I find a mapping for 00501. Also,
please let me know if there is a work around for this.
$: x12xml -m /usr/local/share/pyx12/map/ 834_005010X220A1.X12
<x12simple></x12simple>
2011-11-01 12:07:08,618 ERROR error_handler 325 Line:1 ELE:7 - (:) is not a
valid code for Interchange Control Standards Identifier (ISA11) (:)
2011-11-01 12:07:08,619 ERROR error_handler 325 Line:1 ELE:7 - (00501) is not
a valid code for Interchange Control Version Number (ISA12) (00501)
<loop id="user-content-ISA_LOOP"> <seg id="user-content-ISA"> <ele id="user-content-ISA01">00</ele> <ele id="user-content-ISA02">
</ele> <ele id="user-content-ISA03">00</ele> <ele id="user-content-ISA04"> </ele> <ele id="user-content-ISA05">ZZ</ele> <ele id="user-content-ISA06">SENDER ID </ele> <ele id="user-content-ISA07">ZZ</ele>
<ele id="user-content-ISA08">RECEIVER ID </ele> <ele id="user-content-ISA09">010101</ele> <ele id="user-content-ISA10">0101</ele> <ele id="user-content-ISA11">:</ele> <ele id="user-content-ISA12">00501</ele> <ele id="user-content-ISA13">000000001</ele> <ele id="user-content-ISA14">0</ele> <ele id="user-content-ISA15">T</ele>
<ele id="user-content-ISA16">!</ele> </seg> Traceback (most recent call last): File
"/usr/local/bin/x12xml", line 174, in <module> sys.exit(not main()) File
"/usr/local/bin/x12xml", line 160, in main fd_997=None, fd_html=None,
fd_xmldoc=fd_xml, xslt_files=xslt_files) File "/usr/local/lib/python2.6/dist-
packages/pyx12/x12n_document.py", line 161, in x12n_document (icvn, fic,
vriic) pyx12.errors.EngineError: Map not found. icvn=00501, fic=BE,
vriic=005010X220A1 </module></loop>
Thanks for the help !!!
So, it sounds like the default, simple XML conversion is being used. I can
continue to support that type. I will drop the optional "idtag" and
"idtagqual" formats.
The current 5010 work is being checked into the Subversion source code
repository. I do not expect to create a release for a month or so. The svn
trunk should be considered alpha code at the moment. A good deal is being
changed. However, I am doing unit and integration testing. Most of the time,
the code set is functional.
John
I am currently updating a 4010 installation to 5010. The old 4010 system used
this project extensively, especially the X12 <-> XML functions. It's allowed
more experienced edi guys to take a look at a file and tell us if it looks
good. I wish I knew more about python, otherwise I'd pitch in with some of the
code updating. Maybe this will happen anyway, time will tell...
Hey John, what a great tool. Thanks for all of your hard work on this stuff.
Any plans for a 5010 837I mapping file?
This tool practically saved my life when we were doing our initial 837P 4010
implementation a couple years ago. I just finished a 5010 837P upgrade, and it
was H-E-L-L. It drove me to do crazy things, like sign up with Verizon.