2 // Copyright (C) 2010 Brady Miller <brady@sparmy.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
10 $sanitize_all_escapes=true;
13 //STOP FAKE REGISTER GLOBALS
14 $fake_register_globals=false;
17 require_once("../globals.php");
18 require_once("../../library/patient.inc");
19 require_once("$srcdir/formatting.inc.php");
20 require_once "$srcdir/options.inc.php";
21 require_once "$srcdir/formdata.inc.php";
22 require_once "$srcdir/clinical_rules.php";
23 require_once "$srcdir/report_database.inc";
25 // This is only pertinent for users of php versions less than 5.2
26 // (ie. this wrapper is only loaded when php version is less than
27 // 5.2; otherwise the native php json functions are used)
28 require_once "$srcdir/jsonwrapper/jsonwrapper.php";
30 // See if showing an old report or creating a new report
31 $report_id = (isset($_GET['report_id'])) ?
trim($_GET['report_id']) : "";
33 // Collect the back variable, if pertinent
34 $back_link = (isset($_GET['back'])) ?
trim($_GET['back']) : "";
36 // If showing an old report, then collect information
37 if (!empty($report_id)) {
38 $report_view = collectReportDatabase($report_id);
39 $date_report = $report_view['date_report'];
40 $type_report = $report_view['type'];
42 $type_report = (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ||
43 ($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) ?
$type_report : "standard";
44 $rule_filter = $report_view['type'];
46 if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) {
47 $begin_date = $report_view['date_begin'];
48 $labs_manual = $report_view['labs_manual'];
50 $target_date = $report_view['date_target'];
51 $plan_filter = $report_view['plan'];
52 $organize_method = $report_view['organize_mode'];
53 $provider = $report_view['provider'];
54 $pat_prov_rel = $report_view['pat_prov_rel'];
55 $dataSheet = json_decode($report_view['data'],TRUE);
58 // Collect report type parameter (standard, amc, cqm)
59 // Note that need to convert amc_2011 and amc_2014 to amc and cqm_2011 and cqm_2014 to cqm
60 // to simplify for when submitting for a new report.
61 $type_report = (isset($_GET['type'])) ?
trim($_GET['type']) : "standard";
63 if ( ($type_report == "cqm_2011") ||
($type_report == "cqm_2014") ) {
66 if ( ($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ) {
69 // Collect form parameters (set defaults if empty)
70 if ($type_report == "amc") {
71 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
72 $labs_manual = (isset($_POST['labs_manual_entry'])) ?
trim($_POST['labs_manual_entry']) : "0";
74 $target_date = (isset($_POST['form_target_date'])) ?
trim($_POST['form_target_date']) : date('Y-m-d H:i:s');
75 $rule_filter = (isset($_POST['form_rule_filter'])) ?
trim($_POST['form_rule_filter']) : "";
76 $plan_filter = (isset($_POST['form_plan_filter'])) ?
trim($_POST['form_plan_filter']) : "";
77 $organize_method = (empty($plan_filter)) ?
"default" : "plans";
78 $provider = trim($_POST['form_provider']);
79 $pat_prov_rel = (empty($_POST['form_pat_prov_rel'])) ?
"primary" : trim($_POST['form_pat_prov_rel']);
86 <?php
html_header_show();?
>
88 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
90 <?php
if ($type_report == "standard") { ?
>
91 <title
><?php
echo xlt('Standard Measures'); ?
></title
>
94 <?php
if ($type_report == "cqm") { ?
>
95 <title
><?php
echo xlt('Clinical Quality Measures (CQM)'); ?
></title
>
97 <?php
if ($type_report == "cqm_2011") { ?
>
98 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
></title
>
100 <?php
if ($type_report == "cqm_2014") { ?
>
101 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
></title
>
104 <?php
if ($type_report == "amc") { ?
>
105 <title
><?php
echo xlt('Automated Measure Calculations (AMC)'); ?
></title
>
107 <?php
if ($type_report == "amc_2011") { ?
>
108 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
></title
>
110 <?php
if ($type_report == "amc_2014_stage1") { ?
>
111 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage I'); ?
></title
>
113 <?php
if ($type_report == "amc_2014_stage2") { ?
>
114 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage II'); ?
></title
>
117 <script type
="text/javascript" src
="../../library/overlib_mini.js"></script
>
118 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
119 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
120 <script type
="text/javascript" src
="../../library/js/jquery.1.3.2.js"></script
>
122 <script LANGUAGE
="JavaScript">
124 var mypcc
= '<?php echo text($GLOBALS['phone_country_code
']) ?>';
126 $
(document
).ready(function() {
127 var win
= top
.printLogSetup ? top
: opener
.top
;
128 win
.printLogSetup(document
.getElementById('printbutton'));
131 function runReport() {
134 if (!(validateForm())) {
135 alert("<?php echo xls("Rule Set
and Plan Set selections are not consistent
. Please fix
and Submit again
."); ?>");
139 // Showing processing wheel
140 $
("#processing").show();
142 // hide Submit buttons
143 $
("#submit_button").hide();
144 $
("#xmla_button").hide();
145 $
("#xmlb_button").hide();
146 $
("#xmlc_button").hide();
147 $
("#print_button").hide();
148 $
("#genQRDA").hide();
151 $
("#instructions_text").hide();
153 // Collect an id string via an ajax request
154 top
.restoreSession();
155 $
.get("../../library/ajax/collect_new_report_id.php",
157 // Set the report id in page form
158 $
("#form_new_report_id").attr("value",data
);
160 // Start collection status checks
161 collectStatus($
("#form_new_report_id").val());
164 top
.restoreSession();
165 $
.post("../../library/ajax/execute_cdr_report.php",
166 {provider
: $
("#form_provider").val(),
167 type
: $
("#form_rule_filter").val(),
168 date_target
: $
("#form_target_date").val(),
169 date_begin
: $
("#form_begin_date").val(),
170 plan
: $
("#form_plan_filter").val(),
171 labs
: $
("#labs_manual_entry").val(),
172 pat_prov_rel
: $
("#form_pat_prov_rel").val(),
173 execute_report_id
: $
("#form_new_report_id").val()
178 function collectStatus(report_id
) {
179 // Collect the status string via an ajax request and place in DOM at timed intervals
180 top
.restoreSession();
181 // Do not send the skip_timeout_reset parameter, so don't close window before report is done.
182 $
.post("../../library/ajax/status_report.php",
183 {status_report_id
: report_id
},
185 if (data
== "PENDING") {
186 // Place the pending string in the DOM
187 $
('#status_span').replaceWith("<span id='status_span'><?php echo xlt("Preparing To Run Report
"); ?></span>");
189 else if (data
== "COMPLETE") {
190 // Go into the results page
191 top
.restoreSession();
192 link_report
= "cqm.php?report_id="+report_id
;
193 window
.open(link_report
,'_self',false);
194 //$("#processing").hide();
195 //$('#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>");
198 // Place the string in the DOM
199 $
('#status_span').replaceWith("<span id='status_span'>"+data+
"</span>");
202 // run status check every 10 seconds
203 var repeater
= setTimeout("collectStatus("+report_id+
")", 10000);
206 function GenXml(sNested
) {
207 top
.restoreSession();
208 //QRDA Category III Export
209 if(sNested
== "QRDA"){
210 var form_rule_filter
= theform
.form_rule_filter
.value
211 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);?>";
213 var sLoc
= '../../custom/export_registry_xml.php?&target_date=' + theform
.form_target_date
.value +
'&nested=' + sNested
;
215 dlgopen(sLoc
, '_blank', 600, 500);
219 //QRDA I - 2014 Download
220 function downloadQRDA() {
221 top
.restoreSession();
222 var reportID
= '<?php echo attr($report_id); ?>';
223 var provider
= $
("#form_provider").val();
224 sLoc
= '../../custom/download_qrda.php?&report_id=' + reportID +
'&provider_id=' + provider
;
225 dlgopen(sLoc
, '_blank', 600, 500);
228 function validateForm() {
229 <?php
if ( (empty($report_id)) && ($type_report == "cqm") ) { ?
>
230 // If this is a cqm and plan set not set to ignore, then need to ensure consistent with the rules set
231 if ($
("#form_plan_filter").val() != '') {
232 if ($
("#form_rule_filter").val() == $
("#form_plan_filter").val()) {
246 function Form_Validate() {
247 <?php
if ( (empty($report_id)) && (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) ){ ?
>
248 var d
= document
.forms
[0];
249 FromDate
= d
.form_begin_date
.value
;
250 ToDate
= d
.form_target_date
.value
;
251 if ( (FromDate
.length
> 0) && (ToDate
.length
> 0) ) {
252 if (FromDate
> ToDate
){
253 alert("<?php echo xls('End date must be later than Begin date!'); ?>");
259 //For Results are in Gray Background & disabling anchor links
260 <?php
if($report_id != ""){?
>
261 $
("#report_results").css("opacity", '0.4');
262 $
("#report_results").css("filter", 'alpha(opacity=40)');
263 $
("a").removeAttr("href");
266 $
("#form_refresh").attr("value","true");
273 <style type
="text/css">
275 /* specifically include & exclude from printing */
281 #report_parameters_daterange {
285 #report_results table {
290 /* specifically exclude some from the screen */
292 #report_parameters_daterange {
301 <body
class="body_top">
303 <!-- Required
for the popup date selectors
-->
304 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
306 <span
class='title'><?php
echo xlt('Report'); ?
> -
308 <?php
if ($type_report == "standard") { ?
>
309 <?php
echo xlt('Standard Measures'); ?
>
312 <?php
if ($type_report == "cqm") { ?
>
313 <?php
echo xlt('Clinical Quality Measures (CQM)'); ?
>
315 <?php
if ($type_report == "cqm_2011") { ?
>
316 <?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
>
318 <?php
if ($type_report == "cqm_2014") { ?
>
319 <?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
>
322 <?php
if ($type_report == "amc") { ?
>
323 <?php
echo xlt('Automated Measure Calculations (AMC)'); ?
>
325 <?php
if ($type_report == "amc_2011") { ?
>
326 <?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
>
328 <?php
if ($type_report == "amc_2014_stage1") { ?
>
329 <?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage I'); ?
>
331 <?php
if ($type_report == "amc_2014_stage2") { ?
>
332 <?php
echo xlt('Automated Measure Calculations (AMC) - 2014 Stage II'); ?
>
335 <?php
if (!empty($report_id)) { ?
>
336 <?php
echo " - " . xlt('Date of Report') . ": " . text($date_report);
337 //prepare to disable form elements
338 $dis_text = " disabled='disabled' ";
343 <form method
='post' name
='theform' id
='theform' action
='cqm.php?type=<?php echo attr($type_report) ;?>' onsubmit
='return validateForm()'>
345 <div id
="report_parameters">
348 if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) $widthDyn = "410px";
352 <td scope
="row" width
='<?php echo $widthDyn;?>'>
353 <div style
='float:left'>
357 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
360 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
363 <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); ?>'
364 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
365 <?php
if (empty($report_id)) { ?
>
366 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
367 id
='img_begin_date' border
='0' alt
='[?]' style
='cursor:pointer'
368 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
376 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
377 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
379 <?php
echo htmlspecialchars( xl('Target Date'), ENT_NOQUOTES
); ?
>:
383 <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); ?>'
384 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
385 <?php
if (empty($report_id)) { ?
>
386 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
387 id
='img_target_date' border
='0' alt
='[?]' style
='cursor:pointer'
388 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
393 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
396 <?php
echo xlt('Rule Set'); ?
>:
399 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
400 <option value
='cqm' <?php
if ($rule_filter == "cqm") echo "selected"; ?
>>
401 <?php
echo xlt('All Clinical Quality Measures (CQM)'); ?
></option
>
402 <option value
='cqm_2011' <?php
if ($rule_filter == "cqm_2011") echo "selected"; ?
>>
403 <?php
echo xlt('2011 Clinical Quality Measures (CQM)'); ?
></option
>
404 <option value
='cqm_2014' <?php
if ($rule_filter == "cqm_2014") echo "selected"; ?
>>
405 <?php
echo xlt('2014 Clinical Quality Measures (CQM)'); ?
></option
>
411 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
414 <?php
echo xlt('Rule Set'); ?
>:
417 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
419 <?php
if ($rule_filter == "amc") { //only show this when displaying old reports. Not available option for new reports ?>
420 <option value
='amc' selected
>
421 <?php
echo xlt('All Automated Measure Calculations (AMC)'); ?
></option
>
424 <option value
='amc_2011' <?php
if ($rule_filter == "amc_2011") echo "selected"; ?
>>
425 <?php
echo xlt('2011 Automated Measure Calculations (AMC)'); ?
></option
>
426 <option value
='amc_2014_stage1' <?php
if ($rule_filter == "amc_2014_stage1") echo "selected"; ?
>>
427 <?php
echo xlt('2014 Automated Measure Calculations (AMC) - Stage I'); ?
></option
>
428 <option value
='amc_2014_stage2' <?php
if ($rule_filter == "amc_2014_stage2") echo "selected"; ?
>>
429 <?php
echo xlt('2014 Automated Measure Calculations (AMC) - Stage II'); ?
></option
>
435 <?php
if ($type_report == "standard") { ?
>
438 <?php
echo xlt('Rule Set'); ?
>:
441 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
442 <option value
='passive_alert' <?php
if ($rule_filter == "passive_alert") echo "selected"; ?
>>
443 <?php
echo xlt('Passive Alert Rules'); ?
></option
>
444 <option value
='active_alert' <?php
if ($rule_filter == "active_alert") echo "selected"; ?
>>
445 <?php
echo xlt('Active Alert Rules'); ?
></option
>
446 <option value
='patient_reminder' <?php
if ($rule_filter == "patient_reminder") echo "selected"; ?
>>
447 <?php
echo xlt('Patient Reminder Rules'); ?
></option
>
453 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
454 <input type
='hidden' id
='form_plan_filter' name
='form_plan_filter' value
=''>
458 <?php
echo htmlspecialchars( xl('Plan Set'), ENT_NOQUOTES
); ?
>:
461 <select
<?php
echo $dis_text; ?
> id
='form_plan_filter' name
='form_plan_filter'>
462 <option value
=''>-- <?php
echo htmlspecialchars( xl('Ignore'), ENT_NOQUOTES
); ?
> --</option
>
463 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
464 <option value
='cqm' <?php
if ($plan_filter == "cqm") echo "selected"; ?
>>
465 <?php
echo htmlspecialchars( xl('All Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
466 <option value
='cqm_2011' <?php
if ($plan_filter == "cqm_2011") echo "selected"; ?
>>
467 <?php
echo htmlspecialchars( xl('2011 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
468 <option value
='cqm_2014' <?php
if ($plan_filter == "cqm_2014") echo "selected"; ?
>>
469 <?php
echo htmlspecialchars( xl('2014 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
471 <?php
if ($type_report == "standard") { ?
>
472 <option value
='normal' <?php
if ($plan_filter == "normal") echo "selected"; ?
>>
473 <?php
echo htmlspecialchars( xl('Active Plans'), ENT_NOQUOTES
); ?
></option
>
481 <?php
echo htmlspecialchars( xl('Provider'), ENT_NOQUOTES
); ?
>:
486 // Build a drop-down list of providers.
489 $query = "SELECT id, lname, fname FROM users WHERE ".
490 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
492 $ures = sqlStatement($query);
494 echo " <select " . $dis_text . " id='form_provider' name='form_provider'>\n";
495 echo " <option value=''>-- " . htmlspecialchars( xl('All (Cumulative)'), ENT_NOQUOTES
) . " --\n";
497 echo " <option value='collate_outer'";
498 if ($provider == 'collate_outer') echo " selected";
499 echo ">-- " . htmlspecialchars( xl('All (Collated Format A)'), ENT_NOQUOTES
) . " --\n";
501 echo " <option value='collate_inner'";
502 if ($provider == 'collate_inner') echo " selected";
503 echo ">-- " . htmlspecialchars( xl('All (Collated Format B)'), ENT_NOQUOTES
) . " --\n";
505 while ($urow = sqlFetchArray($ures)) {
506 $provid = $urow['id'];
507 echo " <option value='".htmlspecialchars( $provid, ENT_QUOTES
)."'";
508 if ($provid == $provider) echo " selected";
509 echo ">" . htmlspecialchars( $urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
520 <?php
echo htmlspecialchars( xl('Provider Relationship'), ENT_NOQUOTES
); ?
>:
525 // Build a drop-down list of of patient provider relationships.
527 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";
528 echo " <option value='primary'";
529 if ($pat_prov_rel == 'primary') echo " selected";
530 echo ">" . xlt('Primary') . "\n";
531 echo " <option value='encounter'";
532 if ($pat_prov_rel == 'encounter') echo " selected";
533 echo ">" . xlt('Encounter') . "\n";
539 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2")) { ?
>
542 <?php
echo htmlspecialchars( xl('Number labs'), ENT_NOQUOTES
); ?
>:<br
>
543 (<?php
echo htmlspecialchars( xl('Non-electronic'), ENT_NOQUOTES
); ?
>)
546 <input
<?php
echo $dis_text; ?
> type
="text" id
="labs_manual_entry" name
="labs_manual_entry" value
="<?php echo htmlspecialchars($labs_manual,ENT_QUOTES); ?>">
556 <td align
='left' valign
='middle' height
="100%">
557 <table style
='border-left:1px solid; width:100%; height:100%' >
561 <div style
='margin-left:15px'>
563 <?php
if (empty($report_id)) { ?
>
564 <a id
='submit_button' href
='#' class='css_button' onclick
='runReport();'>
566 <?php
echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES
); ?
>
569 <span id
='status_span'></span
>
570 <div id
='processing' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>
571 <?php
if ($type_report == "cqm") { ?
>
572 <a id
='xmla_button' href
='#' class='css_button' onclick
='return GenXml("false")'>
574 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method A) - 2011'), ENT_NOQUOTES
); ?
>
577 <a id
='xmlb_button' href
='#' class='css_button' onclick
='return GenXml("true")'>
579 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method E) - 2011'), ENT_NOQUOTES
); ?
>
585 <?php
if (!empty($report_id)) { ?
>
586 <a href
='#' class='css_button' id
='printbutton'>
588 <?php
echo htmlspecialchars( xl('Print'), ENT_NOQUOTES
); ?
>
591 <?php
if ($type_report == "cqm_2014") { ?
>
592 <a href
="#" id
="genQRDA" class='css_button' onclick
='return downloadQRDA()'>
594 <?php
echo htmlspecialchars( xl('Generate QRDA I – 2014'), ENT_NOQUOTES
); ?
>
597 <a href
="#" id
="xmlc_button" class='css_button' onclick
='return GenXml("QRDA")'>
599 <?php
echo htmlspecialchars( xl('Generate QRDA III - 2014'), ENT_NOQUOTES
); ?
>
604 <?php
if ($back_link == "list") { ?
>
605 <a href
='report_results.php' class='css_button' onclick
='top.restoreSession()'><span
><?php
echo xlt("Return To Report Results"); ?
></span
></a
>
607 <a href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit();'><span
><?php
echo xlt("Start Another Report"); ?
></span
></a
>
618 </div
> <!-- end of search parameters
-->
623 if (!empty($report_id)) {
627 <div id
="report_results">
632 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
636 <?php
echo htmlspecialchars( xl('Total Patients'), ENT_NOQUOTES
); ?
>
640 <?php
if ($type_report == "amc") { ?
>
641 <?php
echo htmlspecialchars( xl('Denominator'), ENT_NOQUOTES
); ?
></a
>
643 <?php
echo htmlspecialchars( xl('Applicable Patients') .' (' . xl('Denominator') . ')', ENT_NOQUOTES
); ?
></a
>
647 <?php
if ($type_report != "amc") { ?
>
649 <?php
echo htmlspecialchars( xl('Excluded Patients'), ENT_NOQUOTES
); ?
></a
>
654 <?php
if ($type_report == "amc") { ?
>
655 <?php
echo htmlspecialchars( xl('Numerator'), ENT_NOQUOTES
); ?
></a
>
657 <?php
echo htmlspecialchars( xl('Passed Patients') . ' (' . xl('Numerator') . ')', ENT_NOQUOTES
); ?
></a
>
662 <?php
if ($type_report == "amc") { ?
>
663 <?php
echo htmlspecialchars( xl('Failed'), ENT_NOQUOTES
); ?
></a
>
665 <?php
echo htmlspecialchars( xl('Failed Patients'), ENT_NOQUOTES
); ?
></a
>
670 <?php
echo htmlspecialchars( xl('Performance Percentage'), ENT_NOQUOTES
); ?
></a
>
674 <tbody
> <!-- added
for better
print-ability
-->
677 $firstProviderFlag = TRUE;
678 $firstPlanFlag = TRUE;
679 $existProvider = FALSE;
680 foreach ($dataSheet as $row) {
684 <tr bgcolor
='<?php echo $bgcolor ?>'>
687 if (isset($row['is_main']) ||
isset($row['is_sub'])) {
688 echo "<td class='detail'>";
689 if (isset($row['is_main'])) {
691 // is_sub is a special case of is_main whereas total patients, denominator, and excluded patients are taken
692 // from is_main prior to it. So, need to store denominator patients from is_main for subsequent is_sub
693 // to calculate the number of patients that failed.
694 // Note that exlusion in the standard rules is not the same as in the cqm/amd and should not be in calculation
695 // as is in the cqm/amc rules.
696 $main_pass_filter = $row['pass_filter'];
698 echo "<b>".generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'),$row['id'])."</b>";
700 $tempCqmAmcString = "";
701 if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) {
702 if (!empty($row['cqm_pqri_code'])) {
703 $tempCqmAmcString .= " " . htmlspecialchars( xl('PQRI') . ":" . $row['cqm_pqri_code'], ENT_NOQUOTES
) . " ";
705 if (!empty($row['cqm_nqf_code'])) {
706 $tempCqmAmcString .= " " . htmlspecialchars( xl('NQF') . ":" . $row['cqm_nqf_code'], ENT_NOQUOTES
) . " ";
709 if ($type_report == "amc") {
710 if (!empty($row['amc_code'])) {
711 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
713 if (!empty($row['amc_code_2014'])) {
714 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
717 if ($type_report == "amc_2011") {
718 if (!empty($row['amc_code'])) {
719 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
722 if ( ($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ) {
723 if (!empty($row['amc_code_2014'])) {
724 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
728 if (!empty($tempCqmAmcString)) {
729 echo "(".$tempCqmAmcString.")";
732 if ( !(empty($row['concatenated_label'])) ) {
733 echo ", " . htmlspecialchars( xl( $row['concatenated_label'] ), ENT_NOQUOTES
) . " ";
737 else { // isset($row['is_sub'])
738 echo generate_display_field(array('data_type'=>'1','list_id'=>'rule_action_category'),$row['action_category']);
739 echo ": " . generate_display_field(array('data_type'=>'1','list_id'=>'rule_action'),$row['action_item']);
742 echo "<td align='center'>" . $row['total_patients'] . "</td>";
744 if ( isset($row['itemized_test_id']) && ($row['pass_filter'] > 0) ) {
745 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>";
748 echo "<td align='center'>" . $row['pass_filter'] . "</td>";
751 if ($type_report != "amc") {
752 // Note that amc will likely support in excluded items in the future for MU2
753 if ( ($type_report != "standard") && isset($row['itemized_test_id']) && ($row['excluded'] > 0) ) {
754 // Note standard reporting exluded is different than cqm/amc and will not support itemization
755 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>";
758 echo "<td align='center'>" . $row['excluded'] . "</td>";
762 if ( isset($row['itemized_test_id']) && ($row['pass_target'] > 0) ) {
763 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>";
766 echo "<td align='center'>" . $row['pass_target'] . "</td>";
770 if (isset($row['is_main'])) {
771 if ($type_report == "standard") {
772 // Excluded is not part of denominator in standard rules so do not use in calculation
773 $failed_items = $row['pass_filter'] - $row['pass_target'];
776 $failed_items = $row['pass_filter'] - $row['pass_target'] - $row['excluded'];
779 else { // isset($row['is_sub'])
780 // Excluded is not part of denominator in standard rules so do not use in calculation
781 $failed_items = $main_pass_filter - $row['pass_target'];
783 if ( isset($row['itemized_test_id']) && ($failed_items > 0) ) {
784 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>";
787 echo "<td align='center'>" . $failed_items . "</td>";
790 echo "<td align='center'>" . $row['percentage'] . "</td>";
792 else if (isset($row['is_provider'])) {
793 // Display the provider information
794 if (!$firstProviderFlag && $_POST['form_provider'] == 'collate_outer') {
795 echo "<tr><td> </td></tr>";
797 echo "<td class='detail' align='center'><b>";
798 echo htmlspecialchars( xl("Provider").": " . $row['prov_lname'] . "," . $row['prov_fname'], ENT_NOQUOTES
);
799 if (!empty($row['npi']) ||
!empty($row['federaltaxid'])) {
801 if (!empty($row['npi'])) {
802 echo " " . htmlspecialchars( xl('NPI') . ":" . $row['npi'], ENT_NOQUOTES
) . " ";
804 if (!empty($row['federaltaxid'])) {
805 echo " " . htmlspecialchars( xl('TID') . ":" . $row['federaltaxid'], ENT_NOQUOTES
) . " ";
810 $firstProviderFlag = FALSE;
811 $existProvider = TRUE;
813 else { // isset($row['is_plan'])
814 if (!$firstPlanFlag && $_POST['form_provider'] != 'collate_outer') {
815 echo "<tr><td> </td></tr>";
817 echo "<td class='detail' align='center'><b>";
818 echo htmlspecialchars( xl("Plan"), ENT_NOQUOTES
) . ": ";
819 echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'),$row['id']);
820 if (!empty($row['cqm_measure_group'])) {
821 echo " (". htmlspecialchars( xl('Measure Group Code') . ": " . $row['cqm_measure_group'], ENT_NOQUOTES
) . ")";
824 $firstPlanFlag = FALSE;
834 </div
> <!-- end of search results
-->
836 <div id
="instructions_text" class='text'>
837 <?php
echo htmlspecialchars( xl('Please input search criteria above, and click Submit to start report.'), ENT_NOQUOTES
); ?
>
841 <input type
='hidden' name
='form_new_report_id' id
='form_new_report_id' value
=''/>
847 <!-- stuff
for the popup calendar
-->
848 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
849 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
850 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
851 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
852 <script language
="Javascript">
853 <?php
if ($type_report == "amc" ||
($type_report == "amc_2014_stage1") ||
($type_report == "amc_2014_stage2") ) { ?
>
854 Calendar
.setup({inputField
:"form_begin_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_begin_date", showsTime
:'true'});
856 Calendar
.setup({inputField
:"form_target_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_target_date", showsTime
:'true'});