Enhanced Collections Report

ideaman911 wrote on Wednesday, June 03, 2009:

Folks;

I have finally debugged (don’t ask) the addition to the Collections Report to immediately show the last billing for each encounter, which allows you to go directly to that encounter to fix any issues, like Justify, Fee Sheet etc to make it ready to bill, eliminating many steps since the report can be left up for the next encounter to repeat the process.  My notes are below along with the code changes:

Joe Holzer    Idea Man
http://www.holzerent.com

Appended 6/2/09  Added User Selectable Column for Last Billed with "Not Billed" for null in …/reports/collection_reports.  Add similar code as found at 46, 59 & 73 (set defaults as you prefer) with comments.  97 needs to properly columnize when selected

   if ($form_cb_billdate) ++$final_colspan; // added Bill Date selectable 6/2/09  JCH

Depending on your desired location for checkbox, near 300, similar to surrounding will be needed, with comments

   <input type=‘checkbox’ name=‘form_cb_billdate’<?php if ($form_cb_billdate) echo ’ checked’; ?>>
   <?php xl(‘Last Billed’,‘e’) ?>&nbsp;
    
Then at desired column location within $query matrix at 424 insert to grab proper data

   "( SELECT MAX(b.bill_date) FROM billing AS b WHERE " .
            "b.pid = f.pid AND b.encounter = f.encounter AND " .
      "b.activity = 1 AND b.code_type != ‘COPAY’ ) AS billdate, " .     
           
and at 513 the data construct   $row[‘billdate’]  = $erow[‘billdate’]; //  added Bill Date selectable 5/30/09 JCH           

The header label again depends on where you want it, but must be consistent with the data shown further

   <?php if ($form_cb_billdate) {       //  added Last Bill Date selectable 5/30/09  JCH  ?>   
       <td class=“dehead”>&nbsp;<?php xl(‘Last Bill’,‘e’) ?></td>
   <?php } ?>
    
The data will format the date or return “Not Billed” if found NULL from near 1000

   <?php if ($form_cb_billdate) { ?>
     <td class=“detail” align=“left”>
     &nbsp;<?php echo substr(($row[‘billdate’] . “Not Billed”), 0, 10); // added Last Bill selectable 5/30/09  JCH ?>
     </td>
   <?php } ?>   
    
This will display in report, but not in CSV, though similar code could be used for that.  Submitted to Rod for CSV and posted to forums on 6/2/09.