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>;.
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";
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 ?>
70 <style type
="text/css">
72 /* specifically include & exclude from printing */
78 #report_parameters_daterange {
82 #report_results table {
87 /* specifically exclude some from the screen */
89 #report_parameters_daterange {
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">
112 <div style
='float:left'>
117 <td
class='label_custom'>
118 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
121 <input type
='text' name
='form_begin_date' id
='form_begin_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_begin_date
'], ENT_QUOTES); ?>'
123 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
128 <td
class='label_custom'>
129 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
132 <input type
='text' name
='form_end_date' id
='form_end_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_end_date
'], ENT_QUOTES); ?>'
134 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
141 <td align
='left' valign
='middle' height
="100%">
142 <table style
='border-left:1px solid; width:100%; height:100%' >
145 <div style
='margin-left:15px'>
146 <a id
='search_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
148 <?php
echo htmlspecialchars( xl('Search'), ENT_NOQUOTES
); ?
>
151 <a id
='refresh_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
153 <?php
echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES
); ?
>
164 </div
> <!-- end of search parameters
-->
170 <div id
="report_results">
175 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
179 <?php
echo htmlspecialchars( xl('Date'), ENT_NOQUOTES
); ?
>
183 <?php
echo htmlspecialchars( xl('Status'), ENT_NOQUOTES
); ?
>
187 <tbody
> <!-- added
for better
print-ability
-->
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";
260 // Not identified, so give an unknown title
261 $type_title = xl('Unknown') . "-" . $row['type'];
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
>
269 <td align
='center'><?php
echo text($type_title); ?
></td
>
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
>
275 <td align
='center'><?php
echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?
></td
>
281 } // $row = sqlFetchArray($res) while
285 </div
> <!-- end of search results
-->