File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
java/org/openmrs/module/pihcore/page/controller/adt Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 99import org .openmrs .PatientIdentifier ;
1010import org .openmrs .PatientIdentifierType ;
1111import org .openmrs .api .PatientService ;
12+ import org .openmrs .module .appui .UiSessionContext ;
1213import org .openmrs .module .coreapps .CoreAppsProperties ;
1314import org .openmrs .module .emrapi .EmrApiProperties ;
1415import org .openmrs .module .emrapi .adt .AdtService ;
@@ -37,7 +38,13 @@ public void get(PageModel model,
3738 @ SpringBean ("coreAppsProperties" ) CoreAppsProperties coreAppsProperties ,
3839 @ SpringBean ("patientService" ) PatientService patientService ,
3940 @ SpringBean ("adtService" ) AdtService adtService ,
40- @ SpringBean ("emrApiProperties" ) EmrApiProperties emrApiProperties ) throws EvaluationException {
41+ @ SpringBean ("emrApiProperties" ) EmrApiProperties emrApiProperties ,
42+ UiSessionContext uiSessionContext ) throws EvaluationException {
43+
44+ // use the closest visit location associated with the session location if the location param is not specified
45+ if (visitLocation == null ) {
46+ visitLocation = adtService .getLocationThatSupportsVisits (uiSessionContext .getSessionLocation ());
47+ }
4148
4249 InpatientAdmissionSearchCriteria criteria = new InpatientAdmissionSearchCriteria ();
4350 criteria .setVisitLocation (visitLocation );
Original file line number Diff line number Diff line change 5252
5353<h3 class =" inpatient-count" >${ ui. message(" emr.inpatients.patientCount" ) } : <span id =" listSize" >${ inpatientsNumber } </span ></h3 >
5454<div class =" inpatient-filter" >
55- ${ ui. includeFragment(" emr " , " field/location" , [
55+ ${ ui. includeFragment(" pihapps " , " field/location" , [
5656 " id" : " inpatients-filterByLocation" ,
5757 " formFieldName" : " filterByLocationId" ,
5858 " label" : " emr.inpatients.filterByCurrentWard" ,
59- " withTag" : " Admission Location;Transfer Location"
59+ " withTag" : " Admission Location;Transfer Location" ,
60+ " restrictToVisitLocationAndDescendants" : true
6061 ] ) }
6162</div >
6263
You can’t perform that action at this time.
0 commit comments