enable to upload docx templates (#1961)
[openemr.git] / interface / reports / report_results.php
blobf15d96425240ce12494d2be592a14330a27b76df
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 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2012-2017 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
14 require_once("../globals.php");
15 require_once("../../library/patient.inc");
16 require_once "$srcdir/options.inc.php";
17 require_once "$srcdir/clinical_rules.php";
18 require_once "$srcdir/report_database.inc";
20 use OpenEMR\Core\Header;
22 $form_begin_date = DateTimeToYYYYMMDDHHMMSS($_POST['form_begin_date']);
23 $form_end_date = DateTimeToYYYYMMDDHHMMSS($_POST['form_end_date']);
26 <html>
28 <head>
30 <title><?php echo xlt('Report Results/History'); ?></title>
32 <?php Header::setupHeader('datetime-picker'); ?>
34 <script LANGUAGE="JavaScript">
35 $( document ).ready(function(){
36 $('.datepicker').datetimepicker({
37 <?php $datetimepicker_timepicker = true; ?>
38 <?php $datetimepicker_showseconds = true; ?>
39 <?php $datetimepicker_formatInput = true; ?>
40 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
41 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
42 });
43 });
44 </script>
46 <style type="text/css">
47 /* specifically include & exclude from printing */
48 @media print {
49 #report_parameters {
50 visibility: hidden;
51 display: none;
53 #report_parameters_daterange {
54 visibility: visible;
55 display: inline;
57 #report_results table {
58 margin-top: 0px;
62 /* specifically exclude some from the screen */
63 @media screen {
64 #report_parameters_daterange {
65 visibility: hidden;
66 display: none;
69 </style>
70 </head>
72 <body class="body_top">
74 <!-- Required for the popup date selectors -->
75 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
77 <span class='title'><?php echo xlt('Report History/Results'); ?></span>
79 <form method='post' name='theform' id='theform' action='report_results.php' onsubmit='return top.restoreSession()'>
81 <div id="report_parameters">
83 <table>
84 <tr>
85 <td width='470px'>
86 <div style='float:left'>
88 <table class='text'>
90 <tr>
91 <td class='control-label'>
92 <?php echo xlt('Begin Date'); ?>:
93 </td>
94 <td>
95 <input type='text' name='form_begin_date' id='form_begin_date' size='20' value='<?php echo attr(oeFormatDateTime($form_begin_date, 0, true)); ?>'
96 class='datepicker form-control'>
97 </td>
98 </tr>
100 <tr>
101 <td class='control-label'>
102 <?php echo xlt('End Date'); ?>:
103 </td>
104 <td>
105 <input type='text' name='form_end_date' id='form_end_date' size='20' value='<?php echo attr(oeFormatDateTime($form_end_date, 0, true)); ?>'
106 class='datepicker form-control'>
107 </td>
108 </tr>
109 </table>
110 </div>
112 </td>
113 <td align='left' valign='middle' height="100%">
114 <table style='border-left:1px solid; width:100%; height:100%' >
115 <tr>
116 <td>
117 <div class="text-center">
118 <div class="btn-group" role="group">
119 <a href='#' id='search_button' class='btn btn-default btn-search' onclick='top.restoreSession(); $("#theform").submit()'>
120 <?php echo xlt('Search'); ?>
121 </a>
122 <a href='#' id='refresh_button' class='btn btn-default btn-refresh' onclick='top.restoreSession(); $("#theform").submit()'>
123 <?php echo xlt('Refresh'); ?>
124 </a>
125 </div>
126 </div>
127 </td>
128 </tr>
129 </table>
130 </td>
131 </tr>
132 </table>
134 </div> <!-- end of search parameters -->
136 <br>
140 <div id="report_results">
141 <table>
143 <thead>
144 <th align='center'>
145 <?php echo xlt('Title'); ?>
146 </th>
148 <th align='center'>
149 <?php echo xlt('Date'); ?>
150 </th>
152 <th align='center'>
153 <?php echo xlt('Status'); ?>
154 </th>
156 </thead>
157 <tbody> <!-- added for better print-ability -->
158 <?php
160 $res = listingReportDatabase($form_begin_date, $form_end_date);
161 while ($row = sqlFetchArray($res)) {
162 // Figure out the title and link
163 if ($row['type'] == "cqm") {
164 if (!$GLOBALS['enable_cqm']) {
165 continue;
168 $type_title = xl('Clinical Quality Measures (CQM)');
169 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
170 } else if ($row['type'] == "cqm_2011") {
171 if (!$GLOBALS['enable_cqm']) {
172 continue;
175 $type_title = xl('2011 Clinical Quality Measures (CQM)');
176 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
177 } else if ($row['type'] == "cqm_2014") {
178 if (!$GLOBALS['enable_cqm']) {
179 continue;
182 $type_title = xl('2014 Clinical Quality Measures (CQM)');
183 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
184 } else if ($row['type'] == "amc") {
185 if (!$GLOBALS['enable_amc']) {
186 continue;
189 $type_title = xl('Automated Measure Calculations (AMC)');
190 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
191 } else if ($row['type'] == "amc_2011") {
192 if (!$GLOBALS['enable_amc']) {
193 continue;
196 $type_title = xl('2011 Automated Measure Calculations (AMC)');
197 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
198 } else if ($row['type'] == "amc_2014") {
199 if (!$GLOBALS['enable_amc']) {
200 continue;
203 $type_title = xl('2014 Automated Measure Calculations (AMC)');
204 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
205 } else if ($row['type'] == "amc_2014_stage1") {
206 if (!$GLOBALS['enable_amc']) {
207 continue;
210 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage I');
211 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
212 } else if ($row['type'] == "amc_2014_stage2") {
213 if (!$GLOBALS['enable_amc']) {
214 continue;
217 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage II');
218 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
219 } else if ($row['type'] == "process_reminders") {
220 if (!$GLOBALS['enable_cdr']) {
221 continue;
224 $type_title = xl('Processing Patient Reminders');
225 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
226 } else if ($row['type'] == "process_send_reminders") {
227 if (!$GLOBALS['enable_cdr']) {
228 continue;
231 $type_title = xl('Processing and Sending Patient Reminders');
232 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
233 } else if ($row['type'] == "passive_alert") {
234 if (!$GLOBALS['enable_cdr']) {
235 continue;
238 $type_title = xl('Standard Measures (Passive Alerts)');
239 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
240 } else if ($row['type'] == "active_alert") {
241 if (!$GLOBALS['enable_cdr']) {
242 continue;
245 $type_title = xl('Standard Measures (Active Alerts)');
246 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
247 } else if ($row['type'] == "patient_reminder") {
248 if (!$GLOBALS['enable_cdr']) {
249 continue;
252 $type_title = xl('Standard Measures (Patient Reminders)');
253 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
254 } else {
255 // Not identified, so give an unknown title
256 $type_title = xl('Unknown') . "-" . $row['type'];
257 $link="";
260 <tr>
261 <?php if ($row["progress"] == "complete") { ?>
262 <td align='center'><a href='<?php echo $link; ?>' onclick='top.restoreSession()'><?php echo text($type_title); ?></a></td>
263 <?php } else { ?>
264 <td align='center'><?php echo text($type_title); ?></td>
265 <?php } ?>
266 <td align='center'><?php echo text(oeFormatDateTime($row["date_report"], "global", true)); ?></td>
267 <?php if ($row["progress"] == "complete") { ?>
268 <td align='center'><?php echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?></td>
269 <?php } else { ?>
270 <td align='center'><?php echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?></td>
271 <?php } ?>
273 </tr>
275 <?php
276 } // $row = sqlFetchArray($res) while
278 </tbody>
279 </table>
280 </div> <!-- end of search results -->
282 </form>
284 </body>
286 </html>