4 * Copyright (C) 2011-2017 Brady Miller <brady@sparmy.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@sparmy.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/formatting.inc.php");
33 require_once "$srcdir/options.inc.php";
34 require_once "$srcdir/amc.php";
36 // Collect form parameters (set defaults if empty)
37 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
38 $end_date = (isset($_POST['form_end_date'])) ?
trim($_POST['form_end_date']) : "";
39 $rule = (isset($_POST['form_rule'])) ?
trim($_POST['form_rule']) : "";
40 $provider = trim($_POST['form_provider']);
47 <?php
html_header_show();?
>
49 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
50 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
52 <title
><?php
echo htmlspecialchars( xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></title
>
54 <script type
="text/javascript" src
="../../library/overlib_mini.js"></script
>
55 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
56 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
57 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
58 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
60 <script LANGUAGE
="JavaScript">
62 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
64 $
(document
).ready(function() {
65 var win
= top
.printLogSetup ? top
: opener
.top
;
66 win
.printLogSetup(document
.getElementById('printbutton'));
68 $
('.datepicker').datetimepicker({
69 <?php
$datetimepicker_timepicker = true; ?
>
70 <?php
$datetimepicker_formatInput = false; ?
>
71 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
72 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
76 function send_sum(patient_id
,transaction_id
) {
77 if ( $
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
84 $
.post( "../../library/ajax/amc_misc_data.php",
85 { amc_id
: "send_sum_amc",
88 patient_id
: patient_id
,
89 object_category
: "transactions",
90 object_id
: transaction_id
95 function send_sum_elec(patient_id
,transaction_id
) {
96 if ( $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
97 if ( !$
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
98 $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).removeAttr("checked");
99 alert("<?php echo xls('Can not set this unless the Summary of Care Sent toggle is set.'); ?>");
107 top
.restoreSession();
108 $
.post( "../../library/ajax/amc_misc_data.php",
109 { amc_id
: "send_sum_elec_amc",
112 patient_id
: patient_id
,
113 object_category
: "transactions",
114 object_id
: transaction_id
119 function provide_rec_pat(patient_id
,date_created
) {
120 if ( $
('#provide_rec_pat_flag_' + patient_id
).attr('checked') ) {
121 var mode
= "complete_safe";
124 var mode
= "uncomplete_safe";
126 top
.restoreSession();
127 $
.post( "../../library/ajax/amc_misc_data.php",
128 { amc_id
: "provide_rec_pat_amc",
131 date_created
: date_created
,
132 patient_id
: patient_id
137 function provide_sum_pat(patient_id
,encounter_id
) {
138 if ( $
('#provide_sum_pat_flag_' + patient_id +
'_' + encounter_id
).attr('checked') ) {
144 top
.restoreSession();
145 $
.post( "../../library/ajax/amc_misc_data.php",
146 { amc_id
: "provide_sum_pat_amc",
149 patient_id
: patient_id
,
150 object_category
: "form_encounter",
151 object_id
: encounter_id
158 <style type
="text/css">
160 /* specifically include & exclude from printing */
166 #report_parameters_daterange {
170 #report_results table {
175 /* specifically exclude some from the screen */
177 #report_parameters_daterange {
186 <body
class="body_top">
188 <!-- Required
for the popup date selectors
-->
189 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
191 <span
class='title'><?php
echo htmlspecialchars( xl('Report'), ENT_NOQUOTES
); ?
> -
193 <?php
echo htmlspecialchars( xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></span
>
195 <form method
='post' name
='theform' id
='theform' action
='amc_tracking.php' onsubmit
='return top.restoreSession()'>
197 <div id
="report_parameters">
202 <div style
='float:left'>
208 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
211 <input type
='text' name
='form_begin_date' id
="form_begin_date" size
='20' value
='<?php echo htmlspecialchars( $begin_date, ENT_QUOTES); ?>'
213 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
219 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
222 <input type
='text' name
='form_end_date' id
="form_end_date" size
='20' value
='<?php echo htmlspecialchars( $end_date, ENT_QUOTES); ?>'
224 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
230 <?php
echo htmlspecialchars( xl('Rule'), ENT_NOQUOTES
); ?
>:
233 <select name
='form_rule'>
234 <option value
='send_sum_amc' <?php
if ($rule == "send_sum_amc") echo "selected"; ?
>>
235 <?php
echo htmlspecialchars( xl('Send Summaries with Referrals'), ENT_NOQUOTES
); ?
></option
>
236 <option value
='provide_rec_pat_amc' <?php
if ($rule == "provide_rec_pat_amc") echo "selected"; ?
>>
237 <?php
echo htmlspecialchars( xl('Patient Requested Medical Records'), ENT_NOQUOTES
); ?
></option
>
238 <option value
='provide_sum_pat_amc' <?php
if ($rule == "provide_sum_pat_amc") echo "selected"; ?
>>
239 <?php
echo htmlspecialchars( xl('Provide Records to Patient for Visit'), ENT_NOQUOTES
); ?
></option
>
246 <?php
echo htmlspecialchars( xl('Provider'), ENT_NOQUOTES
); ?
>:
251 // Build a drop-down list of providers.
254 $query = "SELECT id, lname, fname FROM users WHERE ".
255 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
257 $ures = sqlStatement($query);
259 echo " <select name='form_provider'>\n";
260 echo " <option value=''>-- " . htmlspecialchars( xl('All'), ENT_NOQUOTES
) . " --\n";
262 while ($urow = sqlFetchArray($ures)) {
263 $provid = $urow['id'];
264 echo " <option value='".htmlspecialchars( $provid, ENT_QUOTES
)."'";
265 if ($provid == $_POST['form_provider']) echo " selected";
266 echo ">" . htmlspecialchars( $urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
279 <td align
='left' valign
='middle' height
="100%">
280 <table style
='border-left:1px solid; width:100%; height:100%' >
283 <div style
='margin-left:15px'>
284 <a href
='#' class='css_button' onclick
='$("#form_refresh").attr("value","true"); top.restoreSession(); $("#theform").submit();'>
286 <?php
echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES
); ?
>
289 <?php
if ($_POST['form_refresh']) { ?
>
290 <a href
='#' class='css_button' id
='printbutton'>
292 <?php
echo htmlspecialchars( xl('Print'), ENT_NOQUOTES
); ?
>
304 </div
> <!-- end of search parameters
-->
309 if ($_POST['form_refresh']) {
313 <div id
="report_results">
318 <?php
echo htmlspecialchars( xl('Patient Name'), ENT_NOQUOTES
); ?
>
322 <?php
echo htmlspecialchars( xl('Patient ID'), ENT_NOQUOTES
); ?
>
327 if ($rule == "send_sum_amc") {
328 echo htmlspecialchars( xl('Referral Date'), ENT_NOQUOTES
);
330 else if ($rule == "provide_rec_pat_amc") {
331 echo htmlspecialchars( xl('Record Request Date'), ENT_NOQUOTES
);
333 else { // $rule == "provide_sum_pat_amc"
334 echo htmlspecialchars( xl('Encounter Date'), ENT_NOQUOTES
);
341 if ($rule == "send_sum_amc") {
342 echo htmlspecialchars( xl('Referral ID'), ENT_NOQUOTES
);
344 else if ($rule == "provide_rec_pat_amc") {
347 else { // $rule == "provide_sum_pat_amc"
348 echo htmlspecialchars( xl('Encounter ID'), ENT_NOQUOTES
);
355 if ($rule == "provide_rec_pat_amc") {
356 echo htmlspecialchars( xl('Medical Records Sent'), ENT_NOQUOTES
);
358 else if ($rule == "send_sum_amc") {
359 echo htmlspecialchars( xl('Summary of Care Sent'), ENT_NOQUOTES
);
361 else { // $rule == "provide_sum_pat_amc"
362 echo htmlspecialchars( xl('Medical Summary Given'), ENT_NOQUOTES
);
367 if ($rule == "send_sum_amc") {
369 echo htmlspecialchars( xl('Summary of Care Sent Electronically'), ENT_NOQUOTES
);
375 <tbody
> <!-- added
for better
print-ability
-->
378 // Send the request for information
379 $resultsArray = amcTrackingRequest($rule,$begin_date,$end_date,$provider);
384 foreach ($resultsArray as $result) {
385 echo "<tr bgcolor='" . $bgcolor ."'>";
386 echo "<td>" . htmlspecialchars($result['lname'].",".$result['fname'], ENT_NOQUOTES
) . "</td>";
387 echo "<td>" . htmlspecialchars($result['pid'],ENT_NOQUOTES
) . "</td>";
388 echo "<td>" . htmlspecialchars($result['date'],ENT_NOQUOTES
) . "</td>";
389 if ($rule == "send_sum_amc" ||
$rule == "provide_sum_pat_amc") {
390 echo "<td>" . htmlspecialchars($result['id'],ENT_NOQUOTES
) . "</td>";
392 else { //$rule == "provide_rec_pat_amc"
396 if ($rule == "send_sum_amc") {
397 echo "<td><input type='checkbox' id='send_sum_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='send_sum(\"".htmlspecialchars($result['pid'],ENT_QUOTES
)."\",\"".htmlspecialchars($result['id'],ENT_QUOTES
)."\")'>" . htmlspecialchars( xl('Yes'), ENT_NOQUOTES
) . "</td>";
398 echo "<td><input type='checkbox' id='send_sum_elec_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='send_sum_elec(\"".htmlspecialchars($result['pid'],ENT_QUOTES
)."\",\"".htmlspecialchars($result['id'],ENT_QUOTES
)."\")'>" . htmlspecialchars( xl('Yes'), ENT_NOQUOTES
) . "</td>";
400 else if ($rule == "provide_rec_pat_amc") {
401 echo "<td><input type='checkbox' id='provide_rec_pat_flag_".attr($result['pid'])."' onclick='provide_rec_pat(\"".htmlspecialchars($result['pid'],ENT_QUOTES
)."\",\"".htmlspecialchars($result['date'],ENT_QUOTES
)."\")'>" . htmlspecialchars( xl('Yes'), ENT_NOQUOTES
) . "</td>";
403 else { //$rule == "provide_sum_pat_amc"
404 echo "<td><input type='checkbox' id='provide_sum_pat_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='provide_sum_pat(\"".htmlspecialchars($result['pid'],ENT_QUOTES
)."\",\"".htmlspecialchars($result['id'],ENT_QUOTES
)."\")'>" . htmlspecialchars( xl('Yes'), ENT_NOQUOTES
) . "</td>";
412 </div
> <!-- end of search results
-->
415 <?php
echo htmlspecialchars( xl('Please input search criteria above, and click Submit to view results.'), ENT_NOQUOTES
); ?
>
419 <input type
='hidden' name
='form_refresh' id
='form_refresh' value
=''/>