Generating claims without freeb

markleeds wrote on Thursday, August 24, 2006:

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.

sunsetsystems wrote on Thursday, August 24, 2006:

I guess nobody does.  Yes, by all means check it in, it will surely be a step in the right direction!

By the way did you happen to look into freeclaims or gatewayedi?  I’d like to hear from anyone who knows about either of these.

Rod
www.sunsetsystems.com

markleeds wrote on Friday, August 25, 2006:

I submitted a test file to Zirmed today with the new program.

I’ll wait to hear what they say before uploading it.

markleeds wrote on Saturday, August 26, 2006:

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.

sunsetsystems wrote on Saturday, August 26, 2006:

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.

Rod
www.sunsetsystems.com

markleeds wrote on Saturday, August 26, 2006:

Too bad DISTINCT can’t take two or more columns.

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.

Thanks Rod.