3 * Generic script to list stored reports. Part of the module to allow the tracking,
4 * storing, and viewing of reports.
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']);
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 ?>
46 <style type
="text/css">
47 /* specifically include & exclude from printing */
53 #report_parameters_daterange {
57 #report_results table {
62 /* specifically exclude some from the screen */
64 #report_parameters_daterange {
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">
86 <div style
='float:left'>
91 <td
class='control-label'>
92 <?php
echo xlt('Begin Date'); ?
>:
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'>
101 <td
class='control-label'>
102 <?php
echo xlt('End Date'); ?
>:
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'>
113 <td align
='left' valign
='middle' height
="100%">
114 <table style
='border-left:1px solid; width:100%; height:100%' >
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'); ?
>
122 <a href
='#' id
='refresh_button' class='btn btn-default btn-refresh' onclick
='top.restoreSession(); $("#theform").submit()'>
123 <?php
echo xlt('Refresh'); ?
>
134 </div
> <!-- end of search parameters
-->
140 <div id
="report_results">
145 <?php
echo xlt('Title'); ?
>
149 <?php
echo xlt('Date'); ?
>
153 <?php
echo xlt('Status'); ?
>
157 <tbody
> <!-- added
for better
print-ability
-->
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
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']) {
252 $type_title = xl('Standard Measures (Patient Reminders)');
253 $link="cqm.php?report_id=" . attr($row["report_id"]) . "&back=list";
255 // Not identified, so give an unknown title
256 $type_title = xl('Unknown') . "-" . $row['type'];
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
>
264 <td align
='center'><?php
echo text($type_title); ?
></td
>
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
>
270 <td align
='center'><?php
echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?
></td
>
276 } // $row = sqlFetchArray($res) while
280 </div
> <!-- end of search results
-->