/** * @see EncounterService#getAllEncounterRoles(boolean) */ @Test public void getAllEncounterRoles_shouldGetAllEncounterRolesBasedOnIncludeRetiredFlag() { EncounterService encounterService = Context.getEncounterService(); List<EncounterRole> encounterRoles = encounterService.getAllEncounterRoles(true); assertEquals("get all encounter roles including retired", 3, encounterRoles.size()); encounterRoles = encounterService.getAllEncounterRoles(false); assertEquals("get all encounter roles excluding retired", 2, encounterRoles.size()); }
@Override public long getAllCount() { return service.getAllEncounterRoles(false).size(); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#doGetAll(org.openmrs.module.webservices.rest.web.RequestContext) */ @Override protected NeedsPaging<EncounterRole> doGetAll(RequestContext context) { return new NeedsPaging<EncounterRole>(Context.getEncounterService().getAllEncounterRoles(context.getIncludeAll()), context); } }
List<EncounterRole> roles = Context.getEncounterService().getAllEncounterRoles(true); Collections.sort(roles, new Comparator<EncounterRole>() { @Override