removal of overlib_mini.js and calendar.js (#640)
[openemr.git] / interface / reports / report_results.php
blobabfb47a0fd0bb923a14daf34092fc7caf697d4cd
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.g.miller@gmail.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.g.miller@gmail.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/options.inc.php";
35 require_once "$srcdir/clinical_rules.php";
36 require_once "$srcdir/report_database.inc";
39 <html>
41 <head>
42 <?php html_header_show();?>
44 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
45 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
47 <title><?php echo htmlspecialchars( xl('Report Results/History'), ENT_NOQUOTES); ?></title>
49 <script type="text/javascript" src="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
50 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
51 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
52 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
54 <script LANGUAGE="JavaScript">
56 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
58 $( document ).ready(function(){
59 $('.datepicker').datetimepicker({
60 <?php $datetimepicker_timepicker = true; ?>
61 <?php $datetimepicker_showseconds = true; ?>
62 <?php $datetimepicker_formatInput = false; ?>
63 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
64 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
65 });
66 });
68 </script>
70 <style type="text/css">
72 /* specifically include & exclude from printing */
73 @media print {
74 #report_parameters {
75 visibility: hidden;
76 display: none;
78 #report_parameters_daterange {
79 visibility: visible;
80 display: inline;
82 #report_results table {
83 margin-top: 0px;
87 /* specifically exclude some from the screen */
88 @media screen {
89 #report_parameters_daterange {
90 visibility: hidden;
91 display: none;
95 </style>
96 </head>
98 <body class="body_top">
100 <!-- Required for the popup date selectors -->
101 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
103 <span class='title'><?php echo htmlspecialchars( xl('Report History/Results'), ENT_NOQUOTES); ?></span>
105 <form method='post' name='theform' id='theform' action='report_results.php' onsubmit='return top.restoreSession()'>
107 <div id="report_parameters">
109 <table>
110 <tr>
111 <td width='470px'>
112 <div style='float:left'>
114 <table class='text'>
116 <tr>
117 <td class='label_custom'>
118 <?php echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES); ?>:
119 </td>
120 <td>
121 <input type='text' name='form_begin_date' id='form_begin_date' size='20' value='<?php echo htmlspecialchars( $_POST['form_begin_date'], ENT_QUOTES); ?>'
122 class='datepicker'
123 title='<?php echo htmlspecialchars( xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
124 </td>
125 </tr>
127 <tr>
128 <td class='label_custom'>
129 <?php echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES); ?>:
130 </td>
131 <td>
132 <input type='text' name='form_end_date' id='form_end_date' size='20' value='<?php echo htmlspecialchars( $_POST['form_end_date'], ENT_QUOTES); ?>'
133 class='datepicker'
134 title='<?php echo htmlspecialchars( xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
135 </td>
136 </tr>
137 </table>
138 </div>
140 </td>
141 <td align='left' valign='middle' height="100%">
142 <table style='border-left:1px solid; width:100%; height:100%' >
143 <tr>
144 <td>
145 <div style='margin-left:15px'>
146 <a id='search_button' href='#' class='css_button' onclick='top.restoreSession(); $("#theform").submit()'>
147 <span>
148 <?php echo htmlspecialchars( xl('Search'), ENT_NOQUOTES); ?>
149 </span>
150 </a>
151 <a id='refresh_button' href='#' class='css_button' onclick='top.restoreSession(); $("#theform").submit()'>
152 <span>
153 <?php echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES); ?>
154 </span>
155 </a>
156 </div>
157 </td>
158 </tr>
159 </table>
160 </td>
161 </tr>
162 </table>
164 </div> <!-- end of search parameters -->
166 <br>
170 <div id="report_results">
171 <table>
173 <thead>
174 <th align='center'>
175 <?php echo htmlspecialchars( xl('Title'), ENT_NOQUOTES); ?>
176 </th>
178 <th align='center'>
179 <?php echo htmlspecialchars( xl('Date'), ENT_NOQUOTES); ?>
180 </th>
182 <th align='center'>
183 <?php echo htmlspecialchars( xl('Status'), ENT_NOQUOTES); ?>
184 </th>
186 </thead>
187 <tbody> <!-- added for better print-ability -->
188 <?php
190 $res = listingReportDatabase($_POST['form_begin_date'],$_POST['form_end_date']);
191 while ($row = sqlFetchArray($res)) {
193 // Figure out the title and link
194 if ($row['type'] == "cqm") {
195 if (!$GLOBALS['enable_cqm']) continue;
196 $type_title = xl('Clinical Quality Measures (CQM)');
197 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
199 else if ($row['type'] == "cqm_2011") {
200 if (!$GLOBALS['enable_cqm']) continue;
201 $type_title = xl('2011 Clinical Quality Measures (CQM)');
202 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
204 else if ($row['type'] == "cqm_2014") {
205 if (!$GLOBALS['enable_cqm']) continue;
206 $type_title = xl('2014 Clinical Quality Measures (CQM)');
207 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
209 else if ($row['type'] == "amc") {
210 if (!$GLOBALS['enable_amc']) continue;
211 $type_title = xl('Automated Measure Calculations (AMC)');
212 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
214 else if ($row['type'] == "amc_2011") {
215 if (!$GLOBALS['enable_amc']) continue;
216 $type_title = xl('2011 Automated Measure Calculations (AMC)');
217 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
219 else if ($row['type'] == "amc_2014") {
220 if (!$GLOBALS['enable_amc']) continue;
221 $type_title = xl('2014 Automated Measure Calculations (AMC)');
222 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
224 else if ($row['type'] == "amc_2014_stage1") {
225 if (!$GLOBALS['enable_amc']) continue;
226 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage I');
227 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
229 else if ($row['type'] == "amc_2014_stage2") {
230 if (!$GLOBALS['enable_amc']) continue;
231 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage II');
232 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
234 else if ($row['type'] == "process_reminders") {
235 if (!$GLOBALS['enable_cdr']) continue;
236 $type_title = xl('Processing Patient Reminders');
237 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
239 else if ($row['type'] == "process_send_reminders") {
240 if (!$GLOBALS['enable_cdr']) continue;
241 $type_title = xl('Processing and Sending Patient Reminders');
242 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
244 else if ($row['type'] == "passive_alert") {
245 if (!$GLOBALS['enable_cdr']) continue;
246 $type_title = xl('Standard Measures (Passive Alerts)');
247 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
249 else if ($row['type'] == "active_alert") {
250 if (!$GLOBALS['enable_cdr']) continue;
251 $type_title = xl('Standard Measures (Active Alerts)');
252 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
254 else if ($row['type'] == "patient_reminder") {
255 if (!$GLOBALS['enable_cdr']) continue;
256 $type_title = xl('Standard Measures (Patient Reminders)');
257 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
259 else {
260 // Not identified, so give an unknown title
261 $type_title = xl('Unknown') . "-" . $row['type'];
262 $link="";
265 <tr>
266 <?php if ($row["progress"] == "complete") { ?>
267 <td align='center'><a href='<?php echo $link; ?>' onclick='top.restoreSession()'><?php echo text($type_title); ?></a></td>
268 <?php } else { ?>
269 <td align='center'><?php echo text($type_title); ?></td>
270 <?php } ?>
271 <td align='center'><?php echo text($row["date_report"]); ?></td>
272 <?php if ($row["progress"] == "complete") { ?>
273 <td align='center'><?php echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?></td>
274 <?php } else { ?>
275 <td align='center'><?php echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?></td>
276 <?php } ?>
278 </tr>
280 <?php
281 } // $row = sqlFetchArray($res) while
283 </tbody>
284 </table>
285 </div> <!-- end of search results -->
287 </form>
289 </body>
291 </html>