6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2011-2017 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
14 require_once("../../library/patient.inc");
15 require_once "$srcdir/options.inc.php";
16 require_once "$srcdir/amc.php";
18 use OpenEMR\Core\Header
;
20 // Collect form parameters (set defaults if empty)
21 $begin_date = (isset($_POST['form_begin_date'])) ?
DateTimeToYYYYMMDDHHMMSS(trim($_POST['form_begin_date'])) : "";
22 $end_date = (isset($_POST['form_end_date'])) ?
DateTimeToYYYYMMDDHHMMSS(trim($_POST['form_end_date'])) : "";
23 $rule = (isset($_POST['form_rule'])) ?
trim($_POST['form_rule']) : "";
24 $provider = trim($_POST['form_provider']);
32 <title
><?php
echo xlt('Automated Measure Calculations (AMC) Tracking'); ?
></title
>
34 <?php Header
::setupHeader('datetime-picker') ?
>
36 <script LANGUAGE
="JavaScript">
38 $
(document
).ready(function() {
39 var win
= top
.printLogSetup ? top
: opener
.top
;
40 win
.printLogSetup(document
.getElementById('printbutton'));
42 $
('.datepicker').datetimepicker({
43 <?php
$datetimepicker_timepicker = true; ?
>
44 <?php
$datetimepicker_showseconds = true; ?
>
45 <?php
$datetimepicker_formatInput = true; ?
>
46 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
47 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
51 function send_sum(patient_id
,transaction_id
) {
52 if ( $
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
59 $
.post( "../../library/ajax/amc_misc_data.php",
60 { amc_id
: "send_sum_amc",
63 patient_id
: patient_id
,
64 object_category
: "transactions",
65 object_id
: transaction_id
70 function send_sum_elec(patient_id
,transaction_id
) {
71 if ( $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
72 if ( !$
('#send_sum_flag_' + patient_id +
'_' + transaction_id
).prop('checked') ) {
73 $
('#send_sum_elec_flag_' + patient_id +
'_' + transaction_id
).prop("checked", false);
74 alert("<?php echo xls('Can not set this unless the Summary of Care Sent toggle is set.'); ?>");
83 $
.post( "../../library/ajax/amc_misc_data.php",
84 { amc_id
: "send_sum_elec_amc",
87 patient_id
: patient_id
,
88 object_category
: "transactions",
89 object_id
: transaction_id
94 function provide_rec_pat(patient_id
,date_created
) {
95 if ( $
('#provide_rec_pat_flag_' + patient_id
).prop('checked') ) {
96 var mode
= "complete_safe";
99 var mode
= "uncomplete_safe";
101 top
.restoreSession();
102 $
.post( "../../library/ajax/amc_misc_data.php",
103 { amc_id
: "provide_rec_pat_amc",
106 date_created
: date_created
,
107 patient_id
: patient_id
112 function provide_sum_pat(patient_id
,encounter_id
) {
113 if ( $
('#provide_sum_pat_flag_' + patient_id +
'_' + encounter_id
).prop('checked') ) {
119 top
.restoreSession();
120 $
.post( "../../library/ajax/amc_misc_data.php",
121 { amc_id
: "provide_sum_pat_amc",
124 patient_id
: patient_id
,
125 object_category
: "form_encounter",
126 object_id
: encounter_id
133 <style type
="text/css">
135 /* specifically include & exclude from printing */
141 #report_parameters_daterange {
145 #report_results table {
150 /* specifically exclude some from the screen */
152 #report_parameters_daterange {
161 <body
class="body_top">
163 <!-- Required
for the popup date selectors
-->
164 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
166 <span
class='title'><?php
echo xlt('Report'); ?
> -
168 <?php
echo xlt('Automated Measure Calculations (AMC) Tracking'); ?
></span
>
170 <form method
='post' name
='theform' id
='theform' action
='amc_tracking.php' onsubmit
='return top.restoreSession()'>
172 <div id
="report_parameters">
177 <div style
='float:left'>
182 <td
class='control-label'>
183 <?php
echo xlt('Begin Date'); ?
>:
186 <input type
='text' name
='form_begin_date' id
="form_begin_date" size
='20' value
='<?php echo attr(oeFormatDateTime($begin_date, 0, true)); ?>'
187 class='datepicker form-control'>
192 <td
class='control-label'>
193 <?php
echo xlt('End Date'); ?
>:
196 <input type
='text' name
='form_end_date' id
="form_end_date" size
='20' value
='<?php echo attr(oeFormatDateTime($end_date, 0, true)); ?>'
197 class='datepicker form-control'>
202 <td
class='control-label'>
203 <?php
echo xlt('Rule'); ?
>:
206 <select name
='form_rule' class='form-control'>
207 <option value
='send_sum_amc' <?php
echo ($rule == "send_sum_amc") ?
"selected" : ""; ?
>>
208 <?php
echo xlt('Send Summaries with Referrals'); ?
></option
>
209 <option value
='provide_rec_pat_amc' <?php
echo ($rule == "provide_rec_pat_amc") ?
"selected" : ""; ?
>>
210 <?php
echo xlt('Patient Requested Medical Records'); ?
></option
>
211 <option value
='provide_sum_pat_amc' <?php
echo ($rule == "provide_sum_pat_amc") ?
"selected" : ""; ?
>>
212 <?php
echo xlt('Provide Records to Patient for Visit'); ?
></option
>
218 <td
class='control-label'>
219 <?php
echo xlt('Provider'); ?
>:
224 // Build a drop-down list of providers.
227 $query = "SELECT id, lname, fname FROM users WHERE ".
228 "authorized = 1 $provider_facility_filter ORDER BY lname, fname"; //(CHEMED) facility filter
230 $ures = sqlStatement($query);
232 echo " <select name='form_provider' class='form-control'>\n";
233 echo " <option value=''>-- " . xlt('All') . " --\n";
235 while ($urow = sqlFetchArray($ures)) {
236 $provid = $urow['id'];
237 echo " <option value='".attr($provid)."'";
238 if ($provid == $_POST['form_provider']) {
242 echo ">" . text($urow['lname'] . ", " . $urow['fname']) . "\n";
255 <td align
='left' valign
='middle' height
="100%">
256 <table style
='border-left:1px solid; width:100%; height:100%' >
259 <div
class="text-center">
260 <div
class="btn-group" role
="group">
261 <a href
='#' class='btn btn-default btn-save' onclick
='$("#form_refresh").attr("value","true"); top.restoreSession(); $("#theform").submit();'>
262 <?php
echo xlt('Submit'); ?
>
264 <?php
if ($_POST['form_refresh']) { ?
>
265 <a href
='#' class='btn btn-default btn-print' id
='printbutton'>
266 <?php
echo xlt('Print'); ?
>
278 </div
> <!-- end of search parameters
-->
283 if ($_POST['form_refresh']) {
287 <div id
="report_results">
292 <?php
echo xlt('Patient Name'); ?
>
296 <?php
echo xlt('Patient ID'); ?
>
301 if ($rule == "send_sum_amc") {
302 echo xlt('Referral Date');
303 } else if ($rule == "provide_rec_pat_amc") {
304 echo xlt('Record Request Date');
305 } else { // $rule == "provide_sum_pat_amc"
306 echo xlt('Encounter Date');
313 if ($rule == "send_sum_amc") {
314 echo xlt('Referral ID');
315 } else if ($rule == "provide_rec_pat_amc") {
317 } else { // $rule == "provide_sum_pat_amc"
318 echo xlt('Encounter ID');
325 if ($rule == "provide_rec_pat_amc") {
326 echo xlt('Medical Records Sent');
327 } else if ($rule == "send_sum_amc") {
328 echo xlt('Summary of Care Sent');
329 } else { // $rule == "provide_sum_pat_amc"
330 echo xlt('Medical Summary Given');
335 if ($rule == "send_sum_amc") {
337 echo xlt('Summary of Care Sent Electronically');
343 <tbody
> <!-- added
for better
print-ability
-->
346 // Send the request for information
347 $resultsArray = amcTrackingRequest($rule, $begin_date, $end_date, $provider);
352 foreach ($resultsArray as $result) {
353 echo "<tr bgcolor='" . $bgcolor ."'>";
354 echo "<td>" . text($result['lname'].",".$result['fname']) . "</td>";
355 echo "<td>" . text($result['pid']) . "</td>";
356 echo "<td>" . text(oeFormatDateTime($result['date'], "global", true)) . "</td>";
357 if ($rule == "send_sum_amc" ||
$rule == "provide_sum_pat_amc") {
358 echo "<td>" . text($result['id']) . "</td>";
359 } else { //$rule == "provide_rec_pat_amc"
360 echo "<td> </td>";
363 if ($rule == "send_sum_amc") {
364 echo "<td><input type='checkbox' id='send_sum_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='send_sum(\"".attr($result['pid'])."\",\"".attr($result['id'])."\")'>" . xlt('Yes') . "</td>";
365 echo "<td><input type='checkbox' id='send_sum_elec_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='send_sum_elec(\"".attr($result['pid'])."\",\"".attr($result['id'])."\")'>" . xlt('Yes') . "</td>";
366 } else if ($rule == "provide_rec_pat_amc") {
367 echo "<td><input type='checkbox' id='provide_rec_pat_flag_".attr($result['pid'])."' onclick='provide_rec_pat(\"".attr($result['pid'])."\",\"".attr($result['date'])."\")'>" . xlt('Yes') . "</td>";
368 } else { //$rule == "provide_sum_pat_amc"
369 echo "<td><input type='checkbox' id='provide_sum_pat_flag_".attr($result['pid'])."_".attr($result['id'])."' onclick='provide_sum_pat(\"".attr($result['pid'])."\",\"".attr($result['id'])."\")'>" . xlt('Yes') . "</td>";
378 </div
> <!-- end of search results
-->
381 <?php
echo xlt('Please input search criteria above, and click Submit to view results.'); ?
>
385 <input type
='hidden' name
='form_refresh' id
='form_refresh' value
=''/>