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 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/formdata.inc.php";
37 require_once "$srcdir/clinical_rules.php";
38 require_once "$srcdir/report_database.inc";
44 <?php
html_header_show();?
>
46 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/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"></script
>
52 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
53 <script type
="text/javascript" src
="../../library/js/jquery.1.3.2.js"></script
>
55 <script LANGUAGE
="JavaScript">
57 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
61 <style type
="text/css">
63 /* specifically include & exclude from printing */
69 #report_parameters_daterange {
73 #report_results table {
78 /* specifically exclude some from the screen */
80 #report_parameters_daterange {
89 <body
class="body_top">
91 <!-- Required
for the popup date selectors
-->
92 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
94 <span
class='title'><?php
echo htmlspecialchars( xl('Report History/Results'), ENT_NOQUOTES
); ?
></span
>
96 <form method
='post' name
='theform' id
='theform' action
='report_results.php' onsubmit
='return top.restoreSession()'>
98 <div id
="report_parameters">
103 <div style
='float:left'>
109 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
112 <input type
='text' name
='form_begin_date' id
='form_begin_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_begin_date
'], ENT_QUOTES); ?>'
113 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
114 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
115 id
='img_begin_date' border
='0' alt
='[?]' style
='cursor:pointer'
116 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
122 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
125 <input type
='text' name
='form_end_date' id
='form_end_date' size
='20' value
='<?php echo htmlspecialchars( $_POST['form_end_date
'], ENT_QUOTES); ?>'
126 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
127 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
128 id
='img_end_date' border
='0' alt
='[?]' style
='cursor:pointer'
129 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
136 <td align
='left' valign
='middle' height
="100%">
137 <table style
='border-left:1px solid; width:100%; height:100%' >
140 <div style
='margin-left:15px'>
141 <a id
='search_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
143 <?php
echo htmlspecialchars( xl('Search'), ENT_NOQUOTES
); ?
>
146 <a id
='refresh_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
148 <?php
echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES
); ?
>
159 </div
> <!-- end of search parameters
-->
165 <div id
="report_results">
170 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
174 <?php
echo htmlspecialchars( xl('Date'), ENT_NOQUOTES
); ?
>
178 <?php
echo htmlspecialchars( xl('Status'), ENT_NOQUOTES
); ?
>
182 <tbody
> <!-- added
for better
print-ability
-->
185 $res = listingReportDatabase($_POST['form_begin_date'],$_POST['form_end_date']);
186 while ($row = sqlFetchArray($res)) {
188 // Figure out the title and link
189 if ($row['type'] == "cqm") {
190 if (!$GLOBALS['enable_cqm']) continue;
191 $type_title = xl('Clinical Quality Measures (CQM)');
192 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
194 else if ($row['type'] == "amc") {
195 if (!$GLOBALS['enable_amc']) continue;
196 $type_title = xl('Automated Measure Calculations (AMC)');
197 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
199 else if ($row['type'] == "process_reminders") {
200 if (!$GLOBALS['enable_cdr']) continue;
201 $type_title = xl('Processing Patient Reminders');
202 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
204 else if ($row['type'] == "process_send_reminders") {
205 if (!$GLOBALS['enable_cdr']) continue;
206 $type_title = xl('Processing and Sending Patient Reminders');
207 $link="../batchcom/batch_reminders.php?report_id=" . attr($row["report_id"]);
209 else if ($row['type'] == "passive_alert") {
210 if (!$GLOBALS['enable_cdr']) continue;
211 $type_title = xl('Standard Measures (Passive Alerts)');
212 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
214 else if ($row['type'] == "active_alert") {
215 if (!$GLOBALS['enable_cdr']) continue;
216 $type_title = xl('Standard Measures (Active Alerts)');
217 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
219 else if ($row['type'] == "patient_reminder") {
220 if (!$GLOBALS['enable_cdr']) continue;
221 $type_title = xl('Standard Measures (Patient Reminders)');
222 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
225 // Not identified, so give an unknown title
226 $type_title = xl('Unknown');
231 <?php
if ($row["progress"] == "complete") { ?
>
232 <td align
='center'><a href
='<?php echo $link; ?>' onclick
='top.restoreSession()'><?php
echo text($type_title); ?
></a
></td
>
234 <td align
='center'><?php
echo text($type_title); ?
></td
>
236 <td align
='center'><?php
echo text($row["date_report"]); ?
></td
>
237 <?php
if ($row["progress"] == "complete") { ?
>
238 <td align
='center'><?php
echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?
></td
>
240 <td align
='center'><?php
echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?
></td
>
246 } // $row = sqlFetchArray($res) while
250 </div
> <!-- end of search results
-->
256 <!-- stuff
for the popup calendar
-->
257 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
258 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
259 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
260 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
261 <script language
="Javascript">
262 Calendar
.setup({inputField
:"form_begin_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_begin_date", showsTime
:'true'});
263 Calendar
.setup({inputField
:"form_end_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_end_date", showsTime
:'true'});