forked from openmrs/openmrs-module-appointmentscheduling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UHM-1183: Allow filtering by multiple services on the Schedule View
Updated Scheduled Appointment Block resource to accept multiple appointment types
- Loading branch information
1 parent
f727734
commit dc32c79
Showing
4 changed files
with
59 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...nmrs/module/appointmentscheduling/rest/resource/openmrs1_9/util/AppointmentRestUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9.util; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.openmrs.api.context.Context; | ||
import org.openmrs.module.appointmentscheduling.AppointmentType; | ||
import org.openmrs.module.appointmentscheduling.api.AppointmentService; | ||
import org.openmrs.module.webservices.rest.web.RequestContext; | ||
|
||
public class AppointmentRestUtils { | ||
|
||
public static List<AppointmentType> getAppointmentTypes(RequestContext context) { | ||
|
||
List<AppointmentType> types = null; | ||
String[] appointmentTypes = context.getRequest().getParameterValues("appointmentType"); | ||
if (appointmentTypes != null && appointmentTypes.length > 0) { | ||
types = new ArrayList<AppointmentType>(); | ||
for (String appointmentType : appointmentTypes) { | ||
types.add(Context.getService(AppointmentService.class).getAppointmentTypeByUuid(appointmentType)); | ||
} | ||
} | ||
|
||
return types; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters