demographics style change (#4195)
[openemr.git] / portal / home.php
blobc510a999a0e032f458595d801c6fa8b236ab8c34
1 <?php
3 /**
4 * Patient Portal Home
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Jerry Padgett <sjpadgett@gmail.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @author Shiqiang Tao <StrongTSQ@gmail.com>
11 * @copyright Copyright (c) 2016-2019 Jerry Padgett <sjpadgett@gmail.com>
12 * @copyright Copyright (c) 2019-2020 Brady Miller <brady.g.miller@gmail.com>
13 * @copyright Copyright (c) 2020 Shiqiang Tao <StrongTSQ@gmail.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 require_once("verify_session.php");
18 require_once("$srcdir/patient.inc");
19 require_once("$srcdir/options.inc.php");
20 require_once("lib/portal_mail.inc");
21 require_once(dirname(__FILE__) . "/../library/appointments.inc.php");
23 use OpenEMR\Common\Csrf\CsrfUtils;
24 use OpenEMR\Core\Header;
26 if (isset($_SESSION['register']) && $_SESSION['register'] === true) {
27 require_once(dirname(__FILE__) . "/../src/Common/Session/SessionUtil.php");
28 OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy();
29 header('Location: ' . $landingpage . '&w');
30 exit();
33 if (!isset($_SESSION['portal_init'])) {
34 $_SESSION['portal_init'] = true;
37 $whereto = 'profilecard';
38 if (isset($_SESSION['whereto'])) {
39 $whereto = $_SESSION['whereto'];
42 $user = isset($_SESSION['sessionUser']) ? $_SESSION['sessionUser'] : 'portal user';
43 $result = getPatientData($pid);
45 $msgs = getPortalPatientNotes($_SESSION['portal_username']);
46 $msgcnt = count($msgs);
47 $newcnt = 0;
48 foreach ($msgs as $i) {
49 if ($i['message_status'] == 'New') {
50 $newcnt += 1;
56 <!DOCTYPE html>
57 <html>
58 <head>
59 <title><?php echo xlt('OpenEMR Portal'); ?> | <?php echo xlt('Home'); ?></title>
60 <meta name="description" content="Developed By sjpadgett@gmail.com" />
62 <script>
63 var tab_mode = true;
65 function restoreSession() {
66 //dummy functions so the dlgopen function will work in the patient portal
67 return true;
70 var isPortal = 1;
71 </script>
72 <?php
73 echo "<script>var cpid=" . js_escape($pid) . ";var cuser=" . js_escape($user) . ";var webRoot=" . js_escape($GLOBALS['web_root']) . ";var ptName=" . js_escape($_SESSION['ptName']) . ";var webroot_url = webRoot;</script>";
75 Header::setupHeader(['no_main-theme', 'datetime-picker', 'patientportal-style']); ?>
77 <script src="../interface/main/tabs/js/dialog_utils.js?v=<?php echo $v_js_includes; ?>"></script>
78 <link href="<?php echo $GLOBALS['web_root']; ?>/portal/sign/css/signer_modal.css?v=<?php echo $v_js_includes; ?>" rel="stylesheet" />
80 <script src="<?php echo $GLOBALS['web_root']; ?>/portal/sign/assets/signature_pad.umd.js?v=<?php echo $v_js_includes; ?>"></script>
81 <script src="<?php echo $GLOBALS['web_root']; ?>/portal/sign/assets/signer_api.js?v=<?php echo $v_js_includes; ?>"></script>
83 <?php if ($GLOBALS['payment_gateway'] == 'Stripe') { ?>
84 <script src="https://js.stripe.com/v3/"></script>
85 <?php } ?>
86 <?php if ($GLOBALS['payment_gateway'] == 'AuthorizeNet') {
87 // Must be loaded from their server
88 $script = "https://jstest.authorize.net/v1/Accept.js"; // test script
89 if ($GLOBALS['gateway_mode_production']) {
90 $script = "https://js.authorize.net/v1/Accept.js"; // Production script
91 } ?>
92 <script src="<?php echo $script; ?>"></script>
93 <?php } ?>
95 <script>
96 $(function () {
97 if($('body').css('direction') == "rtl") {
98 $('.float-left').each(function() {
99 $(this).addClass('float-right').removeClass('float-left');
101 $('.dropdown-menu-right').each(function() {
102 $(this).removeClass('dropdown-menu-right');
104 $('.dropdown-menu-md-right').each(function() {
105 $(this).removeClass('dropdown-menu-md-right');
108 $("#profilereport").load("get_profile.php", {}, function () {
109 $("table").addClass("table");
110 $(".demographics td").removeClass("label");
111 $(".demographics td").addClass("bold");
112 $(".insurance table").addClass("table-sm table-striped");
113 $("#editDems").click(function () {
114 showProfileModal()
118 $("#medicationlist").load("./get_medications.php", {}, function () {
120 $("#labresults").load("./get_lab_results.php", {}, function () {
122 $("#amendmentslist").load("./get_amendments.php", {}, function () {
124 $("#problemslist").load("./get_problems.php", {}, function () {
126 $("#allergylist").load("./get_allergies.php", {}, function () {
128 $("#reports").load("./report/portal_patient_report.php?pid='<?php echo attr_url($pid) ?>'", {}, function () {
131 <?php if ($GLOBALS['portal_two_payments']) { ?>
132 $("#payment").load("./portal_payment.php", {}, function () {
134 <?php } ?>
136 <?php if ($GLOBALS['easipro_enable'] && !empty($GLOBALS['easipro_server']) && !empty($GLOBALS['easipro_name'])) { ?>
137 $("#pro").load("./get_pro.php", {}, function () {
139 <?php } ?>
141 $(".generateDoc_download").click(function () {
142 $("#doc_form").submit();
145 function showProfileModal() {
146 var title = <?php echo xlj('Profile Edits Red = Charted Values Blue = Patient Edits'); ?> +' ';
148 var params = {
149 buttons: [
150 {text: <?php echo xlj('Help'); ?>, close: false, style: 'info', id: 'formHelp'},
151 {text: <?php echo xlj('Cancel'); ?>, close: true, style: 'default'},
152 {text: <?php echo xlj('Revert Edits'); ?>, close: false, style: 'danger', id: 'replaceAllButton'},
153 {text: <?php echo xlj('Send for Review'); ?>, close: false, style: 'success', id: 'donePatientButton'}
155 sizeHeight: 'full',
156 allowDrag: false,
157 onClosed: 'reload',
158 resolvePromiseOn: 'init',
159 type: 'GET',
160 url: webRoot + '/portal/patient/patientdata?pid=' + encodeURIComponent(cpid) + '&user=' + encodeURIComponent(cuser)
162 dlgopen('', '', 'modal-xl', 500, '', title, params).then(function (dialog) {
163 $('div.modal-body', dialog).addClass('overflow-auto');
167 function saveProfile() {
168 page.updateModel();
171 var gowhere = '#' + <?php echo js_escape($whereto); ?>;
172 $(gowhere).collapse('show');
174 $('#cardgroup').on('show.bs.collapse', '.collapse', function () {
175 $('#cardgroup').find('.collapse.show').collapse('hide');
178 $("[data-toggle='pill']").on("click", function (e) {
179 e.preventDefault();
180 // don't toggle if already active.
181 if ($(this).hasClass('active')) {
182 return false;
184 $(".nav-item").removeClass("active");
185 let canHide = $(".navbar-toggler-icon").is(":visible");
186 if (canHide) {
187 $("[data-toggle='offcanvas']").click();
190 $('#popwait').hide();
191 $('#callccda').click(function () {
192 $('#popwait').show();
195 function editAppointment(mode, deid) {
196 let mdata = {};
197 let title = '';
198 if (mode === 'add') {
199 title = <?php echo xlj('Request New Appointment'); ?>;
200 mdata = {pid: deid};
201 } else if (mode === 'recurring') {
202 let msg = <?php echo xlj("A Recurring Appointment. Please contact your appointment desk for any changes."); ?>;
203 signerAlertMsg(msg, 8000);
204 return false;
205 } else {
206 title = <?php echo xlj('Edit Appointment'); ?>;
207 mdata = {eid: deid};
209 var params = {
210 dialogId: 'editpop',
211 buttons: [
212 {text: 'Cancel', close: true, style: 'btn-sm btn-secondary'},
214 allowDrag: false,
215 sizeHeight: 'full',
216 size: 750,
217 title: title,
218 type: "GET",
219 url: './add_edit_event_user.php',
220 data: mdata
223 * A couple notes on dialog.ajax .alert etc.
224 * opener is not required. library will handle for you.
225 * these run in the same scope as calling script.
226 * so same styles, dependencies are in scope.
227 * a promise is returned for doing other neat stuff.
229 * */
230 dialog.ajax(params);
233 function changeCredentials(e) {
234 title = <?php echo xlj('Please Enter New Credentials'); ?>;
235 dlgopen("./account/index_reset.php", '', 600, 360, null, title, {});
238 <?php if ($GLOBALS['easipro_enable'] && !empty($GLOBALS['easipro_server']) && !empty($GLOBALS['easipro_name'])) {
240 function writeResult(score, stdErr, assessmentOID) {
241 $.ajax({
242 url: '../library/ajax/easipro_util.php',
243 data: {
244 'csrf_token_form': <?php echo js_escape(CsrfUtils::collectCsrfToken()); ?>,
245 'function': 'record_result',
246 'score': score,
247 'stdErr': stdErr,
248 'assessmentOID': assessmentOID
250 type: 'POST',
251 dataType: 'script'
255 function selectResponse(obj, assessmentOID) {
256 $.ajax({
257 url: '../library/ajax/easipro_util.php',
258 type: "POST",
259 data: {
260 'csrf_token_form': <?php echo js_escape(CsrfUtils::collectCsrfToken()); ?>,
261 'function': 'select_response',
262 'assessmentOID': assessmentOID,
263 'ItemResponseOID': obj.name,
264 'Response': +obj.id
266 dataType: "json",
267 success: function (data) {
268 if (data.DateFinished != '') {
269 document.getElementById("Content").innerHTML = jsText(<?php echo xlj('You have finished the assessment.'); ?>) + "<br /> " + jsText(<?php echo xlj('Thank you'); ?>);
270 document.getElementById("asst_" + assessmentOID).innerHTML = "<i class='fa fa-check-circle'></i>";
271 document.getElementById("asst_status_" + assessmentOID).innerHTML = "completed";
272 $.ajax({
273 url: '../library/ajax/easipro_util.php',
274 type: "POST",
275 data: {
276 'csrf_token_form': <?php echo js_escape(CsrfUtils::collectCsrfToken()); ?>,
277 'function': 'collect_results',
278 'assessmentOID': assessmentOID
280 dataType: "json",
281 success: function (data) {
282 writeResult(data.Items[0].Theta, data.Items[0].StdError, assessmentOID);
285 return
287 var screen = "";
288 for (var j = 0; j < data.Items[0].Elements.length; j++) {
289 if (typeof (data.Items[0].Elements[j].Map) == 'undefined') {
290 screen = screen + "<div style=\'height: 30px\' >" + data.Items[0].Elements[j].Description + "</div>"
291 } else {
292 for (var k = 0; k < data.Items[0].Elements[j].Map.length; k++) {
293 screen = screen + "<div style=\'height: 50px\' ><input type=\'button\' class='btn-submit' id=\'" + data.Items[0].Elements[j].Map[k].Value + "\' name=\'" + data.Items[0].Elements[j].Map[k].ItemResponseOID + "\' value=\'" + data.Items[0].Elements[j].Map[k].Description + "\' onclick=selectResponse(this,'" + assessmentOID + "') />" + "</div>";
297 document.getElementById("Content").innerHTML = screen;
299 error: function (jqXHR, textStatus, errorThrown) {
300 //document.write(jqXHR.responseText + ':' + textStatus + ':' + errorThrown);
301 alert("An error occurred");
306 function startAssessment(param, assessmentOID) {
307 param.innerHTML = "<i class='fa fa-circle-o-notch fa-spin'></i> " + jsText(<?php echo xlj('Loading'); ?>);
309 $.ajax({
310 url: '../library/ajax/easipro_util.php',
311 type: "POST",
312 data: {
313 'csrf_token_form': <?php echo js_escape(CsrfUtils::collectCsrfToken()); ?>,
314 'function': 'start_assessment',
315 'assessmentOID': assessmentOID
317 dataType: "json",
318 success: function (data) {
319 var screen = "";
320 for (var j = 0; j < data.Items[0].Elements.length; j++) {
321 if (typeof (data.Items[0].Elements[j].Map) == 'undefined') {
322 screen = screen + "<div style=\'height: 30px\' >" + data.Items[0].Elements[j].Description + "</div>"
323 } else {
324 for (var k = 0; k < data.Items[0].Elements[j].Map.length; k++) {
325 screen = screen + "<div style=\'height: 50px\' ><input type=\'button\' class='btn-submit' id=\'" + data.Items[0].Elements[j].Map[k].Value + "\' name=\'" + data.Items[0].Elements[j].Map[k].ItemResponseOID + "\' value=\'" + data.Items[0].Elements[j].Map[k].Description + "\' onclick=selectResponse(this,'" + assessmentOID + "') />" + "</div>";
329 document.getElementById("Content").innerHTML = screen;
331 param.innerHTML = jsText(<?php echo xlj('Start Assessment') ?>);
333 error: function (jqXHR, textStatus, errorThrown) {
334 param.innerHTML = jsText(<?php echo xlj('Start Assessment') ?>);
336 //document.write(jqXHR.responseText);
337 alert("An error occurred");
341 <?php
342 } // end if $GLOBALS['easipro_enable']?>
343 </script>
344 </head>
346 <body class="fixed">
347 <header class="header">
348 <nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
349 <div class="container-fluid">
350 <a href="home.php" class="navbar-brand d-none d-sm-block">
351 <img class="img-fluid" width="140" src='<?php echo $GLOBALS['images_static_relative']; ?>/logo-full-con.png' />
352 </a>
353 <button class="navbar-toggler" type="button" data-toggle="offcanvas" data-target="#left-collapse" aria-controls="left-collapse" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span>
354 </button>
355 <!-- Sidebar toggle button-->
356 <ul class="nav navbar-nav flex-row">
357 <li class="nav-item dropdown">
358 <a href="#" class="nav-link dropdown-toggle" id="newmsgs" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-envelope"></i>
359 <span class="badge badge-pill badge-success"><?php echo text($newcnt); ?></span></a>
360 <div class="dropdown-menu dropdown-menu-md-right" aria-labelledby="newmsgs">
361 <h6 class="dropdown-header"><?php echo xlt('You have'); ?> <?php echo text($newcnt); ?> <?php echo xlt('new messages'); ?></h6>
362 <!-- inner menu: contains the actual data -->
363 <?php
364 foreach ($msgs as $i) {
365 if ($i['message_status'] == 'New') {
366 echo "<div><a class='dropdown-item' href='" . $GLOBALS['web_root'] . "/portal/messaging/messages.php'><h4>" . text($i['title']) . "</h4></a></div>";
370 <div>
371 <a class="dropdown-item" href="<?php echo $GLOBALS['web_root']; ?>/portal/messaging/messages.php"><?php echo xlt('See All Messages'); ?></a>
372 </div>
373 </div>
374 </li>
375 <li class="nav-item dropdown">
376 <a href="#" class="nav-link dropdown-toggle" id="profiletab" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-user"></i>
377 <span><?php echo text($result['fname'] . " " . $result['lname']); ?> <i class="caret"></i></span></a>
378 <div class="dropdown-menu dropdown-menu-md-right" aria-labelledby="profiletab">
379 <div class="dropdown-header text-center"><?php echo xlt('Account'); ?></div>
380 <a class="dropdown-item" href="<?php echo $GLOBALS['web_root']; ?>/portal/messaging/messages.php"> <i class="fa fa-envelope-o fa-fw"></i> <?php echo xlt('Messages'); ?>
381 <span class="badge badge-pill badge-danger"><?php echo text($msgcnt); ?></span></a>
382 <div class="dropdown-divider"></div>
383 <?php if ($GLOBALS['allow_portal_chat']) {
385 <a class="dropdown-item" href="<?php echo $GLOBALS['web_root']; ?>/portal/messaging/secure_chat.php?fullscreen=true"> <i class="fa fa-user fa-fw"></i><?php echo xlt('Chat'); ?></a>
386 <?php
387 } ?>
388 <a class="dropdown-item" href="javascript:changeCredentials(event)"> <i class="fa fa-cog fa-fw"></i> <?php echo xlt('Change Credentials'); ?></a>
389 <div class="dropdown-divider"></div>
390 <a class="dropdown-item" href="logout.php"><i class="fa fa-ban fa-fw"></i> <?php echo xlt('Logout'); ?></a>
391 </div>
392 </li>
393 </ul>
394 </div>
395 </nav>
396 </header>
397 <div class="wrapper d-flex">
398 <!-- Left side column. contains the logo and sidebar -->
399 <aside class="fixed-top left-side sidebar-offcanvas collapse collapse-md mt-5" id="left-collapse">
400 <nav class="sidebar">
401 <!-- Sidebar user panel -->
402 <div class="user-panel">
403 <div class="float-left image">
404 <i class="fa fa-user"></i>
405 </div>
406 <div class="float-left info">
407 <p><?php echo xlt('Welcome') . ' ' . text($result['fname'] . " " . $result['lname']); ?></p>
408 <a href="#"><i class="fa fa-circle text-success"></i> <?php echo xlt('Online'); ?></a>
409 </div>
410 </div>
411 <ul class="nav nav-pills flex-column text-dark">
412 <!-- css class was sidebar-menu -->
413 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#profilecard" data-toggle="collapse" data-parent="#cardgroup"><i class="fas fa-id-card"></i> <?php echo xlt('Profile'); ?></a></li>
414 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#lists" data-toggle="collapse" data-parent="#cardgroup"><i class="fas fa-list"></i> <?php echo xlt('Lists'); ?></a></li>
415 <li class="nav-item"><a class="nav-link" href="<?php echo $GLOBALS['web_root']; ?>/portal/patient/onsitedocuments?pid=<?php echo attr_url($pid); ?>"><i class="fas fa-file-medical"></i> <?php echo xlt('Patient Documents'); ?></a></li>
416 <?php if ($GLOBALS['allow_portal_appointments']) { ?>
417 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#appointmentcard" data-toggle="collapse" data-parent="#cardgroup"><i class="fas fa-calendar-check"></i> <?php echo xlt("Appointment"); ?></a></li>
418 <?php } ?>
419 <?php if ($GLOBALS['portal_two_ledger'] || $GLOBALS['portal_two_payments']) { ?>
420 <li class="nav-item dropdown accounting-menu"><a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"><i class="fas fa-file-invoice-dollar"></i> <?php echo xlt('Accountings'); ?></a>
421 <div class="dropdown-menu">
422 <?php if ($GLOBALS['portal_two_ledger']) { ?>
423 <span data-toggle="pill"><a class="dropdown-item" href="#ledgercard" data-toggle="collapse" data-parent="#cardgroup"><i class="fas fa-folder-open"></i> <?php echo xlt('Ledger'); ?></a></span>
424 <?php } ?>
425 <?php if ($GLOBALS['portal_two_payments']) { ?>
426 <span data-toggle="pill"><a class="dropdown-item" href="#paymentcard" data-toggle="collapse" data-parent="#cardgroup"><i class="fas fa-credit-card"></i> <?php echo xlt('Make Payment'); ?></a></span>
427 <?php } ?>
428 </div>
429 </li>
430 <?php } ?>
431 <li class="nav-item dropdown reporting-menu"><a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"><i class="fas fa-book-medical"></i> <?php echo xlt('Reports'); ?></a>
432 <div class="dropdown-menu">
433 <?php if ($GLOBALS['ccda_alt_service_enable'] > 1) { ?>
434 <a class="dropdown-item" id="callccda" href="<?php echo $GLOBALS['web_root']; ?>/ccdaservice/ccda_gateway.php?action=startandrun"><i class="fas fa-envelope"></i> <?php echo xlt('View CCD'); ?></a>
435 <?php } ?>
436 <?php if (!empty($GLOBALS['portal_onsite_document_download'])) { ?>
437 <span data-toggle="pill"><a class="dropdown-item" href="#reportcard" data-toggle="collapse"
438 data-parent="#cardgroup"><i class="fa fa-folder-open"></i> <?php echo xlt('Report Content'); ?></a></span>
440 <span data-toggle="pill"><a class="dropdown-item" href="#downloadcard" data-toggle="collapse"
441 data-parent="#cardgroup"><i class="fa fa-download"></i> <?php echo xlt('Download Lab Documents'); ?></a></span>
442 <?php } ?>
443 </div>
444 </li>
445 <li class="nav-item"><a class="nav-link" href="<?php echo $GLOBALS['web_root']; ?>/portal/messaging/messages.php"><i class="fas fa-envelope"></i> <?php echo xlt('Secure Messaging'); ?></a></li>
446 <?php if ($GLOBALS['allow_portal_chat']) { ?>
447 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#messagescard" data-toggle="collapse"
448 data-parent="#cardgroup"><i class="fas fa-comment-medical"></i> <?php echo xlt("Secure Chat"); ?></a></li>
449 <?php } ?>
450 <?php if ($GLOBALS['easipro_enable'] && !empty($GLOBALS['easipro_server']) && !empty($GLOBALS['easipro_name'])) { ?>
451 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#procard" data-toggle="collapse" data-parent="#cardgroup"><i class="fa fa-edit"></i> <?php echo xlt("Patient Reported Outcomes"); ?></a></li>
452 <?php } ?>
453 <li class="nav-item" data-toggle="pill"><a class="nav-link" href="#openSignModal" data-toggle="modal" data-type="patient-signature"><i class="fas fa-file-signature"></i> <?php echo xlt('Signature on File'); ?></a></li>
454 <li class="nav-item"><a class="nav-link" href="logout.php"><i class="fa fa-ban"></i> <?php echo xlt('Logout'); ?></a></li>
455 </ul>
456 </nav>
457 </aside>
458 <!-- Right side column. Contains content of the page -->
459 <aside class="right-side mt-3">
460 <!-- Main content -->
461 <section class="container" id="cardgroup">
462 <div id="popwait" class="alert alert-warning"><strong><?php echo xlt('Working!'); ?></strong> <?php echo xlt('Please wait...'); ?></div>
463 <div class="collapse" id="lists">
464 <div class="card">
465 <header class="card-header bg-primary text-light"><?php echo xlt('Medications'); ?> </header>
466 <div id="medicationlist" class="card-body bg-light"></div>
467 </div>
468 <div class="card">
469 <header class="card-header bg-primary text-light"><?php echo xlt('Medications Allergy List'); ?> </header>
470 <div id="allergylist" class="card-body bg-light"></div>
471 </div>
472 <div class="card">
473 <header class="card-header bg-primary text-light"><?php echo xlt('Issues List'); ?></header>
474 <div id="problemslist" class="card-body bg-light"></div>
475 </div>
476 <div class="card">
477 <header class="card-header bg-primary text-light"><?php echo xlt('Amendment List'); ?> </header>
478 <div id="amendmentslist" class="card-body bg-light"></div>
479 </div>
480 <div class="card">
481 <header class="card-header bg-primary text-light"><?php echo xlt('Lab Results'); ?> </header>
482 <div id="labresults" class="card-body bg-light"></div>
483 </div>
484 </div><!-- /.lists -->
485 <?php if ($GLOBALS['allow_portal_appointments']) { ?>
486 <div class="collapse mt-2" id="appointmentcard">
487 <div class="jumbotron jumbotron-fluid m-5 p-3">
488 <div class="container-fluid">
489 <h3 class="text-center"><?php echo xlt('Appointments'); ?></h3>
490 <?php
491 $current_date2 = date('Y-m-d');
492 $apptLimit = 30;
493 $appts = fetchNextXAppts($current_date2, $pid, $apptLimit);
494 if ($appts) {
495 $stringCM = "(" . xl("Comments field entry present") . ")";
496 $stringR = "(" . xl("Recurring appointment") . ")";
497 $count = 0;
498 foreach ($appts as $row) {
499 $status_title = getListItemTitle('apptstat', $row['pc_apptstatus']);
500 $count++;
501 $dayname = xl(date("l", strtotime($row ['pc_eventDate'])));
502 $dispampm = "am";
503 $disphour = substr($row ['pc_startTime'], 0, 2) + 0;
504 $dispmin = substr($row ['pc_startTime'], 3, 2);
505 if ($disphour >= 12) {
506 $dispampm = "pm";
507 if ($disphour > 12) {
508 $disphour -= 12;
512 if ($row ['pc_hometext'] != "") {
513 $etitle = xlt('Comments') . ": " . $row ['pc_hometext'] . "\r\n";
514 } else {
515 $etitle = "";
518 echo '<div class="card p-2">';
519 $mode = (int)$row['pc_recurrtype'] > 0 ? text("recurring") : $row['pc_recurrtype'];
520 $appt_type_icon = (int)$row['pc_recurrtype'] > 0 ? "<i class='float-right fa fa-edit text-danger bg-light'></i>" : "<i class='float-right fa fa-edit text-success bg-light'></i>";
521 echo "<div class='card-header clearfix'><a href='#' onclick='editAppointment(" . attr_js($mode) . "," . attr_js($row ['pc_eid']) . ")'" . " title='" . attr($etitle) . "'>" . $appt_type_icon . "</a></div>";
522 echo "<div class='body font-weight-bold'><p>" . text($dayname . ", " . $row ['pc_eventDate']) . "&nbsp;";
523 echo text($disphour . ":" . $dispmin . " " . $dispampm) . "<br />";
524 echo xlt("Type") . ": " . text($row ['pc_catname']) . "<br />";
525 echo xlt("Provider") . ": " . text($row ['ufname'] . " " . $row ['ulname']) . "<br />";
526 echo xlt("Status") . ": " . text($status_title);
527 echo "</p></div></div>";
529 if ($count == $apptLimit) {
530 echo "<p>" . xlt("Display limit reached") . "<br>" . xlt("More appointments may exist") . "</p>";
532 } else { // if no appts
533 echo "<h3 class='text-center'>" . xlt('No Appointments') . "</h3>";
535 echo '</div>'; ?>
536 <span><a class='btn btn-primary btn-block' href='#' onclick="editAppointment('add',<?php echo attr_js($pid); ?>)"><?php echo xlt('Schedule A New Appointment'); ?></a>
537 </span>
538 </div>
539 </div><!-- /.row -->
540 <?php
541 } ?>
542 <?php if ($GLOBALS['portal_two_payments']) {
544 <div class="collapse" id="paymentcard">
545 <div class="card">
546 <header class="card-header bg-primary text-light"> <?php echo xlt('Payments'); ?> </header>
547 <div id="payment" class="card-body bg-light"></div>
548 </div>
549 </div>
550 <?php } ?>
551 <?php if ($GLOBALS['allow_portal_chat']) { ?>
552 <div class="collapse" id="messagescard">
553 <div class="card pt-0 pb-0">
554 <header class="card-header bg-primary text-light"><?php echo xlt('Secure Chat'); ?> </header>
555 <div id="messages" class="card-body p-0 overflow-auto" style="height: calc(100vh - 120px);">
556 <iframe src="./messaging/secure_chat.php" class="w-100 h-100"></iframe>
557 </div>
558 </div>
559 </div>
560 <?php
561 } ?>
562 <div class="card collapse" id="reportcard">
563 <header class="card-header bg-primary text-light"><?php echo xlt('Reports'); ?></header>
564 <div id="reports" class="card-body"></div>
565 </div>
566 <?php if (!empty($GLOBALS['portal_onsite_document_download'])) {
568 <div class="card collapse" id="downloadcard">
569 <header class="card-header bg-primary text-light"> <?php echo xlt('Download Documents'); ?> </header>
570 <div id="docsdownload" class="card-body">
571 <div>
572 <span class="text"><?php echo xlt('Download all patient documents'); ?></span>
573 <form name='doc_form' id='doc_form' action='./get_patient_documents.php' method='post'>
574 <input type="button" class="generateDoc_download" value="<?php echo xla('Download'); ?>" />
575 </form>
576 </div>
577 </div><!-- /.card-body -->
578 </div>
579 <?php } ?>
580 <?php if ($GLOBALS['portal_two_ledger']) { ?>
581 <div class="collapse" id="ledgercard">
582 <div class="card">
583 <header class="card-header bg-primary text-light"><?php echo xlt('Ledger'); ?></header>
584 <div id="patledger" class="card-body">
585 <iframe src="./report/pat_ledger.php" class="w-100 vh-100 border-0" scrolling="yes"></iframe>
586 </div>
587 </div>
588 </div>
589 <?php } ?>
590 <?php if ($GLOBALS['easipro_enable'] && !empty($GLOBALS['easipro_server']) && !empty($GLOBALS['easipro_name'])) {
592 <div class="card collapse" id="procard">
593 <header class="card-header bg-primary text-light"> <?php echo xlt('Patient Reported Outcomes'); ?> </header>
594 <div id="pro" class="card-body bg-light"></div>
595 </div>
596 <?php } ?>
597 <div class="card collapse" id="profilecard">
598 <header class="card-header bg-primary text-light"><?php echo xlt('Profile'); ?></header>
599 <div id="profilereport" class="card-body bg-light"></div>
600 </div>
601 </section>
602 </aside><!-- /.right-side -->
603 </div><!-- ./wrapper -->
604 </body>
605 </html>