HIPAA X12 document validator and converter
  • Python 94.4%
  • XSLT 4%
  • Makefile 1.6%
Find a file
2021-05-29 14:25:12 -04:00
.github/workflows update release action 2021-05-29 13:48:02 -04:00
bin remove unused config parameters 2013-08-06 01:04:37 -04:00
pyx12 remove dict keys to list 2021-05-29 14:25:12 -04:00
.coveragerc do not report on some methods 2013-08-23 00:18:18 -04:00
.gitattributes Introduce end-of-line normalization 2012-07-17 02:58:12 -04:00
.gitignore fix xml parsing, force xml files to utf-8 (no BOM) 2021-05-26 15:22:38 -04:00
2to3.changelog Typos 2016-07-21 18:57:14 +07:00
LICENSE.txt Update copyright headers 2015-02-13 16:32:44 -05:00
MANIFEST.in tweak MANIFEST.in, release notes 2013-08-08 17:36:05 -04:00
pyx12.pyproj Fixes #42. Create fake loop to wrap LS/LE explicit pair. 2018-07-05 17:00:07 -04:00
pyx12.sln update to VS 2015 2016-06-03 11:24:24 -04:00
README.md remove six install dependency from setup 2021-05-26 17:19:14 -04:00
RELEASE remove __future__ imports 2021-05-28 19:30:50 -04:00
requirements.dev.txt clean up old debug tools 2013-08-23 13:13:56 -04:00
setup.cfg start support for wheel distribution 2013-12-18 11:13:32 -05:00
setup.py remove __future__ imports 2021-05-28 19:30:50 -04:00
TODO misc TODO 2013-08-06 04:51:47 -04:00

Pyx12

Build Status

Pyx12 is a HIPAA X12 document validator and converter. It parses an ANSI X12N data file and validates it against a representation of the Implementation Guidelines for a HIPAA transaction. By default, it creates a 997 response for 4010 and a 999 response for 5010. It can create an html representation of the X12 document or can translate to and from an XML representation of the data file.

Usage

As a command line tool

x12valid <filename>

To fix common X12 structural errors

x12norm --fix --eol <filename>

Code Examples

Iterate over a loop.  Alter children. Show changes
    src = pyx12.x12context.X12ContextReader(param, errh, fd_in)
    for datatree in src.iter_segments('2300'):
        # do something with a 2300 claim loop
        # we have access to the 2300 loop and all its children
        for loop2400 in datatree.select('2400'):
            print(loop2400.get_value('SV101'))
            # update something
            loop2400.set_value('SV102', 'xx')
            # delete something
            if loop2400.exists('PWK'):
                loop2400.delete('PWK')
        # iterate over all the child segments
        for seg_node in datatree.iterate_segments():
            print(seg_node.format())

Prerequisites

Pyx12 uses some runtime features of setuptools / distribute. If you use pip to install, all is good. If not, install setuptools first.

Get setuptools http://pypi.python.org/pypi/setuptools/

Get pip http://www.pip-installer.org/en/latest/installing.html

Install

Install system-wide

pip install pyx12

Or install in a virtual environment

virtualenv my_env
pip -E my_env install pyx12

Licensing

Pyx12 has a BSD license. The full license text is included with the source code for the package.