Edit/Delete EOB Transactions

zhhealthcare wrote on Friday, August 06, 2010:

Brady
We are still struggling with Git’s usage and stuff.  This was complete 15 days ago and wasted a lot of time on the Git: When we tried to create patches some errors came up with “spaces” and “indent”.  Finally we decided to just upload this so that the community can benefit from this and in turn help us out. 

We also did some work on that UI in : http://github.com/zhhealthcare/openemr/tree/paul-GUI-Interface
Calendar debug:  http://github.com/zhhealthcare/openemr/tree/jacob-calendar
We created an encounter level document upload: http://github.com/zhhealthcare/openemr/tree/paul-Encounter-Level-File-Upload

Thanks
Sam

bradymiller wrote on Friday, August 06, 2010:

hey,

Git definitely has a rather steep learning curve. Ignore the “spaces” and “indent” errors. Your repository has lots of good code in it, but it’s very difficult for me to read/test it with all the noise. The goal in the end is to produce code that we(and at some point yourself) can directly committ to the sourceforge CVS repository.  Your repository is also definitely not beyond repair. The problem is that you didn’t update the ‘master’ branch correctly, which then effected your other branches. See http://www.openmedsoftware.org/wiki/Git_for_dummies page for how to correctly maintain your repository.

To fix your master branch (this will remove that last commit you put there):

git co master
git reset --hard 5b18a21b3be3ef316560
git pull upstream master

upstream is the main repository and you are instructed how to set it up in http://www.openmedsoftware.org/wiki/Git_for_dummies

Then can pull from upstream often to keep your master updated to official source code. This is vital for patch creation and to ensure the testers are using most recent code.

Then for each branch you currently have, I’d rec checking out another branch (from master), and then using the git cherry-pick command to place each real commit (ignore the merge commit thing you have) into the new branch. Then all your new branches will be cleaned up, and can use the git rebase master command whenever you want to update them to your master branch.

To have more control on your commits (such as removing the changes you made to sqlconf.php), learn the git rebase -i (interactive) command. This is a very powerful to consolidate and modify commits.

Most importantly, keep to the steps and tenets outlined in http://www.openmedsoftware.org/wiki/Git_for_dummies

hope this helps,
brady

zhhealthcare wrote on Saturday, August 07, 2010:

Brady
Does this look better. http://github.com/zhhealthcare/openemr/tree/payment

bradymiller wrote on Saturday, August 07, 2010:

woohoo,
Took me about 30 seconds to grab it, test it, and upload it to my github repos. The power of git.
Here’s what I did:

git co master
git co -b zh_payment_1
git add remote zhhealthcare git://github.com/zhhealthcare/openemr.git
git fetch git://github.com/zhhealthcare/openemr.git
git pull zhhealthcare payment
git rebase master

Your patch can then be tested via above scripts (that copy current checked out copy to my web directory)

Also can save this(basically your) branch on my github  repo:

git push origin zh_payment_1

http://github.com/bradymiller/openemr/commits/zh_payment_1

Lots of good code there. Will look through the code and test it out within the next couple days.

thanks,
brady

bradymiller wrote on Saturday, August 07, 2010:

error in above:
instead of :
git fetch git://github.com/zhhealthcare/openemr.git
should do :
git fetch zhhealthcare

-brady

bradymiller wrote on Saturday, August 07, 2010:

Also,
Please make a patch and place it in the tracker and provide link to the tracker item here. This is so the few who don’t use git can test it. Especially Rod, since he’s much more adept at billing than I am.

git co payment
git format-patch master

Above instructions will make you a nice patch
May be missing the interface/pic/Delete.gif pic, but that’s fine.

-brady

bradymiller wrote on Sunday, August 08, 2010:

hey,
Another thing that would be useful is a brief explanation of the patch, so we know what the patch is trying to accomplish.
thanks,
brady

sunsetsystems wrote on Monday, August 09, 2010:

Thanks Brady.  Yep I’ll take a look in the next day or two.  Sometimes I wish I could clone myself!

Rod
www.sunsetsystems.com

sunsetsystems wrote on Friday, August 13, 2010:

OK, I finally had a bit of time to apply the Z&H patches and take a look.

My main comment is, it looks nice but where are the comments?  I don’t have a week to study the code and figure out what’s going on.  Please give us some narrative, both in the code and in a separate description of what the new features are!

Also I have some questions about the database changes:

* Why do you need ar_session.undistributed_amount?  We already have the total payment (pay_total) as well as the individual payments in the ar_activity table, so isn’t this redundant data?

* What is ar_session.global_amount?

* What is ar_session.adjustment_code for?  Adjustments are associated with individual claim line items, not with a check posting session.

* What is ar_session.post_to_date for?

* Why ar_session.patient_id?  The patient (and encounter) IDs are in ar_activity.

* What are follow_up, follow_up_note and account_code in the ar_activity table used for?

Thanks!

Rod
www.sunsetsystems.com

zhhealthcare wrote on Saturday, August 14, 2010:

* Why do you need ar_session.undistributed_amount?- Its true that there is pay_total in ar_session and its distribution in ar_activity as pay_amount. There may be situation when the accounting person  cannot post an entire EOB, for want of some information or missing information etc. especially in the time of manual posting.In this scenario if we have to again find out which of the payment has this undistributed amount we have to run an entire database query comparing each ar_session entry with its distribution in ar_activity, or the person has to manually note it down and follow up. We think it is more effiecient way to control this through undistributed amount column. In Electronic EOB posting also this point is valid as sometimes the sytem is not able to match the coreect invoice, which has to be corrected manually.

* What is ar_session.global_amount?- This is a field intended for controlling the ,practices which shifts from another softwares to OpenEMR. When a current practice is changing the system, there will be claims which they have already submitted and will be get paid. This payments again will be mixed up with the charges we have submitting through the openEMR. So if we are receivinng a payment against a charge submitted through some other system, we cannot distribute that, and its not come in the purview of undistributed amount discussed above. These type of payments can be kept sparate in this field.

* What is ar_session.adjustment_code for? -it is nothing to do with the insurance  Adjustments. This is used for tracking payments category, something useful for reporting purposes. The user can if they want, classify his payments received. If the practice wants to some particular types of payments they can assign particular codes and generate the reports. For eg. if a doctor is reimbursed from charity organisations and he wants to track that he can create a code in the list and can have a report on the basis of code. 
* What is ar_session.post_to_date-    Suppose some checks were received for a practice in the month of July, and it is missed out for enter in the system and was never deposited in the bank also. In this scenario if he want to include this payment in the collections of July, there is no option. There will be either created date or deposit date. Using this field we can determine to which period one payment should belongs. This also a field useful for reporting. 

* Why ar_session.patient_id?  -we also think of a Family concept of patients. One of the family member may pay for the other members. in that case we can use this to distinguish the paid member and for whom it is paid.This is not fully developed.Fot the time being the patient id is stored.
* What are follow_up, follow_up_note and account_code in the ar_activity table used for?- At the time of payment posting there will be denials also in the EOB’s  or have situations where we want ot resubmit, appeal etc. Through these fields we can track the claims for wich followup actions are required, and have some descriptions if required. Account_code is again intended for reporting purpose. There will be situations where doctors are allowing discounts,Interest payments from insurances etc. It can also be used for identify the insurance primary payment,secondary payments etc. This time we have not used this field in this module, but we have used this field in the fee sheet we have developed.

sunsetsystems wrote on Saturday, August 14, 2010:

Distributed amount: Easily computed with a query like “select sum(pay_amount) from ar_activity where session_id = $session_id”.  You don’t need it in the ar_session table, and having it there creates confusion as to what is the authoritative source.

global_amount: So this is for excess payments that the system cannot balance against anything?  Oh boy. Sounds like the underlying problem is a failure to convert all data (e.g. claims) from the old system, which is going to be fundamentally problematic.  I really encourage you to find another way to deal with that (perhaps create encounters with only the billing info as needed?), or at least separate it from your patch.

adjustment_code - sounds good!

post_to_date: OK, makes sense.

patient_id: This does not belong in ar_session because one insurance payment (session) can cover multiple patients.

follow_up, follow_up_note, account_code: Need some more explanation here, or omit fields you are not yet using. In general claim notes would not go into ar_activity, but rather into the form_encounter table (which is effectively the header for the encounter).  Or possibly the “claims” table which has an entry for each claim submission.

And finally, could you write up some documentation?

Thanks!

Rod
www.sunsetsystems.com

zhhealthcare wrote on Monday, August 16, 2010:

Distributed amount: “select sum(pay_amount) from ar_activity where session_id = $session_id”.  — This will work fine if we know  the session ID. What if we want to find out all the checks for which there is an undistributed amount. if there is a ar_session table with 1000 records we have to loop through entire 1000 records. In a small practice with a monthly average of $10000 collection will have these number of entries in a matter of months, the thing will become much worse for big practices/hospitals.

patient_id:  If the payment is from the patient then only the patient_id will be there. Presently the patient payments are recorded in Billing table, we feel that its not the right thing. It should also be recorded through ar_session and Ar_activity, if we are accepting this point at that time this is required.

follow_up, follow_up_note-- What you have pointed out is right. But these have to be tracked on line item basis, we cannot link it for a particular claim. There may be circumstances where insurance will disallow one particular line item. So I think we have to link it to the billing table by each item. We will have a look into the tables you have mentioned and will come back to you.

We had made some documentation which we will be uploading.

zhhealthcare wrote on Monday, August 16, 2010:

Monies that are not related to any encounters entered in the Open Emr system are stored in the Global Account. This becomes particularly useful when there is a transition between one billing company to another and collections need be tracked separately . This will also make sure the ERA are balanced out properly  and an undistributed amount will only reflect values in relation to actual encounters entered in the Open EMR system.
Also when previous data cannot be readily converted to open EMR (ie due s/w vendor/paper system etc) the global account comes to play until a date it can be sorted out properly. 

jpmd wrote on Monday, August 16, 2010:

I think the preferred method for billing would be to have a separate location for payments unrelated to encounters as suggested by zhhealthcare.  I am not sure of any of the technical aspects of the code but I know that there is a need to account for monies distributed by ie Medicare for bonus payments, PQRI payments, Stimulus monies, etc  and as mentioned monies from previous systems that should be tied with a patient chart but not related to an encounter.

It is too cumbersome to have to create an encounter just for billing purposes especially if that process is not automated.  In addition, any calculation in reporting must account for large multi-facility practices that adds thousands of rows of billing data.

Jude A. Pierre, MD
Phyaura, LLC

zhhealthcare wrote on Monday, August 16, 2010:

We have uploaded the documentation for your perusal.
Thanks
Sam


https://sourceforge.net/tracker/?func=detail&atid=1245239&aid=3040507&group_id=60081#

zhhealthcare wrote on Tuesday, August 17, 2010:

Suppose there is an encounter in which four CPT codes are there and the insurance paid for only two and the balance they have denied. They have denied it for some reasons which we can correct. That means the fate of first two CPT’s are known and if any balance is there it has to be moved to secondary insurance, if any or has to be moved to patient balance, but the undecided CPT’s has to be remained in the primary insurance balance. How we will track it in OpenEMR. Presently the fields available for tracking this is “last_level_billed” and “last_level_closed” in “form_encounter” table .  This is a header row and we cannot deal with the situation mentioned. Our suggestion is to move these field to billing table from form_encounter table. We also like to add a field in billing table which decide whether all the insurance has completed and the balance is of patient responsibility. A true or false fiield.(name something like “Move_to_patient_responsibility”. This will reduce the calculations for arriving at patient balances, and patient statements. Also we feel it a good idea to have a remainder field in the billing table, which records the present remainder of the charge value(ie after adjusting insurance payments, adjustments etc.)

sunsetsystems wrote on Wednesday, August 18, 2010:

Distributed amount: “select sum(pay_amount) from ar_activity where session_id = $session_id”. –- This will work fine if we know the session ID. What if we want to find out all the checks for which there is an undistributed amount. if there is a ar_session table with 1000 records we have to loop through entire 1000 records. In a small practice with a monthly average of $10000 collection will have these number of entries in a matter of months, the thing will become much worse for big practices/hospitals.

No, this is a common type of problem that can be solved with a single query using aggregate functions.  See this tutorial for example:
http://www.mysqltutorial.org/mysql-aggregate-functions.aspx

patient_id: If the payment is from the patient then only the patient_id will be there. Presently the patient payments are recorded in Billing table, we feel that its not the right thing. It should also be recorded through ar_session and Ar_activity, if we are accepting this point at that time this is required.

Agreed that it would be cleaner to put all patient payments in ar_activity.  Co-pays in the billing table are an inherited “feature”.

Anyway, if you need to keep track of payers who are not insurance companies and who are not the patient associated with the encounter, then I think something more general is needed - it doesn’t seem valid to assume that the payer must be some other patient in that case.  This merits more discussion.

Monies that are not related to any encounters entered in the Open Emr system are stored in the Global Account. This becomes particularly useful when there is a transition between one billing company to another and collections need be tracked separately . This will also make sure the ERA are balanced out properly and an undistributed amount will only reflect values in relation to actual encounters entered in the Open EMR system. Also when previous data cannot be readily converted to open EMR (ie due s/w vendor/paper system etc) the global account comes to play until a date it can be sorted out properly.

Pardon my confusion, but how are you going to sort it out later if you don’t also save information from the EOB about the patient, encounter and line items that are being paid for?  And if you do save that information, the natural places to do it are patient_data, form_encounter, billing, etc.

I think the preferred method for billing would be to have a separate location for payments unrelated to encounters as suggested by zhhealthcare. I am not sure of any of the technical aspects of the code but I know that there is a need to account for monies distributed by ie Medicare for bonus payments, PQRI payments, Stimulus monies, etc and as mentioned monies from previous systems that should be tied with a patient chart but not related to an encounter.

Keep in mind OpenEMR is not a general purpose accounting system.  Payments for things that are not visit-related charges should not be put into it.

Suppose there is an encounter in which four CPT codes are there and the insurance paid for only two and the balance they have denied. They have denied it for some reasons which we can correct. That means the fate of first two CPT’s are known and if any balance is there it has to be moved to secondary insurance, if any or has to be moved to patient balance, but the undecided CPT’s has to be remained in the primary insurance balance. How we will track it in OpenEMR. Presently the fields available for tracking this is “last_level_billed” and “last_level_closed” in “form_encounter” table . This is a header row and we cannot deal with the situation mentioned. Our suggestion is to move these field to billing table from form_encounter table. We also like to add a field in billing table which decide whether all the insurance has completed and the balance is of patient responsibility. A true or false fiield.(name something like “Move_to_patient_responsibility”. This will reduce the calculations for arriving at patient balances, and patient statements. Also we feel it a good idea to have a remainder field in the billing table, which records the present remainder of the charge value(ie after adjusting insurance payments, adjustments etc.)

Not sure I understand all this, but I really hate the idea of storing redundant data for the sake of “simplifying calculations.”  The way to simplify is to create functions or classes that compute desired values from more complex data.  This goes to the core of proper database design.

Rod
www.sunsetsystems.com

zhhealthcare wrote on Thursday, August 19, 2010:

Rod
Please find responses to your points as they appear chronologically.

1.We will look at how aggregate functions can be used here and get back to you in a day. It should be a better method if we can implement it.

2.Guess the copay feature is good to go then.

3.We are not intending to include any other payors other than insurance or patients.  This feature was meant more for  family payments.

4.Lets try to rephrase the earlier answer:  Many practices who intend to use openEMR are already using a system.  Now when they try to transition, they can either try to transfer all the data or they can choose a cut off point and start using the openEMR from a certain date.  In the latter case they still receive ERAs and have to post them.  These ERA/EOBs will contain information from encounters that are filed in their old system. Therefore the global account is created to  allocate those payments that are not in the new system.  This happens only during the initial stages of a practice starting openEMR.  It is not mandatory but an additional feature that the community may decide to use. 

5.We understand: however anything related to billing needs to be entered here.   For example “capitation”: some insurances do not pay based on encounters but based on the number of patients the doctors see.  In this case the encounters are stored for records purposes but no claims  filed individuall.  The doctor gets the money based on his patient numbers.

6.Again let’s rephrase: currently the claim status  indicator is in the header table(form_encounter).  From our experience of servicing the billing needs over 30 practices, big and small, we find that most Claims are paid based on per line CPTs, which means that in a single encounter there can be line CPTs allowed and denied.  The option should be given to transfer the approved ones to patient due/secondary billing etc  and the non-approved ones to follow up action so that all appeal process can be completed before moving to patient due.  Another instance would be with regard to secondary billing/tertiary billing.  In all these cases the claims ought to be closed based on individual CPTs and not the entire encounter/claim.  Therefore it is recommended to have claim status indicator on the detail table(billing.)This is not included in the current patch but would like to include it.

Thanks
Sam

sunsetsystems wrote on Thursday, August 19, 2010:

3.We are not intending to include any other payors other than insurance or patients. This feature was meant more for family payments.

So the idea is to allow a “responsible party” who is already a (different) patient in the system.  I can see how that would be useful.  We might want to later add a new table for other such parties, but this seems OK for now.  Anyone else want to comment?

4.Lets try to rephrase the earlier answer: Many practices who intend to use openEMR are already using a system. Now when they try to transition, they can either try to transfer all the data or they can choose a cut off point and start using the openEMR from a certain date. In the latter case they still receive ERAs and have to post them. These ERA/EOBs will contain information from encounters that are filed in their old system. Therefore the global account is created to allocate those payments that are not in the new system. This happens only during the initial stages of a practice starting openEMR. It is not mandatory but an additional feature that the community may decide to use.

OK I can live with that.

5.We understand: however anything related to billing needs to be entered here. For example “capitation”: some insurances do not pay based on encounters but based on the number of patients the doctors see. In this case the encounters are stored for records purposes but no claims filed individuall. The doctor gets the money based on his patient numbers.

What bad thing will happen if payments like that are tracked outside of OpenEMR?

6.Again let’s rephrase: currently the claim status indicator is in the header table(form_encounter). From our experience of servicing the billing needs over 30 practices, big and small, we find that most Claims are paid based on per line CPTs, which means that in a single encounter there can be line CPTs allowed and denied. The option should be given to transfer the approved ones to patient due/secondary billing etc and the non-approved ones to follow up action so that all appeal process can be completed before moving to patient due. Another instance would be with regard to secondary billing/tertiary billing. In all these cases the claims ought to be closed based on individual CPTs and not the entire encounter/claim. Therefore it is recommended to have claim status indicator on the detail table(billing.)This is not included in the current patch but would like to include it.

That’s going to be a huge change to the billing logic.  I’d suggest working up a more complete design first.

Rod
www.sunsetsystems.com

jpmd wrote on Thursday, August 19, 2010:

3.We are not intending to include any other payors other than insurance or patients. This feature was meant more for family payments.

So the idea is to allow a “responsible party” who is already a (different) patient in the system.  I can see how that would be useful.  We might want to later add a new table for other such parties, but this seems OK for now.  Anyone else want to comment?

_These would be a desired feature.
_

4.Lets try to rephrase the earlier answer: Many practices who intend to use openEMR are already using a system. Now when they try to transition, they can either try to transfer all the data or they can choose a cut off point and start using the openEMR from a certain date. In the latter case they still receive ERAs and have to post them. These ERA/EOBs will contain information from encounters that are filed in their old system. Therefore the global account is created to allocate those payments that are not in the new system. This happens only during the initial stages of a practice starting openEMR. It is not mandatory but an additional feature that the community may decide to use.

OK I can live with that.

5.We understand: however anything related to billing needs to be entered here. For example “capitation”: some insurances do not pay based on encounters but based on the number of patients the doctors see. In this case the encounters are stored for records purposes but no claims filed individuall. The doctor gets the money based on his patient numbers.

What bad thing will happen if payments like that are tracked outside of OpenEMR?

The consideration for capitation payments within EMR is a logical feature and this is what CMS is moving towards when you look at payments under the Medical Home Concept.  It only makes sense to track payments within OpenEMR since the PMS is already included in the system.  I am definitely for any method to allow for capitation payments to be assigned by patient and the balance written off.

6.Again let’s rephrase: currently the claim status indicator is in the header table(form_encounter). From our experience of servicing the billing needs over 30 practices, big and small, we find that most Claims are paid based on per line CPTs, which means that in a single encounter there can be line CPTs allowed and denied. The option should be given to transfer the approved ones to patient due/secondary billing etc and the non-approved ones to follow up action so that all appeal process can be completed before moving to patient due. Another instance would be with regard to secondary billing/tertiary billing. In all these cases the claims ought to be closed based on individual CPTs and not the entire encounter/claim. Therefore it is recommended to have claim status indicator on the detail table(billing.)This is not included in the current patch but would like to include it.

That’s going to be a huge change to the billing logic.  I’d suggest working up a more complete design first.

_This feature would make sense as long as we make sure that it does not interfere with the workflow and functionality that existed prior to having such a method in place.
_
Just my 2 cents.

Jude A. Pierre, MD
Phyaura, LLC