4 * Copyright (C) 2011-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/amc.php";
35 // Collect form parameters (set defaults if empty)
36 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
37 $end_date = (isset($_POST['form_end_date'])) ?
trim($_POST['form_end_date']) : "";
38 $rule = (isset($_POST['form_rule'])) ?
trim($_POST['form_rule']) : "";
39 $provider = trim($_POST['form_provider']);
46 <?php
html_header_show();?
>
48 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
49 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
51 <title
><?php
echo htmlspecialchars( xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></title
>
53 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
54 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
55 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
56 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
58 <script LANGUAGE
="JavaScript">
60 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
62 $
(document
).ready(function() {
63 var win
= top
.printLogSetup ? top
: opener
.top
;
64 win
.printLogSetup(document
.getElementById('printbutton'));
66 $
('.datepicker').datetimepicker({
67 <?php
$datetimepicker_timepicker = true; ?
>
68 <?php
$datetimepicker_showseconds = true; ?
>
69 <?php
$datetimepicker_formatInput = false; ?
>
70 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
71 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
75 function send_sum(patient_id
,transaction_id
) {
76 if ( $
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
83 $
.post( "../../library/ajax/amc_misc_data.php",
84 { amc_id
: "send_sum_amc",
87 patient_id
: patient_id
,
88 object_category
: "transactions",
89 object_id
: transaction_id
94 function send_sum_elec(patient_id
,transaction_id
) {
95 if ( $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
96 if ( !$
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).attr('checked') ) {
97 $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).removeAttr("checked");
98 alert("<?php echo xls('Can not set this unless the Summary of Care Sent toggle is set.'); ?>");
106 top
.restoreSession();
107 $
.post( "../../library/ajax/amc_misc_data.php",
108 { amc_id
: "send_sum_elec_amc",
111 patient_id
: patient_id
,
112 object_category
: "transactions",
113 object_id
: transaction_id
118 function provide_rec_pat(patient_id
,date_created
) {
119 if ( $
('#provide_rec_pat_flag_' + patient_id
).attr('checked') ) {
120 var mode
= "complete_safe";
123 var mode
= "uncomplete_safe";
125 top
.restoreSession();
126 $
.post( "../../library/ajax/amc_misc_data.php",
127 { amc_id
: "provide_rec_pat_amc",
130 date_created
: date_created
,
131 patient_id
: patient_id
136 function provide_sum_pat(patient_id
,encounter_id
) {
137 if ( $
('#provide_sum_pat_flag_' + patient_id +
'_' + encounter_id
).attr('checked') ) {
143 top
.restoreSession();
144 $
.post( "../../library/ajax/amc_misc_data.php",
145 { amc_id
: "provide_sum_pat_amc",
148 patient_id
: patient_id
,
149 object_category
: "form_encounter",
150 object_id
: encounter_id
157 <style type
="text/css">
159 /* specifically include & exclude from printing */
165 #report_parameters_daterange {
169 #report_results table {
174 /* specifically exclude some from the screen */
176 #report_parameters_daterange {
185 <body
class="body_top">
187 <!-- Required
for the popup date selectors
-->
188 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
190 <span
class='title'><?php
echo htmlspecialchars( xl('Report'), ENT_NOQUOTES
); ?
> -
192 <?php
echo htmlspecialchars( xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></span
>
194 <form method
='post' name
='theform' id
='theform' action
='amc_tracking.php' onsubmit
='return top.restoreSession()'>
196 <div id
="report_parameters">
201 <div style
='float:left'>
206 <td
class='label_custom'>
207 <?php
echo htmlspecialchars( xl('Begin Date'), ENT_NOQUOTES
); ?
>:
210 <input type
='text' name
='form_begin_date' id
="form_begin_date" size
='20' value
='<?php echo htmlspecialchars( $begin_date, ENT_QUOTES); ?>'
212 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
217 <td
class='label_custom'>
218 <?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
); ?
>:
221 <input type
='text' name
='form_end_date' id
="form_end_date" size
='20' value
='<?php echo htmlspecialchars( $end_date, ENT_QUOTES); ?>'
223 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
228 <td
class='label_custom'>
229 <?php
echo htmlspecialchars( xl('Rule'), ENT_NOQUOTES
); ?
>:
232 <select name
='form_rule'>
233 <option value
='send_sum_amc' <?php
if ($rule == "send_sum_amc") echo "selected"; ?
>>
234 <?php
echo htmlspecialchars( xl('Send Summaries with Referrals'), ENT_NOQUOTES
); ?
></option
>
235 <option value
='provide_rec_pat_amc' <?php
if ($rule == "provide_rec_pat_amc") echo "selected"; ?
>>
236 <?php
echo htmlspecialchars( xl('Patient Requested Medical Records'), ENT_NOQUOTES
); ?
></option
>
237 <option value
='provide_sum_pat_amc' <?php
if ($rule == "provide_sum_pat_amc") echo "selected"; ?
>>
238 <?php
echo htmlspecialchars( xl('Provide Records to Patient for Visit'), ENT_NOQUOTES
); ?
></option
>
244 <td
class='label_custom'>
245 <?php
echo htmlspecialchars( xl('Provider'), ENT_NOQUOTES
); ?
>:
250 // Build a drop-down list of providers.
253 $query = "SELECT id, lname, fname FROM users WHERE ".
254 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
256 $ures = sqlStatement($query);
258 echo " <select name='form_provider'>\n";
259 echo " <option value=''>-- " . htmlspecialchars( xl('All'), ENT_NOQUOTES
) . " --\n";
261 while ($urow = sqlFetchArray($ures)) {
262 $provid = $urow['id'];
263 echo " <option value='".htmlspecialchars( $provid, ENT_QUOTES
)."'";
264 if ($provid == $_POST['form_provider']) echo " selected";
265 echo ">" . htmlspecialchars( $urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
278 <td align
='left' valign
='middle' height
="100%">
279 <table style
='border-left:1px solid; width:100%; height:100%' >
282 <div style
='margin-left:15px'>
283 <a href
='#' class='css_button' onclick
='$("#form_refresh").attr("value","true"); top.restoreSession(); $("#theform").submit();'>
285 <?php
echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES
); ?
>
288 <?php
if ($_POST['form_refresh']) { ?
>
289 <a href
='#' class='css_button' id
='printbutton'>
291 <?php
echo htmlspecialchars( xl('Print'), ENT_NOQUOTES
); ?
>
303 </div
> <!-- end of search parameters
-->
308 if ($_POST['form_refresh']) {
312 <div id
="report_results">
317 <?php
echo htmlspecialchars( xl('Patient Name'), ENT_NOQUOTES
); ?
>
321 <?php
echo htmlspecialchars( xl('Patient ID'), ENT_NOQUOTES
); ?
>
326 if ($rule == "send_sum_amc") {
327 echo htmlspecialchars( xl('Referral Date'), ENT_NOQUOTES
);
329 else if ($rule == "provide_rec_pat_amc") {
330 echo htmlspecialchars( xl('Record Request Date'), ENT_NOQUOTES
);
332 else { // $rule == "provide_sum_pat_amc"
333 echo htmlspecialchars( xl('Encounter Date'), ENT_NOQUOTES
);
340 if ($rule == "send_sum_amc") {
341 echo htmlspecialchars( xl('Referral ID'), ENT_NOQUOTES
);
343 else if ($rule == "provide_rec_pat_amc") {
346 else { // $rule == "provide_sum_pat_amc"
347 echo htmlspecialchars( xl('Encounter ID'), ENT_NOQUOTES
);
354 if ($rule == "provide_rec_pat_amc") {
355 echo htmlspecialchars( xl('Medical Records Sent'), ENT_NOQUOTES
);
357 else if ($rule == "send_sum_amc") {
358 echo htmlspecialchars( xl('Summary of Care Sent'), ENT_NOQUOTES
);
360 else { // $rule == "provide_sum_pat_amc"
361 echo htmlspecialchars( xl('Medical Summary Given'), ENT_NOQUOTES
);
366 if ($rule == "send_sum_amc") {
368 echo htmlspecialchars( xl('Summary of Care Sent Electronically'), ENT_NOQUOTES
);
374 <tbody
> <!-- added
for better
print-ability
-->
377 // Send the request for information
378 $resultsArray = amcTrackingRequest($rule,$begin_date,$end_date,$provider);
383 foreach ($resultsArray as $result) {
384 echo "<tr bgcolor='" . $bgcolor ."'>";
385 echo "<td>" . htmlspecialchars($result['lname'].",".$result['fname'], ENT_NOQUOTES
) . "</td>";
386 echo "<td>" . htmlspecialchars($result['pid'],ENT_NOQUOTES
) . "</td>";
387 echo "<td>" . htmlspecialchars($result['date'],ENT_NOQUOTES
) . "</td>";
388 if ($rule == "send_sum_amc" ||
$rule == "provide_sum_pat_amc") {
389 echo "<td>" . htmlspecialchars($result['id'],ENT_NOQUOTES
) . "</td>";
391 else { //$rule == "provide_rec_pat_amc"
395 if ($rule == "send_sum_amc") {
396 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>";
397 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>";
399 else if ($rule == "provide_rec_pat_amc") {
400 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>";
402 else { //$rule == "provide_sum_pat_amc"
403 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>";
411 </div
> <!-- end of search results
-->
414 <?php
echo htmlspecialchars( xl('Please input search criteria above, and click Submit to view results.'), ENT_NOQUOTES
); ?
>
418 <input type
='hidden' name
='form_refresh' id
='form_refresh' value
=''/>