ongoing internationalization of date widget
[openemr.git] / interface / reports / report_results.php
blob622ad2ee16f10537b6866c167e43d0ac26708fb7
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
25 use OpenEMR\Core\Header;
27 require_once("../globals.php");
28 require_once("../../library/patient.inc");
29 require_once "$srcdir/options.inc.php";
30 require_once "$srcdir/clinical_rules.php";
31 require_once "$srcdir/report_database.inc";
34 <html>
36 <head>
38 <title><?php echo htmlspecialchars(xl('Report Results/History'), ENT_NOQUOTES); ?></title>
40 <?php Header::setupHeader('datetime-picker'); ?>
42 <script LANGUAGE="JavaScript">
44 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
46 $( document ).ready(function(){
47 $('.datepicker').datetimepicker({
48 <?php $datetimepicker_timepicker = true; ?>
49 <?php $datetimepicker_showseconds = true; ?>
50 <?php $datetimepicker_formatInput = false; ?>
51 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
52 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
53 });
54 });
56 </script>
58 <style type="text/css">
60 /* specifically include & exclude from printing */
61 @media print {
62 #report_parameters {
63 visibility: hidden;
64 display: none;
66 #report_parameters_daterange {
67 visibility: visible;
68 display: inline;
70 #report_results table {
71 margin-top: 0px;
75 /* specifically exclude some from the screen */
76 @media screen {
77 #report_parameters_daterange {
78 visibility: hidden;
79 display: none;
83 </style>
84 </head>
86 <body class="body_top">
88 <!-- Required for the popup date selectors -->
89 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
91 <span class='title'><?php echo htmlspecialchars(xl('Report History/Results'), ENT_NOQUOTES); ?></span>
93 <form method='post' name='theform' id='theform' action='report_results.php' onsubmit='return top.restoreSession()'>
95 <div id="report_parameters">
97 <table>
98 <tr>
99 <td width='470px'>
100 <div style='float:left'>
102 <table class='text'>
104 <tr>
105 <td class='control-label'>
106 <?php echo htmlspecialchars(xl('Begin Date'), ENT_NOQUOTES); ?>:
107 </td>
108 <td>
109 <input type='text' name='form_begin_date' id='form_begin_date' size='20' value='<?php echo htmlspecialchars($_POST['form_begin_date'], ENT_QUOTES); ?>'
110 class='datepicker form-control'
111 title='<?php echo htmlspecialchars(xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
112 </td>
113 </tr>
115 <tr>
116 <td class='control-label'>
117 <?php echo htmlspecialchars(xl('End Date'), ENT_NOQUOTES); ?>:
118 </td>
119 <td>
120 <input type='text' name='form_end_date' id='form_end_date' size='20' value='<?php echo htmlspecialchars($_POST['form_end_date'], ENT_QUOTES); ?>'
121 class='datepicker form-control'
122 title='<?php echo htmlspecialchars(xl('yyyy-mm-dd hh:mm:ss'), ENT_QUOTES); ?>'>
123 </td>
124 </tr>
125 </table>
126 </div>
128 </td>
129 <td align='left' valign='middle' height="100%">
130 <table style='border-left:1px solid; width:100%; height:100%' >
131 <tr>
132 <td>
133 <div class="text-center">
134 <div class="btn-group" role="group">
135 <a href='#' id='search_button' class='btn btn-default btn-search' onclick='top.restoreSession(); $("#theform").submit()'>
136 <?php echo xlt('Search'); ?>
137 </a>
138 <a href='#' id='refresh_button' class='btn btn-default btn-refresh' onclick='top.restoreSession(); $("#theform").submit()'>
139 <?php echo xlt('Refresh'); ?>
140 </a>
141 </div>
142 </div>
143 </td>
144 </tr>
145 </table>
146 </td>
147 </tr>
148 </table>
150 </div> <!-- end of search parameters -->
152 <br>
156 <div id="report_results">
157 <table>
159 <thead>
160 <th align='center'>
161 <?php echo htmlspecialchars(xl('Title'), ENT_NOQUOTES); ?>
162 </th>
164 <th align='center'>
165 <?php echo htmlspecialchars(xl('Date'), ENT_NOQUOTES); ?>
166 </th>
168 <th align='center'>
169 <?php echo htmlspecialchars(xl('Status'), ENT_NOQUOTES); ?>
170 </th>
172 </thead>
173 <tbody> <!-- added for better print-ability -->
174 <?php
176 $res = listingReportDatabase($_POST['form_begin_date'], $_POST['form_end_date']);
177 while ($row = sqlFetchArray($res)) {
178 // Figure out the title and link
179 if ($row['type'] == "cqm") {
180 if (!$GLOBALS['enable_cqm']) {
181 continue;
184 $type_title = xl('Clinical Quality Measures (CQM)');
185 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
186 } else if ($row['type'] == "cqm_2011") {
187 if (!$GLOBALS['enable_cqm']) {
188 continue;
191 $type_title = xl('2011 Clinical Quality Measures (CQM)');
192 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
193 } else if ($row['type'] == "cqm_2014") {
194 if (!$GLOBALS['enable_cqm']) {
195 continue;
198 $type_title = xl('2014 Clinical Quality Measures (CQM)');
199 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
200 } else if ($row['type'] == "amc") {
201 if (!$GLOBALS['enable_amc']) {
202 continue;
205 $type_title = xl('Automated Measure Calculations (AMC)');
206 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
207 } else if ($row['type'] == "amc_2011") {
208 if (!$GLOBALS['enable_amc']) {
209 continue;
212 $type_title = xl('2011 Automated Measure Calculations (AMC)');
213 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
214 } else if ($row['type'] == "amc_2014") {
215 if (!$GLOBALS['enable_amc']) {
216 continue;
219 $type_title = xl('2014 Automated Measure Calculations (AMC)');
220 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
221 } else if ($row['type'] == "amc_2014_stage1") {
222 if (!$GLOBALS['enable_amc']) {
223 continue;
226 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage I');
227 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
228 } else if ($row['type'] == "amc_2014_stage2") {
229 if (!$GLOBALS['enable_amc']) {
230 continue;
233 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage II');
234 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
235 } else if ($row['type'] == "process_reminders") {
236 if (!$GLOBALS['enable_cdr']) {
237 continue;
240 $type_title = xl('Processing Patient Reminders');
241 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
242 } else if ($row['type'] == "process_send_reminders") {
243 if (!$GLOBALS['enable_cdr']) {
244 continue;
247 $type_title = xl('Processing and Sending Patient Reminders');
248 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
249 } else if ($row['type'] == "passive_alert") {
250 if (!$GLOBALS['enable_cdr']) {
251 continue;
254 $type_title = xl('Standard Measures (Passive Alerts)');
255 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
256 } else if ($row['type'] == "active_alert") {
257 if (!$GLOBALS['enable_cdr']) {
258 continue;
261 $type_title = xl('Standard Measures (Active Alerts)');
262 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
263 } else if ($row['type'] == "patient_reminder") {
264 if (!$GLOBALS['enable_cdr']) {
265 continue;
268 $type_title = xl('Standard Measures (Patient Reminders)');
269 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
270 } else {
271 // Not identified, so give an unknown title
272 $type_title = xl('Unknown') . "-" . $row['type'];
273 $link="";
276 <tr>
277 <?php if ($row["progress"] == "complete") { ?>
278 <td align='center'><a href='<?php echo $link; ?>' onclick='top.restoreSession()'><?php echo text($type_title); ?></a></td>
279 <?php } else { ?>
280 <td align='center'><?php echo text($type_title); ?></td>
281 <?php } ?>
282 <td align='center'><?php echo text($row["date_report"]); ?></td>
283 <?php if ($row["progress"] == "complete") { ?>
284 <td align='center'><?php echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?></td>
285 <?php } else { ?>
286 <td align='center'><?php echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?></td>
287 <?php } ?>
289 </tr>
291 <?php
292 } // $row = sqlFetchArray($res) while
294 </tbody>
295 </table>
296 </div> <!-- end of search results -->
298 </form>
300 </body>
302 </html>