Skip to content

Commit

Permalink
RA-2046 - Registration app should support column config within the fi…
Browse files Browse the repository at this point in the history
…nd patient component (#143)
  • Loading branch information
mseaton authored Sep 28, 2024
1 parent d68fb44 commit aa5383d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.JsonNode;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.openmrs.Encounter;
import org.openmrs.EncounterType;
import org.openmrs.GlobalProperty;
import org.openmrs.Location;
import org.openmrs.api.EncounterService;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -65,6 +65,12 @@ public void controller(UiSessionContext uiSessionContext,
model.addAttribute("appId", null);
}

JsonNode columnConfig = null;
if (app.getConfig() != null) {
columnConfig = app.getConfig().get("patientSearchColumnConfig");
}
model.addAttribute("patientSearchColumnConfig", columnConfig);

List<Extension> includeFragments = appFrameworkService.getExtensionsForCurrentUser(RegistrationAppConstants.FIND_PATIENT_FRAGMENTS_EXTENSION_POINT);
Collections.sort(includeFragments);
model.addAttribute("includeFragments", includeFragments);
Expand Down
12 changes: 7 additions & 5 deletions omod/src/main/webapp/pages/findPatient.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ ${ ui.includeFragment("uicommons", "validationMessages")}
</div>
<div class="col-12"><h3>${ ui.message("coreapps.searchPatientHeading") }</h3></div>
<div class="col-12 col-md-8">
${ ui.includeFragment("coreapps", "patientsearch/patientSearchWidget",
[ afterSelectedUrl: afterSelectedUrl,
rowSelectionHandler: "selectPatientHandler",
initialSearchFromParameter: "search",
showLastViewedPatients: 'false' ])}
${ ui.includeFragment("coreapps", "patientsearch/patientSearchWidget", [
afterSelectedUrl: afterSelectedUrl,
rowSelectionHandler: "selectPatientHandler",
initialSearchFromParameter: "search",
showLastViewedPatients: 'false',
columnConfig: patientSearchColumnConfig
])}
</div>
</div>

Expand Down

0 comments on commit aa5383d

Please sign in to comment.