We have a problem when we process X12 for some encounters. The encounters that are having the problems are ones that have multiple diagnosis codes. Only the first code is packaged in the batch file generate by the process X12. The batch is then transmitted to Zirmed our clearing house. We have the same problem on our production OpenEMR 2.8.2 and test OpenEMR 2.8.3.
Looks like 2.8.3 puts only the primary diagnosis for each procedure into an X12 claim. Probably because that’s what freeb did. So you can have multiple diagnoses but only if there are multiple procedures. The places to fix it would be in library/gen_x12_837.inc.php and Claim.class.php; look for references to diagArray() and diagIndex().
Question are all x12 bills being produced via gen_x12_837.inc.php instead of freeb now? And only hcfa via freeb? I’ll have to make some changes to the gen_x12_837.inc.php because I used the proxymed format via freeb and made some changes to it, and will have to port them over.
That’s what I’m trying to figure out because most of the claims are bouncing back from proxymed. Once I determine the difference I’ll post my findings.
I made changes to my local and will send you the file in the next day or so once the billing is processed by proxymed. I ran the resultant X12 files through the X12 verification program to make sure it was standard X12 (https://sites.edifecs.com/index.jsp?MedAvant). You can check out the differences in what you’ve coded and make changes accordingly (otherwise I can check in the changes and you can test against it that way).
There were only a few files I needed to touch namely:
<openemr root>/library/gen_x12_837.inc.php --corrected some of the generated x12
<openemr root>/library/Claim.class.php --added functions to handle insurance_type field
<openemr root>/library/patient.inc --added insurance_type to the insurance_data pull (needed for secondary/tertiary insurances)
<openemr root>/interface/patient_file/summary/demographics_full.php --added insurance_type to the insurance section (primarily needed for secondary/tertiary insurances)
And added column insurance_type to the insurance_data table.
OK, thanks for doing this. It’s nice to see someone besides just me working on billing stuff! Use your judgment regarding whether to run it by me first.