New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Hide dashboard cards option #7192
Conversation
@@ -614,3 +614,16 @@ CREATE TABLE `fee_schedule` ( | |||
UNIQUE KEY `ins_plan_code_mod_type_date` (`insurance_company_id`, `plan`, `code`, `modifier`, `type`, `effective_date`) | |||
) ENGINE=InnoDb AUTO_INCREMENT=1; | |||
#EndIf | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @juggernautsei, no need for this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not a part of my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop the changes in this script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove this from the PR just copy the raw file into the file in this branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adunsulag
@stephenwaite removed this. It was not apart of my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still here. You can't simply remove, you have to commit the correct version.
You really need to pull and merge master in your local then push.
You know, better yet @juggernautsei, close this and push new PR with correct files for the feature option. I'm not sure what happened to this PR but it is a mess. For sure get rid of new table and list options so really no need to push any database/upgrade changes.
Since now in globals with hard coded select options I foresee only two or three files for feature.
This IMO is easiest way to get this in....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juggernautsei Did you see this above?
sql/7_0_2-to-7_0_3_upgrade.sql
Outdated
@@ -113,3 +113,15 @@ | |||
ALTER TABLE `form_encounter` ADD `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; | |||
#EndIf | |||
|
|||
#IfNotRow2D list_options list_id lists option_id default_open_tabs | |||
-- Create new list Default Open Tabs | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`) VALUES ('lists', 'Hide_Dashboard_Cards', 'Hide Dashboard Cards'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above should be looking for option id Hide_Dashboard_Cards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what it should be
#IfNotRow lists option_id Hide_Dashboard_Cards
Should this take into account the ACL of the user so that way any medical info could not be put out of reach of a physician or clinician? |
Pretty neat way to turn certain things off for a practice.
|
This only hide certain cards. I don't understand the second part of your question but the list can be added to. I did the ones that I am most often asked to remove. The core dashboard cards I left. These are the ones that everyone uses. |
@stephenwaite I understand your concern but the clinic that does this is usually a none primary care. If it is a primary care clinic or a clinic that needs those cards. Why would they turn them off? I deal with behavioral health a lot and most of them do not need or use those cards. But the psychiatrist that prescribes. We leave the prescription card on for them and the medication card stays on. The ACL component can be added so that no matter what a provider would still see the cards. But kind of defeats the purpose. The person that turns these cards off would need admin privileges. It is hard to prevent malicious or ignorant actors in a clinic. I can see expanding the feature so that only those that need to see the cards will see them by ACL. A front desk member would not need to see medications while an MA would. It may be worth pursuing. Good thought. |
Bump. Can we get this into the next patch? |
@@ -74,6 +74,7 @@ | |||
// want smart support in their system. | |||
$smartLaunchController = new SMARTLaunchController($GLOBALS["kernel"]->getEventDispatcher()); | |||
$smartLaunchController->registerContextEvents(); | |||
$activeCards = getActiveDashboardCards(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$hiddenCards = getHiddenDashboardCards();
@@ -1079,7 +1080,9 @@ function filterActiveIssues(array $i): array | |||
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=allergy')" | |||
]; | |||
echo "<div class=\"$col\">"; | |||
echo $t->render('patient/card/allergies.html.twig', $viewArgs); | |||
if (in_array('card_allergies', $activeCards)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!in_array('card_allergies', $hiddenCards)) {
library/lists.inc.php
Outdated
@@ -142,3 +142,13 @@ function setListTouch($patient_id, $type) | |||
sqlStatement("INSERT INTO `lists_touch` ( `pid`,`type`,`date` ) VALUES ( ?, ?, NOW() )", array($patient_id,$type)); | |||
} | |||
} | |||
|
|||
function getActiveDashboardCards() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function getHiddenDashboardCards()
sql/7_0_2-to-7_0_3_upgrade.sql
Outdated
#IfNotRow2D list_options list_id lists option_id Hide_Dashboard_Cards | ||
-- Create new list Hide Dashboard Cards | ||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`) VALUES ('lists', 'Hide_Dashboard_Cards', 'Hide Dashboard Cards'); | ||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`,`activity`) VALUES ('Hide_Dashboard_Cards', 'card_allergies', 'Allergies', 10, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set all the active settings from 1 to 0
@@ -13638,3 +13638,13 @@ INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default` | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'YE', 'Yemeni', '2480', '0', '0', '', 'Yemen', 'YEM:887'); | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'ZM', 'Zambian', '2490', '0', '0', '', 'Zambia', 'ZMB:894'); | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'ZW', 'Zimbabwean', '2500', '0', '0', '', 'Zimbabwe', 'ZWE:716'); | |||
|
|||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`) VALUES ('lists', 'Hide_Dashboard_Cards', 'Hide Dashboard Cards'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set all the active settings from 1 to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this file as its no longer being used due to the globals setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is gone. I can't find it in the PR. I just looked.
|
@@ -162,6 +162,11 @@ | |||
<div class= "row" id="section3"> | |||
<div class="col-sm-12"> | |||
<h4 class="oe-help-heading"><?php echo xlt("Data Section"); ?><a href="#"><i class="fa fa-arrow-circle-up oe-pull-away oe-help-redirect" aria-hidden="true"></i></a></h4> | |||
|
|||
<p><?php echo xlt("The some of the cards on the dashboard can be turned off if not being utilized by the clinic");?></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the 'The some' to 'Some'
Note the above proposed strategy will also then make it easier to support adding tthe other cards to this mechanism without hiding them by mistake. For example, can place the conditionals around the other cards, and they will still show by default even if they are not yet listed in the Hide list. |
review complete :) |
hi @juggernautsei , check out https://github.com/openemr/openemr/blob/master/interface/super/edit_list.php#L1251 for where you can change active to hide |
@@ -1079,7 +1080,9 @@ function filterActiveIssues(array $i): array | |||
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=allergy')" | |||
]; | |||
echo "<div class=\"$col\">"; | |||
echo $t->render('patient/card/allergies.html.twig', $viewArgs); | |||
if (in_array('card_allergies', $hiddenCards)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be if (!in_array
The card themselves have acl's so should not need in list options. |
Ok, Jerry, if this will be a huge favor, I will take the time to plan this out some more and see what I can do with the suggestion. I am going to need a little bit more details of operations to hammer this out. How do you see this working from the UI? |
The ability to hide cards would provide significant utility to my clinics. User-specific lists, while a worthy enhancement, represents a large expansion of the bike shed. Suggest to merge #7192 first.. |
@@ -1103,7 +1106,9 @@ function filterActiveIssues(array $i): array | |||
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=medical_problem')" | |||
]; | |||
echo "<div class=\"$col\">"; | |||
echo $t->render('patient/card/medical_problems.html.twig', $viewArgs); | |||
if (in_array('card_medicalproblems', $hiddenCards)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs !in_array
@@ -1125,7 +1130,9 @@ function filterActiveIssues(array $i): array | |||
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=medication')" | |||
]; | |||
echo "<div class=\"$col\">"; | |||
echo $t->render('patient/card/medication.html.twig', $viewArgs); | |||
if (in_array('card_medication', $hiddenCards)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs !in_array
Added UpForGrabs demo for testing this PR at: https://www.open-emr.org/wiki/index.php/Development_Demo#Alpha_-_Up_For_Grabs_Demo |
It is testing well for me in the up for grabs |
interface/super/edit_globals.php
Outdated
echo " <select multiple class='form-control' name='form_{$i}[]' id='form_{$i}[]' size='3'>\n"; | ||
while ($row = sqlFetchArray($res)) { | ||
echo " <option value='" . attr($row['card_abrev']) . "'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a default none or empty so user can select to hide 0 cards. Currently once you select cards you will always have to select at least one card.
<option value="">attr("Hide None")</option>
Or something like after select echo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I suppose a ctrl click will work so maybe okay the way you have it.
Thanks for the effort Sherwin.
hi @juggernautsei , This is definitely headed in the right direction with the multiselect global.
|
Just hardcode the multilist. It will not need to be dynamic |
hi @juggernautsei and @sjpadgett , |
Hi @bradymiller can this be resolved and brought into the code base |
hi @juggernautsei , looks like you have that conflict with the upgrade script? |
Ok I will pull it back and take a look at it. I was being lazy. Thx @stephenwaite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's some cleanup that needs to occur with all of the changes. Unless that happens today, we'll need to bump this to the next patch.
|
||
<p><?php echo xlt("Some of the cards on the dashboard can be turned off if not being utilized by the clinic");?></p> | ||
|
||
<p><?php echo xlt("To see which cards can be hidden, go to Admin, Forms, Lists, then search for Hide Dashboard Cards");?>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is no longer accurate as it looks like settings are now done in the globals configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address this!
interface/super/edit_list.php
Outdated
@@ -1283,6 +1283,13 @@ function lister() { | |||
<th><?php echo xlt('Check In'); ?> </th> | |||
<th><?php echo xlt('Check Out'); ?></th> | |||
<th><?php echo xlt('Code(s)'); ?></th> | |||
<?php elseif ($list_id == 'Hide_Dashboard_Cards') : ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since config is now in globals, this file needs to be reverted.
@@ -614,3 +614,16 @@ CREATE TABLE `fee_schedule` ( | |||
UNIQUE KEY `ins_plan_code_mod_type_date` (`insurance_company_id`, `plan`, `code`, `modifier`, `type`, `effective_date`) | |||
) ENGINE=InnoDb AUTO_INCREMENT=1; | |||
#EndIf | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to happen.
@@ -112,4 +112,8 @@ | |||
#IfMissingColumn form_encounter last_update | |||
ALTER TABLE `form_encounter` ADD `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; | |||
#EndIf | |||
#IfNotRow4D supported_external_dataloads load_type CQM_VALUESET load_source NIH_VSAC load_release_date 2023-05-04 load_filename ec_only_cms_20230504.xml.zip | |||
INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here, not sure how it even made it into this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of those GitHub things. Not is my PR.
@@ -13638,3 +13638,13 @@ INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default` | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'YE', 'Yemeni', '2480', '0', '0', '', 'Yemen', 'YEM:887'); | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'ZM', 'Zambian', '2490', '0', '0', '', 'Zambia', 'ZMB:894'); | |||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`) VALUES('nationality_with_country', 'ZW', 'Zimbabwean', '2500', '0', '0', '', 'Zimbabwe', 'ZWE:716'); | |||
|
|||
INSERT INTO `list_options` (`list_id`, `option_id`, `title`) VALUES ('lists', 'Hide_Dashboard_Cards', 'Hide Dashboard Cards'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this file as its no longer being used due to the globals setting.
Everything that @adunsulag addresses has been corrected and moved. There is nothing for me to do here. @sjpadgett |
Okay thanks @juggernautsei . Let me test and review again and i'll let you know. |
interface/super/edit_globals.php
Outdated
@@ -645,6 +645,22 @@ function checkBackgroundServices() | |||
echo "</option>\n"; | |||
} | |||
echo " </select>\n"; | |||
} elseif ($fldtype == GlobalSetting::DATA_TYPE_MULTI_DASHBOARD_CARDS) { | |||
$res = sqlStatement("SELECT * FROM dashboard_card_visibility"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were supposed to get rid of table and hard code these options!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjpadgett eye eye captain
} elseif ($fldtype == GlobalSetting::DATA_TYPE_MULTI_DASHBOARD_CARDS) { | ||
$res = sqlStatement("SELECT * FROM dashboard_card_visibility"); | ||
echo " <select multiple class='form-control' name='form_{$i}[]' id='form_{$i}[]' size='3'>\n"; | ||
while ($row = sqlFetchArray($res)) { | ||
echo " <option value='" . attr($row['card_abrev']) . "'"; | ||
foreach ($glarr as $glrow) { | ||
if ($glrow['gl_value'] == $row['card_abrev']) { | ||
echo " selected"; | ||
break; | ||
} | ||
} | ||
echo ">"; | ||
echo xlt($row['card_name']); | ||
echo "</option>\n"; | ||
} | ||
echo " </select>\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juggernautsei I don't understand what is going here. This is the preferred way you strove for! Just needed to hard code the options that current are in the new table then revert table.
Did you accidently push an older version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the code and will start a new PR for clarity sake.
Going to start a new PR. |
Fixes #7191
Short description of what this resolves:
Creates the ability to turn off cards that are not being used by the clinic
Changes proposed in this pull request:
Create a list of cards and use it in an array to to display or hide the card. This is what the dashboard looks like with the cards turned off.
below added by @bradymiller :
UpForGrabs demo for testing this PR is at: https://www.open-emr.org/wiki/index.php/Development_Demo#Alpha_-_Up_For_Grabs_Demo