keironstoddart / edi-835-parser

A simple EDI 835 file format parser.
MIT License
80 stars 40 forks source link

Assertion Error when Trying to transform to Pandas #6

Open javigoncompte opened 3 years ago

javigoncompte commented 3 years ago

~/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:

keironstoddart commented 3 years ago

@javigoncompte, thank you for your interest in this library. I should find time to take a look at this issue over the weekend.

javigoncompte commented 3 years ago

i think it happens when the 835 has the same payer but multiple payer segments for multiple claims

keironstoddart commented 3 years ago

Look into 'joined' 835s.

Abdelzero commented 1 year ago

Hello,

I am running to the same issue here. What I noticed is that the 835 files for my clearinghouse comes most of the time with different payer name for each claim. it doesn't mean it is an entire different payer but just a different plan. is it possible to make this loop through payer and as it does for patient name if applicable. Thank you