Encounters & Documents View Enhancements

ideaman911 wrote on Monday, February 23, 2009:

The Encounters and Documents - Clinical View (default) will be a lot more helpful by eliminating the need to bounce between encounters and fee sheet and billing by indicating the billing status of an encounter right there.  So the following modification to …/patient_file/history/encounters.php from line 294 will result in a display beneath the encounter dates of "Justify" if there has been a CPT assigned (you can see it to the right) but "Billed" and its date if the encounter has already be billed, and add separating space for best viewability.

                                            // This is where we show encounter date & start table 2/22/09  JCH
                                                                                               
        $just = “”;                           //  Make Justify & Billed tags print beneath encounter date 2/22/09  JCH
        $jcpt = “CPT4”;
       
        $jtmp = sqlQuery("SELECT justify, bill_date, code_type, activity FROM billing WHERE " .
                “pid = ‘$pid’ AND code_type = ‘$jcpt’ AND activity AND encounter = '” . $iter[‘encounter’] . “’”);   
                                       
                        if (substr($jtmp[‘code_type’], 0, 3) == “CPT” && !$jtmp[‘justify’]) {
                            $just = ‘<br>’ . “Justify” . ‘<br><br>’; }
                        if (substr($jtmp[‘code_type’], 0, 3) == “CPT” && strlen($jtmp[‘bill_date’]    > 3)) {
                            $just = ‘<br>’ . “1st Billed” . ‘<br>’ . substr($jtmp[‘bill_date’], 0, 10) . ‘<br><br>’; }
                                                                                                                   
    echo “<td valign=‘top’>$linkbeg$raw_encounter_date$just$linkend</td>\n”; //  Added $just which is tag 2/22/09  JCH

Joe Holzer

ideaman911 wrote on Monday, February 23, 2009:

Please note that this is especially valuable if you are using the 2.9.1 version and added the safety in the Billing of requiring the CPT have at least one ICD justify code in order to have a checkbox to allow billing which I described elsewhere in the forums.

Joe Holzer

voipbound wrote on Monday, March 02, 2009:

so where does this go if I am using 2.9.0 and how does it fit into what is already there?  Do I add this or do I overwrite?

ideaman911 wrote on Wednesday, March 04, 2009:

VOIPBound;

I cannot be certain because I chose 2.9.1 due to the problems with trying to port SQLedger to Windows.  But I cannot really see why it would be very different given the function the view provides in 2.9.1.  The specific line may be different, but you should look for $raw_encounter_date and look for the echo statement.  The last line above should look like that echo statement, except that it will be missing the $just.  All I showed above that line is inserted so as to create the $just filler as an adder which will show below the encounter date in the table view for both the billing and non-billing view.

What I have seen so far of version 3.0 is completely different, so I have to see the outputs before i can say whether this is applicable.

You will also want to know;  An odd quirk was discovered which prevented properly justified claims from having their billable checkbox with the "no justify exclusion" in place if there was a copay from the Fee Sheet, simply because the spelling for COPAY lists it before CPT4.  Silly as that is, my programming skills have been unable to find a workaround because both CPT4 and COPAY have logical tests elsewhere which make fixing it nightmarish.  Therefore, best advice is the make certain to have the Justify prompt in use with the Encounters and Documents view (shown elsewhere in the OpenEMR forums)and advise users to enter copays in the Billing - EOB process or in Transactions - Billing (though that will not actually be reflected in the accounting).  At worst with the addition of the code below inserted between the current if statement and the else statement near line 712 in …/billing/billing_report.php only those with copays from the fee sheet will potentially be billed before they have been justified, which is still better than the as-distributed situation:

else if ($iter[‘id’] && $last_encounter_id != $this_encounter_id && $iter[code_type] == “COPAY”) {
      $tmpbpr = $iter[‘bill_process’];
      if ($tmpbpr == ‘0’ && $iter[‘billed’]) $tmpbpr = ‘2’;    
      $rhtml .= “<td><input type=‘checkbox’ value=’$tmpbpr’ name='claims[” . $this_encounter_id . “][bill]’ onclick=‘set_button_states()’>&nbsp;</td>\n”;
    }

ideaman911 wrote on Thursday, March 05, 2009:

Just discovered that v3 CVS has over 300 lines of code changes in …/patient_file/history/encounters.php, with a known change in the "echo" statement basis from 2.9.1dev (the one I use right now in Windows) from my 2/23/09 notes above.  I do not yet know if the function already exists, or even can exist, in the new structure.  I will note as soon as I find out.

Joe Holzer