@Test public void ageAtMost_shouldReturnAllPatientsAgedAtMost() throws Exception { CohortDefinition cd = commonCohortLibrary.agedAtMost(35); context.addParameterValue("effectiveDate", context.getParameterValue("endDate")); EvaluatedCohort evaluated = Context.getService(CohortDefinitionService.class).evaluate(cd, context); ReportingTestUtils.assertCohortEquals(Arrays.asList(6, 7), evaluated); }
public CohortDefinition agedAtMost(int maxAge) { AgeCohortDefinition cd = new AgeCohortDefinition(); cd.setName("aged at most " + maxAge); cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class)); cd.setMaxAge(maxAge); return cd; }
CommonCohortLibrary { public CohortDefinition agedAtMost(int maxAge) { AgeCohortDefinition cd = new AgeCohortDefinition(); cd.setName("aged at most " + maxAge); cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class)); cd.setMaxAge(maxAge); return cd; } }
CommonCohortLibrary { public CohortDefinition agedAtMost(int maxAge) { AgeCohortDefinition cd = new AgeCohortDefinition(); cd.setName("aged at most " + maxAge); cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class)); cd.setMaxAge(maxAge); return cd; }  }
CommonCohortLibrary { public CohortDefinition agedAtMost(int maxAge) { AgeCohortDefinition cd = new AgeCohortDefinition(); cd.setName("aged at most " + maxAge); cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class)); cd.setMaxAge(maxAge); 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(); }
CommonCohortLibrary { public CohortDefinition agedAtMost(int maxAge) { AgeCohortDefinition cd = new AgeCohortDefinition(); cd.setName("aged at most " + maxAge); cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class)); cd.setMaxAge(maxAge); 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();  }