From 60be001f686a6f33de7ec396e4f33b5aac5de65f Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Tue, 21 Nov 2017 02:35:33 -0800 Subject: [PATCH] cleanup referral report --- interface/reports/referrals_report.php | 179 ++++++++++++++------------------- 1 file changed, 76 insertions(+), 103 deletions(-) diff --git a/interface/reports/referrals_report.php b/interface/reports/referrals_report.php index 1f3048603..1453a5653 100644 --- a/interface/reports/referrals_report.php +++ b/interface/reports/referrals_report.php @@ -2,109 +2,84 @@ /** * This report lists referrals for a given date range. * - * Copyright (C) 2008-2016 Rod Roark - * Copyright (C) 2016 Roberto Vasquez - * 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 2 - * 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 Roberto Vasquez - * @author Brady Miller - * @link http://www.open-emr.org + * @package OpenEMR + * @link http://www.open-emr.org + * @author Rod Roark + * @author Roberto Vasquez + * @author Brady Miller + * @copyright Copyright (c) 2008-2016 Rod Roark + * @copyright Copyright (c) 2016 Roberto Vasquez + * @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("$srcdir/patient.inc"); - require_once "$srcdir/options.inc.php"; +require_once("../globals.php"); +require_once("$srcdir/patient.inc"); +require_once "$srcdir/options.inc.php"; + +use OpenEMR\Core\Header; - $from_date = (isset($_POST['form_from_date'])) ? fixDate($_POST['form_from_date'], date('Y-m-d')) : ''; - $form_from_date = $from_date; - $to_date = (isset($_POST['form_to_date'])) ? fixDate($_POST['form_to_date'], date('Y-m-d')) : ''; -; - $form_to_date = $to_date; - $form_facility = isset($_POST['form_facility']) ? $_POST['form_facility'] : ''; +$form_from_date = (isset($_POST['form_from_date'])) ? DateToYYYYMMDD($_POST['form_from_date']) : date('Y-01-01'); +$form_to_date = (isset($_POST['form_to_date'])) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d'); +$form_facility = isset($_POST['form_facility']) ? $_POST['form_facility'] : ''; ?> + <?php echo xlt('Referrals'); ?> -<?php echo xlt('Referrals'); ?> - - - - - - + $('.datepicker').datetimepicker({ + + + + + + }); + }); - + function show_referral(transid) { + dlgopen('../patient_file/transaction/print_referral.php?transid=' + transid, + '_blank', 550, 400,true); // Force new window rather than iframe because of the dynamic generation of the content in print_referral.php + return false; + } + + + @@ -112,7 +87,7 @@ use OpenEMR\Core\Header; -
- +
@@ -136,17 +111,15 @@ use OpenEMR\Core\Header; : - '> + : - '> + @@ -214,7 +187,7 @@ if ($_POST['form_refresh']) { "WHERE t.title = 'LBTref' AND " . "d1.field_value >= ? AND d1.field_value <= ? " . "ORDER BY ut.organization, d1.field_value, t.id"; - $res = sqlStatement($query, array($from_date, $to_date)); + $res = sqlStatement($query, array($form_from_date, $form_to_date)); while ($row = sqlFetchArray($res)) { // If a facility is specified, ignore rows that do not match. @@ -233,13 +206,13 @@ if ($_POST['form_refresh']) { ?> - + } else { + echo text($row['referer_to']); + } + ?> -- 2.11.4.GIT