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
23 use OpenEMR\Core\Header
;
25 require_once("../globals.php");
26 require_once("../../library/patient.inc");
27 require_once "$srcdir/options.inc.php";
28 require_once "$srcdir/amc.php";
30 // Collect form parameters (set defaults if empty)
31 $begin_date = (isset($_POST['form_begin_date'])) ?
trim($_POST['form_begin_date']) : "";
32 $end_date = (isset($_POST['form_end_date'])) ?
trim($_POST['form_end_date']) : "";
33 $rule = (isset($_POST['form_rule'])) ?
trim($_POST['form_rule']) : "";
34 $provider = trim($_POST['form_provider']);
42 <title
><?php
echo htmlspecialchars(xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></title
>
44 <?php Header
::setupHeader('datetime-picker') ?
>
46 <script LANGUAGE
="JavaScript">
48 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
50 $
(document
).ready(function() {
51 var win
= top
.printLogSetup ? top
: opener
.top
;
52 win
.printLogSetup(document
.getElementById('printbutton'));
54 $
('.datepicker').datetimepicker({
55 <?php
$datetimepicker_timepicker = true; ?
>
56 <?php
$datetimepicker_showseconds = true; ?
>
57 <?php
$datetimepicker_formatInput = false; ?
>
58 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
59 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
63 function send_sum(patient_id
,transaction_id
) {
64 if ( $
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
71 $
.post( "../../library/ajax/amc_misc_data.php",
72 { amc_id
: "send_sum_amc",
75 patient_id
: patient_id
,
76 object_category
: "transactions",
77 object_id
: transaction_id
82 function send_sum_elec(patient_id
,transaction_id
) {
83 if ( $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
84 if ( !$
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
85 $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).prop("checked", false);
86 alert("<?php echo xls('Can not set this unless the Summary of Care Sent toggle is set.'); ?>");
95 $
.post( "../../library/ajax/amc_misc_data.php",
96 { amc_id
: "send_sum_elec_amc",
99 patient_id
: patient_id
,
100 object_category
: "transactions",
101 object_id
: transaction_id
106 function provide_rec_pat(patient_id
,date_created
) {
107 if ( $
('#provide_rec_pat_flag_' + patient_id
).prop('checked') ) {
108 var mode
= "complete_safe";
111 var mode
= "uncomplete_safe";
113 top
.restoreSession();
114 $
.post( "../../library/ajax/amc_misc_data.php",
115 { amc_id
: "provide_rec_pat_amc",
118 date_created
: date_created
,
119 patient_id
: patient_id
124 function provide_sum_pat(patient_id
,encounter_id
) {
125 if ( $
('#provide_sum_pat_flag_' + patient_id +
'_' + encounter_id
).prop('checked') ) {
131 top
.restoreSession();
132 $
.post( "../../library/ajax/amc_misc_data.php",
133 { amc_id
: "provide_sum_pat_amc",
136 patient_id
: patient_id
,
137 object_category
: "form_encounter",
138 object_id
: encounter_id
145 <style type
="text/css">
147 /* specifically include & exclude from printing */
153 #report_parameters_daterange {
157 #report_results table {
162 /* specifically exclude some from the screen */
164 #report_parameters_daterange {
173 <body
class="body_top">
175 <!-- Required
for the popup date selectors
-->
176 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
178 <span
class='title'><?php
echo htmlspecialchars(xl('Report'), ENT_NOQUOTES
); ?
> -
180 <?php
echo htmlspecialchars(xl('Automated Measure Calculations (AMC) Tracking'), ENT_NOQUOTES
); ?
></span
>
182 <form method
='post' name
='theform' id
='theform' action
='amc_tracking.php' onsubmit
='return top.restoreSession()'>
184 <div id
="report_parameters">
189 <div style
='float:left'>
194 <td
class='control-label'>
195 <?php
echo htmlspecialchars(xl('Begin Date'), ENT_NOQUOTES
); ?
>:
198 <input type
='text' name
='form_begin_date' id
="form_begin_date" size
='20' value
='<?php echo htmlspecialchars($begin_date, ENT_QUOTES); ?>'
199 class='datepicker form-control'
200 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
205 <td
class='control-label'>
206 <?php
echo htmlspecialchars(xl('End Date'), ENT_NOQUOTES
); ?
>:
209 <input type
='text' name
='form_end_date' id
="form_end_date" size
='20' value
='<?php echo htmlspecialchars($end_date, ENT_QUOTES); ?>'
210 class='datepicker form-control'
211 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd hh
:mm
:ss
'), ENT_QUOTES); ?>'>
216 <td
class='control-label'>
217 <?php
echo htmlspecialchars(xl('Rule'), ENT_NOQUOTES
); ?
>:
220 <select name
='form_rule' class='form-control'>
221 <option value
='send_sum_amc' <?php
if ($rule == "send_sum_amc") {
224 <?php
echo htmlspecialchars(xl('Send Summaries with Referrals'), ENT_NOQUOTES
); ?
></option
>
225 <option value
='provide_rec_pat_amc' <?php
if ($rule == "provide_rec_pat_amc") {
228 <?php
echo htmlspecialchars(xl('Patient Requested Medical Records'), ENT_NOQUOTES
); ?
></option
>
229 <option value
='provide_sum_pat_amc' <?php
if ($rule == "provide_sum_pat_amc") {
232 <?php
echo htmlspecialchars(xl('Provide Records to Patient for Visit'), ENT_NOQUOTES
); ?
></option
>
238 <td
class='control-label'>
239 <?php
echo htmlspecialchars(xl('Provider'), ENT_NOQUOTES
); ?
>:
244 // Build a drop-down list of providers.
247 $query = "SELECT id, lname, fname FROM users WHERE ".
248 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
250 $ures = sqlStatement($query);
252 echo " <select name='form_provider' class='form-control'>\n";
253 echo " <option value=''>-- " . htmlspecialchars(xl('All'), ENT_NOQUOTES
) . " --\n";
255 while ($urow = sqlFetchArray($ures)) {
256 $provid = $urow['id'];
257 echo " <option value='".htmlspecialchars($provid, ENT_QUOTES
)."'";
258 if ($provid == $_POST['form_provider']) {
262 echo ">" . htmlspecialchars($urow['lname'] . ", " . $urow['fname'], ENT_NOQUOTES
) . "\n";
275 <td align
='left' valign
='middle' height
="100%">
276 <table style
='border-left:1px solid; width:100%; height:100%' >
279 <div
class="text-center">
280 <div
class="btn-group" role
="group">
281 <a href
='#' class='btn btn-default btn-save' onclick
='$("#form_refresh").attr("value","true"); top.restoreSession(); $("#theform").submit();'>
282 <?php
echo xlt('Submit'); ?
>
284 <?php
if ($_POST['form_refresh']) { ?
>
285 <a href
='#' class='btn btn-default btn-print' id
='printbutton'>
286 <?php
echo xlt('Print'); ?
>
298 </div
> <!-- end of search parameters
-->
303 if ($_POST['form_refresh']) {
307 <div id
="report_results">
312 <?php
echo htmlspecialchars(xl('Patient Name'), ENT_NOQUOTES
); ?
>
316 <?php
echo htmlspecialchars(xl('Patient ID'), ENT_NOQUOTES
); ?
>
321 if ($rule == "send_sum_amc") {
322 echo htmlspecialchars(xl('Referral Date'), ENT_NOQUOTES
);
323 } else if ($rule == "provide_rec_pat_amc") {
324 echo htmlspecialchars(xl('Record Request Date'), ENT_NOQUOTES
);
325 } else { // $rule == "provide_sum_pat_amc"
326 echo htmlspecialchars(xl('Encounter Date'), ENT_NOQUOTES
);
333 if ($rule == "send_sum_amc") {
334 echo htmlspecialchars(xl('Referral ID'), ENT_NOQUOTES
);
335 } else if ($rule == "provide_rec_pat_amc") {
337 } else { // $rule == "provide_sum_pat_amc"
338 echo htmlspecialchars(xl('Encounter ID'), ENT_NOQUOTES
);
345 if ($rule == "provide_rec_pat_amc") {
346 echo htmlspecialchars(xl('Medical Records Sent'), ENT_NOQUOTES
);
347 } else if ($rule == "send_sum_amc") {
348 echo htmlspecialchars(xl('Summary of Care Sent'), ENT_NOQUOTES
);
349 } else { // $rule == "provide_sum_pat_amc"
350 echo htmlspecialchars(xl('Medical Summary Given'), ENT_NOQUOTES
);
355 if ($rule == "send_sum_amc") {
357 echo htmlspecialchars(xl('Summary of Care Sent Electronically'), ENT_NOQUOTES
);
363 <tbody
> <!-- added
for better
print-ability
-->
366 // Send the request for information
367 $resultsArray = amcTrackingRequest($rule, $begin_date, $end_date, $provider);
372 foreach ($resultsArray as $result) {
373 echo "<tr bgcolor='" . $bgcolor ."'>";
374 echo "<td>" . htmlspecialchars($result['lname'].",".$result['fname'], ENT_NOQUOTES
) . "</td>";
375 echo "<td>" . htmlspecialchars($result['pid'], ENT_NOQUOTES
) . "</td>";
376 echo "<td>" . htmlspecialchars($result['date'], ENT_NOQUOTES
) . "</td>";
377 if ($rule == "send_sum_amc" ||
$rule == "provide_sum_pat_amc") {
378 echo "<td>" . htmlspecialchars($result['id'], ENT_NOQUOTES
) . "</td>";
379 } else { //$rule == "provide_rec_pat_amc"
380 echo "<td> </td>";
383 if ($rule == "send_sum_amc") {
384 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>";
385 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>";
386 } else if ($rule == "provide_rec_pat_amc") {
387 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>";
388 } else { //$rule == "provide_sum_pat_amc"
389 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>";
398 </div
> <!-- end of search results
-->
401 <?php
echo htmlspecialchars(xl('Please input search criteria above, and click Submit to view results.'), ENT_NOQUOTES
); ?
>
405 <input type
='hidden' name
='form_refresh' id
='form_refresh' value
=''/>