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>;.
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";
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 ?>
71 <style type
="text/css">
73 /* specifically include & exclude from printing */
79 #report_parameters_daterange {
83 #report_results table {
88 /* specifically exclude some from the screen */
90 #report_parameters_daterange {
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">
113 <div style
='float:left'>
119 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
122 <input type
='text' name
='form_begin_date' id
='form_begin_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_begin_date
'], ENT_QUOTES); ?>'
124 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
130 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
133 <input type
='text' name
='form_end_date' id
='form_end_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_end_date
'], ENT_QUOTES); ?>'
135 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
142 <td align
='left' valign
='middle' height
="100%">
143 <table style
='border-left:1px solid; width:100%; height:100%' >
146 <div style
='margin-left:15px'>
147 <a id
='search_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
149 <?php
echo htmlspecialchars( xl('Search'), ENT_NOQUOTES
); ?
>
152 <a id
='refresh_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
154 <?php
echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES
); ?
>
165 </div
> <!-- end of search parameters
-->
171 <div id
="report_results">
176 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
180 <?php
echo htmlspecialchars( xl('Date'), ENT_NOQUOTES
); ?
>
184 <?php
echo htmlspecialchars( xl('Status'), ENT_NOQUOTES
); ?
>
188 <tbody
> <!-- added
for better
print-ability
-->
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";
261 // Not identified, so give an unknown title
262 $type_title = xl('Unknown') . "-" . $row['type'];
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
>
270 <td align
='center'><?php
echo text($type_title); ?
></td
>
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
>
276 <td align
='center'><?php
echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?
></td
>
282 } // $row = sqlFetchArray($res) while
286 </div
> <!-- end of search results
-->