Compact css tweak
[openemr.git] / interface / patient_tracker / patient_tracker.php
blob04d7c976c875eda0c45814aa2f50dd14d5fbf034
1 <?php
2 /**
3 * Patient Tracker (Patient Flow Board)
5 * This program displays the information entered in the Calendar program ,
6 * allowing the user to change status and view those changed here and in the Calendar
7 * Will allow the collection of length of time spent in each status
9 * @package OpenEMR
10 * @link http://www.open-emr.org
11 * @author Terry Hill <terry@lilysystems.com>
12 * @author Brady Miller <brady.g.miller@gmail.com>
13 * @copyright Copyright (c) 2015-2017 Terry Hill <terry@lillysystems.com>
14 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
15 * @copyright Copyright (c) 2017 Ray Magauran <magauran@medexbank.com>
16 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
19 require_once "../globals.php";
20 require_once "$srcdir/patient.inc";
21 require_once "$srcdir/options.inc.php";
22 require_once "$srcdir/patient_tracker.inc.php";
23 require_once "$srcdir/user.inc";
24 require_once "$srcdir/MedEx/API.php";
26 use OpenEMR\Core\Header;
28 // These settings are sticky user preferences linked to a given page.
29 // mdsupport - user_settings prefix
30 $uspfx = substr(__FILE__, strlen($webserver_root)) . '.';
31 $setting_new_window = prevSetting($uspfx, 'setting_new_window', 'setting_new_window', ' ');
32 // flow board and recall board share bootstrap settings:
33 $setting_bootstrap_submenu = prevSetting('', 'setting_bootstrap_submenu', 'setting_bootstrap_submenu', ' ');
34 $setting_selectors = prevSetting($uspfx, 'setting_selectors', 'setting_selectors', 'block');
35 $form_apptcat = prevSetting($uspfx, 'form_apptcat', 'form_apptcat', '');
36 $form_apptstatus = prevSetting($uspfx, 'form_apptstatus', 'form_apptstatus', '');
37 $facility = prevSetting($uspfx, 'form_facility', 'form_facility', '');
38 $provider = prevSetting($uspfx, 'form_provider', 'form_provider', $_SESSION['authUserID']);
40 if (($_POST['setting_new_window']) ||
41 ($_POST['setting_bootstrap_submenu']) ||
42 ($_POST['setting_selectors'])) {
43 // These are not form elements. We only ever change them via ajax, so exit now.
44 exit();
46 if ($_POST['saveCALLback'] == "Save") {
47 $sqlINSERT = "INSERT INTO medex_outgoing (msg_pc_eid,msg_pid,campaign_uid,msg_type,msg_reply,msg_extra_text)
48 VALUES
49 (?,?,?,'NOTES','CALLED',?)";
50 sqlQuery($sqlINSERT, array($_POST['pc_eid'], $_POST['pc_pid'], $_POST['campaign_uid'], $_POST['txtCALLback']));
53 //set default start date of flow board to value based on globals
54 if (!$GLOBALS['ptkr_date_range']) {
55 $from_date = date('Y-m-d');
56 } elseif (!is_null($_REQUEST['form_from_date'])) {
57 $from_date = DateToYYYYMMDD($_REQUEST['form_from_date']);
58 } elseif (($GLOBALS['ptkr_start_date'])=='D0') {
59 $from_date = date('Y-m-d');
60 } elseif (($GLOBALS['ptkr_start_date'])=='B0') {
61 if (date(w)==GLOBALS['first_day_week']) {
62 //today is the first day of the week
63 $from_date = date('Y-m-d');
64 } elseif ($GLOBALS['first_day_week']==0) {
65 //Sunday
66 $from_date = date('Y-m-d', strtotime('previous sunday'));
67 } elseif ($GLOBALS['first_day_week']==1) {
68 //Monday
69 $from_date = date('Y-m-d', strtotime('previous monday'));
70 } elseif ($GLOBALS['first_day_week']==6) {
71 //Saturday
72 $from_date = date('Y-m-d', strtotime('previous saturday'));
74 } else {
75 //shouldnt be able to get here...
76 $from_date = date('Y-m-d');
79 //set default end date of flow board to value based on globals
80 if ($GLOBALS['ptkr_date_range']) {
81 if (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'Y') {
82 $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1);
83 $ptkr_future_time = mktime(0, 0, 0, date('m'), date('d'), date('Y') + $ptkr_time);
84 } elseif (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'M') {
85 $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1);
86 $ptkr_future_time = mktime(0, 0, 0, date('m') + $ptkr_time, date('d'), date('Y'));
87 } elseif (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'D') {
88 $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1);
89 $ptkr_future_time = mktime(0, 0, 0, date('m'), date('d') + $ptkr_time, date('Y'));
92 $to_date = date('Y-m-d', $ptkr_future_time);
93 $to_date = !is_null($_REQUEST['form_to_date']) ? DateToYYYYMMDD($_REQUEST['form_to_date']) : $to_date;
94 } else {
95 $to_date = date('Y-m-d');
98 $form_patient_name = !is_null($_POST['form_patient_name']) ? $_POST['form_patient_name'] : null;
99 $form_patient_id = !is_null($_POST['form_patient_id']) ? $_POST['form_patient_id'] : null;
101 // get all appts for date range and refine view client side. very fast...
102 $appointments = array();
103 $datetime = date("Y-m-d H:i:s");
104 $appointments = fetch_Patient_Tracker_Events($from_date, $to_date, '', '', '', '', $form_patient_name, $form_patient_id);
105 $appointments = sortAppointments($appointments, 'date', 'time');
106 //grouping of the count of every status
107 $appointments_status = getApptStatus($appointments);
110 $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE list_id = ? AND activity=1", array('apptstat'));
111 while ($lrow = sqlFetchArray($lres)) {
112 // if exists, remove the legend character
113 if ($lrow['title'][1] == ' ') {
114 $splitTitle = explode(' ', $lrow['title']);
115 array_shift($splitTitle);
116 $title = implode(' ', $splitTitle);
117 } else {
118 $title = $lrow['title'];
120 $statuses_list[$lrow['option_id']] = $title;
123 $chk_prov = array(); // list of providers with appointments
124 // Scan appointments for additional info
125 foreach ($appointments as $apt) {
126 $chk_prov[$apt['uprovider_id']] = $apt['ulname'] . ', ' . $apt['ufname'] . ' ' . $apt['umname'];
129 if ($GLOBALS['medex_enable'] == '1') {
130 $query2 = "SELECT * FROM medex_icons";
131 $iconed = sqlStatement($query2);
132 while ($icon = sqlFetchArray($iconed)) {
133 $icons[$icon['msg_type']][$icon['msg_status']]['html'] = $icon['i_html'];
135 $MedEx = new MedExApi\MedEx('MedExBank.com');
136 $logged_in = $MedEx->login();
137 $sql = "SELECT * FROM medex_prefs LIMIT 1";
138 $preferences = sqlStatement($sql);
139 $prefs = sqlFetchArray($preferences);
140 if ($logged_in) {
141 $results = $MedEx->campaign->events($logged_in['token']);
142 foreach ($results['events'] as $event) {
143 if ($event['M_group'] != 'REMINDER') {
144 continue;
146 $icon = $icons[$event['M_type']]['SCHEDULED']['html'];
147 if ($event['E_timing'] == '1') {
148 $action = xl("before");
150 if ($event['E_timing'] == '2') {
151 $action = xl("before (PM)");
153 if ($event['E_timing'] == '3') {
154 $action = xl("after");
156 if ($event['E_timing'] == '4') {
157 $action = xl("after (PM)");
159 $days = ($event['E_fire_time'] == '1') ? xl("day") : xl("days");
160 $current_events .= $icon . " &nbsp; " . (int)$event['E_fire_time'] . " " . text($days) . " " . text($action) . "<br />";
162 } else {
163 $current_events = $icons['SMS']['FAILED']['html'] . " " . xlt("Currently off-line");
167 if (!$_REQUEST['flb_table']) {
169 <html>
170 <head>
171 <title><?php echo xlt('Flow Board'); ?></title>
173 <?php Header::setupHeader(['datetime-picker', 'jquery-ui', 'jquery-ui-cupertino', 'opener', 'pure']); ?>
175 <script type="text/javascript">
176 <?php require_once "$srcdir/restoreSession.php"; ?>
177 </script>
179 <link rel="stylesheet" href="<?php echo $GLOBALS['web_root']; ?>/library/css/bootstrap_navbar.css?v=<?php echo $v_js_includes; ?>" type="text/css">
180 <script type="text/javascript" src="<?php echo $GLOBALS['web_root']; ?>/interface/main/messages/js/reminder_appts.js?v=<?php echo $v_js_includes; ?>"></script>
182 <link rel="shortcut icon" href="<?php echo $webroot; ?>/sites/default/favicon.ico" />
184 <meta charset="utf-8">
185 <meta http-equiv="X-UA-Compatible" content="IE=edge">
186 <meta name="author" content="OpenEMR: MedExBank">
187 <meta name="viewport" content="width=device-width, initial-scale=1">
188 <style>
189 label {
190 font-weight: 400;
193 select {
194 width: 170px;
197 .btn{
198 border: solid black 0.5pt;
199 box-shadow: 3px 3px 3px #7b777760;
200 color:white;
203 .dialogIframe {
204 border: none;
207 .scheduled {
208 background-color: white;
209 color: black;
210 padding: 5px;
213 .divTable {
214 display: table;
215 font-size: 0.9em;
216 background: white;
217 box-shadow: 2px 3px 9px #c0c0c0;
218 border-radius: 8px;
219 padding: 10px;
220 margin: 15px auto;
221 min-width: 400px;
222 overflow: hidden;
225 .title {
226 font-family: Georgia, serif;
227 font-weight: bold;
228 padding: 3px 10px;
229 text-transform: uppercase;
230 line-height: 1.5em;
231 color: #455832;
232 border-bottom: 2px solid #455832;
233 margin: 0 auto;
234 width: 70%;
236 .ui-datepicker-year {
237 color: #000;
239 input[type="text"] {
240 text-align:center;
242 .ui-widget {
243 font-size: 1.0em;
245 body_top {
246 height:100%;
248 a:hover {
249 color:black;
250 text-decoration:none;
252 </style>
254 </head>
256 <body class="body_top">
257 <?php
258 if (($GLOBALS['medex_enable'] == '1') && (empty($_REQUEST['nomenu']))) {
259 $MedEx->display->navigation($logged_in);
262 <div class="container-fluid" style="margin-top: 20px;">
263 <div class="row-fluid" id="flb_selectors" style="display:<?php echo attr($setting_selectors); ?>;">
264 <div class="col-sm-12">
265 <div class="showRFlow" id="show_flows" style="text-align:center;margin:20px auto;" name="kiosk_hide">
266 <div class="title"><?php echo xlt('Flow Board'); ?></div>
267 <div name="div_response" id="div_response" class="nodisplay"></div>
268 <?php
269 if ($GLOBALS['medex_enable'] == '1') {
270 $col_width = "3";
271 } else {
272 $col_width = "4";
273 $last_col_width = "nodisplay";
276 <br/>
277 <form name="flb" id="flb" method="post">
278 <div class=" text-center row divTable" style="width: 85%;padding: 10px 10px 0;margin: 10px auto;">
279 <div class="col-sm-<?php echo $col_width; ?> text-center" style="margin-top:15px;">
280 <select id="form_apptcat" name="form_apptcat" class="form-group ui-selectmenu-button ui-button ui-widget ui-selectmenu-button-closed ui-corner-all"
281 onchange="refineMe('apptcat');" title="">
282 <?php
283 $categories = fetchAppointmentCategories();
284 echo "<option value=''>" . xlt("Visit Categories") . "</option>";
285 while ($cat = sqlFetchArray($categories)) {
286 echo "<option value='" . attr($cat['id']) . "'";
287 if ($cat['id'] == $_POST['form_apptcat']) {
288 echo " selected='true' ";
290 echo ">" . xlt($cat['category']) . "</option>";
293 </select>
295 <select id="form_apptstatus" name="form_apptstatus" class="form-group ui-selectmenu-button ui-button ui-widget ui-selectmenu-button-closed ui-corner-all"
296 onchange="refineMe();">
297 <option value=""><?php echo xlt("Visit Status"); ?></option>
299 <?php
300 $apptstats = sqlStatement("SELECT * FROM list_options WHERE list_id = 'apptstat' AND activity = 1 ORDER BY seq");
301 while ($apptstat = sqlFetchArray($apptstats)) {
302 echo "<option value='" . attr($apptstat['option_id']) . "'";
303 if ($apptstat['option_id'] == $_POST['form_apptstatus']) {
304 echo " selected='true' ";
306 echo ">" . xlt($apptstat['title']) . "</option>";
309 </select>
311 <input type="text"
312 placeholder="<?php echo xla('Patient Name'); ?>"
313 class="form-control input-sm" id="form_patient_name" name="form_patient_name"
314 value="<?php echo ($form_patient_name) ? attr($form_patient_name) : ""; ?>"
315 onKeyUp="refineMe();">
316 </div>
317 <div class="col-sm-<?php echo $col_width; ?> text-center" style="margin-top:15px;">
318 <select class="form-group ui-selectmenu-button ui-button ui-widget ui-selectmenu-button-closed ui-corner-all" id="form_facility" name="form_facility"
319 <?php
320 $fac_sql = sqlStatement("SELECT * FROM facility ORDER BY id");
321 while ($fac = sqlFetchArray($fac_sql)) {
322 $true = ($fac['id'] == $_POST['form_facility']) ? "selected=true" : '';
323 $select_facs .= "<option value=" . attr($fac['id']) . " " . $true . ">" . text($fac['name']) . "</option>\n";
324 $count_facs++;
326 if ($count_facs < '1') {
327 echo "disabled";
329 ?> onchange="refineMe('facility');">
330 <option value=""><?php echo xlt('All Facilities'); ?></option>
331 <?php echo $select_facs; ?>
332 </select>
334 <?php
335 // Build a drop-down list of ACTIVE providers.
336 $query = "SELECT id, lname, fname FROM users WHERE " .
337 "authorized = 1 AND active = 1 AND username > '' ORDER BY lname, fname"; #(CHEMED) facility filter
338 $ures = sqlStatement($query);
339 while ($urow = sqlFetchArray($ures)) {
340 $provid = $urow['id'];
341 $select_provs .= " <option value='" . attr($provid) . "'";
342 if (isset($_POST['form_provider']) && $provid == $_POST['form_provider']) {
343 $select_provs .= " selected";
344 } elseif (!isset($_POST['form_provider']) && $_SESSION['userauthorized'] && $provid == $_SESSION['authUserID']) {
345 $select_provs .= " selected";
347 $select_provs .= ">" . text($urow['lname']) . ", " . text($urow['fname']) . "\n";
348 $count_provs++;
352 <select class="form-group ui-selectmenu-button ui-button ui-widget ui-selectmenu-button-closed ui-corner-all" id="form_provider" name="form_provider" <?php
353 if ($count_provs < '2') {
354 echo "disabled";
356 ?> onchange="refineMe('provider');">
357 <option value="" selected><?php echo xlt('All Providers'); ?></option>
359 <?php
360 echo $select_provs;
362 </select>
363 <input placeholder="<?php echo xla('Patient ID'); ?>"
364 class="form-control input-sm" type="text"
365 id="form_patient_id" name="form_patient_id"
366 value="<?php echo ($form_patient_id) ? attr($form_patient_id) : ""; ?>"
367 onKeyUp="refineMe();">
368 </div>
369 <div class="col-sm-<?php echo $col_width; ?>">
370 <div style="margin: 0 auto;" class="input-append">
371 <table class="table-hover table-condensed" style="margin:0 auto;">
372 <?php
373 if ($GLOBALS['ptkr_date_range'] == '1') {
374 $type = 'date';
375 $style = '';
376 } else {
377 $type = 'hidden';
378 $style = 'display:none;';
379 } ?>
380 <tr style="<?php echo $style; ?>" class="align-bottom">
381 <td class="text-right align-bottom">
382 <label for="flow_from"><?php echo xlt('From'); ?>:</label></td>
383 <td>
384 <input type="text"
385 id="form_from_date" name="form_from_date"
386 class="datepicker form-control input-sm text-center"
387 value="<?php echo attr(oeFormatShortDate($from_date)); ?>"
388 style="max-width:140px;min-width:85px;">
389 </td>
390 </tr>
391 <tr style="<?php echo $style; ?>">
392 <td class="text-right">
393 <label for="flow_to">&nbsp;&nbsp;<?php echo xlt('To'); ?>:</label></td>
394 <td>
395 <input type="text"
396 id="form_to_date" name="form_to_date"
397 class="datepicker form-control input-sm text-center"
398 value="<?php echo attr(oeFormatShortDate($to_date)); ?>"
399 style="max-width:140px;min-width:85px;">
400 </td>
401 </tr>
402 <tr>
403 <td class="text-center" colspan="2">
404 <input href="#"
405 class="btn btn-primary"
406 type="submit" id="filter_submit"
407 value="<?php echo xla('Filter'); ?>">
408 <input type="hidden" id="kiosk" name="kiosk"
409 value="<?php echo attr($_REQUEST['kiosk']); ?>">
410 </td>
411 </tr>
412 </table>
413 </div>
414 </div>
415 <div class="col-sm-<?php echo $col_width . " " . $last_col_width; ?> text-center">
416 <?php
417 if ($GLOBALS['medex_enable'] == '1') {
420 <div class="text-center" style="margin: 0 auto;">
421 <span class="bold" style="text-decoration:underline;font-size:1.2em;">MedEx <?php echo xlt('Reminders'); ?></span><br/>
422 <div class="text-left blockquote" style="width: 65%;margin: 5px auto;">
423 <a href="https://medexbank.com/cart/upload/index.php?route=information/campaigns&amp;g=rem"
424 target="_medex">
425 <?php echo $current_events; ?>
426 </a>
427 </div>
428 </div>
429 <?php } ?>
430 </div>
431 <div id="message" class="warning"></div>
432 </div>
433 </div>
434 </form>
435 </div>
436 </div>
437 <div class="row-fluid">
438 <div class="row divTable">
439 <div class="col-sm-12 text-center" style='margin:5px;'>
440 <span class="hidden-xs" id="status_summary">
441 <?php
442 $statuses_output = "<span style='margin:0 10px;'><em>" . xlt('Total patients') . ':</em> <span class="badge">' . text($appointments_status['count_all']) . "</span></span>";
443 unset($appointments_status['count_all']);
444 foreach ($appointments_status as $status_symbol => $count) {
445 $statuses_output .= " | <span style='margin:0 10px;'><em>" . text(xl_list_label($statuses_list[$status_symbol])) . ":</em> <span class='badge'>" . text($count) . "</span></span>";
447 echo $statuses_output;
449 </span>
450 <span id="pull_kiosk_right" class="pull-right">
451 <a id='setting_cog'><i class="fa fa-cog fa-2x fa-fw">&nbsp;</i></a>
453 <label for='setting_new_window' id='settings'>
454 <input type='checkbox' name='setting_new_window' id='setting_new_window'
455 value='<?php echo $setting_new_window; ?>' <?php echo $setting_new_window; ?> />
456 <?php echo xlt('Open Patient in New Window'); ?>
457 </label>
458 <a id='refreshme'><i class="fa fa-refresh fa-2x fa-fw">&nbsp;</i></a>
459 <span class="fa-stack fa-lg" id="flb_caret" onclick="toggleSelectors();"
460 title="<?php echo xla('Show/Hide the Selection Area'); ?>"
461 style="color:<?php echo $color = ($setting_selectors == 'none') ? 'red' : 'black'; ?>;">
462 <i class="fa fa-square-o fa-stack-2x"></i>
463 <i id="print_caret"
464 class='fa fa-caret-<?php echo $caret = ($setting_selectors == 'none') ? 'down' : 'up'; ?> fa-stack-1x'></i>
465 </span>
467 <a class='btn btn-primary' onclick="print_FLB();"> <?php echo xlt('Print'); ?> </a>
469 <?php if ($GLOBALS['new_tabs_layout']) { ?>
470 <a class='btn btn-primary' onclick="kiosk_FLB();"> <?php echo xlt('Kiosk'); ?> </a>
471 <?php } ?>
472 </span>
473 </div>
475 <div class="col-sm-12 textclear" id="flb_table" name="flb_table">
476 <?php
478 //end of if !$_REQUEST['flb_table'] - this is the table we fetch via ajax during a refreshMe() call
480 <table class="table table-responsive table-condensed table-hover table-bordered">
481 <thead>
482 <tr bgcolor="#cccff" class="small bold text-center">
483 <?php if ($GLOBALS['ptkr_show_pid']) { ?>
484 <td class="dehead hidden-xs text-center" name="kiosk_hide">
485 <?php echo xlt('PID'); ?>
486 </td>
487 <?php } ?>
488 <td class="dehead text-center" style="max-width:150px;">
489 <?php echo xlt('Patient'); ?>
490 </td>
491 <?php if ($GLOBALS['ptkr_visit_reason'] == '1') { ?>
492 <td class="dehead hidden-xs text-center" name="kiosk_hide">
493 <?php echo xlt('Reason'); ?>
494 </td>
495 <?php } ?>
496 <?php if ($GLOBALS['ptkr_show_encounter']) { ?>
497 <td class="dehead text-center hidden-xs hidden-sm" name="kiosk_hide">
498 <?php echo xlt('Encounter'); ?>
499 </td>
500 <?php } ?>
502 <?php if ($GLOBALS['ptkr_date_range'] == '1') { ?>
503 <td class="dehead hidden-xs text-center" name="kiosk_hide">
504 <?php echo xlt('Appt Date'); ?>
505 </td>
506 <?php } ?>
507 <td class="dehead text-center">
508 <?php echo xlt('Appt Time'); ?>
509 </td>
510 <td class="dehead hidden-xs text-center">
511 <?php echo xlt('Arrive Time'); ?>
512 </td>
513 <td class="dehead visible-xs hidden-sm hidden-md hidden-lg text-center">
514 <?php echo xlt('Arrival'); ?>
515 </td>
516 <td class="dehead hidden-xs text-center">
517 <?php echo xlt('Appt Status'); ?>
518 </td>
519 <td class="dehead hidden-xs text-center">
520 <?php echo xlt('Current Status'); ?>
521 </td>
522 <td class="dehead visible-xs hidden-sm hidden-md hidden-lg text-center">
523 <?php echo xlt('Current'); ?>
524 </td>
525 <td class="dehead hidden-xs text-center" name="kiosk_hide">
526 <?php echo xlt('Visit Type'); ?>
527 </td>
528 <?php if (count($chk_prov) > 1) { ?>
529 <td class="dehead text-center hidden-xs">
530 <?php echo xlt('Provider'); ?>
531 </td>
532 <?php } ?>
533 <td class="dehead text-center">
534 <?php echo xlt('Total Time'); ?>
535 </td>
536 <td class="dehead hidden-xs text-center">
537 <?php echo xlt('Check Out Time'); ?>
538 </td>
539 <td class="dehead visible-xs hidden-sm hidden-md hidden-lg text-center">
540 <?php echo xlt('Out Time'); ?>
541 </td>
542 <?php
543 if ($GLOBALS['ptkr_show_staff']) { ?>
544 <td class="dehead hidden-xs hidden-sm text-center" name="kiosk_hide">
545 <?php echo xlt('Updated By'); ?>
546 </td>
547 <?php
549 if ($_REQUEST['kiosk'] != '1') {
550 if ($GLOBALS['drug_screen']) { ?>
551 <td class="dehead center hidden-xs " name="kiosk_hide">
552 <?php echo xlt('Random Drug Screen'); ?>
553 </td>
554 <td class="dehead center hidden-xs " name="kiosk_hide">
555 <?php echo xlt('Drug Screen Completed'); ?>
556 </td>
557 <?php
559 } ?>
560 </tr>
561 </thead>
562 <tbody>
563 <?php
564 $prev_appt_date_time = "";
565 foreach ($appointments as $appointment) {
566 // Collect appt date and set up squashed date for use below
567 $date_appt = $appointment['pc_eventDate'];
568 $date_squash = str_replace("-", "", $date_appt);
569 if (empty($appointment['room']) && ($logged_in)) {
570 //Patient has not arrived yet, display MedEx Reminder info
571 //one icon per type of response.
572 //If there was a SMS dialog, display it as a mouseover/title
573 //Display date received also as mouseover title.
574 $other_title = '';
575 $title = '';
576 $icon2_here = '';
577 $icon_CALL = '';
578 $icon_4_CALL = '';
579 $appt['stage'] = '';
580 $icon_here = array();
581 $prog_text = '';
582 $CALLED = '';
583 $FINAL = '';
584 $icon_CALL = '';
586 $query = "SELECT * FROM medex_outgoing WHERE msg_pc_eid =? ORDER BY msg_date";
587 $myMedEx = sqlStatement($query, array($appointment['eid']));
589 * Each row for this pc_eid in the medex_outgoing table represents an event.
590 * Every event is recorded in $prog_text.
591 * A modality is represented by an icon (eg mail icon, phone icon, text icon).
592 * The state of the Modality is represented by the color of the icon:
593 * CONFIRMED = green
594 * READ = blue
595 * FAILED = pink
596 * SENT/in process = yellow
597 * SCHEDULED = white
598 * Icons are displayed in their highest state.
600 $FINAL = '';
601 while ($row = sqlFetchArray($myMedEx)) {
602 // Need to convert $row['msg_date'] to localtime (stored as GMT) & then oeFormatShortDate it.
603 // I believe there is a new GLOBAL for server timezone??? If so, it will be easy.
604 // If not we need to import it from Medex through medex_preferences. It should really be in openEMR though.
605 // Delete when we figure this out.
606 $other_title = '';
607 if (!empty($row['msg_extra_text'])) {
608 $local = attr($row['msg_extra_text']) . " |";
610 $prog_text .= attr(oeFormatShortDate($row['msg_date'])) . " :: " . attr($row['msg_type']) . " : " . attr($row['msg_reply']) . " | " . $local . " |";
612 if ($row['msg_reply'] == 'Other') {
613 $other_title .= $row['msg_extra_text'] . "\n";
614 $icon_extra .= str_replace(
615 "EXTRA",
616 attr(oeFormatShortDate($row['msg_date'])) . "\n" . xla('Patient Message') . ":\n" . attr($row['msg_extra_text']) . "\n",
617 $icons[$row['msg_type']]['EXTRA']['html']
619 continue;
620 } elseif ($row['msg_reply'] == "FAILED") {
621 $appointment[$row['msg_type']]['stage'] = "FAILED";
622 $icon_here[$row['msg_type']] = $icons[$row['msg_type']]['FAILED']['html'];
623 } elseif (($row['msg_reply'] == "CONFIRMED") || ($FINAL)) {
624 $appointment[$row['msg_type']]['stage'] = "CONFIRMED";
625 $FINAL = $icons[$row['msg_type']]['CONFIRMED']['html'];
626 $icon_here[$row['msg_type']] = $FINAL;
627 continue;
628 } elseif ($row['msg_type'] == "NOTES") {
629 $CALLED = "1";
630 $FINAL = $icons['NOTES']['CALLED']['html'];
631 $FINAL = str_replace("Call Back: COMPLETED", attr(oeFormatShortDate($row['msg_date'])) . " :: " . xla('Callback Performed') . " | " . xla('NOTES') . ": " . $row['msg_extra_text'] . " | ", $FINAL);
632 $icon_CALL = $icon_4_call;
633 continue;
634 } elseif (($row['msg_reply'] == "READ") || ($appointment[$row['msg_type']]['stage'] == "READ")) {
635 $appointment[$row['msg_type']]['stage'] = "READ";
636 $icon_here[$row['msg_type']] = $icons[$row['msg_type']]['READ']['html'];
637 } elseif (($row['msg_reply'] == "SENT") || ($appointment[$row['msg_type']]['stage'] == "SENT")) {
638 $appointment[$row['msg_type']]['stage'] = "SENT";
639 $icon_here[$row['msg_type']] = $icons[$row['msg_type']]['SENT']['html'];
640 } elseif (($row['msg_reply'] == "To Send") || (empty($appointment['stage']))) {
641 if (($appointment[$row['msg_type']]['stage'] != "CONFIRMED") &&
642 ($appointment[$row['msg_type']]['stage'] != "READ") &&
643 ($appointment[$row['msg_type']]['stage'] != "SENT") &&
644 ($appointment[$row['msg_type']]['stage'] != "FAILED")) {
645 $appointment[$row['msg_type']]['stage'] = "QUEUED";
646 $icon_here[$row['msg_type']] = $icons[$row['msg_type']]['SCHEDULED']['html'];
649 //these are additional icons if present
650 if (($row['msg_reply'] == "CALL") && (!$CALLED)) {
651 $icon_here = '';
652 $icon_4_CALL = $icons[$row['msg_type']]['CALL']['html'];
653 $icon_CALL = "<span onclick=\"doCALLback('" . attr($date_squash) . "','" . attr($appointment['eid']) . "','" . attr($appointment['pc_cattype']) . "')\">" . $icon_4_CALL . "</span>
654 <span class='hidden' name='progCALLback_" . attr($appointment['eid']) . "' id='progCALLback_" . attr($appointment['eid']) . "'>
655 <form id='notation_" . attr($appointment['eid']) . "' method='post'
656 action='#'>
657 <h4>" . xlt('Call Back Notes') . ":</h4>
658 <input type='hidden' name='pc_eid' id='pc_eid' value='" . attr($appointment['eid']) . "'>
659 <input type='hidden' name='pc_pid' id='pc_pid' value='" . attr($appointment['pc_pid']) . "'>
660 <input type='hidden' name='campaign_uid' id='campaign_uid' value='" . attr($row['campaign_uid']) . "'>
661 <textarea name='txtCALLback' id='txtCALLback' rows=6 cols=20></textarea>
662 <input type='submit' name='saveCALLback' id='saveCALLback' value='" . xla("Save") ."'>
663 </form>
664 </span>
666 } elseif ($row['msg_reply'] == "STOP") {
667 $icon2_here .= $icons[$row['msg_type']]['STOP']['html'];
668 } elseif ($row['msg_reply'] == "Other") {
669 $icon2_here .= $icons[$row['msg_type']]['Other']['html'];
670 } elseif ($row['msg_reply'] == "CALLED") {
671 $icon2_here .= $icons[$row['msg_type']]['CALLED']['html'];
674 //if pc_apptstatus == '-', update it now to=status
675 if (!empty($other_title)) {
676 $appointment['messages'] = $icon2_here . $icon_extra;
680 // Collect variables and do some processing
681 $docname = $chk_prov[$appointment['uprovider_id']];
682 if (strlen($docname) <= 3) {
683 continue;
685 $ptname = $appointment['lname'] . ', ' . $appointment['fname'] . ' ' . $appointment['mname'];
686 $ptname_short = $appointment['fname'][0] . " " . $appointment['lname'][0];
687 $appt_enc = $appointment['encounter'];
688 $appt_eid = (!empty($appointment['eid'])) ? $appointment['eid'] : $appointment['pc_eid'];
689 $appt_pid = (!empty($appointment['pid'])) ? $appointment['pid'] : $appointment['pc_pid'];
690 if ($appt_pid == 0) {
691 continue; // skip when $appt_pid = 0, since this means it is not a patient specific appt slot
693 $status = (!empty($appointment['status']) && (!is_numeric($appointment['status']))) ? $appointment['status'] : $appointment['pc_apptstatus'];
694 $appt_room = (!empty($appointment['room'])) ? $appointment['room'] : $appointment['pc_room'];
695 $appt_time = (!empty($appointment['appttime'])) ? $appointment['appttime'] : $appointment['pc_startTime'];
696 $tracker_id = $appointment['id'];
697 // reason for visit
698 if ($GLOBALS['ptkr_visit_reason']) {
699 $reason_visit = $appointment['pc_hometext'];
701 $newarrive = collect_checkin($tracker_id);
702 $newend = collect_checkout($tracker_id);
703 $colorevents = (collectApptStatusSettings($status));
704 $bgcolor = $colorevents['color'];
705 $statalert = $colorevents['time_alert'];
706 // process the time to allow items with a check out status to be displayed
707 if (is_checkout($status) && (($GLOBALS['checkout_roll_off'] > 0) && strlen($form_apptstatus) != 1)) {
708 $to_time = strtotime($newend);
709 $from_time = strtotime($datetime);
710 $display_check_out = round(abs($from_time - $to_time) / 60, 0);
711 if ($display_check_out >= $GLOBALS['checkout_roll_off']) {
712 continue;
716 echo '<tr data-apptstatus="' . attr($appointment['pc_apptstatus']) . '"
717 data-apptcat="' . attr($appointment['pc_catid']) . '"
718 data-facility="' . attr($appointment['pc_facility']) . '"
719 data-provider="' . attr($appointment['uprovider_id']) . '"
720 data-pid="' . attr($appointment['pc_pid']) . '"
721 data-pname="' . attr($ptname) . '"
722 class="text-small"
723 bgcolor="' . attr($bgcolor) . '" >';
724 if ($GLOBALS['ptkr_show_pid']) {
726 <td class="detail hidden-xs" align="center" name="kiosk_hide">
727 <?php echo text($appt_pid); ?>
728 </td>
729 <?php
733 <td class="detail text-center hidden-xs" name="kiosk_hide">
734 <a href="#"
735 onclick="return topatient('<?php echo attr($appt_pid); ?>','<?php echo attr($appt_enc); ?>')">
736 <?php echo text($ptname); ?></a>
737 </td>
738 <td class="detail text-center visible-xs hidden-sm hidden-md hidden-lg"
739 style="white-space: normal;" name="kiosk_hide">
740 <a href="#"
741 onclick="return topatient('<?php echo attr($appt_pid); ?>','<?php echo attr($appt_enc); ?>')">
742 <?php echo text($ptname_short); ?></a>
743 </td>
745 <td class="detail text-center" style="white-space: normal;" name="kiosk_show">
746 <a href="#"
747 onclick="return topatient('<?php echo attr($appt_pid); ?>','<?php echo attr($appt_enc); ?>')">
748 <?php echo text($ptname_short); ?></a>
749 </td>
751 <!-- reason -->
752 <?php if ($GLOBALS['ptkr_visit_reason']) { ?>
753 <td class="detail hidden-xs text-center" name="kiosk_hide">
754 <?php echo text($reason_visit) ?>
755 </td>
756 <?php } ?>
757 <?php if ($GLOBALS['ptkr_show_encounter']) { ?>
758 <td class="detail hidden-xs hidden-sm text-center" name="kiosk_hide">
759 <?php if ($appt_enc != 0) {
760 echo text($appt_enc);
761 } ?>
762 </td>
763 <?php }
764 if ($GLOBALS['ptkr_date_range'] == '1') { ?>
765 <td class="detail hidden-xs text-center" name="kiosk_hide">
766 <?php echo text(oeFormatShortDate($appointment['pc_eventDate']));
768 </td>
769 <?php } ?>
770 <td class="detail" align="center">
771 <?php echo oeFormatTime($appt_time) ?>
772 </td>
773 <td class="detail text-center">
774 <?php
775 if ($newarrive) {
776 echo oeFormatTime($newarrive);
779 </td>
780 <td class="detail hidden-xs text-center small">
781 <?php if (empty($tracker_id)) { //for appt not yet with tracker id and for recurring appt ?>
782 <a onclick="return calendarpopup(<?php echo attr($appt_eid) . "," . attr($date_squash); // calls popup for add edit calendar event?>)">
783 <?php } else { ?>
784 <a onclick="return bpopup(<?php echo attr($tracker_id); // calls popup for patient tracker status?>)">
785 <?php }
786 if ($appointment['room'] > '') {
787 echo getListItemTitle('patient_flow_board_rooms', $appt_room);
788 } else {
789 echo text(getListItemTitle("apptstat", $status)); // drop down list for appointment status
792 </a>
793 </td>
795 <?php
796 //time in current status
797 $to_time = strtotime(date("Y-m-d H:i:s"));
798 $yestime = '0';
799 if (strtotime($newend) != '') {
800 $from_time = strtotime($newarrive);
801 $to_time = strtotime($newend);
802 $yestime = '0';
803 } else {
804 $from_time = strtotime($appointment['start_datetime']);
805 $yestime = '1';
808 $timecheck = round(abs($to_time - $from_time) / 60, 0);
809 if ($timecheck >= $statalert && ($statalert > '0')) { // Determine if the time in status limit has been reached.
810 echo "<td class='text-center js-blink-infinite small' nowrap> "; // and if so blink
811 } else {
812 echo "<td class='detail text-center' nowrap> "; // and if not do not blink
814 if (($yestime == '1') && ($timecheck >= 1) && (strtotime($newarrive) != '')) {
815 echo text($timecheck . ' ' . ($timecheck >= 2 ? xl('minutes') : xl('minute')));
816 } else if ($icon_here || $icon2_here || $icon_CALL) {
817 echo "<span style='font-size:0.7em;' onclick='return calendarpopup(" . attr($appt_eid) . "," . attr($date_squash) . ")'>" . implode($icon_here) . $icon2_here . "</span> " . $icon_CALL;
818 } else if ($logged_in) {
819 $pat = $MedEx->display->possibleModalities($appointment);
820 echo "<span style='font-size:0.7em;'>" . $pat['SMS'] . $pat['AVM'] . $pat['EMAIL'] . "</span>";
822 //end time in current status
823 echo "</td>";
825 <td class="detail hidden-xs text-center" name="kiosk_hide">
826 <?php echo xlt($appointment['pc_title']); ?>
827 </td>
828 <?php
829 if (count($chk_prov) > 1) { ?>
830 <td class="detail text-center hidden-xs">
831 <?php echo text($docname); ?>
832 </td>
833 <?php
834 } ?>
835 <td class="detail text-center">
836 <?php
837 // total time in practice
838 if (strtotime($newend) != '') {
839 $from_time = strtotime($newarrive);
840 $to_time = strtotime($newend);
841 } else {
842 $from_time = strtotime($newarrive);
843 $to_time = strtotime(date("Y-m-d H:i:s"));
845 $timecheck2 = round(abs($to_time - $from_time) / 60, 0);
846 if (strtotime($newarrive) != '' && ($timecheck2 >= 1)) {
847 echo text($timecheck2 . ' ' . ($timecheck2 >= 2 ? xl('minutes') : xl('minute')));
849 // end total time in practice
850 echo text($appointment['pc_time']); ?>
851 </td>
852 <td class="detail text-center">
855 </td>
856 <?php
857 if ($GLOBALS['ptkr_show_staff'] == '1') {
859 <td class="detail hidden-xs hidden-sm text-center" name="kiosk_hide">
860 <?php echo text($appointment['user']) ?>
861 </td>
862 <?php
864 if ($GLOBALS['drug_screen']) {
865 if (strtotime($newarrive) != '') { ?>
866 <td class="detail hidden-xs text-center" name="kiosk_hide">
867 <?php
868 if (text($appointment['random_drug_test']) == '1') {
869 echo xl('Yes');
870 } else {
871 echo xl('No');
872 } ?>
873 </td>
874 <?php
875 } ?>
876 <?php
877 if (strtotime($newarrive) != '' && $appointment['random_drug_test'] == '1') { ?>
878 <td class="detail hidden-xs text-center" name="kiosk_hide">
879 <?php
880 if (strtotime($newend) != '') {
881 // the following block allows the check box for drug screens to be disabled once the status is check out ?>
882 <input type=checkbox disabled='disable' class="drug_screen_completed"
883 id="<?php echo htmlspecialchars($appointment['pt_tracker_id'], ENT_NOQUOTES) ?>" <?php if ($appointment['drug_screen_completed'] == "1") {
884 echo "checked";
885 } ?>>
886 <?php
887 } else {
889 <input type=checkbox class="drug_screen_completed"
890 id='<?php echo htmlspecialchars($appointment['pt_tracker_id'], ENT_NOQUOTES) ?>'
891 name="drug_screen_completed" <?php if ($appointment['drug_screen_completed'] == "1") {
892 echo "checked";
893 } ?>>
894 <?php
895 } ?>
896 </td>
897 <?php
898 } else {
899 echo " </td>";
903 </tr>
904 <?php
905 } //end foreach
907 </tbody>
908 </table>
909 <?php
910 if (!$_REQUEST['flb_table']) { ?>
911 </div>
912 </div>
913 </div><?php //end container ?>
914 <!-- form used to open a new top level window when a patient row is clicked -->
915 <form name='fnew' method='post' target='_blank'
916 action='../main/main_screen.php?auth=login&site=<?php echo attr($_SESSION['site_id']); ?>'>
917 <input type='hidden' name='patientID' value='0'/>
918 <input type='hidden' name='encounterID' value='0'/>
919 </form>
921 <?php echo myLocalJS(); ?>
922 </body>
923 </html>
924 <?php
925 } //end of second !$_REQUEST['flb_table']
927 //$content = ob_get_clean();
928 //echo $content;
930 exit;
932 function myLocalJS()
935 <script type="text/javascript">
936 var auto_refresh = null;
937 //this can be refined to redact HIPAA material using @media print options.
938 top.restoreSession();
939 if (top.tab_mode) {
940 window.parent.$("[name='flb']").attr('allowFullscreen', 'true');
941 } else {
942 $(this).attr('allowFullscreen', 'true');
944 <?php
945 if ($_REQUEST['kiosk'] == '1') { ?>
946 $("[name='kiosk_hide']").hide();
947 $("[name='kiosk_show']").show();
948 <?php } else { ?>
949 $("[name='kiosk_hide']").show();
950 $("[name='kiosk_show']").hide();
951 <?php } ?>
952 function print_FLB() {
953 window.print();
956 function toggleSelectors() {
957 if ($("#flb_selectors").css('display') === 'none') {
958 $.post("<?php echo $GLOBALS['webroot'] . "/interface/patient_tracker/patient_tracker.php"; ?>", {
959 'setting_selectors': 'block',
960 success: function (data) {
962 $("#flb_selectors").slideToggle();
963 $("#flb_caret").css('color', '#000');
966 } else {
967 $.post("<?php echo $GLOBALS['webroot'] . "/interface/patient_tracker/patient_tracker.php"; ?>", {
968 'setting_selectors': 'none',
969 success: function (data) {
970 $("#flb_selectors").slideToggle();
971 $("#flb_caret").css('color', 'red');
975 $("#print_caret").toggleClass('fa-caret-up').toggleClass('fa-caret-down');
979 * This function refreshes the whole flb_table according to our to/from dates.
981 function refreshMe() {
982 top.restoreSession();
983 var posting = $.post('../patient_tracker/patient_tracker.php', {
984 flb_table: '1',
985 form_from_date: $("#form_from_date").val(),
986 form_to_date: $("#form_to_date").val(),
987 form_facility: $("#form_facility").val(),
988 form_provider: $("#form_provider").val(),
989 form_apptstatus: $("#form_apptstatus").val(),
990 form_patient_name: $("#form_patient_name").val(),
991 form_patient_id: $("#form_patient_id").val(),
992 form_apptcat: $("#form_apptcat").val(),
993 kiosk: $("#kiosk").val()
994 }).done(
995 function (data) {
996 $("#flb_table").html(data);
997 if ($("#kiosk").val() === '') {
998 $("[name='kiosk_hide']").show();
999 $("[name='kiosk_show']").hide();
1000 } else {
1001 $("[name='kiosk_hide']").hide();
1002 $("[name='kiosk_show']").show();
1005 refineMe();
1008 function refreshme() {
1009 // Just need this to support refreshme call from the popup used for recurrent appt
1010 refreshMe();
1014 * This function hides all then shows only the flb_table rows that match our selection, client side.
1015 * It is called on initial load, on refresh and 'onchange/onkeyup' of a flow board parameter.
1017 function refineMe() {
1018 var apptcatV = $("#form_apptcat").val();
1019 var apptstatV = $("#form_apptstatus").val();
1020 var facV = $("#form_facility").val();
1021 var provV = $("#form_provider").val();
1022 var pidV = String($("#form_patient_id").val());
1023 var pidRE = new RegExp(pidV, 'g');
1024 var pnameV = $("#form_patient_name").val();
1025 var pnameRE = new RegExp(pnameV, 'ig');
1027 //and hide what we don't want to show
1028 $('#flb_table tbody tr').hide().filter(function () {
1029 var d = $(this).data();
1030 meets_cat = (apptcatV === '') || (apptcatV == d.apptcat);
1031 meets_stat = (apptstatV === '') || (apptstatV == d.apptstatus);
1032 meets_fac = (facV === '') || (facV == d.facility);
1033 meets_prov = (provV === '') || (provV == d.provider);
1034 meets_pid = (pidV === '');
1035 if ((pidV > '') && pidRE.test(d.pid)) {
1036 meets_pid = true;
1038 meets_pname = (pnameV === '');
1039 if ((pnameV > '') && pnameRE.test(d.pname)) {
1040 meets_pname = true;
1042 return meets_pname && meets_pid && meets_cat && meets_stat && meets_fac && meets_prov;
1043 }).show();
1046 // popup for patient tracker status
1047 function bpopup(tkid) {
1048 top.restoreSession();
1049 dlgopen('../patient_tracker/patient_tracker_status.php?tracker_id=' + tkid, '_blank', 500, 250);
1050 return false;
1053 // popup for calendar add edit
1054 function calendarpopup(eid, date_squash) {
1055 top.restoreSession();
1056 dlgopen('../main/calendar/add_edit_event.php?eid=' + eid + '&date=' + date_squash, '_blank', 775, 500);
1057 return false;
1060 // used to display the patient demographic and encounter screens
1061 function topatient(newpid, enc) {
1062 if ($('#setting_new_window').val() === 'checked') {
1063 openNewTopWindow(newpid, enc);
1065 else {
1066 top.restoreSession();
1067 if (enc > 0) {
1068 top.RTop.location = "<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/summary/demographics.php?set_pid=" + newpid + "&set_encounterid=" + enc;
1070 else {
1071 top.RTop.location = "<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/summary/demographics.php?set_pid=" + newpid;
1076 function doCALLback(eventdate, eid, pccattype) {
1077 $("#progCALLback_" + eid).parent().removeClass('js-blink-infinite').css('animation-name', 'none');
1078 $("#progCALLback_" + eid).removeClass("hidden");
1079 clearInterval(auto_refresh);
1082 // opens the demographic and encounter screens in a new window
1083 function openNewTopWindow(newpid, newencounterid) {
1084 document.fnew.patientID.value = newpid;
1085 document.fnew.encounterID.value = newencounterid;
1086 top.restoreSession();
1087 document.fnew.submit();
1090 //opens the two-way SMS phone app
1092 * @return {boolean}
1094 function SMS_bot(pid) {
1095 top.restoreSession();
1096 var from = '<?php echo attr($from_date); ?>';
1097 var to = '<?php echo attr($to_date); ?>';
1098 var oefrom = '<?php echo attr(oeFormatShortDate($from_date)); ?>';
1099 var oeto = '<?php echo attr(oeFormatShortDate($to_date)); ?>';
1100 window.open('../main/messages/messages.php?nomenu=1&go=SMS_bot&pid=' + pid + '&to=' + to + '&from=' + from + '&oeto=' + oeto + '&oefrom=' + oefrom, 'SMS_bot', 'width=370,height=600,resizable=0');
1101 return false;
1104 function kiosk_FLB() {
1105 $("#kiosk").val('1');
1106 $("[name='kiosk_hide']").hide();
1107 $("[name='kiosk_show']").show();
1108 var i = document.getElementById("flb_table");
1109 // go full-screen
1110 if (i.requestFullscreen) {
1111 i.requestFullscreen();
1112 } else if (i.webkitRequestFullscreen) {
1113 i.webkitRequestFullscreen();
1114 } else if (i.mozRequestFullScreen) {
1115 i.mozRequestFullScreen();
1116 } else if (i.msRequestFullscreen) {
1117 i.msRequestFullscreen();
1119 // refreshMe();
1122 $(document).ready(function () {
1123 refineMe();
1124 $("#kiosk").val('');
1125 $("[name='kiosk_hide']").show();
1126 $("[name='kiosk_show']").hide();
1128 onresize = function () {
1129 var state = 1 >= outerHeight - innerHeight ? "fullscreen" : "windowed";
1130 if (window.state === state) return;
1131 window.state = state;
1132 var event = document.createEvent("Event");
1133 event.initEvent(state, true, true);
1134 window.dispatchEvent(event);
1137 addEventListener('windowed', function (e) {
1138 $("#kiosk").val('');
1139 $("[name='kiosk_hide']").show();
1140 $("[name='kiosk_show']").hide();
1141 //alert(e.type);
1142 }, false);
1143 addEventListener('fullscreen', function (e) {
1144 $("#kiosk").val('1');
1145 $("[name='kiosk_hide']").hide();
1146 $("[name='kiosk_show']").show();
1147 //alert(e.type);
1148 }, false);
1150 <?php
1151 if ($GLOBALS['pat_trkr_timer'] != '0') {
1153 var reftime = "<?php echo attr($GLOBALS['pat_trkr_timer']); ?>";
1154 var parsetime = reftime.split(":");
1155 parsetime = (parsetime[0] * 60) + (parsetime[1] * 1) * 1000;
1156 if (auto_refresh) clearInteral(auto_refresh);
1157 auto_refresh = setInterval(function () {
1158 refreshMe() // this will run after every parsetime seconds
1159 }, parsetime);
1160 <?php
1164 $('#settings').css("display", "none");
1165 $('.js-blink-infinite').each(function () {
1166 // set up blinking text
1167 var elem = $(this);
1168 setInterval(function () {
1169 if (elem.css('visibility') === 'hidden') {
1170 elem.css('visibility', 'visible');
1171 } else {
1172 elem.css('visibility', 'hidden');
1174 }, 500);
1176 // toggle of the check box status for drug screen completed and ajax call to update the database
1177 $(".drug_screen_completed").change(function () {
1178 top.restoreSession();
1179 if (this.checked) {
1180 testcomplete_toggle = "true";
1181 } else {
1182 testcomplete_toggle = "false";
1184 $.post("../../library/ajax/drug_screen_completed.php", {
1185 trackerid: this.id,
1186 testcomplete: testcomplete_toggle
1190 // mdsupport - Immediately post changes to setting_new_window
1191 $('#setting_new_window').click(function () {
1192 $('#setting_new_window').val(this.checked ? 'checked' : ' ');
1193 $.post("<?php echo basename(__FILE__) ?>", {
1194 'setting_new_window': $('#setting_new_window').val(),
1195 success: function (data) {
1200 $('#setting_cog').click(function () {
1201 $(this).css("display", "none");
1202 $('#settings').css("display", "inline");
1205 $('#refreshme').click(function () {
1206 refreshMe();
1207 refineMe();
1210 $('#filter_submit').click(function (e) {
1211 e.preventDefault;
1212 top.restoreSession;
1213 refreshMe();
1216 $('[data-toggle="tooltip"]').tooltip();
1218 $('.datepicker').datetimepicker({
1219 <?php $datetimepicker_timepicker = false; ?>
1220 <?php $datetimepicker_showseconds = false; ?>
1221 <?php $datetimepicker_formatInput = true; ?>
1222 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
1223 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
1227 </script>
1228 <?php