CommonCohortLibrary { public CohortDefinition females() { GenderCohortDefinition cd = new GenderCohortDefinition(); cd.setName("females"); cd.setFemaleIncluded(true); return cd; }  CohortDefinition females(); CohortDefinition males(); CohortDefinition agedAtMost(int maxAge); CohortDefinition agedAtLeast(int minAge); CohortDefinition agedAtLeastAgedAtMost(int minAge, int maxAge); CohortDefinition femalesAgedAtLeast18(); CohortDefinition hasEncounter(EncounterType... types); CohortDefinition hasObs(Concept question, Concept... answers); CohortDefinition transferredIn(); CohortDefinition transferredOut(); CohortDefinition enrolled(Program... programs); CohortDefinition enrolledExcludingTransfers(Program... programs); CohortDefinition enrolledExcludingTransfersOnDate(Program... programs); CohortDefinition pregnant(); CohortDefinition inProgram(Program program); CohortDefinition medicationDispensed(Concept... concepts); CohortDefinition compltedProgram(); CohortDefinition deceasedPatients(); CohortDefinition markedAsDeadButNotDeceased();  }
@Test public void females_shouldReturnAllFemalePatients() throws Exception { CohortDefinition cd = commonCohortLibrary.females(); EvaluatedCohort evaluated = Context.getService(CohortDefinitionService.class).evaluate(cd, context); ReportingTestUtils.assertCohortEquals(Arrays.asList(7, 8), evaluated); }