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 option #7192

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Documentation/help_files/medical_dashboard_help.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("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>
Copy link
Sponsor Member

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.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address this!


<p><?php echo xlt("The data section of the dashboard page lists all pertinent items related to a patient");?>.</p>

<p><?php echo xlt("These items can be edited if the user has sufficient privilege");?>.</p>
Expand Down
36 changes: 26 additions & 10 deletions interface/patient_file/summary/demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
// want smart support in their system.
$smartLaunchController = new SMARTLaunchController($GLOBALS["kernel"]->getEventDispatcher());
$smartLaunchController->registerContextEvents();
$hiddenCards = getHiddenDashboardCards();

/**
* @var EventDispatcher
Expand Down Expand Up @@ -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)) {
echo $t->render('patient/card/allergies.html.twig', $viewArgs);
}
echo "</div>";
}

Expand All @@ -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)) {
echo $t->render('patient/card/medical_problems.html.twig', $viewArgs);
}
echo "</div>";
}

Expand All @@ -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)) {
echo $t->render('patient/card/medication.html.twig', $viewArgs);
}
echo "</div>";
}

Expand All @@ -1152,8 +1159,7 @@ function filterActiveIssues(array $i): array
'auth' => false,
'rxList' => $rxArr,
];

echo $t->render('patient/card/erx.html.twig', $viewArgs);
echo $t->render('patient/card/erx.html.twig', $viewArgs);
}

$id = "prescriptions_ps_expand";
Expand Down Expand Up @@ -1455,7 +1461,9 @@ function filterActiveIssues(array $i): array
'prependedInjection' => $dispatchResult->getPrependedInjection(),
'appendedInjection' => $dispatchResult->getAppendedInjection(),
];
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
if (!in_array('card_patientreminders', $hiddenCards)) {
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
}
endif; //end if prw is activated

if (AclMain::aclCheckCore('patients', 'disclosure')) :
Expand All @@ -1476,7 +1484,9 @@ function filterActiveIssues(array $i): array
'prependedInjection' => $dispatchResult->getPrependedInjection(),
'appendedInjection' => $dispatchResult->getAppendedInjection(),
];
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
if (!in_array('card_disclosure', $hiddenCards)) {
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
}
endif; // end if disclosures authorized

if ($GLOBALS['amendments'] && AclMain::aclCheckCore('patients', 'amendment')) :
Expand Down Expand Up @@ -1504,7 +1514,9 @@ function filterActiveIssues(array $i): array
'prependedInjection' => $dispatchResult->getPrependedInjection(),
'appendedInjection' => $dispatchResult->getAppendedInjection(),
];
echo $twig->getTwig()->render('patient/card/amendments.html.twig', $viewArgs);
if (!in_array('card_amendments', $hiddenCards)) {
echo $twig->getTwig()->render('patient/card/amendments.html.twig', $viewArgs);
}
endif; // end amendments authorized

if (AclMain::aclCheckCore('patients', 'lab')) :
Expand Down Expand Up @@ -1532,7 +1544,9 @@ function filterActiveIssues(array $i): array
'prependedInjection' => $dispatchResult->getPrependedInjection(),
'appendedInjection' => $dispatchResult->getAppendedInjection(),
];
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
if (!in_array('card_lab', $hiddenCards)) {
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
}
endif; // end labs authorized

if ($vitals_is_registered && AclMain::aclCheckCore('patients', 'med')) :
Expand All @@ -1555,7 +1569,9 @@ function filterActiveIssues(array $i): array
'prependedInjection' => $dispatchResult->getPrependedInjection(),
'appendedInjection' => $dispatchResult->getAppendedInjection(),
];
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
if (!in_array('card_vitals', $hiddenCards)) {
echo $twig->getTwig()->render('patient/card/loader.html.twig', $viewArgs);
}
endif; // end vitals

// if anyone wants to render anything after the patient demographic list
Expand Down
7 changes: 6 additions & 1 deletion library/globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ function gblTimeZones()
'style_light.css',
xl('Pick a general theme (need to logout/login after changing this setting).')
),

'hide_dashboard_cards' => array(
xl('Hide cards on patient dashboard'),
'm_dashboard_cards',
'',
xl('Select the cards you want to hide on the patient dashboard.')
),
'window_title_add_patient_name' => array(
xl('Add Patient Name To Window Title'),
'bool', // data type
Expand Down
11 changes: 11 additions & 0 deletions library/lists.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,14 @@ function setListTouch($patient_id, $type)
sqlStatement("INSERT INTO `lists_touch` ( `pid`,`type`,`date` ) VALUES ( ?, ?, NOW() )", array($patient_id,$type));
}
}

function getHiddenDashboardCards()
{
$hiddenList = [];
$ret = sqlStatement("SELECT gl_value FROM `globals` WHERE `gl_name` = 'hide_dashboard_cards'");
while ($row = sqlFetchArray($ret)) {
$hiddenList[] = $row['gl_value'];
}

return $hiddenList;
}
1 change: 1 addition & 0 deletions sql/7_0_1-to-7_0_2_upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -614,3 +614,4 @@ 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

Copy link
Sponsor Member

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

Copy link
Member Author

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.

Copy link
Sponsor Member

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

Copy link
Sponsor Member

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

Copy link
Sponsor Member

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.

Copy link
Member Author

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.

Copy link
Sponsor Member

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....

Copy link
Sponsor Member

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?

4 changes: 4 additions & 0 deletions sql/7_0_2-to-7_0_3_upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Sponsor Member

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.

Copy link
Member Author

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.

('CQM_VALUESET', 'NIH_VSAC', '2023-05-04', 'ec_only_cms_20230504.xml.zip', 'b77b3c2a88d23de0ec427c1cfc5088ce');
#EndIf

15 changes: 15 additions & 0 deletions sql/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13638,3 +13638,18 @@ 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');

DROP TABLE IF EXISTS `dashboard_card_visibility`;
Copy link
Sponsor Member

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

Copy link
Sponsor Member

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.

Copy link
Member Author

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.

CREATE TABLE IF NOT EXISTS dashboard_card_visibility (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`card_abrev` VARCHAR(75) NOT NULL,
`card_name` VARCHAR(75) NOT NULL
)Engine=InnoDB;

INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_allergies', 'Allergies');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_amendments', 'Amendments');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_disclosure', 'Disclosures');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_lab', 'Lab');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_medicalproblems', 'Medical Problems');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_medication', 'Medication');
INSERT INTO `dashboard_card_visibility` (`id`, `card_abrev`, `card_name`) VALUES (NULL, 'card_vitals', 'Vitals');
3 changes: 3 additions & 0 deletions src/Services/Globals/GlobalSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class GlobalSetting
// multiple select language selector
const DATA_TYPE_MULTI_LANGUAGE_SELECT = "m_lang";

// multiple select dashboard cards
const DATA_TYPE_MULTI_DASHBOARD_CARDS = "m_dashboard_cards";

// list of default visits in OpenEMR
const DATA_TYPE_DEFAULT_VISIT_CATEGORY = "default_visit_category";
// CSS Theme selector
Expand Down