Skip to content

Commit

Permalink
fix: add canceled appts counter to report (openemr#7295)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwaite authored Mar 26, 2024
1 parent fd6500f commit 3591dc6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions interface/reports/appointments_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,22 @@ function oldEvt(eventid) {
} else {
$pid_list = array(); // Initialize list of PIDs for Superbill option
$apptdate_list = array(); // same as above for the appt details
$totalAppontments = count($appointments);
$totalAppointments = count($appointments);
$canceledAppointments = 0;

$cntr = 1; // column labels above start at 1
foreach ($appointments as $appointment) {
if (
$appointment['pc_apptstatus'] == "x"
&& empty($chk_with_canceled_appt)
) {
$canceledAppointments++;
continue;
} elseif (
$appointment['pc_apptstatus'] == "x"
&& !empty($chk_with_canceled_appt)
) {
$canceledAppointments++;
}
$cntr++;
array_push($pid_list, $appointment['pid']);
Expand Down Expand Up @@ -572,7 +579,8 @@ function oldEvt(eventid) {

if (empty($_POST['form_csvexport'])) { ?>
<tr>
<td colspan="10" align="left"><?php echo xlt('Total number of appointments'); ?>:&nbsp;<?php echo text($totalAppontments);?></td>
<td colspan="2" align="left"><?php echo xlt('Total number of appointments'); ?>:&nbsp;<?php echo text($totalAppointments);?></td>
<td colspan="2" align="left"><?php echo xlt('Total number of canceled appointments'); ?>:&nbsp;<?php echo text($canceledAppointments);?></td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 3591dc6

Please sign in to comment.