From 5171f148b65849da474fa6056860a3d31ca84f6e Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Thu, 15 Jun 2006 17:54:07 +0000 Subject: [PATCH] patient-specific appointments report --- interface/patient_file/navigation.php | 2 +- interface/reports/appointments_report.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/interface/patient_file/navigation.php b/interface/patient_file/navigation.php index 11d20b09c..f5925a310 100644 --- a/interface/patient_file/navigation.php +++ b/interface/patient_file/navigation.php @@ -73,7 +73,7 @@ function selpopup(selobj) { - + diff --git a/interface/reports/appointments_report.php b/interface/reports/appointments_report.php index 787b367af..fa465a4b6 100644 --- a/interface/reports/appointments_report.php +++ b/interface/reports/appointments_report.php @@ -28,7 +28,15 @@ printf("%.2f", $amount); } - $from_date = fixDate($_POST['form_from_date'], date('Y-m-d')); + $patient = $_REQUEST['patient']; + + if ($patient && ! $_POST['form_from_date']) { + // If a specific patient, default to 2 years ago. + $tmp = date('Y') - 2; + $from_date = date("$tmp-m-d"); + } else { + $from_date = fixDate($_POST['form_from_date'], date('Y-m-d')); + } $to_date = fixDate($_POST['form_to_date'], ''); $provider = $_POST['form_provider']; @@ -38,8 +46,9 @@ $where = "e.pc_pid != '' AND e.pc_eventDate >= '$from_date'"; - if ($to_date) $where .= " AND e.pc_eventDate <= '$to_date'"; + if ($to_date ) $where .= " AND e.pc_eventDate <= '$to_date'"; if ($provider) $where .= " AND e.pc_aid = '$provider'"; + if ($patient ) $where .= " AND e.pc_pid = '$patient'"; // Get the info. // @@ -199,6 +208,7 @@ + -- 2.11.4.GIT