/**
  * Patients who completed program ${onOrAfter} and ${onOrBefore}
  *
  * @return the cohort definition
  */
 public CohortDefinition compltedProgram() {
   ProgramEnrollmentCohortDefinition cd = new ProgramEnrollmentCohortDefinition();
   cd.setName("Those patients who completed program on date");
   cd.addParameter(new Parameter("completedOnOrBefore", "Complete Date", Date.class));
   cd.setPrograms(Arrays.asList(MetadataUtils.existing(Program.class, HivMetadata._Program.HIV)));
   return cd;
 }
 /**
  * Patients who were enrolled on the given programs between ${enrolledOnOrAfter} and
  * ${enrolledOnOrBefore}
  *
  * @param programs the programs
  * @return the cohort definition
  */
 public CohortDefinition enrolled(Program... programs) {
   ProgramEnrollmentCohortDefinition cd = new ProgramEnrollmentCohortDefinition();
   cd.setName("enrolled in program between dates");
   cd.addParameter(new Parameter("enrolledOnOrAfter", "After Date", Date.class));
   cd.addParameter(new Parameter("enrolledOnOrBefore", "Before Date", Date.class));
   if (programs.length > 0) {
     cd.setPrograms(Arrays.asList(programs));
   }
   return cd;
 }