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 on demographics page #7423
Conversation
Thanks @juggernautsei I assume you had an opportunity to test too? |
@sjpadgett I did test. Flawless |
$allergy = (AclMain::aclCheckIssue('allergy')) ? 1 : 0; | ||
$pl = (AclMain::aclCheckIssue('medical_problem')) ? 1 : 0; | ||
$meds = (AclMain::aclCheckIssue('medication')) ? 1 : 0; | ||
$allergy = (AclMain::aclCheckIssue('allergy') ? 1 : 0) && !in_array('card_allergies', $hiddenCards) ? 1 : 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.
won't this result in boolean instead of 1 or 0. Wouldn't this make more sense:
$allergy = (AclMain::aclCheckIssue('allergy') && !in_array('card_allergies', $hiddenCards)) ? 1 : 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.
You'd think so but think how PHP handles truthy though your way would work but I left same logic as original.
} | ||
// The list of cards to hide. For now add to array new cards. | ||
$res = array( | ||
['card_abrev' => '', 'card_name' => xlt('None or Reset')], |
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.
how does this work for a multiselect? Couldn't they select this and still select other items?
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 could but why would you! Even if selected will be ignored. 1 in 100 chance for user doing that. I'll take the odds rather adding a JS or having user unselect to an unselected box.
['card_abrev' => attr('card_lab'), 'card_name' => xlt('Labs')], | ||
['card_abrev' => attr('card_medicalproblems'), 'card_name' => xlt('Medical Problems')], | ||
['card_abrev' => attr('card_medication'), 'card_name' => xlt('Medications')], | ||
//['card_abrev' => 'card_rx', 'card_name' => 'Prescriptions'], // For now don't hide because can be disabled as feature. |
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.
up to you, but i think ok if you want to also include prescriptions in this feature
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.
@bradymiller prescriptions already have its own disable feature. No need to include it here.
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 still say this should be user selectable simply for fact all user don't need all cards but don't want to reargue here!:)
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.
But I think I see @bradymiller point is to move the old turn-off feature into here so that people don't have to go to two spots to turn off a card.
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 agree but I left to others to decide and I asked admins on signal is why Brady chimed in. but i'll add in my PR. thanks
thank you @bradymiller as always very insightful review. I just hope my memory serves correct for truthy:) will check anyway cause I have a pr for some bug fixes going up. |
…_last * 'master' of https://github.com/openemr/openemr: Hide dashboard card 2 (openemr#7423) fix: ccda zip import and php warnings and deprecations (openemr#7416) Fee sheet and Codes revenue code (openemr#7415) Refactor UB04 837i X12 feature to make work again. (openemr#7412) feat: support loop 2420E (openemr#7405) Fix: Revert "Fix: OpenEMR logs sensitive information such as payment details (openemr#7341)" (openemr#7396) Weno better error handling from fetches (openemr#7408)
(cherry picked from commit 6e94bfb)
(cherry picked from commit 6e94bfb)
Fixes #7191
Short description of what this resolves:
Hide unutilized dashboard cards
Changes proposed in this pull request: