* @author Brady Miller * @author Ray Magauran * @copyright Copyright (c) 2015-2017 Terry Hill * @copyright Copyright (c) 2017-2021 Brady Miller * @copyright Copyright (c) 2017 Ray Magauran * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once "../globals.php"; require_once "$srcdir/patient.inc"; require_once "$srcdir/options.inc.php"; require_once "$srcdir/patient_tracker.inc.php"; require_once "$srcdir/user.inc"; require_once "$srcdir/MedEx/API.php"; use OpenEMR\Common\Csrf\CsrfUtils; use OpenEMR\Core\Header; if (!empty($_POST)) { if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) { CsrfUtils::csrfNotVerified(); } } // These settings are sticky user preferences linked to a given page. // mdsupport - user_settings prefix $uspfx = substr(__FILE__, strlen($webserver_root)) . '.'; $setting_new_window = prevSetting($uspfx, 'setting_new_window', 'setting_new_window', ' '); // flow board and recall board share bootstrap settings: $setting_bootstrap_submenu = prevSetting('', 'setting_bootstrap_submenu', 'setting_bootstrap_submenu', ' '); $setting_selectors = prevSetting($uspfx, 'setting_selectors', 'setting_selectors', 'block'); $form_apptcat = prevSetting($uspfx, 'form_apptcat', 'form_apptcat', ''); $form_apptstatus = prevSetting($uspfx, 'form_apptstatus', 'form_apptstatus', ''); $facility = prevSetting($uspfx, 'form_facility', 'form_facility', ''); $provider = prevSetting($uspfx, 'form_provider', 'form_provider', $_SESSION['authUserID']); if ( ($_POST['setting_new_window'] ?? '') || ($_POST['setting_bootstrap_submenu'] ?? '') || ($_POST['setting_selectors'] ?? '') ) { // These are not form elements. We only ever change them via ajax, so exit now. exit(); } if (($_POST['saveCALLback'] ?? '') == "Save") { $sqlINSERT = "INSERT INTO medex_outgoing (msg_pc_eid,msg_pid,campaign_uid,msg_type,msg_reply,msg_extra_text) VALUES (?,?,?,'NOTES','CALLED',?)"; sqlQuery($sqlINSERT, array($_POST['pc_eid'], $_POST['pc_pid'], $_POST['campaign_uid'], $_POST['txtCALLback'])); } //set default start date of flow board to value based on globals if (!$GLOBALS['ptkr_date_range']) { $from_date = date('Y-m-d'); } elseif (!is_null($_REQUEST['form_from_date'])) { $from_date = DateToYYYYMMDD($_REQUEST['form_from_date']); } elseif (($GLOBALS['ptkr_start_date']) == 'D0') { $from_date = date('Y-m-d'); } elseif (($GLOBALS['ptkr_start_date']) == 'B0') { if (date(w) == GLOBALS['first_day_week']) { //today is the first day of the week $from_date = date('Y-m-d'); } elseif ($GLOBALS['first_day_week'] == 0) { //Sunday $from_date = date('Y-m-d', strtotime('previous sunday')); } elseif ($GLOBALS['first_day_week'] == 1) { //Monday $from_date = date('Y-m-d', strtotime('previous monday')); } elseif ($GLOBALS['first_day_week'] == 6) { //Saturday $from_date = date('Y-m-d', strtotime('previous saturday')); } } else { //shouldnt be able to get here... $from_date = date('Y-m-d'); } //set default end date of flow board to value based on globals if ($GLOBALS['ptkr_date_range']) { if (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'Y') { $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1); $ptkr_future_time = mktime(0, 0, 0, date('m'), date('d'), date('Y') + $ptkr_time); } elseif (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'M') { $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1); $ptkr_future_time = mktime(0, 0, 0, date('m') + $ptkr_time, date('d'), date('Y')); } elseif (substr($GLOBALS['ptkr_end_date'], 0, 1) == 'D') { $ptkr_time = substr($GLOBALS['ptkr_end_date'], 1, 1); $ptkr_future_time = mktime(0, 0, 0, date('m'), date('d') + $ptkr_time, date('Y')); } $to_date = date('Y-m-d', $ptkr_future_time); $to_date = !is_null($_REQUEST['form_to_date']) ? DateToYYYYMMDD($_REQUEST['form_to_date']) : $to_date; } else { $to_date = date('Y-m-d'); } $form_patient_name = !is_null($_POST['form_patient_name']) ? $_POST['form_patient_name'] : null; $form_patient_id = !is_null($_POST['form_patient_id']) ? $_POST['form_patient_id'] : null; $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE list_id = ? AND activity=1", array('apptstat')); while ($lrow = sqlFetchArray($lres)) { // if exists, remove the legend character if ($lrow['title'][1] == ' ') { $splitTitle = explode(' ', $lrow['title']); array_shift($splitTitle); $title = implode(' ', $splitTitle); } else { $title = $lrow['title']; } $statuses_list[$lrow['option_id']] = $title; } if ($GLOBALS['medex_enable'] == '1') { $query2 = "SELECT * FROM medex_icons"; $iconed = sqlStatement($query2); while ($icon = sqlFetchArray($iconed)) { $icons[$icon['msg_type']][$icon['msg_status']]['html'] = $icon['i_html']; } $MedEx = new MedExApi\MedEx('MedExBank.com'); $sql = "SELECT * FROM medex_prefs LIMIT 1"; $preferences = sqlStatement($sql); $prefs = sqlFetchArray($preferences); $results = json_decode($prefs['status'], true); $logged_in = $results; $logged_in = $results; if (!empty($logged_in['token'])) { $current_events = xlt("On-line"); } else { $current_events = xlt("Currently off-line"); } } if (!$_REQUEST['flb_table']) { ?> <?php echo xlt('Flow Board'); ?> login(); $MedEx->display->navigation($logged_in); } ?>

'' ORDER BY lname, fname"; #(CHEMED) facility filter $ures = sqlStatement($query); while ($urow = sqlFetchArray($ures)) { $provid = $urow['id']; $select_provs .= "
" onKeyUp="refineMe();" />
" onKeyUp="refineMe();" />
MedEx:
...

...

" . xlt('Total patients') . ': ' . text($appointments_status['count_all']) . ""; unset($appointments_status['count_all']); foreach ($appointments_status as $status_symbol => $count) { $statuses_output .= " | " . text(xl_list_label($statuses_list[$status_symbol])) . ": " . text($count) . ""; } echo $statuses_output; ?>
fa-stack-1x'>
/>
1) { ?> " . $icon_4_CALL . " "; } elseif ($row['msg_reply'] == "STOP") { $icon2_here .= $icons[$row['msg_type']]['STOP']['html']; } elseif ($row['msg_reply'] == "Other") { $icon2_here .= $icons[$row['msg_type']]['Other']['html']; } elseif ($row['msg_reply'] == "CALLED") { $icon2_here .= $icons[$row['msg_type']]['CALLED']['html']; } } //if pc_apptstatus == '-', update it now to=status if (!empty($other_title)) { $appointment['messages'] = $icon2_here . $icon_extra; } } // Collect variables and do some processing $docname = $chk_prov[$appointment['uprovider_id']]; if (strlen($docname) <= 3) { continue; } $ptname = $appointment['lname'] . ', ' . $appointment['fname'] . ' ' . $appointment['mname']; $ptname_short = $appointment['fname'][0] . " " . $appointment['lname'][0]; $appt_enc = $appointment['encounter']; $appt_eid = (!empty($appointment['eid'])) ? $appointment['eid'] : $appointment['pc_eid']; $appt_pid = (!empty($appointment['pid'])) ? $appointment['pid'] : $appointment['pc_pid']; if ($appt_pid == 0) { continue; // skip when $appt_pid = 0, since this means it is not a patient specific appt slot } $status = (!empty($appointment['status']) && (!is_numeric($appointment['status']))) ? $appointment['status'] : $appointment['pc_apptstatus']; $appt_room = (!empty($appointment['room'])) ? $appointment['room'] : $appointment['pc_room']; $appt_time = (!empty($appointment['appttime'])) ? $appointment['appttime'] : $appointment['pc_startTime']; $tracker_id = $appointment['id']; // reason for visit if ($GLOBALS['ptkr_visit_reason']) { $reason_visit = $appointment['pc_hometext']; } $newarrive = collect_checkin($tracker_id); $newend = collect_checkout($tracker_id); $colorevents = (collectApptStatusSettings($status)); $bgcolor = $colorevents['color']; $statalert = $colorevents['time_alert']; // process the time to allow items with a check out status to be displayed if (is_checkout($status) && (($GLOBALS['checkout_roll_off'] > 0) && strlen($form_apptstatus) != 1)) { $to_time = strtotime($newend); $from_time = strtotime($datetime); $display_check_out = round(abs($from_time - $to_time) / 60, 0); if ($display_check_out >= $GLOBALS['checkout_roll_off']) { continue; } } echo ''; if ($GLOBALS['ptkr_show_pid']) { ?> = $statalert && ($statalert > '0')) { // Determine if the time in status limit has been reached. echo ""; ?> 1) { ?>
)"> '') { echo text(getListItemTitle('patient_flow_board_rooms', $appt_room)); } else { echo text(getListItemTitle("apptstat", $status)); // drop down list for appointment status } ?> "; // and if not do not blink } if (($yestime == '1') && ($timecheck >= 1) && (strtotime($newarrive) != '')) { echo text($timecheck . ' ' . ($timecheck >= 2 ? xl('minutes') : xl('minute'))); } elseif ($icon_here || $icon2_here || $icon_CALL) { echo "" . implode($icon_here) . $icon2_here . " " . $icon_CALL; } elseif ($logged_in) { $pat = $MedEx->display->possibleModalities($appointment); echo "" . $pat['SMS'] . $pat['AVM'] . $pat['EMAIL'] . ""; } //end time in current status echo " = 1)) { echo text($timecheck2 . ' ' . ($timecheck2 >= 2 ? xl('minutes') : xl('minute'))); } // end total time in practice echo text($appointment['pc_time']); ?> /> ' name="drug_screen_completed" />
'>