I’m using OpenMRS 1.11.4, ReferenceApplication 2.3.1 and bundled modules.
I found that when user clicks on the demographics or contact information displayed on patient header, the page reloads with following change in URL:
http://localhost:8080/mrs/coreapps/clinicianfacing/patient.page?patientId=25
TO
http://localhost:8080/mrs/coreapps/clinicianfacing/patient.page?patientId=25&app=pih.app.clinicianDashboard
I just wanted to know if this reload/redirection has any business functionality or is just redundant. On digging the code I found this:
throw new IllegalStateException("Invalid configuration: number of days expected in " + CoreAppsConstants.GP_RECENT_DIAGNOSIS_PERIOD_IN_DAYS, e);
}
}
return 730; //2 years
}
public String getDashboardUrl() {
String url = getGlobalProperty(CoreAppsConstants.GP_DASHBOARD_URL, false);
if (!StringUtils.hasText(url)) {
return "/coreapps/clinicianfacing/patient.page?patientId={{patientId}}";
}
else {
return url;
}
}
public String getDashboardUrlWithoutQueryParams() {
String url = getGlobalProperty(CoreAppsConstants.GP_DASHBOARD_URL, false);
if (!StringUtils.hasText(url)) {
return "/coreapps/clinicianfacing/patient.page";
}
AND
There might be a possibility that the URLs weren’t updated during code migration in the past.
darius
(Darius Jazayeri)
October 6, 2016, 5:52pm
2
It’s a mistake that the hardcoded default value is PIH-specific…
mogoodrich
(Mark Goodrich)
October 6, 2016, 6:04pm
3
Agreed. The “app=pih.app.clinicianDashboard” can be removed… I don’t know if there is another app name for the reference app we want to include instead.
Mark
The app parameter needs to be removed all together as the regular clinicianfacing page only has patientId
as parameter.
Global property coreapps.dashboardUrl
is also required to be changed
Let me resolve it and generate a PR