npiaget
(Nicolas Piaget)
December 20, 2019, 1:57pm
1
Application Name: Reference Application
Version Number: 2.9.0
Question:
I would like to hide fragments of the Patient dashboard such as vitals, obsGraph and others. However the method suggested by @mksd in How to hide vitals & diagnosis on patient dashboard page? does not work for me. I was able to successfully disable the attachments and the allergy fragments but not the coreapps fragments. Here is the code that I used in a fork from the reference application:
diff --git a/api/src/main/java/org/openmrs/module/referenceapplication/ReferenceApplicationActivator.java b/api/src/main/java/org/openmrs/module/referenceapplication/ReferenceApplicationAct>
index e37e87c..8e415fd 100644
--- a/api/src/main/java/org/openmrs/module/referenceapplication/ReferenceApplicationActivator.java
+++ b/api/src/main/java/org/openmrs/module/referenceapplication/ReferenceApplicationActivator.java
@@ -91,7 +91,11 @@ public class ReferenceApplicationActivator extends BaseModuleActivator {
appFrameworkService.disableApp("registrationapp.basicRegisterPatient");
appFrameworkService.disableApp("coreapps.awaitingAdmission");
-
+ appFrameworkService.disableExtension("org.openmrs.module.coreapps..mostRecentVitals.clinicianDashboardFirstColumn");
+ appFrameworkService.disableExtension("org.openmrs.module.coreapps..mostRecentVitals.clinicianDashboardSecondColumn");
+ appFrameworkService.disableExtension("org.openmrs.module.attachments.patientDashboard.secondColumnFragments.att");
+ appFrameworkService.disableExtension("org.openmrs.module.allergyui.patientDashboard.secondColumnFragments");
+
administrationService.saveGlobalProperty(new GlobalProperty("registrationcore.patientNameSearch",
"registrationcore.ExistingPatientNameSearch"));
It seems to me that appFrameworkService.disableExtension
is using the Extension id to disable the correct extension but several extensions in coreapps seems to use the same ID:
[
{
"id": "coreapps.latestObsForConceptList",
"instanceOf": "coreapps.template.dashboardWidget",
"description": "coreapps.latestObsForConceptList.app.description",
"order": 10,
"config": {
"widget": "latestobsforconceptlist",
"icon": "icon-user-md",
"label": "LATEST OBSERVATIONS",
"maxAge": "1m",
"concepts": "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, 5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, 5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, 5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, 5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"extensions": [
{
"id": "${project.parent.groupId}.${project.parent.artifactId}.mostRecentVitals.clinicianDashboardFirstColumn",
"appId": "coreapps.latestObsForConceptList",
"extensionPointId": "patientDashboard.firstColumnFragments",
"extensionParams": {
"provider": "${project.parent.artifactId}",
This file has been truncated. show original
What am I missing ?
Thank you for your help,
Nicolas
mozzy
(Moses Mutesasira)
December 20, 2019, 2:06pm
2
@npiaget ,
did you call the above methods in the started()
method of the module’s activator??
npiaget
(Nicolas Piaget)
December 20, 2019, 2:07pm
3
yes, sorry , forget to mention it
mozzy
(Moses Mutesasira)
December 20, 2019, 2:14pm
4
did you have to write the extension like that ??
it should be as simple as
"coreapps.mostRecentVitals.clinicianDashboardFirstColumn"
npiaget
(Nicolas Piaget)
December 20, 2019, 2:20pm
5
I have tried both ways. Just to test that I had the correct Extension ID, I have added the following line in the started()
method:
List<Extension> extensions = appFrameworkService.getAllEnabledExtensions();
for (Extension i : extensions) {
log.error(i.getId());
}
wich output this:
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,275| org.openmrs.module.coreapps.createVisit
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,276| org.openmrs.module.coreapps.createRetrospectiveVisit
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,276| owa.metadatamapping.adminGroup
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,277| owa.metadatamapping.adminLink
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,277| formentryapp.forms.homepageLink
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,277| owa.conceptdictionary.adminGroup
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,278| owa.conceptdictionary.adminLink
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,278| coreapps.mergePatientsHomepageLink
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,279| org.openmrs.module.coreapps.diagnoses.clinicianDashboardFirstColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,279| coreapps.activeVisitsHomepageLink
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,279| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,280| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,280| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,281| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardSecondColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,281| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn
ERROR - ReferenceApplicationActivator.started(98) |2019-12-19 22:06:06,282| org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardSecondColumn
mozzy
(Moses Mutesasira)
December 20, 2019, 2:25pm
6
if you dont mind , can you give a github link/PR to the actual code where you where trying to do this ??
dkayiwa
(Daniel Kayiwa)
December 22, 2019, 4:26pm
8
Can you try this? appFrameworkService.disableApp("coreapps.mostRecentVitals")
and: appFrameworkService.disableApp("coreapps.diagnoses")
1 Like
npiaget
(Nicolas Piaget)
December 23, 2019, 10:29am
9
Sorry Daniel, I’m just realizing now that your solution works! Please ignore my first post.
Thanks for your help @dkayiwa and @mozzy !
mozzy
(Moses Mutesasira)
December 23, 2019, 5:13pm
10
Thanks @dkayiwa , actually that really makes sense, as all those widgets are configured as apps not merely extensions