4 * Copyright (C) 2010-2017 Brady Miller <brady.g.miller@gmail.com>
6 * LICENSE: This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @author Brady Miller <brady.g.miller@gmail.com>
19 * @link http://www.open-emr.org
22 //SANITIZE ALL ESCAPES
23 $sanitize_all_escapes=true;
26 //STOP FAKE REGISTER GLOBALS
27 $fake_register_globals=false;
30 require_once("../globals.php");
31 require_once("../../library/patient.inc");
32 require_once "$srcdir/options.inc.php";
33 require_once "$srcdir/clinical_rules.php";
34 require_once "$srcdir/report_database.inc";
36 // See if showing an old report or creating a new report
37 $report_id = (isset($_GET['report_id'])) ?
trim($_GET['report_id']) : "";
39 // Collect the back variable, if pertinent
40 $back_link = (isset($_GET['back'])) ?
trim($_GET['back']) : "";
42 // If showing an old report, then collect information
43 if (!empty($report_id)) {
44 $report_view = collectReportDatabase($report_id);
45 $date_report = $report_view['date_report'];
46 $type_report = $report_view['type'];
48 $type_report = (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ||
49 ($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) ?
$type_report : "standard";
50 $rule_filter = $report_view['type'];
52 if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) {
53 $begin_date = $report_view['date_begin'];
54 $labs_manual = $report_view['labs_manual'];
56 $target_date = $report_view['date_target'];
57 $plan_filter = $report_view['plan'];
58 $organize_method = $report_view['organize_mode'];
59 $provider = $report_view['provider'];
60 $pat_prov_rel = $report_view['pat_prov_rel'];
61 $dataSheet = json_decode($report_view['data'],TRUE);
64 // Collect report type parameter (standard, amc, cqm)
65 // Note that need to convert amc_2011 and amc_2014 to amc and cqm_2011 and cqm_2014 to cqm
66 // to simplify for when submitting for a new report.
67 $type_report = (isset($_GET['type'])) ?
trim($_GET['type']) : "standard";
69 if ( ($type_report == "cqm_2011") ||
($type_report == "cqm_2014") ) {
72 if ( ($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ) {
75 // Collect form parameters (set defaults if empty)
76 if ($type_report == "amc") {
77 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
78 $labs_manual = (isset($_POST['labs_manual_entry'])) ?
trim($_POST['labs_manual_entry']) : "0";
80 $target_date = (isset($_POST['form_target_date'])) ?
trim($_POST['form_target_date']) : date('Y-m-d H:i:s');
81 $rule_filter = (isset($_POST['form_rule_filter'])) ?
trim($_POST['form_rule_filter']) : "";
82 $plan_filter = (isset($_POST['form_plan_filter'])) ?
trim($_POST['form_plan_filter']) : "";
83 $organize_method = (empty($plan_filter)) ?
"default" : "plans";
84 $provider = trim($_POST['form_provider']);
85 $pat_prov_rel = (empty($_POST['form_pat_prov_rel'])) ?
"primary" : trim($_POST['form_pat_prov_rel']);
92 <?php
html_header_show();?
>
94 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
95 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
97 <?php
if ($type_report == "standard") { ?
>
98 <title
><?php
echo xlt('Standard Measures'); ?
></title
>
101 <?php
if ($type_report == "cqm") { ?
>
102 <title
><?php
echo xlt('Clinical Quality Measures (CQM)'); ?
></title
>
104 <?php
if ($type_report == "cqm_2011") { ?
>
105 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
></title
>
107 <?php
if ($type_report == "cqm_2014") { ?
>
108 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
></title
>
111 <?php
if ($type_report == "amc") { ?
>
112 <title
><?php
echo xlt('Automated Measure Calculations (AMC)'); ?
></title
>
114 <?php
if ($type_report == "amc_2011") { ?
>
115 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
></title
>
117 <?php
if ($type_report == "amc_2014_stage1") { ?
>
118 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage I'); ?
></title
>
120 <?php
if ($type_report == "amc_2014_stage2") { ?
>
121 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage II'); ?
></title
>
124 <script type
="text/javascript" src
="../../library/overlib_mini.js"></script
>
125 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
126 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
127 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
128 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
130 <script LANGUAGE
="JavaScript">
132 var mypcc
= '<?php echo text($GLOBALS['phone_country_code
']) ?>';
134 $
(document
).ready(function() {
135 var win
= top
.printLogSetup ? top
: opener
.top
;
136 win
.printLogSetup(document
.getElementById('printbutton'));
138 $
('.datepicker').datetimepicker({
139 <?php
$datetimepicker_timepicker = true; ?
>
140 <?php
$datetimepicker_formatInput = false; ?
>
141 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
142 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
146 function runReport() {
149 if (!(validateForm())) {
150 alert("<?php echo xls("Rule Set
and Plan Set selections are not consistent
. Please fix
and Submit again
."); ?>");
154 // Showing processing wheel
155 $
("#processing").show();
157 // hide Submit buttons
158 $
("#submit_button").hide();
159 $
("#xmla_button").hide();
160 $
("#xmlb_button").hide();
161 $
("#xmlc_button").hide();
162 $
("#print_button").hide();
163 $
("#genQRDA").hide();
166 $
("#instructions_text").hide();
168 // Collect an id string via an ajax request
169 top
.restoreSession();
170 $
.get("../../library/ajax/collect_new_report_id.php",
172 // Set the report id in page form
173 $
("#form_new_report_id").attr("value",data
);
175 // Start collection status checks
176 collectStatus($
("#form_new_report_id").val());
179 top
.restoreSession();
180 $
.post("../../library/ajax/execute_cdr_report.php",
181 {provider
: $
("#form_provider").val(),
182 type
: $
("#form_rule_filter").val(),
183 date_target
: $
("#form_target_date").val(),
184 date_begin
: $
("#form_begin_date").val(),
185 plan
: $
("#form_plan_filter").val(),
186 labs
: $
("#labs_manual_entry").val(),
187 pat_prov_rel
: $
("#form_pat_prov_rel").val(),
188 execute_report_id
: $
("#form_new_report_id").val()
193 function collectStatus(report_id
) {
194 // Collect the status string via an ajax request and place in DOM at timed intervals
195 top
.restoreSession();
196 // Do not send the skip_timeout_reset parameter, so don't close window before report is done.
197 $
.post("../../library/ajax/status_report.php",
198 {status_report_id
: report_id
},
200 if (data
== "PENDING") {
201 // Place the pending string in the DOM
202 $
('#status_span').replaceWith("<span id='status_span'><?php echo xlt("Preparing To Run Report
"); ?></span>");
204 else if (data
== "COMPLETE") {
205 // Go into the results page
206 top
.restoreSession();
207 link_report
= "cqm.php?report_id="+report_id
;
208 window
.open(link_report
,'_self',false);
209 //$("#processing").hide();
210 //$('#status_span').replaceWith("<a id='view_button' href='cqm.php?report_id="+report_id+"' class='css_button' onclick='top.restoreSession()'><span><?php echo xlt('View Report'); ?></span></a>");
213 // Place the string in the DOM
214 $
('#status_span').replaceWith("<span id='status_span'>"+data+
"</span>");
217 // run status check every 10 seconds
218 var repeater
= setTimeout("collectStatus("+report_id+
")", 10000);
221 function GenXml(sNested
) {
222 top
.restoreSession();
223 //QRDA Category III Export
224 if(sNested
== "QRDA"){
225 var form_rule_filter
= theform
.form_rule_filter
.value
226 var sLoc
= '../../custom/export_qrda_xml.php?target_date=' + theform
.form_target_date
.value +
'&qrda_version=3&rule_filter=cqm_2014&form_provider='+theform
.form_provider
.value+
"&report_id=<?php echo attr($report_id);?>";
228 var sLoc
= '../../custom/export_registry_xml.php?&target_date=' + theform
.form_target_date
.value +
'&nested=' + sNested
;
230 dlgopen(sLoc
, '_blank', 600, 500);
234 //QRDA I - 2014 Download
235 function downloadQRDA() {
236 top
.restoreSession();
237 var reportID
= '<?php echo attr($report_id); ?>';
238 var provider
= $
("#form_provider").val();
239 sLoc
= '../../custom/download_qrda.php?&report_id=' + reportID +
'&provider_id=' + provider
;
240 dlgopen(sLoc
, '_blank', 600, 500);
243 function validateForm() {
244 <?php
if ( (empty($report_id)) && ($type_report == "cqm") ) { ?
>
245 // If this is a cqm and plan set not set to ignore, then need to ensure consistent with the rules set
246 if ($
("#form_plan_filter").val() != '') {
247 if ($
("#form_rule_filter").val() == $
("#form_plan_filter").val()) {
261 function Form_Validate() {
262 <?php
if ( (empty($report_id)) && (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) ){ ?
>
263 var d
= document
.forms
[0];
264 FromDate
= d
.form_begin_date
.value
;
265 ToDate
= d
.form_target_date
.value
;
266 if ( (FromDate
.length
> 0) && (ToDate
.length
> 0) ) {
267 if (FromDate
> ToDate
){
268 alert("<?php echo xls('End date must be later than Begin date!'); ?>");
274 //For Results are in Gray Background & disabling anchor links
275 <?php
if($report_id != ""){?
>
276 $
("#report_results").css("opacity", '0.4');
277 $
("#report_results").css("filter", 'alpha(opacity=40)');
278 $
("a").removeAttr("href");
281 $
("#form_refresh").attr("value","true");
288 <style type
="text/css">
290 /* specifically include & exclude from printing */
296 #report_parameters_daterange {
300 #report_results table {
305 /* specifically exclude some from the screen */
307 #report_parameters_daterange {
316 <body
class="body_top">
318 <!-- Required
for the popup date selectors
-->
319 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
321 <span
class='title'><?php
echo xlt('Report'); ?
> -
323 <?php
if ($type_report == "standard") { ?
>
324 <?php
echo xlt('Standard Measures'); ?
>
327 <?php
if ($type_report == "cqm") { ?
>
328 <?php
echo xlt('Clinical Quality Measures (CQM)'); ?
>
330 <?php
if ($type_report == "cqm_2011") { ?
>
331 <?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
>
333 <?php
if ($type_report == "cqm_2014") { ?
>
334 <?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
>
337 <?php
if ($type_report == "amc") { ?
>
338 <?php
echo xlt('Automated Measure Calculations (AMC)'); ?
>
340 <?php
if ($type_report == "amc_2011") { ?
>
341 <?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
>
343 <?php
if ($type_report == "amc_2014_stage1") { ?
>
344 <?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage I'); ?
>
346 <?php
if ($type_report == "amc_2014_stage2") { ?
>
347 <?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage II'); ?
>
350 <?php
if (!empty($report_id)) { ?
>
351 <?php
echo " - " . xlt('Date of Report') . ": " . text($date_report);
352 //prepare to disable form elements
353 $dis_text = " disabled='disabled' ";
358 <form method
='post' name
='theform' id
='theform' action
='cqm.php?type=<?php echo attr($type_report) ;?>' onsubmit
='return validateForm()'>
360 <div id
="report_parameters">
363 if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) $widthDyn = "410px";
367 <td scope
="row" width
='<?php echo $widthDyn;?>'>
368 <div style
='float:left'>
372 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
375 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
378 <input
<?php
echo $dis_text; ?
> type
='text' name
='form_begin_date' id
="form_begin_date" size
='20' value
='<?php echo htmlspecialchars( $begin_date, ENT_QUOTES); ?>'
380 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
381 <?php
if (empty($report_id)) { ?
>
389 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
390 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
392 <?php
echo htmlspecialchars( xl('Target Date'), ENT_NOQUOTES
); ?
>:
396 <input
<?php
echo $dis_text; ?
> type
='text' name
='form_target_date' id
="form_target_date" size
='20' value
='<?php echo htmlspecialchars( $target_date, ENT_QUOTES); ?>'
398 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
399 <?php
if (empty($report_id)) { ?
>
404 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
407 <?php
echo xlt('Rule Set'); ?
>:
410 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
411 <option value
='cqm' <?php
if ($rule_filter == "cqm") echo "selected"; ?
>>
412 <?php
echo xlt('All Clinical Quality Measures (CQM)'); ?
></option
>
413 <option value
='cqm_2011' <?php
if ($rule_filter == "cqm_2011") echo "selected"; ?
>>
414 <?php
echo xlt('2011 Clinical Quality Measures (CQM)'); ?
></option
>
415 <option value
='cqm_2014' <?php
if ($rule_filter == "cqm_2014") echo "selected"; ?
>>
416 <?php
echo xlt('2014 Clinical Quality Measures (CQM)'); ?
></option
>
422 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
425 <?php
echo xlt('Rule Set'); ?
>:
428 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
430 <?php
if ($rule_filter == "amc") { //only show this when displaying old reports. Not available option for new reports ?>
431 <option value
='amc' selected
>
432 <?php
echo xlt('All Automated Measure Calculations (AMC)'); ?
></option
>
435 <option value
='amc_2011' <?php
if ($rule_filter == "amc_2011") echo "selected"; ?
>>
436 <?php
echo xlt('2011 Automated Measure Calculations (AMC)'); ?
></option
>
437 <option value
='amc_2014_stage1' <?php
if ($rule_filter == "amc_2014_stage1") echo "selected"; ?
>>
438 <?php
echo xlt('2014 Automated Measure Calculations (AMC) - Stage I'); ?
></option
>
439 <option value
='amc_2014_stage2' <?php
if ($rule_filter == "amc_2014_stage2") echo "selected"; ?
>>
440 <?php
echo xlt('2014 Automated Measure Calculations (AMC) - Stage II'); ?
></option
>
446 <?php
if ($type_report == "standard") { ?
>
449 <?php
echo xlt('Rule Set'); ?
>:
452 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
453 <option value
='passive_alert' <?php
if ($rule_filter == "passive_alert") echo "selected"; ?
>>
454 <?php
echo xlt('Passive Alert Rules'); ?
></option
>
455 <option value
='active_alert' <?php
if ($rule_filter == "active_alert") echo "selected"; ?
>>
456 <?php
echo xlt('Active Alert Rules'); ?
></option
>
457 <option value
='patient_reminder' <?php
if ($rule_filter == "patient_reminder") echo "selected"; ?
>>
458 <?php
echo xlt('Patient Reminder Rules'); ?
></option
>
464 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
465 <input type
='hidden' id
='form_plan_filter' name
='form_plan_filter' value
=''>
469 <?php
echo htmlspecialchars( xl('Plan Set'), ENT_NOQUOTES
); ?
>:
472 <select
<?php
echo $dis_text; ?
> id
='form_plan_filter' name
='form_plan_filter'>
473 <option value
=''>-- <?php
echo htmlspecialchars( xl('Ignore'), ENT_NOQUOTES
); ?
> --</option
>
474 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
475 <option value
='cqm' <?php
if ($plan_filter == "cqm") echo "selected"; ?
>>
476 <?php
echo htmlspecialchars( xl('All Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
477 <option value
='cqm_2011' <?php
if ($plan_filter == "cqm_2011") echo "selected"; ?
>>
478 <?php
echo htmlspecialchars( xl('2011 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
479 <option value
='cqm_2014' <?php
if ($plan_filter == "cqm_2014") echo "selected"; ?
>>
480 <?php
echo htmlspecialchars( xl('2014 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
482 <?php
if ($type_report == "standard") { ?
>
483 <option value
='normal' <?php
if ($plan_filter == "normal") echo "selected"; ?
>>
484 <?php
echo htmlspecialchars( xl('Active Plans'), ENT_NOQUOTES
); ?
></option
>
492 <?php
echo htmlspecialchars( xl('Provider'), ENT_NOQUOTES
); ?
>:
497 // Build a drop-down list of providers.
500 $query = "SELECT id, lname, fname FROM users WHERE ".
501 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
503 $ures = sqlStatement($query);
505 echo " <select " . $dis_text . " id='form_provider' name='form_provider'>\n";
506 echo " <option value=''>-- " . htmlspecialchars( xl('All (Cumulative)'), ENT_NOQUOTES
) . " --\n";
508 echo " <option value='collate_outer'";
509 if ($provider == 'collate_outer') echo " selected";
510 echo ">-- " . htmlspecialchars( xl('All (Collated Format A)'), ENT_NOQUOTES
) . " --\n";
512 echo " <option value='collate_inner'";
513 if ($provider == 'collate_inner') echo " selected";
514 echo ">-- " . htmlspecialchars( xl('All (Collated Format B)'), ENT_NOQUOTES
) . " --\n";
516 while ($urow = sqlFetchArray($ures)) {
517 $provid = $urow['id'];
518 echo " <option value='".htmlspecialchars( $provid, ENT_QUOTES
)."'";
519 if ($provid == $provider) echo " selected";
520 echo ">" . htmlspecialchars( $urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
531 <?php
echo htmlspecialchars( xl('Provider Relationship'), ENT_NOQUOTES
); ?
>:
536 // Build a drop-down list of of patient provider relationships.
538 echo " <select ". $dis_text ." id='form_pat_prov_rel' name='form_pat_prov_rel' title='" . xlt('Only applicable if a provider or collated list was chosen above. PRIMARY only selects patients that the provider is the primary provider. ENCOUNTER selects all patients that the provider has seen.') . "'>\n";
539 echo " <option value='primary'";
540 if ($pat_prov_rel == 'primary') echo " selected";
541 echo ">" . xlt('Primary') . "\n";
542 echo " <option value='encounter'";
543 if ($pat_prov_rel == 'encounter') echo " selected";
544 echo ">" . xlt('Encounter') . "\n";
550 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
553 <?php
echo htmlspecialchars( xl('Number labs'), ENT_NOQUOTES
); ?
>:<br
>
554 (<?php
echo htmlspecialchars( xl('Non-electronic'), ENT_NOQUOTES
); ?
>)
557 <input
<?php
echo $dis_text; ?
> type
="text" id
="labs_manual_entry" name
="labs_manual_entry" value
="<?php echo htmlspecialchars($labs_manual,ENT_QUOTES); ?>">
567 <td align
='left' valign
='middle' height
="100%">
568 <table style
='border-left:1px solid; width:100%; height:100%' >
572 <div style
='margin-left:15px'>
574 <?php
if (empty($report_id)) { ?
>
575 <a id
='submit_button' href
='#' class='css_button' onclick
='runReport();'>
577 <?php
echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES
); ?
>
580 <span id
='status_span'></span
>
581 <div id
='processing' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>
582 <?php
if ($type_report == "cqm") { ?
>
583 <a id
='xmla_button' href
='#' class='css_button' onclick
='return GenXml("false")'>
585 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method A) - 2011'), ENT_NOQUOTES
); ?
>
588 <a id
='xmlb_button' href
='#' class='css_button' onclick
='return GenXml("true")'>
590 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method E) - 2011'), ENT_NOQUOTES
); ?
>
596 <?php
if (!empty($report_id)) { ?
>
597 <a href
='#' class='css_button' id
='printbutton'>
599 <?php
echo htmlspecialchars( xl('Print'), ENT_NOQUOTES
); ?
>
602 <?php
if ($type_report == "cqm_2014") { ?
>
603 <a href
="#" id
="genQRDA" class='css_button' onclick
='return downloadQRDA()'>
605 <?php
echo htmlspecialchars( xl('Generate QRDA I – 2014'), ENT_NOQUOTES
); ?
>
608 <a href
="#" id
="xmlc_button" class='css_button' onclick
='return GenXml("QRDA")'>
610 <?php
echo htmlspecialchars( xl('Generate QRDA III - 2014'), ENT_NOQUOTES
); ?
>
615 <?php
if ($back_link == "list") { ?
>
616 <a href
='report_results.php' class='css_button' onclick
='top.restoreSession()'><span
><?php
echo xlt("Return To Report Results"); ?
></span
></a
>
618 <a href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit();'><span
><?php
echo xlt("Start Another Report"); ?
></span
></a
>
629 </div
> <!-- end of search parameters
-->
634 if (!empty($report_id)) {
638 <div id
="report_results">
643 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
648 if($type_report == 'cqm' ||
$type_report == 'cqm_2011' ||
$type_report == 'cqm_2014')
649 echo htmlspecialchars( xl('Initial Patient Population'), ENT_NOQUOTES
);
651 echo htmlspecialchars( xl('Total Patients'), ENT_NOQUOTES
);
656 <?php
if ($type_report == "amc") { ?
>
657 <?php
echo htmlspecialchars( xl('Denominator'), ENT_NOQUOTES
); ?
></a
>
659 <?php
echo htmlspecialchars( xl('Applicable Patients') .' (' . xl('Denominator') . ')', ENT_NOQUOTES
); ?
></a
>
663 <?php
if ($type_report != "amc") { ?
>
665 <?php
echo htmlspecialchars( xl('Denominator Exclusion'), ENT_NOQUOTES
); ?
></a
>
668 <?php
if($type_report == 'cqm' ||
$type_report == 'cqm_2011' ||
$type_report == 'cqm_2014') {?
>
670 <?php
echo htmlspecialchars( xl('Denominator Exception'), ENT_NOQUOTES
); ?
></a
>
675 <?php
if ($type_report == "amc") { ?
>
676 <?php
echo htmlspecialchars( xl('Numerator'), ENT_NOQUOTES
); ?
></a
>
678 <?php
echo htmlspecialchars( xl('Passed Patients') . ' (' . xl('Numerator') . ')', ENT_NOQUOTES
); ?
></a
>
683 <?php
if ($type_report == "amc") { ?
>
684 <?php
echo htmlspecialchars( xl('Failed'), ENT_NOQUOTES
); ?
></a
>
686 <?php
echo htmlspecialchars( xl('Failed Patients'), ENT_NOQUOTES
); ?
></a
>
691 <?php
echo htmlspecialchars( xl('Performance Percentage'), ENT_NOQUOTES
); ?
></a
>
695 <tbody
> <!-- added
for better
print-ability
-->
698 $firstProviderFlag = TRUE;
699 $firstPlanFlag = TRUE;
700 $existProvider = FALSE;
701 foreach ($dataSheet as $row) {
705 <tr bgcolor
='<?php echo $bgcolor ?>'>
708 if (isset($row['is_main']) ||
isset($row['is_sub'])) {
709 echo "<td class='detail'>";
710 if (isset($row['is_main'])) {
712 // is_sub is a special case of is_main whereas total patients, denominator, and excluded patients are taken
713 // from is_main prior to it. So, need to store denominator patients from is_main for subsequent is_sub
714 // to calculate the number of patients that failed.
715 // Note that exlusion in the standard rules is not the same as in the cqm/amd and should not be in calculation
716 // as is in the cqm/amc rules.
717 $main_pass_filter = $row['pass_filter'];
719 echo "<b>".generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'),$row['id'])."</b>";
721 $tempCqmAmcString = "";
722 if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) {
723 if (!empty($row['cqm_pqri_code'])) {
724 $tempCqmAmcString .= " " . htmlspecialchars( xl('PQRI') . ":" . $row['cqm_pqri_code'], ENT_NOQUOTES
) . " ";
726 if (!empty($row['cqm_nqf_code'])) {
727 $tempCqmAmcString .= " " . htmlspecialchars( xl('NQF') . ":" . $row['cqm_nqf_code'], ENT_NOQUOTES
) . " ";
730 if ($type_report == "amc") {
731 if (!empty($row['amc_code'])) {
732 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
734 if (!empty($row['amc_code_2014'])) {
735 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
738 if ($type_report == "amc_2011") {
739 if (!empty($row['amc_code'])) {
740 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
743 if ( ($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ) {
744 if (!empty($row['amc_code_2014'])) {
745 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
749 if (!empty($tempCqmAmcString)) {
750 echo "(".$tempCqmAmcString.")";
753 if ( !(empty($row['concatenated_label'])) ) {
754 echo ", " . htmlspecialchars( xl( $row['concatenated_label'] ), ENT_NOQUOTES
) . " ";
758 else { // isset($row['is_sub'])
759 echo generate_display_field(array('data_type'=>'1','list_id'=>'rule_action_category'),$row['action_category']);
760 echo ": " . generate_display_field(array('data_type'=>'1','list_id'=>'rule_action'),$row['action_item']);
764 if($type_report == 'cqm' ||
$type_report == 'cqm_2011' ||
$type_report == 'cqm_2014')
765 echo "<td align='center'>" . $row['initial_population'] . "</td>";
767 echo "<td align='center'>" . $row['total_patients'] . "</td>";
769 if ( isset($row['itemized_test_id']) && ($row['pass_filter'] > 0) ) {
770 echo "<td align='center'><a href='../main/finder/patient_select.php?from_page=cdr_report&pass_id=all&report_id=".attr($report_id)."&itemized_test_id=".attr($row['itemized_test_id'])."&numerator_label=".urlencode(attr($row['numerator_label']))."' onclick='top.restoreSession()'>" . $row['pass_filter'] . "</a></td>";
773 echo "<td align='center'>" . $row['pass_filter'] . "</td>";
776 if ($type_report != "amc") {
777 // Note that amc will likely support in excluded items in the future for MU2
778 if ( ($type_report != "standard") && isset($row['itemized_test_id']) && ($row['excluded'] > 0) ) {
779 // Note standard reporting exluded is different than cqm/amc and will not support itemization
780 echo "<td align='center'><a href='../main/finder/patient_select.php?from_page=cdr_report&pass_id=exclude&report_id=".attr($report_id)."&itemized_test_id=".attr($row['itemized_test_id'])."&numerator_label=".urlencode(attr($row['numerator_label']))."' onclick='top.restoreSession()'>" . $row['excluded'] . "</a></td>";
783 echo "<td align='center'>" . $row['excluded'] . "</td>";
787 if($type_report == 'cqm' ||
$type_report == 'cqm_2011' ||
$type_report == 'cqm_2014'){
788 // Note that amc will likely support in exception items in the future for MU2
789 if ( isset($row['itemized_test_id']) && ($row['exception'] > 0) ) {
790 // Note standard reporting exluded is different than cqm/amc and will not support itemization
791 echo "<td align='center'><a href='../main/finder/patient_select.php?from_page=cdr_report&pass_id=exception&report_id=".attr($report_id)."&itemized_test_id=".attr($row['itemized_test_id'])."&numerator_label=".urlencode(attr($row['numerator_label']))."' onclick='top.restoreSession()'>" . $row['exception'] . "</a></td>";
794 echo "<td align='center'>" . $row['exception'] . "</td>";
798 if ( isset($row['itemized_test_id']) && ($row['pass_target'] > 0) ) {
799 echo "<td align='center'><a href='../main/finder/patient_select.php?from_page=cdr_report&pass_id=pass&report_id=".attr($report_id)."&itemized_test_id=".attr($row['itemized_test_id'])."&numerator_label=".urlencode(attr($row['numerator_label']))."' onclick='top.restoreSession()'>" . $row['pass_target'] . "</a></td>";
802 echo "<td align='center'>" . $row['pass_target'] . "</td>";
806 if (isset($row['is_main'])) {
807 if ($type_report == "standard") {
808 // Excluded is not part of denominator in standard rules so do not use in calculation
809 $failed_items = $row['pass_filter'] - $row['pass_target'];
812 $failed_items = $row['pass_filter'] - $row['pass_target'] - $row['excluded'];
815 else { // isset($row['is_sub'])
816 // Excluded is not part of denominator in standard rules so do not use in calculation
817 $failed_items = $main_pass_filter - $row['pass_target'];
819 if ( isset($row['itemized_test_id']) && ($failed_items > 0) ) {
820 echo "<td align='center'><a href='../main/finder/patient_select.php?from_page=cdr_report&pass_id=fail&report_id=".attr($report_id)."&itemized_test_id=".attr($row['itemized_test_id'])."&numerator_label=".urlencode(attr($row['numerator_label']))."' onclick='top.restoreSession()'>" . $failed_items . "</a></td>";
823 echo "<td align='center'>" . $failed_items . "</td>";
826 echo "<td align='center'>" . $row['percentage'] . "</td>";
828 else if (isset($row['is_provider'])) {
829 // Display the provider information
830 if (!$firstProviderFlag && $_POST['form_provider'] == 'collate_outer') {
831 echo "<tr><td> </td></tr>";
833 echo "<td class='detail' align='center'><b>";
834 echo htmlspecialchars( xl("Provider").": " . $row['prov_lname'] . "," . $row['prov_fname'], ENT_NOQUOTES
);
835 if (!empty($row['npi']) ||
!empty($row['federaltaxid'])) {
837 if (!empty($row['npi'])) {
838 echo " " . htmlspecialchars( xl('NPI') . ":" . $row['npi'], ENT_NOQUOTES
) . " ";
840 if (!empty($row['federaltaxid'])) {
841 echo " " . htmlspecialchars( xl('TID') . ":" . $row['federaltaxid'], ENT_NOQUOTES
) . " ";
846 $firstProviderFlag = FALSE;
847 $existProvider = TRUE;
849 else { // isset($row['is_plan'])
850 if (!$firstPlanFlag && $_POST['form_provider'] != 'collate_outer') {
851 echo "<tr><td> </td></tr>";
853 echo "<td class='detail' align='center'><b>";
854 echo htmlspecialchars( xl("Plan"), ENT_NOQUOTES
) . ": ";
855 echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'),$row['id']);
856 if (!empty($row['cqm_measure_group'])) {
857 echo " (". htmlspecialchars( xl('Measure Group Code') . ": " . $row['cqm_measure_group'], ENT_NOQUOTES
) . ")";
860 $firstPlanFlag = FALSE;
870 </div
> <!-- end of search results
-->
872 <div id
="instructions_text" class='text'>
873 <?php
echo htmlspecialchars( xl('Please input search criteria above, and click Submit to start report.'), ENT_NOQUOTES
); ?
>
877 <input type
='hidden' name
='form_new_report_id' id
='form_new_report_id' value
=''/>