4 * Generic script to list stored reports. Part of the module to allow the tracking,
5 * storing, and viewing of reports.
8 * @link http://www.open-emr.org
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2012-2018 Brady Miller <brady.g.miller@gmail.com>
11 * @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\Common\Csrf\CsrfUtils
;
21 use OpenEMR\Core\Header
;
24 if (!CsrfUtils
::verifyCsrfToken($_POST["csrf_token_form"])) {
25 CsrfUtils
::csrfNotVerified();
29 $form_begin_date = DateTimeToYYYYMMDDHHMMSS($_POST['form_begin_date'] ??
'');
30 $form_end_date = DateTimeToYYYYMMDDHHMMSS($_POST['form_end_date'] ??
'');
37 <title
><?php
echo xlt('Report Results/History'); ?
></title
>
39 <?php Header
::setupHeader('datetime-picker'); ?
>
43 $
('.datepicker').datetimepicker({
44 <?php
$datetimepicker_timepicker = true; ?
>
45 <?php
$datetimepicker_showseconds = true; ?
>
46 <?php
$datetimepicker_formatInput = true; ?
>
47 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
48 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
54 /* specifically include & exclude from printing */
60 #report_parameters_daterange {
64 #report_results table {
69 /* specifically exclude some from the screen */
71 #report_parameters_daterange {
79 <body
class="body_top">
81 <!-- Required
for the popup date selectors
-->
82 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
84 <span
class='title'><?php
echo xlt('Report History/Results'); ?
></span
>
86 <form method
='post' name
='theform' id
='theform' action
='report_results.php' onsubmit
='return top.restoreSession()'>
87 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
89 <div id
="report_parameters">
94 <div
class="float-left">
99 <td
class='col-form-label'>
100 <?php
echo xlt('Begin Date'); ?
>:
103 <input type
='text' name
='form_begin_date' id
='form_begin_date' size
='20' value
='<?php echo attr(oeFormatDateTime($form_begin_date, 0, true)); ?>'
104 class='datepicker form-control' />
109 <td
class='col-form-label'>
110 <?php
echo xlt('End Date'); ?
>:
113 <input type
='text' name
='form_end_date' id
='form_end_date' size
='20' value
='<?php echo attr(oeFormatDateTime($form_end_date, 0, true)); ?>'
114 class='datepicker form-control' />
121 <td
class='h-100' align
='left' valign
='middle'>
122 <table
class='w-100 h-100' style
='border-left: 1px solid;'>
125 <div
class="text-center">
126 <div
class="btn-group" role
="group">
127 <a href
='#' id
='search_button' class='btn btn-secondary btn-search' onclick
='top.restoreSession(); $("#theform").submit()'>
128 <?php
echo xlt('Search'); ?
>
130 <a href
='#' id
='refresh_button' class='btn btn-secondary btn-refresh' onclick
='top.restoreSession(); $("#theform").submit()'>
131 <?php
echo xlt('Refresh'); ?
>
142 </div
> <!-- end of search parameters
-->
148 <div id
="report_results">
149 <table
class='table'>
151 <thead
class='thead-light'>
152 <th
class='text-center'>
153 <?php
echo xlt('Title'); ?
>
156 <th
class='text-center'>
157 <?php
echo xlt('Date'); ?
>
160 <th
class='text-center'>
161 <?php
echo xlt('Status'); ?
>
165 <tbody
> <!-- added
for better
print-ability
-->
168 $res = listingReportDatabase($form_begin_date, $form_end_date);
169 while ($row = sqlFetchArray($res)) {
170 // Figure out the title and link
171 if ($row['type'] == "cqm") {
172 if (!$GLOBALS['enable_cqm']) {
176 $type_title = xl('Clinical Quality Measures (CQM)');
177 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
178 } elseif ($row['type'] == "cqm_2011") {
179 if (!$GLOBALS['enable_cqm']) {
183 $type_title = xl('2011 Clinical Quality Measures (CQM)');
184 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
185 } elseif ($row['type'] == "cqm_2014") {
186 if (!$GLOBALS['enable_cqm']) {
190 $type_title = xl('2014 Clinical Quality Measures (CQM)');
191 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
192 } elseif ($row['type'] == "amc") {
193 if (!$GLOBALS['enable_amc']) {
197 $type_title = xl('Automated Measure Calculations (AMC)');
198 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
199 } elseif ($row['type'] == "amc_2011") {
200 if (!$GLOBALS['enable_amc']) {
204 $type_title = xl('2011 Automated Measure Calculations (AMC)');
205 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
206 } elseif ($row['type'] == "amc_2014") {
207 if (!$GLOBALS['enable_amc']) {
211 $type_title = xl('2014 Automated Measure Calculations (AMC)');
212 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
213 } elseif ($row['type'] == "amc_2014_stage1") {
214 if (!$GLOBALS['enable_amc']) {
218 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage I');
219 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
220 } elseif ($row['type'] == "amc_2014_stage2") {
221 if (!$GLOBALS['enable_amc']) {
225 $type_title = xl('2014 Automated Measure Calculations (AMC) - Stage II');
226 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
227 } elseif ($row['type'] == "process_reminders") {
228 if (!$GLOBALS['enable_cdr']) {
232 $type_title = xl('Processing Patient Reminders');
233 $link = "../batchcom/batch_reminders.php?report_id=" . attr_url($row["report_id"]);
234 } elseif ($row['type'] == "process_send_reminders") {
235 if (!$GLOBALS['enable_cdr']) {
239 $type_title = xl('Processing and Sending Patient Reminders');
240 $link = "../batchcom/batch_reminders.php?report_id=" . attr_url($row["report_id"]);
241 } elseif ($row['type'] == "passive_alert") {
242 if (!$GLOBALS['enable_cdr']) {
246 $type_title = xl('Standard Measures (Passive Alerts)');
247 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
248 } elseif ($row['type'] == "active_alert") {
249 if (!$GLOBALS['enable_cdr']) {
253 $type_title = xl('Standard Measures (Active Alerts)');
254 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
255 } elseif ($row['type'] == "patient_reminder") {
256 if (!$GLOBALS['enable_cdr']) {
260 $type_title = xl('Standard Measures (Patient Reminders)');
261 $link = "cqm.php?report_id=" . attr_url($row["report_id"]) . "&back=list";
263 // Not identified, so give an unknown title
264 $type_title = xl('Unknown') . "-" . $row['type'];
269 <?php
if ($row["progress"] == "complete") { ?
>
270 <td
class='text-center'><a href
='<?php echo $link; ?>' onclick
='top.restoreSession()'><?php
echo text($type_title); ?
></a
></td
>
272 <td
class='text-center'><?php
echo text($type_title); ?
></td
>
274 <td
class='text-center'><?php
echo text(oeFormatDateTime($row["date_report"], "global", true)); ?
></td
>
275 <?php
if ($row["progress"] == "complete") { ?
>
276 <td
class='text-center'><?php
echo xlt("Complete") . " (" . xlt("Processing Time") . ": " . text($row['report_time_processing']) . " " . xlt("Minutes") . ")"; ?
></td
>
278 <td
class='text-center'><?php
echo xlt("Pending") . " (" . text($row["progress_items"]) . " / " . text($row["total_items"]) . " " . xlt("Patients Processed") . ")"; ?
></td
>
284 } // $row = sqlFetchArray($res) while
288 </div
> <!-- end of search results
-->