From 5c7f249c3283fb86ee02fb69b5eb041af0ba2535 Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Thu, 23 Nov 2017 20:05:51 -0800 Subject: [PATCH] cleaned up several reports --- interface/reports/appointments_report.php | 214 ++++++++---------- interface/reports/daily_summary_report.php | 68 ++---- interface/reports/encounters_report.php | 221 ++++++++----------- interface/reports/patient_flow_board_report.php | 281 +++++++++--------------- 4 files changed, 312 insertions(+), 472 deletions(-) diff --git a/interface/reports/appointments_report.php b/interface/reports/appointments_report.php index 3d82f895a..ef7e680ff 100644 --- a/interface/reports/appointments_report.php +++ b/interface/reports/appointments_report.php @@ -2,40 +2,25 @@ /** * This report shows upcoming appointments with filtering and * sorting by patient, practitioner, appointment type, and date. - * 2012-01-01 - Added display of home and cell phone and fixed header - * 2015-06-19 - brought up to security standards terry@lillysystems.com * - * Copyright (C) 2005-2016 Rod Roark - * Copyright (C) 2017 Brady Miller - * - * LICENSE: This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see ;. - * - * @package OpenEMR - * @author Rod Roark - * @author Brady Miller - * @link http://www.open-emr.org + * @package OpenEMR + * @link http://www.open-emr.org + * @author Rod Roark + * @author Brady Miller + * @copyright Copyright (c) 2005-2016 Rod Roark + * @copyright Copyright (c) 2017 Brady Miller + * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ - - -use OpenEMR\Core\Header; - require_once("../globals.php"); require_once("../../library/patient.inc"); require_once "$srcdir/options.inc.php"; require_once "$srcdir/appointments.inc.php"; require_once "$srcdir/clinical_rules.php"; +use OpenEMR\Core\Header; + # Clear the pidList session whenever load this page. # This session will hold array of patients that are listed in this # report, which is then used by the 'Superbills' and 'Address Labels' @@ -45,13 +30,14 @@ unset($_SESSION['pidList']); $alertmsg = ''; // not used yet but maybe later $patient = $_REQUEST['patient']; -if ($patient && ! $_POST['form_from_date']) { +if ($patient && !isset($_POST['form_from_date'])) { // If a specific patient, default to 2 years ago. $tmp = date('Y') - 2; $from_date = date("$tmp-m-d"); + $to_date = date('Y-m-d'); } else { - $from_date = fixDate($_POST['form_from_date'], date('Y-m-d')); - $to_date = fixDate($_POST['form_to_date'], date('Y-m-d')); + $from_date = isset($_POST['form_from_date']) ? DateToYYYYMMDD($_POST['form_from_date']) : date('Y-m-d'); + $to_date = isset($_POST['form_to_date']) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d'); } $show_available_times = false; @@ -69,7 +55,6 @@ if ($_POST['with_out_facility']) { $chk_with_out_facility = true; } -//$to_date = fixDate($_POST['form_to_date'], ''); $provider = $_POST['form_provider']; $facility = $_POST['form_facility']; //(CHEMED) facility filter $form_orderby = getComparisonOrder($_REQUEST['form_orderby']) ? $_REQUEST['form_orderby'] : 'date'; @@ -119,71 +104,66 @@ function fetch_reminders($pid, $appt_date) + <?php echo xlt('Appointments Report'); ?> + + + + + function refreshme() { + // location.reload(); + document.forms[0].submit(); + } + - + /* specifically exclude some from the screen */ + @media screen { + #report_parameters_daterange { + visibility: hidden; + display: none; + } + } + @@ -194,7 +174,7 @@ function fetch_reminders($pid, $appt_date) - -
+
@@ -243,14 +223,12 @@ function fetch_reminders($pid, $appt_date) : + size='10' value=''> : + size='10' value=''> @@ -280,9 +258,7 @@ function fetch_reminders($pid, $appt_date)
@@ -301,18 +277,14 @@ function fetch_reminders($pid, $appt_date)
-
-
@@ -363,33 +335,23 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > >> + > > + > > + > > + > @@ -397,15 +359,11 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > > + > @@ -480,19 +438,20 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { - - + } + ?> + class="detail" /> class="detail" align='left'> @@ -515,7 +474,7 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) {
- + +
- diff --git a/interface/reports/daily_summary_report.php b/interface/reports/daily_summary_report.php index a31020142..3a5c01990 100644 --- a/interface/reports/daily_summary_report.php +++ b/interface/reports/daily_summary_report.php @@ -1,34 +1,20 @@ - * - * LICENSE: This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see ;. - * - * @package OpenEMR - * @author Rishabh Software - * @author Brady Miller - * @link http://www.open-emr.org - * + * @package OpenEMR + * @link http://www.open-emr.org + * @author Rishabh Software + * @author Brady Miller + * @copyright Copyright (c) 2016 Rishabh Software + * @copyright Copyright (c) 2017 Brady Miller + * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ - require_once("../globals.php"); require_once "$srcdir/options.inc.php"; require_once "$srcdir/appointments.inc.php"; @@ -38,25 +24,20 @@ use OpenEMR\Services\FacilityService; $facilityService = new FacilityService(); -$selectedFromDate = isset($_POST['form_from_date']) ? $_POST['form_from_date'] : date('Y-m-d'); // From date filter -$selectedToDate = isset($_POST['form_to_date']) ? $_POST['form_to_date'] : date('Y-m-d'); // To date filter +$from_date = isset($_POST['form_from_date']) ? DateToYYYYMMDD($_POST['form_from_date']) : date('Y-m-d'); // From date filter +$to_date = isset($_POST['form_to_date']) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d'); // To date filter $selectedFacility = isset($_POST['form_facility']) ? $_POST['form_facility'] : ""; // facility filter $selectedProvider = isset($_POST['form_provider']) ? $_POST['form_provider'] : ""; // provider filter - -$from_date = fixDate($selectedFromDate, date('Y-m-d')); -$to_date = fixDate($selectedToDate, date('Y-m-d')); ?> + <?php echo xlt('Daily Summary Report'); ?> + + /* specifically exclude some from the screen */ + @media screen { + #report_parameters_daterange { + visibility: hidden; + display: none; + } + } + + + @@ -216,7 +203,7 @@ $res = sqlStatement($query); -
- +
@@ -272,51 +259,39 @@ $res = sqlStatement($query); : - + : - +
-
-
-
-
-
@@ -360,27 +335,19 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > > + > > + > > + > @@ -390,9 +357,7 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > @@ -470,7 +435,7 @@ if ($res) { // Figure product sales into billing status. $sres = sqlStatement("SELECT billed FROM drug_sales " . - "WHERE pid = '{$row['pid']}' AND encounter = '{$row['encounter']}'"); + "WHERE pid = ? AND encounter = ?", array($row['pid'], $row['encounter'])); while ($srow = sqlFetchArray($sres)) { if ($srow['billed']) { ++$billed_count; diff --git a/interface/reports/patient_flow_board_report.php b/interface/reports/patient_flow_board_report.php index b4f3b1e5d..3daf1616d 100644 --- a/interface/reports/patient_flow_board_report.php +++ b/interface/reports/patient_flow_board_report.php @@ -1,50 +1,38 @@ - * Copyright (C) 2017 Brady Miller - * - * LICENSE: This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see ;. - * - * @package OpenEMR - * @author Terry Hill - * @author Brady Miller - * @link http://www.open-emr.org + * @package OpenEMR + * @link http://www.open-emr.org + * @author Terry Hill + * @author Brady Miller + * @copyright Copyright (c) 2015 Terry Hill + * @copyright Copyright (c) 2017 Brady Miller + * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ - -use OpenEMR\Core\Header; - require_once("../globals.php"); require_once("../../library/patient.inc"); require_once "$srcdir/options.inc.php"; require_once "$srcdir/appointments.inc.php"; require_once("$srcdir/patient_tracker.inc.php"); +use OpenEMR\Core\Header; + $patient = $_REQUEST['patient']; -if ($patient && ! $_POST['form_from_date']) { - # This sets the dates in the date select calendars - # If a specific patient, default to 2 years ago. +if ($patient && !isset($_POST['form_from_date'])) { + // If a specific patient, default to 2 years ago. $tmp = date('Y') - 2; $from_date = date("$tmp-m-d"); + $to_date = date('Y-m-d'); } else { - $from_date = fixDate($_POST['form_from_date'], date('Y-m-d')); - $to_date = fixDate($_POST['form_to_date'], date('Y-m-d')); + $from_date = isset($_POST['form_from_date']) ? DateToYYYYMMDD($_POST['form_from_date']) : date('Y-m-d'); + $to_date = isset($_POST['form_to_date']) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d'); } # check box information @@ -81,74 +69,68 @@ if ($form_patient == '') { + <?php echo xlt('Patient Flow Board Report'); ?> + + + + + // CapMinds :: callback by the find-patient popup. + function setpatient(pid, lname, fname, dob) { + var f = document.theform; + f.form_patient.value = lname + ', ' + fname; + f.form_pid.value = pid; + } + + + + @@ -163,7 +145,7 @@ if ($form_patient == '') { -
+
@@ -214,14 +196,12 @@ if ($form_patient == '') { : + size='10' value=''> : + size='10' value=''> @@ -257,9 +237,7 @@ if ($form_patient == '') {
- +
@@ -273,16 +251,12 @@ if ($form_patient == '') { # if both are selected then only completed drug screens will be displayed. ?>
- +
- +
@@ -327,52 +301,36 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > > + > > + > >    + >    + > + > > + > > + > @@ -396,40 +354,28 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { > + > > + > > + > >     + >     + + @@ -439,9 +385,7 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) {   > + > @@ -523,7 +467,8 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { ?> - +   @@ -551,9 +496,7 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) { } } else { if ($tracker_status != "") { - $frow['data_type']=1; - $frow['list_id']='apptstat'; - generate_print_field($frow, $tracker_status); + echo getListItemTitle('apptstat', $tracker_status); } } ?> @@ -570,7 +513,8 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) {   - - +   @@ -666,18 +611,10 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) {   -        +        -        +          @@ -688,7 +625,7 @@ if ($_POST['form_refresh'] || $_POST['form_orderby']) {     - +
- + +
- + - -- 2.11.4.GIT