added new datepicker to amendments gui
[openemr.git] / interface / reports / report_results.php
blob0a5b7d09ff27b355f978665845b923f04086db75
1 <?php
2 /**
3 * Generic script to list stored reports. Part of the module to allow the tracking,
4 * storing, and viewing of reports.
6 * Copyright (C) 2012-2017 Brady Miller <brady@sparmy.com>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Brady Miller <brady@sparmy.com>
21 * @link http://www.open-emr.org
24 //SANITIZE ALL ESCAPES
25 $sanitize_all_escapes=true;
28 //STOP FAKE REGISTER GLOBALS
29 $fake_register_globals=false;
32 require_once("../globals.php");
33 require_once("../../library/patient.inc");
34 require_once("$srcdir/formatting.inc.php");
35 require_once "$srcdir/options.inc.php";
36 require_once "$srcdir/clinical_rules.php";
37 require_once "$srcdir/report_database.inc";
40 <html>
42 <head>
43 <?php html_header_show();?>
45 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
46 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
48 <title><?php echo htmlspecialchars( xl('Report Results/History'), ENT_NOQUOTES); ?></title>
50 <script type="text/javascript" src="../../library/overlib_mini.js"></script>
51 <script type="text/javascript" src="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
52 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
53 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
54 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
56 <script LANGUAGE="JavaScript">
58 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
60 $( document ).ready(function(){
61 $('.datepicker').datetimepicker({
62 <?php $datetimepicker_timepicker = true; ?>
63 <?php $datetimepicker_formatInput = false; ?>
64 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
65 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
66 });
67 });
69 </script>
71 <style type="text/css">
73 /* specifically include & exclude from printing */
74 @media print {
75 #report_parameters {
76 visibility: hidden;
77 display: none;
79 #report_parameters_daterange {
80 visibility: visible;
81 display: inline;
83 #report_results table {
84 margin-top: 0px;
88 /* specifically exclude some from the screen */
89 @media screen {
90 #report_parameters_daterange {
91 visibility: hidden;
92 display: none;
96 </style>
97 </head>
99 <body class="body_top">
101 <!-- Required for the popup date selectors -->
102 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
104 <span class='title'><?php echo htmlspecialchars( xl('Report History/Results'), ENT_NOQUOTES); ?></span>
106 <form method='post' name='theform' id='theform' action='report_results.php' onsubmit='return top.restoreSession()'>
108 <div id="report_parameters">
110 <table>
111 <tr>
112 <td width='470px'>
113 <div style='float:left'>
115 <table class='text'>
117 <tr>
118 <td class='label'>
119 <?php echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES); ?>:
120 </td>
121 <td>
122 <input type='text' name='form_begin_date' id='form_begin_date' size='20' value='<?php echo htmlspecialchars( $_POST['form_begin_date'], ENT_QUOTES); ?>'
123 class='datepicker'
124 title='<?php echo htmlspecialchars( xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
125 </td>
126 </tr>
128 <tr>
129 <td class='label'>
130 <?php echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES); ?>:
131 </td>
132 <td>
133 <input type='text' name='form_end_date' id='form_end_date' size='20' value='<?php echo htmlspecialchars( $_POST['form_end_date'], ENT_QUOTES); ?>'
134 class='datepicker'
135 title='<?php echo htmlspecialchars( xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
136 </td>
137 </tr>
138 </table>
139 </div>
141 </td>
142 <td align='left' valign='middle' height="100%">
143 <table style='border-left:1px solid; width:100%; height:100%' >
144 <tr>
145 <td>
146 <div style='margin-left:15px'>
147 <a id='search_button' href='#' class='css_button' onclick='top.restoreSession(); $("#theform").submit()'>
148 <span>
149 <?php echo htmlspecialchars( xl('Search'), ENT_NOQUOTES); ?>
150 </span>
151 </a>
152 <a id='refresh_button' href='#' class='css_button' onclick='top.restoreSession(); $("#theform").submit()'>
153 <span>
154 <?php echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES); ?>
155 </span>
156 </a>
157 </div>
158 </td>
159 </tr>
160 </table>
161 </td>
162 </tr>
163 </table>
165 </div> <!-- end of search parameters -->
167 <br>
171 <div id="report_results">
172 <table>
174 <thead>
175 <th align='center'>
176 <?php echo htmlspecialchars( xl('Title'), ENT_NOQUOTES); ?>
177 </th>
179 <th align='center'>
180 <?php echo htmlspecialchars( xl('Date'), ENT_NOQUOTES); ?>
181 </th>
183 <th align='center'>
184 <?php echo htmlspecialchars( xl('Status'), ENT_NOQUOTES); ?>
185 </th>
187 </thead>
188 <tbody> <!-- added for better print-ability -->
189 <?php
191 $res = listingReportDatabase($_POST['form_begin_date'],$_POST['form_end_date']);
192 while ($row = sqlFetchArray($res)) {
194 // Figure out the title and link
195 if ($row['type'] == "cqm") {
196 if (!$GLOBALS['enable_cqm']) continue;
197 $type_title = xl('Clinical Quality Measures (CQM)');
198 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
200 else if ($row['type'] == "cqm_2011") {
201 if (!$GLOBALS['enable_cqm']) continue;
202 $type_title = xl('2011 Clinical Quality Measures (CQM)');
203 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
205 else if ($row['type'] == "cqm_2014") {
206 if (!$GLOBALS['enable_cqm']) continue;
207 $type_title = xl('2014 Clinical Quality Measures (CQM)');
208 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
210 else if ($row['type'] == "amc") {
211 if (!$GLOBALS['enable_amc']) continue;
212 $type_title = xl('Automated Measure Calculations (AMC)');
213 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
215 else if ($row['type'] == "amc_2011") {
216 if (!$GLOBALS['enable_amc']) continue;
217 $type_title = xl('2011 Automated Measure Calculations (AMC)');
218 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
220 else if ($row['type'] == "amc_2014") {
221 if (!$GLOBALS['enable_amc']) continue;
222 $type_title = xl('2014 Automated Measure Calculations (AMC)');
223 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
225 else if ($row['type'] == "amc_2014_stage1") {
226 if (!$GLOBALS['enable_amc']) continue;
227 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage I');
228 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
230 else if ($row['type'] == "amc_2014_stage2") {
231 if (!$GLOBALS['enable_amc']) continue;
232 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage II');
233 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
235 else if ($row['type'] == "process_reminders") {
236 if (!$GLOBALS['enable_cdr']) continue;
237 $type_title = xl('Processing Patient Reminders');
238 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
240 else if ($row['type'] == "process_send_reminders") {
241 if (!$GLOBALS['enable_cdr']) continue;
242 $type_title = xl('Processing and Sending Patient Reminders');
243 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
245 else if ($row['type'] == "passive_alert") {
246 if (!$GLOBALS['enable_cdr']) continue;
247 $type_title = xl('Standard Measures (Passive Alerts)');
248 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
250 else if ($row['type'] == "active_alert") {
251 if (!$GLOBALS['enable_cdr']) continue;
252 $type_title = xl('Standard Measures (Active Alerts)');
253 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
255 else if ($row['type'] == "patient_reminder") {
256 if (!$GLOBALS['enable_cdr']) continue;
257 $type_title = xl('Standard Measures (Patient Reminders)');
258 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
260 else {
261 // Not identified, so give an unknown title
262 $type_title = xl('Unknown') . "-" . $row['type'];
263 $link="";
266 <tr>
267 <?php if ($row["progress"] == "complete") { ?>
268 <td align='center'><a href='<?php echo $link; ?>' onclick='top.restoreSession()'><?php echo text($type_title); ?></a></td>
269 <?php } else { ?>
270 <td align='center'><?php echo text($type_title); ?></td>
271 <?php } ?>
272 <td align='center'><?php echo text($row["date_report"]); ?></td>
273 <?php if ($row["progress"] == "complete") { ?>
274 <td align='center'><?php echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?></td>
275 <?php } else { ?>
276 <td align='center'><?php echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?></td>
277 <?php } ?>
279 </tr>
281 <?php
282 } // $row = sqlFetchArray($res) while
284 </tbody>
285 </table>
286 </div> <!-- end of search results -->
288 </form>
290 </body>
292 </html>