Copay's missing from billing table

redlettertech wrote on Tuesday, December 18, 2012:

On EMR 4.1.1(8) the Appointment-Encounter report is not displaying any copay’s that were entered via the Payment screen.  Checked the database table billing for code_type of COPAY and there are not entries since upgrade to 4.1.1.  Also recreated scenario on EMR demo site with  encounters and copay’s.  After building scenario data on demo site checked database and there are no co-payment entries into the billing table.  Have the co-payments been moved to another table?

yehster wrote on Tuesday, December 18, 2012:

Yup… ar_session and ar_activity

bradymiller wrote on Wednesday, December 19, 2012:

Hi,
This is a bug then.
Looks like that script got missed (lots of work went into migrating the copays to ar_session and ar_activity). If a developer wants to take this on, it should be a rather easy fix if look at the code where the copays are correctly grabbed.
-brady
OpenEMR

openemrdev wrote on Wednesday, December 19, 2012:

Brady,
           Quick qus on this…

Previously Copay is fetched from billing table,So copay values are fetched from billing table.i looked at the code high level,still the queries are mentioning copay from billing table.What would be the fix here?I would like to help on this.please guide me,

-Nathan

bradymiller wrote on Saturday, December 22, 2012:

Hi Nathan,

Check out these commit to get an idea of what needs to be done:
http://github.com/openemr/openemr/commit/9e98195fa7e22527071eb93f1a4855b9eec1ba33
http://github.com/openemr/openemr/commit/3d4d206e9ab2635eeaecbc2cf21c6c83b690300f

-brady
OpenEMR

tmccormi wrote on Thursday, January 17, 2013:

Has anyone managed to figure this out and fix it yet?
-Tony

bradymiller wrote on Thursday, January 17, 2013:

Hi Tony,

Bug is still there. Here’s another commit illustrating several more examples how to fix this:
http://github.com/openemr/openemr/commit/6561e30b45a0b1dcece2ed875c346bddcb5b99e5

-brady
OpenEMR

hitechelp wrote on Thursday, January 17, 2013:

Hi folks,

Does this mean co-pays collected using “Payments” were not included on our X12 claims?
and
If we use “Checkout” to take co-pays, will that work properly?

-David

bradymiller wrote on Friday, January 18, 2013:

Hi David,

The entire codebase was refactored to support the migration of copayments away from the billing table, which was contributed by ZH. A couple things were missed in the initial contribution, which I then addressed in a follow-up commit:
http://github.com/openemr/openemr/commit/6561e30b45a0b1dcece2ed875c346bddcb5b99e5
(note this incorporated X12 (claims class) and the checkout scripts, so to answer your question is that these should be working properly in 4.1.1)

The bug discussed in above posts is likely just an isolated bug that was missed when refactoring the codebase.

-brady
OpenEMR

tmccormi wrote on Friday, January 18, 2013:

So I wonder why ZH has not jumped in to fix it?
-Tony

zhhealthcare wrote on Friday, January 18, 2013:

Hi,

We will check this issue and get back soon.

ZH HealthCare

zhhealthcare wrote on Friday, January 18, 2013:

Hi,

Submitted the modification to address the issue, for code review. Please let us know if there is any more issue.

git hub path:https://github.com/zhhealthcare/openemr/commit/ca5efea2dee55c5e5bba619abd3fe4f192c466da

Thanks and Regards,
ZH HealthCare

bradymiller wrote on Saturday, January 19, 2013:

Hi Ajil,

It looks good and seems to test well, so just committed it to sourceforge. It will also go in the enxt 4.1.1 patch.

thanks for the fix,
-brady
OpenEMR

mkup wrote on Tuesday, March 05, 2013:

Hi,
“Past Encounters and Documents” does not show copays in the billing view. It used to be there.
Seems like a similar problem.

mark