Bug Report: Billing Manager Marked as Cleared not working as designed


(Sherwin Gaddis) #1

I have tried this out in the demo system and it is not functioning as designed.
In the billing manager, when a group of encounters is being batched for claims. There is this a popup window that asks the question

"Would you like them to be marked as cleared?"

The choices are Ok to clear or Cancel to continue processing. If Cancel is selected, the encounter is processed and cleared from the screen.

According to the instructions, that is not supposed to happen.

To get it back in queue, it has to be reopened.

In the billing_report.php the logic is this.

  if(confirm(Message + "\n\n\n<?php echo addslashes(xl('Total')); ?>" + ' ' + CheckBoxBillingCount + ' ' +  "<?php echo addslashes(xl('Selected')); ?>\n" +
  "<?php echo addslashes(xl('Would You Like them to be Marked as Cleared.')); ?>\n" + "<?php echo addslashes(xl('Click OK to Clear or Cancel to continue processing.')); ?>"))

In the bill_process.php, line 200 the logic is this.

        $tmp = 1;
        if (isset($ar['HiddenMarkAsCleared']) && $ar['HiddenMarkAsCleared'] == 'yes') {

Logic would dictate that Yes, is being sent no matter which button is selected.

After much testing, I have learned that line 200 has no effect on skipping the processing of the claim.
(I am writing this because I have no one to talk to but myself) I have removed line 200 completely and it still marks the encounter cleared.


I checked the database before and after selecting Cancel. So, it is marked billed somewhere. The game is afoot!

This is inaccurate information. Billing is never marked 2. Maybe it should be it is not happening.


  elseif ($status >= 0) {
	$claimset .= ", status = '$status'";
	if ($status > 1) {
	  $billset .= ", billed = 1";
	  if ($status == 2) $billset  .= ", bill_date = NOW()";
	} else {
	  $billset .= ", billed = 0";

$status has to be 2 all the time for it to change the billed to 1 all the time. Now, I need to backtrack and see where this is happening.

(Stephen Waite) #2

hi @juggernautsei, maybe professor moriarty has meddled with one of the other conditions, openemr/billing_process.php at master · openemr/openemr · GitHub

(Jerry P) #3

Was a doctor wasn’t he? I added clarification to what Okay and Cancel did in the popup at some point, I didn’t per chance flip them did I?

(Sherwin Gaddis) #4

hi @stephenwaite, you are right, one of those conditions are marking them billed. I have worked through the first three and it is not either of those. I have commented out the first three conditions and the billing is still marked billed.

I will take sometime tomorrow to work through a few more to figure out why it is getting marked when it should be left 0.

Personally I blame the Joker. https://www.arthurconandoyle.com/professormoriarty.html

(Sherwin Gaddis) #5

I commented out all of the conditions and the system still marked the entry billed.

(Raimund Engel) #6

Hi guys,
a stupid question: Where do you find the Billing Manager Screen in v 5.x? I thought it was taken out in v 4.2 and I could not find it anywhere since.

EDIT: I can find it in the official demo, but not in any of my installations - where can I activate it?


(Sherwin Gaddis) #7

Go to globals and seach billing. It should be under features.

(Raimund Engel) #8

Thanks for the super-fast reply! Still can’t find it, however. There are checkboxes for
Simplified Co-Pay
Use Charges Panel
Enable Fees Submenu
Enable Batch Payment
Enable Posting
Enable EDI History

But none of these brings me the menu Item >fees >billing.
Of course I also tried everything on the >globals >billing tab. :frowning:

Other suggestions?

(Sherwin Gaddis) #9

Try this one Hide Billing Widget uncheck this box if it is checked.

(Jerry P) #10

I’ve recreated and am looking into. Hint: the proper billed flag is being submitted and problem is something in the updateclaim in billing util class…

(Jerry P) #11

L-1494 BillingUtilities.php:
if ($status > 1) { $billset .= ", billed = 1"; if ($status == 2) { $billset .= ", bill_date = NOW()"; } } else { $billset .= ", billed = 0"; }

i.e submitted billed flag is ignored and update is hardcoded to mark billed for any bill process not 1.
I forget the bill processes but this is why you have this issue!
Hope this helps…

(Raimund Engel) #12

@juggernautsei: thanks again, but that’s not the right checkbox either … The link to the billing manager is still hidden.

(Jerry P) #13

Hi, Make sure you have permissions for logged in user to do billing. i.e Administration->Users

(Raimund Engel) #14

@sjpadgett: thanks for the suggestion, am testing everything in full admin role, but no luck.

(Jerry P) #15

@juggernautsei and @stephenwaite
For some reason every processed claim (x12 or hcfa print) creates two versions. First is correctly generated with billed and bill_process set correctly but when the report is generated, regardless of type(x12,hcfa) claimupdate is called again with the same params in call i.e:
if (! BillingUtilities::updateClaim(false, $patient_id, $encounter, - 1, - 1, 2, 2, $bat_filename, 'ub04', - 1, 0, json_encode($ub04id))) { $bill_info[] = xl("Internal error: claim ") . $claimid . xl(" not found!") . "\n"; }

Now this second call that creates a new version is meant to document the report has been generated and is/how disposed so we need a flag or pass in the correct claim status with the update.

I’m unclear how this was handle previous to the new classes being implemented but you may want to go back to 5.0.0 codebase and take a look. I could prob come up with a fix if this is indeed an oversight or this behavior is by design, in which case, Stephen will need to verify for us…

(Jerry P) #16

Hi @RaimundE, what in the world have you gotten yourself into? :wink:
Can you do a screenshot of your Fees menu?

Can you create FeeSheets?

(Raimund Engel) #17

Interesting, isn’t it? :thinking:
Here’s a screenshot from an of 5.0.1(7) that we have not messed around with yet.
Fee Sheet and Checkout work ok (have been using these for a while), Batch Payment and Posting seem to be ok as well. Just the billing manager is missing.

(Jerry P) #18

When in doubt, goto source code
{ "label": "Billing Manager", "menu_id": "bil0", "target": "bil", "url": "/interface/billing/billing_report.php", "children": [], "requirement": 0, "acl_req": [ [ "acct", "eob", "write" ], [ "acct", "bill", "write" ] ], "global_req": "!simplified_demographics" },

So Administration->Globals->Appearance-> Simplified Demographics
should not be checked…

(Raimund Engel) #19

Thanks, that did the trick! You’re a star :clap:

Interesting programming decision, however.

(Jerry P) #20

Yes Sir, I agree. I’m surprised this has not come up before so I will resolve this for future.
Thanks for bringing to our attention.