Giter Site home page Giter Site logo

edi-835-parser's Introduction

EDI 835 Parser

Python - 3.9.0+ Maintenance GitHub license Downloads

edi-835-parser: a lightweight EDI 835 file parser

This package provides a simple-to-use Python interface to EDI 835 Health Care Claim Payment and Remittance Advice files.

This package is made publicly available by Senscio Systems, the company behind the Ibis Program, an industry leading healthcare initiative that helps people take control of their chronic condition management.

Please consider taking two minutes to give feedback.

Installation

Binary installers for the latest released version are at the Python Package Index. Please note that you need to run Python 3.9 or higher to install the edi-835-parser.

pip install edi-835-parser

Usage

To parse an EDI 835 file simply execute the parse function.

from edi_835_parser import parse

path = '~/Desktop/my_edi_file.txt'
transaction_set = parse(path)

The parse function also works on a directory path.

from edi_835_parser import parse

path = '~/Desktop/my_directory_of_edi_files'
transaction_sets = parse(path)

In both cases, parse returns an instance of the TransactionSets class. This is the class you manipulate depending on your needs. For example, say you want to work with the transaction sets data as a pd.DataFrame.

from edi_835_parser import parse

path = '~/Desktop/my_directory_of_edi_files'
transaction_sets = parse(path)

data = transaction_sets.to_dataframe()

And then save that pd.DataFrame as a .csv file.

data.to_csv('~/Desktop/my_edi_file.csv')

The complete set of TransactionSets functionality can be found by inspecting the TransactionSets class found at edi_parser/transaction_set/transaction_sets.py

Tests

Example EDI 835 files can be found in tests/test_edi_835/files. To run the tests use pytest.

python -m pytest

Contributing to edi-835-parser

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.

Not all EDI 835 elements and segments are currently parsable and not all EDI codes are mapped. If you are interested in contributing to edi-835-parser, please feel free to fork the project and/or reach out by emailing [email protected].

Acknowledgements

A special thank you to Github user gizquier2 for his interest in this project and continued feedback.

edi-835-parser's People

Contributors

christopherpickering avatar keironstoddart avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

edi-835-parser's Issues

Issue with LX Handler

Trying to parse some reconstructed era files from a clearinghouse. I get this error:
/Users/x/opt/anaconda3/lib/python3.9/site-packages/edi_835_parser/loops/service.py:109: UserWarning: Identifier: LX not handled in service loop.
warn(message)
Traceback (most recent call last):
File "/Users/x/eraParseTest.py", line 53, in
data = transaction_sets.to_dataframe()
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/edi_835_parser/transaction_set/transaction_sets.py", line 25, in to_dataframe
data = pd.concat([data, transaction_set.to_dataframe()])
File "/Usersx/opt/anaconda3/lib/python3.9/site-packages/edi_835_parser/transaction_set/transaction_set.py", line 53, in to_dataframe
self.payer,
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/edi_835_parser/transaction_set/transaction_set.py", line 36, in payer
assert len(payer) == 1
AssertionError

I noticed that the payer/payee is listed multiple time in the era 835 file and not only in the beginning like in the usual 835 files. The payer is the same but variation of the payer's name or section. For Example: Healthcare Insurance Company, Healthcare Insurance Company Medicare Solutions, Healthcare Insurance Company Medicaid Solutions, etc. Or it just lists the payer/payee for each claim. Is there a solution for this problem?

invalid literal for int() with base 10: 'BDATA'

(edi-parser-py3.12) stevenli@Stevens-MBP edi_parser % python display_edi_file.py

Traceback (most recent call last):
File "/Users/stevenli/Documents/github/steven4354/edi_parser/display_edi_file.py", line 7, in
transaction_sets = parse(input_file_name)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenli/Library/Caches/pypoetry/virtualenvs/edi-parser-o53mJRh5-py3.12/lib/python3.12/site-packages/edi_835_parser/init.py", line 28, in parse
transaction_set = TransactionSet.build(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenli/Library/Caches/pypoetry/virtualenvs/edi-parser-o53mJRh5-py3.12/lib/python3.12/site-packages/edi_835_parser/transaction_set/transaction_set.py", line 136, in build
response = cls.build_attribute(segment, segments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenli/Library/Caches/pypoetry/virtualenvs/edi-parser-o53mJRh5-py3.12/lib/python3.12/site-packages/edi_835_parser/transaction_set/transaction_set.py", line 177, in build_attribute
organization, segments, segment = OrganizationLoop.build(segment, segments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenli/Library/Caches/pypoetry/virtualenvs/edi-parser-o53mJRh5-py3.12/lib/python3.12/site-packages/edi_835_parser/loops/organization.py", line 32, in build
organization.organization = OrganizationSegment(current_segment)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenli/Library/Caches/pypoetry/virtualenvs/edi-parser-o53mJRh5-py3.12/lib/python3.12/site-packages/edi_835_parser/segments/organization.py", line 19, in init
self.identification_code = int(segment[4]) if len(segment) >= 5 else None
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'BDATA'
(edi-parser-py3.12) stevenli@Stevens-MBP edi_parser %

IndexError in entity.py

Some remittance files contain the 'NM1' segment multiple times in the claim loop. Occasionally the 'NM1' segments contain fewer than 3 elements, which raises an IndexError exception once the segment gets to Entity class in entity.py.

CLP Index should not be integer

CLP segment 1 should not be an integer, multiple times the claim# or claim identifier, is a "system created value" not only digits.

Easy to solve just change

class Claim:

**index = str()**

Reverse Parser,

Hey, I checked out the parser and Its Great! I really loved it. I wanted to check if I can reverse parse i.e, converting back the EDI 835 parsed output which is in the excel/tabular format to a proper edi 835 file.

837 Parser

Is there a roadmap for an 837 parser?

Assertion Error when Trying to transform to Pandas

~/miniconda3/envs/835_parser/lib/python3.9/site-packages/edi_835_parser/transaction_set/transaction_set.py in to_dataframe(self)
45 datum = TransactionSet.serialize_service(
46 self.financial_information,
---> 47 self.payer,
48 claim,
49 service

~/miniconda3/envs/835_parser/lib/python3.9/site-packages/edi_835_parser/transaction_set/transaction_set.py in payer(self)
34 def payer(self) -> OrganizationLoop:
35 payer = [o for o in self.organizations if o.organization.type == 'payer']
---> 36 assert len(payer) == 1
37 return payer[0]
38

AssertionError:

Looking for NCI from record results

Looking for NCI in parsed output. NCI numbers are part of the 835 file, but I can't seem to find the reference in the segments or other parser elements. We also don't see it in the CSV output. Is NCI supported in this tool and I'm just missing it?

SVC segment 1

In the parser you are cutting just the middle part of the SVC segment 1

` class ServiceCode(Element):

def parser(self, value: str) -> str:
	value = split_element(value)
	_, code, *_ = value
	return code `

image

Probably a good way to do this is sparse this in 3 columns, 1 is the the first part HC ( for CPT HCPC) , part 2 the code itself, part3 the Modifier if HC.

or in a different way, have 3 columns ( HCPC-CPT, -> include here the code if part 1 is HC, PROC_CODE -> here the code ( part 2) if NU or RB, MODIFIER -> here part 3 if HC in part 1)

No matching distribution found error

When I am trying to install I keep getting following error.

Could not find a version that satisfies the requirement edi-835-parser
ERROR: No matching distribution found for edi-835-parser

Interest In CLI Script/Console Script?

Hello,

First of all, thank you very much for this library! I would like to add a simple CLI wrapper (using argparse) to the library to support generating CSV files from the command line/terminal. To support this I am going to add a "cli" module and the appropriate config to setup.py. If you have any interest in accepting a PR for this, please let me know and I will be happy to submit it.

Thanks!

Dixon

Pandas dataframe enhancement

REF 6R that may help to circle back to 837,
REF - LINE ITEM CONTROL NUMBER X12 Segment Name: Reference Information X12 Purpose: To specify identifying information X12 Syntax: 1. R0203 At least one of REF02 or REF03 is required. Loop: 2110 โ€” SERVICE PAYMENT INFORMATION

Adjustments per service is fundamental in an 835 parser, instead of closing segments on each ~, may loop from CLP to next CLP and capture the adjustments and the reference.

CAS - SERVICE ADJUSTMENT X12 Segment Name: Claims Adjustment X12 Purpose: To supply adjustment reason codes and amounts as needed for an entire claim or for a particular service within the claim being paid may be multiple

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.