Skip to content

Commit

Permalink
Portal Updates for Usability study, UI/UX and bug fixes. (openemr#7556)
Browse files Browse the repository at this point in the history
* Portal Updates for Usability study, UI/UX and bug fixes.
- bug prevent version check in ckeditor.

* start removing secure chat app.
delete support secure chat app classes
fix for portal ckeditor version check

* - rename Ledger
- fix CCDA shows in menu if not enabled
- remove direction arrows from history button
- reword demographics edit buttons
- rename reports
- Chang topNav to container instead of fluid

* Add hide menu item flag to twig menu builder
started adding cards to Dashboard from top menu
rework action buttons in patient documents
all cards consistent in view size using container-fluid
some smaller UX issues solved
Removed Accounting top menu and moved items to main menu. Still unsure what menu will look like when finished!

* more UX refactors
add more cards to dashboard

* remove secure chat count in dropdown
removing persist cards

* change dashboard load order

* more refactoring to dashboard cards
created selection of available documents by cayegory from patient documents for download
add separate flag to use custom report in portal globals
reorg globals portal page
WIP settings page

* remove top level Reports Menu

* review comments
add globals to turn off insurance and portal upload to documents
refactor dashboard naming and order

* still trying to balance top menu with dashboard. maybe top needs to go!
also selections naming conventions

* add a prescription card
remove id from secure message message display
modify signatures plugin to always display on white background
rewrote Help landing page-  upload from dashboard.

* fix create and reset portal credentials
add global flag to toggle the use of email for username create or reset
rename change password to generate new

* theme change
  • Loading branch information
sjpadgett authored Jul 25, 2024
1 parent 3c40f4b commit 6a796e1
Show file tree
Hide file tree
Showing 32 changed files with 1,724 additions and 2,023 deletions.
11 changes: 2 additions & 9 deletions interface/main/tabs/templates/patient_data_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class="img-thumbnail"
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="portalMsgAlerts">
<li>
<a class="dropdown-item" href="#" data-bind="click: viewPortalMail">
<i class="fa fa-envelope-o"></i>&nbsp;<?php echo xlt("Portal Mail"); ?>&nbsp;
<i class="fa fa-envelope"></i>&nbsp;<?php echo xlt("Portal Mail"); ?>&nbsp;
<span class="badge badge-success" style="display:inline" data-bind="text: portalMail()"></span>
</a>
</li>
Expand All @@ -205,16 +205,9 @@ class="img-thumbnail"
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="#" data-bind="click: viewPortalChats">
<i class="fa fa-envelope"></i>&nbsp;<?php echo xlt("Portal Chats"); ?>&nbsp;
<span class="badge badge-success" style="display:inline" data-bind="text: portalChats()"></span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="#" data-bind="click: viewPortalPayments">
<i class="fa fa-envelope"></i>&nbsp;<?php echo xlt("Portal Payments"); ?>&nbsp;<span class="badge badge-success" style="display:inline" data-bind="text: portalPayments()"></span>
<i class="fa fa-credit-card"></i>&nbsp;<?php echo xlt("Portal Payments"); ?>&nbsp;<span class="badge badge-success" style="display:inline" data-bind="text: portalPayments()"></span>
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion interface/patient_file/summary/create_portallogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function displayLogin($patient_id, $message, $emailFlag)
, 'fname' => $credentials['fname']
, 'portal_username' => $credentials['portal_username']
, 'id' => $credentials['id']
, 'uname' => $credentials['portal_username'] ?: $credentials['fname'] . $credentials['id']
, 'uname' => $credentials['portal_username'] ?: $credentials['fname'] . $credentials['lname'] . $credentials['id']
, 'login_uname' => $credentials['portal_login_username'] ?? $trustedUserName
, 'pwd' => $patientAccessOnSiteService->getRandomPortalPassword()
, 'enforce_signin_email' => $GLOBALS['enforce_signin_email']
Expand Down
47 changes: 34 additions & 13 deletions library/globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3125,9 +3125,16 @@ function gblTimeZones()
xl('Use servers protocol and host in urls (portal internal only).')
),

'use_email_for_portal_username' => array(
xl('Use Patients on-record E-Mail for new Portal Login Username'),
'bool',
'1',
xl('Use contact email when creating portal credentials.')
),

'enforce_signin_email' => array(
xl('Enforce E-Mail in Portal Log On Dialog'),
'bool', // data type
xl('Require Patients to enter their on-record email for Portal Login'),
'bool',
'1',
xl('Patient is required to enter their contact e-mail if present in Demographics Contact.')
),
Expand Down Expand Up @@ -3160,22 +3167,29 @@ function gblTimeZones()
xl('Enable Patient Portal new patient to self register.')
),

'portal_two_pass_reset' => array(
xl('Allow Patients to Reset Credentials') . ' ' . xl('This requires reCAPTCHA to be setup'),
'bool', // data type
'0',
xl('Patient may change their logon from portal login dialog.')
),

'allow_portal_appointments' => array(
xl('Allow Online Appointments'),
'bool', // data type
'1',
xl('Allow Patient to make and view appointments online.')
),

'allow_portal_chat' => array(
xl('Allow Online Secure Chat'),
'allow_custom_report' => array(
xl('Allow Online Custom Content Report'),
'bool', // data type
'1',
xl('Allow Patient to use Secure Chat Application.')
xl('Allow Patient to use Custom Content Report.')
),

'portal_two_ledger' => array(
xl('Allow Patient Ledger'),
xl('Allow Patient Billing Summary Report Online'),
'bool', // data type
'1',
xl('Allow Patient to view their accounting ledger online.')
Expand All @@ -3188,19 +3202,26 @@ function gblTimeZones()
xl('Allow Patient to make payments online.')
),

'portal_two_pass_reset' => array(
xl('Allow Patients to Reset Credentials') . ' ' . xl('This requires reCAPTCHA to be setup'),
'bool', // data type
'0',
xl('Patient may change their logon from portal login dialog.')
),

'portal_onsite_document_download' => array(
xl('Enable Patient Portal Document Download'),
'bool', // data type
'1',
xl('Enables the ability to download documents in the Patient Portal by the user.')
),

'allow_portal_uploads' => array(
xl('Allow Patient Uploads from Portal Documents'),
'bool',
'1',
xl('Enables the ability for patient to upload documents to Documents Onsite Patient category.')
),

'show_insurance_in_profile' => array(
xl('Allow Insurances in Patient Profile'),
'bool',
'1',
xl('UnCheck to not show insurances in Profile.')
),
),

// Connectors Tab
Expand Down
28 changes: 17 additions & 11 deletions portal/account/index_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@
" FROM " . TBL_PAT_ACC_ON . " WHERE pid = ?";

$auth = privQuery($sql, array($_SESSION['pid']));
$password = trim($_POST['pass_current'] ?? '');
$password_new = trim($_POST['pass_new']);
$valid = ((!empty(trim($_POST['uname']))) &&
(!empty(trim($_POST['login_uname']))) &&
(!empty(trim($_POST['pass_current']))) &&
(!empty(trim($_POST['pass_new']))) &&
(!empty($password)) &&
(!empty($password_new)) &&
(trim($_POST['uname']) == $auth[COL_POR_USER]) &&
(AuthHash::passwordVerify(trim($_POST['pass_current']), $auth[COL_POR_PWD])));
(AuthHash::passwordVerify($password, $auth[COL_POR_PWD])));
if (isset($_POST['submit'])) {
if (!$valid) {
$errmsg = xlt("Invalid Current Credentials Error.") . xlt("Unknown.");
$logit->portalLog('Credential update attempt', '', ($_POST['uname'] . ':unknown'), '', '0');
die($errmsg);
}
$new_hash = (new AuthHash('auth'))->passwordHash(trim($_POST['pass_new']));
$new_hash = (new AuthHash('auth'))->passwordHash($password_new);
if (empty($new_hash)) {
// Something is seriously wrong
error_log('OpenEMR Error : OpenEMR is not working because unable to create a hash.');
Expand Down Expand Up @@ -142,44 +144,48 @@ function process_new_pass() {
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<form action="" method="POST" onsubmit="return process_new_pass()">
<div class="alert alert-info">
<p><?php echo xlt('Use this form to change your login Password, Username or Both.'); ?></p>
<p><?php echo xlt('For example, to change your current Password, enter and use your current Username and enter new Password. You must still confirm Password and Username regardless.'); ?></p>
</div>
<input style="display:none" type="text" name="dummyuname" />
<input style="display:none" type="password" name="dummypassword" />
<input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken("portal_index_reset")); ?>" />
<table class="table table-sm" style="border-bottom:0px;width:100%">
<tr>
<td width="35%"><strong><?php echo xlt('Account Name'); ?><strong></td>
<td width="35%"><strong><?php echo xlt('Portal Account ID for referrence'); ?><strong></td>
<td><input class="form-control" name="uname" id="uname" type="text" readonly
value="<?php echo attr($auth['portal_username']); ?>" /></td>
</tr>
<tr>
<td><strong><?php echo xlt('New or Current Username'); ?><strong></td>
<td><strong><?php echo xlt('Change or Keep Existing Username'); ?><strong></td>
<td><input class="form-control" name="login_uname" id="login_uname" type="text" required onblur="checkUserName()"
title="<?php echo xla('Change or keep current. Enter 12 to 80 characters. Recommended to include symbols and numbers but not required.'); ?>" pattern=".{12,80}"
value="<?php echo attr($auth['portal_login_username']); ?>" />
</td>
</tr>
<tr>
<tr>
<td><strong><?php echo xlt('Confirm Username'); ?><strong></td>
<td><strong><?php echo xlt('Confirm Above Username'); ?><strong></td>
<td><input class="form-control" name="confirm_uname" id="confirm_uname" type="text" required
title="<?php echo xla('You must confirm this Username.'); ?>"
autocomplete="none" pattern=".{8,80}" value="" />
</td>
</tr>
</tr>
<tr>
<td><strong><?php echo xlt('Current Password'); ?><strong></td>
<td><strong><?php echo xlt('Current Password to Authorize Changes'); ?><strong></td>
<td>
<input class="form-control" name="pass_current" id="pass_current" type="password" required
placeholder="<?php echo xla('Current password to authorize changes.'); ?>"
placeholder="<?php echo xla('Enter your current password used to login.'); ?>"
title="<?php echo xla('Enter your existing current password used to login.'); ?>"
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" />
</td>
</tr>
<tr>
<td><strong><?php echo xlt('New or Current Password'); ?><strong></td>
<td><strong><?php echo xlt('Change or Keep Existing Password'); ?><strong></td>
<td>
<input class="form-control" name="pass_new" id="pass_new" type="password" required
placeholder="<?php echo xla('Min length is 8 with upper,lowercase,numbers mix'); ?>"
Expand Down
26 changes: 13 additions & 13 deletions portal/get_allergies.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Cassian LUP <[email protected]>
* @link http://www.open-emr.org
* @author Cassian LUP <[email protected]>
* @link http://www.open-emr.org
*
*/

require_once("verify_session.php");
require_once("verify_session.php");

$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'allergy' ORDER BY begdate";
$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'allergy' ORDER BY begdate";

$res = sqlStatement($sql, array($pid));
$res = sqlStatement($sql, array($pid));

if (sqlNumRows($res) > 0) {
?>
<table class="table table-striped">
<tr class="header">
<th><?php echo xlt('Title'); ?></th>
<th><?php echo xlt('Reported Date'); ?></th>
<th><?php echo xlt('Start Date'); ?></th>
<th><?php echo xlt('End Date'); ?></th>
<th><?php echo xlt('Referrer'); ?></th>
</tr>
<table class="table table-striped table-sm">
<tr class="header">
<th><?php echo xlt('Title'); ?></th>
<th><?php echo xlt('Reported Date'); ?></th>
<th><?php echo xlt('Start Date'); ?></th>
<th><?php echo xlt('End Date'); ?></th>
<th><?php echo xlt('Referrer'); ?></th>
</tr>
<?php
$even = false;
while ($row = sqlFetchArray($res)) {
Expand Down
42 changes: 21 additions & 21 deletions portal/get_lab_results.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
require_once('../library/options.inc.php');

$selects =
"po.procedure_order_id, po.date_ordered, pc.procedure_order_seq, " .
"pt1.procedure_type_id AS order_type_id, pc.procedure_name, " .
"pr.procedure_report_id, pr.date_report, pr.date_collected, pr.specimen_num, " .
"pr.report_status, pr.review_status";
"po.procedure_order_id, po.date_ordered, pc.procedure_order_seq, " .
"pt1.procedure_type_id AS order_type_id, pc.procedure_name, " .
"pr.procedure_report_id, pr.date_report, pr.date_collected, pr.specimen_num, " .
"pr.report_status, pr.review_status";

$joins =
"JOIN procedure_order_code AS pc ON pc.procedure_order_id = po.procedure_order_id " .
Expand All @@ -43,8 +43,8 @@

if (sqlNumRows($res) > 0) {
?>
<table class="table table-striped table-sm table-bordered">
<tr class="header">
<table class="table table-striped table-sm table-bordered">
<tr class="header">
<th><?php echo xlt('Order Date'); ?></th>
<th><?php echo xlt('Order Name'); ?></th>
<th><?php echo xlt('Result Name'); ?></th>
Expand All @@ -54,23 +54,23 @@
<th><?php echo xlt('Units'); ?></th>
<th><?php echo xlt('Result Status'); ?></th>
<th><?php echo xlt('Report Status'); ?></th>
</tr>
</tr>
<?php
$even = false;

while ($row = sqlFetchArray($res)) {
$order_type_id = empty($row['order_type_id' ]) ? 0 : ($row['order_type_id' ] + 0);
$report_id = empty($row['procedure_report_id']) ? 0 : ($row['procedure_report_id'] + 0);
$order_type_id = empty($row['order_type_id']) ? 0 : ($row['order_type_id'] + 0);
$report_id = empty($row['procedure_report_id']) ? 0 : ($row['procedure_report_id'] + 0);

$selects = "pt2.procedure_type, pt2.procedure_code, pt2.units AS pt2_units, " .
"pt2.range AS pt2_range, pt2.procedure_type_id AS procedure_type_id, " .
"pt2.name AS name, pt2.description, pt2.seq AS seq, " .
"ps.procedure_result_id, ps.result_code AS result_code, ps.result_text, ps.abnormal, ps.result, " .
"ps.range, ps.result_status, ps.facility, ps.comments, ps.units, ps.comments";
"pt2.range AS pt2_range, pt2.procedure_type_id AS procedure_type_id, " .
"pt2.name AS name, pt2.description, pt2.seq AS seq, " .
"ps.procedure_result_id, ps.result_code AS result_code, ps.result_text, ps.abnormal, ps.result, " .
"ps.range, ps.result_status, ps.facility, ps.comments, ps.units, ps.comments";

// procedure_type_id for order:
$pt2cond = "pt2.parent = '" . add_escape_custom($order_type_id) . "' AND " .
"(pt2.procedure_type LIKE 'res%' OR pt2.procedure_type LIKE 'rec%')";
"(pt2.procedure_type LIKE 'res%' OR pt2.procedure_type LIKE 'rec%')";

// pr.procedure_report_id or 0 if none:
$pscond = "ps.procedure_report_id = '" . add_escape_custom($report_id) . "'";
Expand All @@ -81,13 +81,13 @@
// result types defined for this order type, as well as any actual
// results that do not have a matching result type.
$query = "(SELECT $selects FROM procedure_type AS pt2 " .
"LEFT JOIN procedure_result AS ps ON $pscond AND $joincond " .
"WHERE $pt2cond" .
") UNION (" .
"SELECT $selects FROM procedure_result AS ps " .
"LEFT JOIN procedure_type AS pt2 ON $pt2cond AND $joincond " .
"WHERE $pscond) " .
"ORDER BY seq, name, procedure_type_id, result_code";
"LEFT JOIN procedure_result AS ps ON $pscond AND $joincond " .
"WHERE $pt2cond" .
") UNION (" .
"SELECT $selects FROM procedure_result AS ps " .
"LEFT JOIN procedure_type AS pt2 ON $pt2cond AND $joincond " .
"WHERE $pscond) " .
"ORDER BY seq, name, procedure_type_id, result_code";

$rres = sqlStatement($query);
while ($rrow = sqlFetchArray($rres)) {
Expand Down
26 changes: 12 additions & 14 deletions portal/get_medications.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
*
* Copyright (C) 2016-2017 Jerry Padgett <[email protected]>
* Copyright (C) 2016-2024 Jerry Padgett <[email protected]>
* Copyright (C) 2011 Cassian LUP <[email protected]>
*
* LICENSE: This program is free software; you can redistribute it and/or
Expand All @@ -17,38 +17,36 @@
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Cassian LUP <[email protected]>
* @author Jerry Padgett <[email protected]>
* @link http://www.open-emr.org
* @author Cassian LUP <[email protected]>
* @author Jerry Padgett <[email protected]>
* @link http://www.open-emr.org
*
*/

require_once("verify_session.php");
require_once("verify_session.php");

$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'medication' ORDER BY begdate";

$res = sqlStatement($sql, array($pid));
$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'medication' ORDER BY begdate";
$res = sqlStatement($sql, array($pid));

if (sqlNumRows($res) > 0) {
?>
<table class="table table-striped">
<tr>
<table class="table table-striped table-sm">
<tr>
<th><?php echo xlt('Drug'); ?></th>
<th><?php echo xlt('Start Date'); ?></th>
<th><?php echo xlt('Last Modified'); ?></th>
<th><?php echo xlt('End Date'); ?></th>
<th><?php echo xlt('Referrer'); ?></th>
</tr>
</tr>
<?php
$even = false;
while ($row = sqlFetchArray($res)) {
echo "<tr class='" . text($class ?? '') . "'>";
echo "<td>" . text($row['title']) . "</td>";
echo "<td>" . text($row['begdate']) . "</td>";
echo "<td>" . text($row['modifydate']) . "</td>";
echo "<td>" . text($row['enddate']) . "</td>";
echo "<td>" . text($row['referredby']) . "</td>";
echo "</tr>";
}

echo "</table>";
} else {
echo xlt("No Results");
Expand Down
Loading

0 comments on commit 6a796e1

Please sign in to comment.