use of org.openmrs.parameter.EncounterSearchCriteriaBuilder in project openmrs-core by openmrs.
the class EncounterServiceTest method getEncounters_shouldGetEncountersByLocation.
/**
* @see EncounterService#getEncounters(Patient, Location, Date, Date, java.util.Collection,
* java.util.Collection, java.util.Collection, boolean)
*/
@Test
public void getEncounters_shouldGetEncountersByLocation() {
EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder().setLocation(new Location(1)).setIncludeVoided(true).createEncounterSearchCriteria();
List<Encounter> encounters = Context.getEncounterService().getEncounters(encounterSearchCriteria);
assertEquals(6, encounters.size());
}
use of org.openmrs.parameter.EncounterSearchCriteriaBuilder in project openmrs-core by openmrs.
the class EncounterServiceTest method getEncounters_shouldGetEncountersByVisit.
/**
* @see EncounterService#getEncounters(Patient, Location, Date, Date, java.util.Collection,
* java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection,
* boolean)
*/
@Test
public void getEncounters_shouldGetEncountersByVisit() {
List<Visit> visits = new ArrayList<>();
visits.add(new Visit(1));
EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder().setVisits(visits).setIncludeVoided(true).createEncounterSearchCriteria();
List<Encounter> encounters = Context.getEncounterService().getEncounters(encounterSearchCriteria);
assertEquals(2, encounters.size());
}
Aggregations