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'];
41 $type_report = (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014") ||
42 ($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) ?
$type_report : "standard";
43 $rule_filter = $report_view['type'];
44 if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) {
45 $begin_date = $report_view['date_begin'];
46 $labs_manual = $report_view['labs_manual'];
48 $target_date = $report_view['date_target'];
49 $plan_filter = $report_view['plan'];
50 $organize_method = $report_view['organize_mode'];
51 $provider = $report_view['provider'];
52 $pat_prov_rel = $report_view['pat_prov_rel'];
53 $dataSheet = json_decode($report_view['data'],TRUE);
56 // Collect report type parameter (standard, amc, cqm)
57 // Note that need to convert amc_2011 and amc_2014 to amc and cqm_2011 and cqm_2014 to cqm
58 // to simplify for when submitting for a new report.
59 $type_report = (isset($_GET['type'])) ?
trim($_GET['type']) : "standard";
60 if ( ($type_report == "cqm_2011") ||
($type_report == "cqm_2014") ) {
63 if ( ($type_report == "amc_2011") ||
($type_report == "amc_2014") ) {
66 // Collect form parameters (set defaults if empty)
67 if ($type_report == "amc") {
68 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
69 $labs_manual = (isset($_POST['labs_manual_entry'])) ?
trim($_POST['labs_manual_entry']) : "0";
71 $target_date = (isset($_POST['form_target_date'])) ?
trim($_POST['form_target_date']) : date('Y-m-d H:i:s');
72 $rule_filter = (isset($_POST['form_rule_filter'])) ?
trim($_POST['form_rule_filter']) : "";
73 $plan_filter = (isset($_POST['form_plan_filter'])) ?
trim($_POST['form_plan_filter']) : "";
74 $organize_method = (empty($plan_filter)) ?
"default" : "plans";
75 $provider = trim($_POST['form_provider']);
76 $pat_prov_rel = (empty($_POST['form_pat_prov_rel'])) ?
"primary" : trim($_POST['form_pat_prov_rel']);
83 <?php
html_header_show();?
>
85 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
87 <?php
if ($type_report == "standard") { ?
>
88 <title
><?php
echo xlt('Standard Measures'); ?
></title
>
91 <?php
if ($type_report == "cqm") { ?
>
92 <title
><?php
echo xlt('Clinical Quality Measures (CQM)'); ?
></title
>
94 <?php
if ($type_report == "cqm_2011") { ?
>
95 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
></title
>
97 <?php
if ($type_report == "cqm_2014") { ?
>
98 <title
><?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
></title
>
101 <?php
if ($type_report == "amc") { ?
>
102 <title
><?php
echo xlt('Automated Measure Calculations (AMC)'); ?
></title
>
104 <?php
if ($type_report == "amc_2011") { ?
>
105 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
></title
>
107 <?php
if ($type_report == "amc_2014") { ?
>
108 <title
><?php
echo xlt('Automated Measure Calculations (AMC) - 2014'); ?
></title
>
112 <script type
="text/javascript" src
="../../library/overlib_mini.js"></script
>
113 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
114 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
115 <script type
="text/javascript" src
="../../library/js/jquery.1.3.2.js"></script
>
117 <script LANGUAGE
="JavaScript">
119 var mypcc
= '<?php echo text($GLOBALS['phone_country_code
']) ?>';
121 function runReport() {
124 if (!(validateForm())) {
125 alert("<?php echo xls("Rule Set
and Plan Set selections are not consistent
. Please fix
and Submit again
."); ?>");
129 // Showing processing wheel
130 $
("#processing").show();
132 // hide Submit buttons
133 $
("#submit_button").hide();
134 $
("#xmla_button").hide();
135 $
("#xmlb_button").hide();
138 $
("#instructions_text").hide();
140 // Collect an id string via an ajax request
141 top
.restoreSession();
142 $
.get("../../library/ajax/collect_new_report_id.php",
144 // Set the report id in page form
145 $
("#form_new_report_id").attr("value",data
);
147 // Start collection status checks
148 collectStatus($
("#form_new_report_id").val());
151 top
.restoreSession();
152 $
.post("../../library/ajax/execute_cdr_report.php",
153 {provider
: $
("#form_provider").val(),
154 type
: $
("#form_rule_filter").val(),
155 date_target
: $
("#form_target_date").val(),
156 date_begin
: $
("#form_begin_date").val(),
157 plan
: $
("#form_plan_filter").val(),
158 labs
: $
("#labs_manual_entry").val(),
159 pat_prov_rel
: $
("#form_pat_prov_rel").val(),
160 execute_report_id
: $
("#form_new_report_id").val()
165 function collectStatus(report_id
) {
166 // Collect the status string via an ajax request and place in DOM at timed intervals
167 top
.restoreSession();
168 // Do not send the skip_timeout_reset parameter, so don't close window before report is done.
169 $
.post("../../library/ajax/status_report.php",
170 {status_report_id
: report_id
},
172 if (data
== "PENDING") {
173 // Place the pending string in the DOM
174 $
('#status_span').replaceWith("<span id='status_span'><?php echo xlt("Preparing To Run Report
"); ?></span>");
176 else if (data
== "COMPLETE") {
177 // Go into the results page
178 top
.restoreSession();
179 link_report
= "cqm.php?report_id="+report_id
;
180 window
.open(link_report
,'_self',false);
181 //$("#processing").hide();
182 //$('#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>");
185 // Place the string in the DOM
186 $
('#status_span').replaceWith("<span id='status_span'>"+data+
"</span>");
189 // run status check every 10 seconds
190 var repeater
= setTimeout("collectStatus("+report_id+
")", 10000);
193 function GenXml(sNested
) {
194 top
.restoreSession();
195 var sLoc
= '../../custom/export_registry_xml.php?&target_date=' + theform
.form_target_date
.value +
'&nested=' + sNested
;
196 dlgopen(sLoc
, '_blank', 600, 500);
200 function validateForm() {
201 <?php
if ( (empty($report_id)) && ($type_report == "cqm") ) { ?
>
202 // If this is a cqm and plan set not set to ignore, then need to ensure consistent with the rules set
203 if ($
("#form_plan_filter").val() != '') {
204 if ($
("#form_rule_filter").val() == $
("#form_plan_filter").val()) {
220 <style type
="text/css">
222 /* specifically include & exclude from printing */
228 #report_parameters_daterange {
232 #report_results table {
237 /* specifically exclude some from the screen */
239 #report_parameters_daterange {
248 <body
class="body_top">
250 <!-- Required
for the popup date selectors
-->
251 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
253 <span
class='title'><?php
echo xlt('Report'); ?
> -
255 <?php
if ($type_report == "standard") { ?
>
256 <?php
echo xlt('Standard Measures'); ?
>
259 <?php
if ($type_report == "cqm") { ?
>
260 <?php
echo xlt('Clinical Quality Measures (CQM)'); ?
>
262 <?php
if ($type_report == "cqm_2011") { ?
>
263 <?php
echo xlt('Clinical Quality Measures (CQM) - 2011'); ?
>
265 <?php
if ($type_report == "cqm_2014") { ?
>
266 <?php
echo xlt('Clinical Quality Measures (CQM) - 2014'); ?
>
269 <?php
if ($type_report == "amc") { ?
>
270 <?php
echo xlt('Automated Measure Calculations (AMC)'); ?
>
272 <?php
if ($type_report == "amc_2011") { ?
>
273 <?php
echo xlt('Automated Measure Calculations (AMC) - 2011'); ?
>
275 <?php
if ($type_report == "amc_2014") { ?
>
276 <?php
echo xlt('Automated Measure Calculations (AMC) - 2014'); ?
>
279 <?php
if (!empty($report_id)) { ?
>
280 <?php
echo " - " . xlt('Date of Report') . ": " . text($date_report);
281 //prepare to disable form elements
282 $dis_text = " disabled='disabled' ";
288 <form method
='post' name
='theform' id
='theform' action
='cqm.php?type=<?php echo attr($type_report) ;?>' onsubmit
='return validateForm()'>
290 <div id
="report_parameters">
295 <div style
='float:left'>
299 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) { ?
>
302 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
305 <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); ?>'
306 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
307 <?php
if (empty($report_id)) { ?
>
308 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
309 id
='img_begin_date' border
='0' alt
='[?]' style
='cursor:pointer'
310 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
318 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) { ?
>
319 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
321 <?php
echo htmlspecialchars( xl('Target Date'), ENT_NOQUOTES
); ?
>:
325 <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); ?>'
326 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
327 <?php
if (empty($report_id)) { ?
>
328 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
329 id
='img_target_date' border
='0' alt
='[?]' style
='cursor:pointer'
330 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
335 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
338 <?php
echo xlt('Rule Set'); ?
>:
341 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
342 <option value
='cqm' <?php
if ($rule_filter == "cqm") echo "selected"; ?
>>
343 <?php
echo xlt('All Clinical Quality Measures (CQM)'); ?
></option
>
344 <option value
='cqm_2011' <?php
if ($rule_filter == "cqm_2011") echo "selected"; ?
>>
345 <?php
echo xlt('2011 Clinical Quality Measures (CQM)'); ?
></option
>
346 <option value
='cqm_2014' <?php
if ($rule_filter == "cqm_2014") echo "selected"; ?
>>
347 <?php
echo xlt('2014 Clinical Quality Measures (CQM)'); ?
></option
>
353 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) { ?
>
356 <?php
echo xlt('Rule Set'); ?
>:
359 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
360 <option value
='amc' <?php
if ($rule_filter == "amc") echo "selected"; ?
>>
361 <?php
echo xlt('All Automated Measure Calculations (AMC)'); ?
></option
>
362 <option value
='amc_2011' <?php
if ($rule_filter == "amc_2011") echo "selected"; ?
>>
363 <?php
echo xlt('2011 Automated Measure Calculations (AMC)'); ?
></option
>
364 <option value
='amc_2014' <?php
if ($rule_filter == "amc_2014") echo "selected"; ?
>>
365 <?php
echo xlt('2014 Automated Measure Calculations (AMC)'); ?
></option
>
371 <?php
if ($type_report == "standard") { ?
>
374 <?php
echo xlt('Rule Set'); ?
>:
377 <select
<?php
echo $dis_text; ?
> id
='form_rule_filter' name
='form_rule_filter'>
378 <option value
='passive_alert' <?php
if ($rule_filter == "passive_alert") echo "selected"; ?
>>
379 <?php
echo xlt('Passive Alert Rules'); ?
></option
>
380 <option value
='active_alert' <?php
if ($rule_filter == "active_alert") echo "selected"; ?
>>
381 <?php
echo xlt('Active Alert Rules'); ?
></option
>
382 <option value
='patient_reminder' <?php
if ($rule_filter == "patient_reminder") echo "selected"; ?
>>
383 <?php
echo xlt('Patient Reminder Rules'); ?
></option
>
389 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) { ?
>
390 <input type
='hidden' id
='form_plan_filter' name
='form_plan_filter' value
=''>
394 <?php
echo htmlspecialchars( xl('Plan Set'), ENT_NOQUOTES
); ?
>:
397 <select
<?php
echo $dis_text; ?
> id
='form_plan_filter' name
='form_plan_filter'>
398 <option value
=''>-- <?php
echo htmlspecialchars( xl('Ignore'), ENT_NOQUOTES
); ?
> --</option
>
399 <?php
if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) { ?
>
400 <option value
='cqm' <?php
if ($plan_filter == "cqm") echo "selected"; ?
>>
401 <?php
echo htmlspecialchars( xl('All Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
402 <option value
='cqm_2011' <?php
if ($plan_filter == "cqm_2011") echo "selected"; ?
>>
403 <?php
echo htmlspecialchars( xl('2011 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
404 <option value
='cqm_2014' <?php
if ($plan_filter == "cqm_2014") echo "selected"; ?
>>
405 <?php
echo htmlspecialchars( xl('2014 Official Clinical Quality Measures (CQM) Measure Groups'), ENT_NOQUOTES
); ?
></option
>
407 <?php
if ($type_report == "standard") { ?
>
408 <option value
='normal' <?php
if ($plan_filter == "normal") echo "selected"; ?
>>
409 <?php
echo htmlspecialchars( xl('Active Plans'), ENT_NOQUOTES
); ?
></option
>
417 <?php
echo htmlspecialchars( xl('Provider'), ENT_NOQUOTES
); ?
>:
422 // Build a drop-down list of providers.
425 $query = "SELECT id, lname, fname FROM users WHERE ".
426 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
428 $ures = sqlStatement($query);
430 echo " <select " . $dis_text . " id='form_provider' name='form_provider'>\n";
431 echo " <option value=''>-- " . htmlspecialchars( xl('All (Cumulative)'), ENT_NOQUOTES
) . " --\n";
433 echo " <option value='collate_outer'";
434 if ($provider == 'collate_outer') echo " selected";
435 echo ">-- " . htmlspecialchars( xl('All (Collated Format A)'), ENT_NOQUOTES
) . " --\n";
437 echo " <option value='collate_inner'";
438 if ($provider == 'collate_inner') echo " selected";
439 echo ">-- " . htmlspecialchars( xl('All (Collated Format B)'), ENT_NOQUOTES
) . " --\n";
441 while ($urow = sqlFetchArray($ures)) {
442 $provid = $urow['id'];
443 echo " <option value='".htmlspecialchars( $provid, ENT_QUOTES
)."'";
444 if ($provid == $provider) echo " selected";
445 echo ">" . htmlspecialchars( $urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
456 <?php
echo htmlspecialchars( xl('Provider Relationship'), ENT_NOQUOTES
); ?
>:
461 // Build a drop-down list of of patient provider relationships.
463 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";
464 echo " <option value='primary'";
465 if ($pat_prov_rel == 'primary') echo " selected";
466 echo ">" . xlt('Primary') . "\n";
467 echo " <option value='encounter'";
468 if ($pat_prov_rel == 'encounter') echo " selected";
469 echo ">" . xlt('Encounter') . "\n";
475 <?php
if (($type_report == "amc") ||
($type_report == "amc_2011") ||
($type_report == "amc_2014")) { ?
>
478 <?php
echo htmlspecialchars( xl('Number labs'), ENT_NOQUOTES
); ?
>:<br
>
479 (<?php
echo htmlspecialchars( xl('Non-electronic'), ENT_NOQUOTES
); ?
>)
482 <input
<?php
echo $dis_text; ?
> type
="text" id
="labs_manual_entry" name
="labs_manual_entry" value
="<?php echo htmlspecialchars($labs_manual,ENT_QUOTES); ?>">
492 <td align
='left' valign
='middle' height
="100%">
493 <table style
='border-left:1px solid; width:100%; height:100%' >
496 <div style
='margin-left:15px'>
497 <?php
if (empty($report_id)) { ?
>
498 <a id
='submit_button' href
='#' class='css_button' onclick
='runReport();'>
500 <?php
echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES
); ?
>
503 <span id
='status_span'></span
>
504 <div id
='processing' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>
505 <?php
if ($type_report == "cqm") { ?
>
506 <a id
='xmla_button' href
='#' class='css_button' onclick
='return GenXml("false")'>
508 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method A) - 2011'), ENT_NOQUOTES
); ?
>
511 <a id
='xmlb_button' href
='#' class='css_button' onclick
='return GenXml("true")'>
513 <?php
echo htmlspecialchars( xl('Generate PQRI report (Method E) - 2011'), ENT_NOQUOTES
); ?
>
518 <?php
if (!empty($report_id)) { ?
>
519 <a href
='#' class='css_button' onclick
='window.print()'>
521 <?php
echo htmlspecialchars( xl('Print'), ENT_NOQUOTES
); ?
>
524 <?php
if ($back_link == "list") { ?
>
525 <a href
='report_results.php' class='css_button' onclick
='top.restoreSession()'><span
><?php
echo xlt("Return To Report Results"); ?
></span
></a
>
527 <a href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit();'><span
><?php
echo xlt("Start Another Report"); ?
></span
></a
>
538 </div
> <!-- end of search parameters
-->
543 if (!empty($report_id)) {
547 <div id
="report_results">
552 <?php
echo htmlspecialchars( xl('Title'), ENT_NOQUOTES
); ?
>
556 <?php
echo htmlspecialchars( xl('Total Patients'), ENT_NOQUOTES
); ?
>
560 <?php
if ($type_report == "amc") { ?
>
561 <?php
echo htmlspecialchars( xl('Denominator'), ENT_NOQUOTES
); ?
></a
>
563 <?php
echo htmlspecialchars( xl('Applicable Patients') .' (' . xl('Denominator') . ')', ENT_NOQUOTES
); ?
></a
>
567 <?php
if ($type_report != "amc") { ?
>
569 <?php
echo htmlspecialchars( xl('Excluded Patients'), ENT_NOQUOTES
); ?
></a
>
574 <?php
if ($type_report == "amc") { ?
>
575 <?php
echo htmlspecialchars( xl('Numerator'), ENT_NOQUOTES
); ?
></a
>
577 <?php
echo htmlspecialchars( xl('Passed Patients') . ' (' . xl('Numerator') . ')', ENT_NOQUOTES
); ?
></a
>
582 <?php
echo htmlspecialchars( xl('Performance Percentage'), ENT_NOQUOTES
); ?
></a
>
586 <tbody
> <!-- added
for better
print-ability
-->
589 $firstProviderFlag = TRUE;
590 $firstPlanFlag = TRUE;
591 $existProvider = FALSE;
592 foreach ($dataSheet as $row) {
596 <tr bgcolor
='<?php echo $bgcolor ?>'>
599 if (isset($row['is_main']) ||
isset($row['is_sub'])) {
600 echo "<td class='detail'>";
601 if (isset($row['is_main'])) {
602 echo "<b>".generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'),$row['id'])."</b>";
604 $tempCqmAmcString = "";
605 if (($type_report == "cqm") ||
($type_report == "cqm_2011") ||
($type_report == "cqm_2014")) {
606 if (!empty($row['cqm_pqri_code'])) {
607 $tempCqmAmcString .= " " . htmlspecialchars( xl('PQRI') . ":" . $row['cqm_pqri_code'], ENT_NOQUOTES
) . " ";
609 if (!empty($row['cqm_nqf_code'])) {
610 $tempCqmAmcString .= " " . htmlspecialchars( xl('NQF') . ":" . $row['cqm_nqf_code'], ENT_NOQUOTES
) . " ";
613 if ($type_report == "amc") {
614 if (!empty($row['amc_code'])) {
615 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
617 if (!empty($row['amc_code_2014'])) {
618 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
621 if ($type_report == "amc_2011") {
622 if (!empty($row['amc_code'])) {
623 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2011') . ":" . $row['amc_code'], ENT_NOQUOTES
) . " ";
626 if ($type_report == "amc_2014") {
627 if (!empty($row['amc_code_2014'])) {
628 $tempCqmAmcString .= " " . htmlspecialchars( xl('AMC-2014') . ":" . $row['amc_code_2014'], ENT_NOQUOTES
) . " ";
632 if (!empty($tempCqmAmcString)) {
633 echo "(".$tempCqmAmcString.")";
636 if ( !(empty($row['concatenated_label'])) ) {
637 echo ", " . htmlspecialchars( xl( $row['concatenated_label'] ), ENT_NOQUOTES
) . " ";
641 else { // isset($row['is_sub'])
642 echo generate_display_field(array('data_type'=>'1','list_id'=>'rule_action_category'),$row['action_category']);
643 echo ": " . generate_display_field(array('data_type'=>'1','list_id'=>'rule_action'),$row['action_item']);
646 echo "<td align='center'>" . $row['total_patients'] . "</td>";
647 echo "<td align='center'>" . $row['pass_filter'] . "</td>";
648 if ($type_report != "amc") {
649 echo "<td align='center'>" . $row['excluded'] . "</td>";
651 echo "<td align='center'>" . $row['pass_target'] . "</td>";
652 echo "<td align='center'>" . $row['percentage'] . "</td>";
654 else if (isset($row['is_provider'])) {
655 // Display the provider information
656 if (!$firstProviderFlag && $_POST['form_provider'] == 'collate_outer') {
657 echo "<tr><td> </td></tr>";
659 echo "<td class='detail' align='center'><b>";
660 echo htmlspecialchars( xl("Provider").": " . $row['prov_lname'] . "," . $row['prov_fname'], ENT_NOQUOTES
);
661 if (!empty($row['npi']) ||
!empty($row['federaltaxid'])) {
663 if (!empty($row['npi'])) {
664 echo " " . htmlspecialchars( xl('NPI') . ":" . $row['npi'], ENT_NOQUOTES
) . " ";
666 if (!empty($row['federaltaxid'])) {
667 echo " " . htmlspecialchars( xl('TID') . ":" . $row['federaltaxid'], ENT_NOQUOTES
) . " ";
672 $firstProviderFlag = FALSE;
673 $existProvider = TRUE;
675 else { // isset($row['is_plan'])
676 if (!$firstPlanFlag && $_POST['form_provider'] != 'collate_outer') {
677 echo "<tr><td> </td></tr>";
679 echo "<td class='detail' align='center'><b>";
680 echo htmlspecialchars( xl("Plan"), ENT_NOQUOTES
) . ": ";
681 echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'),$row['id']);
682 if (!empty($row['cqm_measure_group'])) {
683 echo " (". htmlspecialchars( xl('Measure Group Code') . ": " . $row['cqm_measure_group'], ENT_NOQUOTES
) . ")";
686 $firstPlanFlag = FALSE;
696 </div
> <!-- end of search results
-->
698 <div id
="instructions_text" class='text'>
699 <?php
echo htmlspecialchars( xl('Please input search criteria above, and click Submit to start report.'), ENT_NOQUOTES
); ?
>
703 <input type
='hidden' name
='form_new_report_id' id
='form_new_report_id' value
=''/>
709 <!-- stuff
for the popup calendar
-->
710 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
711 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
712 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
713 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
714 <script language
="Javascript">
715 <?php
if ($type_report == "amc") { ?
>
716 Calendar
.setup({inputField
:"form_begin_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_begin_date", showsTime
:'true'});
718 Calendar
.setup({inputField
:"form_target_date", ifFormat
:"%Y-%m-%d %H:%M:%S", button
:"img_target_date", showsTime
:'true'});