Skip to content
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

Merged
merged 1 commit into from May 6, 2024

Conversation

juggernautsei
Copy link
Member

@juggernautsei juggernautsei commented May 5, 2024

Fixes #7191

Short description of what this resolves:

Hide unutilized dashboard cards

Changes proposed in this pull request:

@sjpadgett
Copy link
Sponsor Member

Thanks @juggernautsei I assume you had an opportunity to test too?
Looks okay to me but could use another set of eyes in case I've missed something. @bradymiller if you get a chance maybe check this out for us. thanks

@juggernautsei
Copy link
Member Author

@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;
Copy link
Sponsor Member

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;

Copy link
Sponsor Member

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')],
Copy link
Sponsor Member

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?

Copy link
Sponsor Member

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.
Copy link
Sponsor Member

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

Copy link
Member Author

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.

Copy link
Sponsor Member

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!:)

Copy link
Member Author

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.

Copy link
Sponsor Member

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

@sjpadgett sjpadgett merged commit 6e94bfb into openemr:master May 6, 2024
25 checks passed
@sjpadgett
Copy link
Sponsor Member

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.

sjpadgett added a commit to sjpadgett/openemr that referenced this pull request May 7, 2024
…_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)
sjpadgett pushed a commit to sjpadgett/openemr that referenced this pull request May 20, 2024
@adunsulag adunsulag changed the title Hide dashboard card 2 feat: Hide dashboard cards on demographics page May 20, 2024
sjpadgett pushed a commit to sjpadgett/openemr that referenced this pull request May 21, 2024
@sjpadgett sjpadgett mentioned this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Hide cards in the patient dashboard
3 participants