From 977e3be9e2240ab151eb211160396f78932bdbe4 Mon Sep 17 00:00:00 2001 From: matrix-drorgo Date: Wed, 28 Dec 2016 12:25:26 +0200 Subject: [PATCH] added new feature to the patient report - list recurring appointments. (#403) --- interface/patient_file/report/custom_report.php | 41 ++++++++++++++++++++++-- interface/patient_file/report/patient_report.php | 3 ++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/interface/patient_file/report/custom_report.php b/interface/patient_file/report/custom_report.php index 67d341a4b..bc1c2abf0 100644 --- a/interface/patient_file/report/custom_report.php +++ b/interface/patient_file/report/custom_report.php @@ -42,7 +42,7 @@ require_once($GLOBALS["include_root"] . "/orders/single_order_results.inc.php"); if ($GLOBALS['gbl_portal_cms_enable']) { require_once($GLOBALS["include_root"] . "/cmsportal/portal.inc.php"); } - +require_once("$srcdir/appointments.inc.php"); // For those who care that this is the patient report. $GLOBALS['PATIENT_REPORT_ACTIVE'] = true; @@ -308,7 +308,44 @@ foreach ($ar as $key => $val) { // if (stristr($key,"include_")) { - if ($val == "demographics") { + if($val == "recurring_days"){ + + /// label/header for recurring days + echo "
"; + echo "
\n"; + print "

".xlt('Recurrent Appointments').":

"; + + //fetch the data of the recurring days + $recurrences = fetchRecurrences($pid); + + //print the recurring days to screen + if($recurrences[0] == false){ //if there are no recurrent appointments: + echo "
"; + echo "" . xlt('None') . ""; + echo "
"; + echo "
"; + } + else { + foreach ($recurrences as $row) { + //checks if there are recurrences and if they are current (git didn't end yet) + if ($row == false || !recurrence_is_current($row['pc_endDate'])) + continue; + echo "
"; + echo "" . xlt('Appointment Category') . ': ' . text($row['pc_title']) . ""; + echo "
"; + echo "" . xlt('Recurrence') . ': ' .text($row['pc_recurrspec']) . ""; + echo "
"; + $red_text = ""; //if ends in a week, make font red + if (ends_in_a_week($row['pc_endDate'])) { + $red_text = " style=\"color:red;\" "; + } + echo "" . xlt('End Date') . ': ' . text($row['pc_endDate']) . ""; + echo "
"; + echo "
"; + } + } + } + elseif ($val == "demographics") { echo "
"; echo "
\n"; diff --git a/interface/patient_file/report/patient_report.php b/interface/patient_file/report/patient_report.php index 64b97beb7..9a1477d3a 100644 --- a/interface/patient_file/report/patient_report.php +++ b/interface/patient_file/report/patient_report.php @@ -218,6 +218,9 @@ function show_date_fun(){

+ +
+ -- 2.11.4.GIT