Does anyone have working code for generating insurance claims from the OpenEMR database without freeb?
I am working on a simple program (a php generated html page) that generates claims in csv format for Zirmed. It’s time consuming, but not too complicated.
It didn’t occur to me to ask here first if anyone has already done something like this.
They will take claims in any format and map it based on a user submitted test file.
If it hasn’t already been done, I’ll put it in the contrib directory when I’m finished.
I may have made a fundamental mistake again with respect to assuming that encounter IDs are unique.
I start out by getting a unique list of encounter IDs from the billing table (using DISTINCT function), putting those in an array and iterating through the array, using each encounter ID to query all of the required tables to put together the data for each claim.
I think that billing_report.php does it by pid.
Is it true that encounter IDs are not unique values? I may have to rework the main loop if that is the case.
I believe that older versions of OpenEMR were generating encounter IDs that were not unique. And in some cases an encounter can be generated with an ID that is the YYYYMMDD date. So you should identify an encounter by the combination of pid and encounter ID.
So, I will select for a distinct set of pid from the billing table between start and end date, ordered by date. Then, for each pid retrieved, I will select all distinct encounter from the billing table and create a claim from those individual encounter IDs.
Ok, got it. The big test, of course, will be to see if I get paid as a result of the data that this code generates.