There are more options available for these needs:
These certainly exist. You should be able to use NumericObsCohortDefinition, CodedObsCohortDefinition, DateObsCohortDefinition, and TextObsCohortDefinition
This is possible by use of expressions when mapping parameters. There is some explanation of what is available to do this here. It is also possible by creating an appropriate definition library that takes in the number of months/days and units, and converts this to a date.
Based on the error message I see here:
java.lang.NullPointerException\n\tat org.openmrs.module.reporting.report.util.SqlUtils.openmrsObjectIdListHelper(SqlUtils.java:213)\n\tat org.openmrs.module.reporting.cohort.query.db.hibernate.HibernateCohortQueryDAO.getPatientsHavingEncounters(HibernateCohortQueryDAO.java:567)\n\tat org.openmrs.module.reporting.cohort.query.service.CohortQueryServiceImpl.getPatientsHavingEncounters(CohortQueryServiceImpl.java:156)\n\tat
My best guess is that this is caused more by bad test data than by any problem in the reporting framework. Were you testing this on patients and encounters that were previously saved, or just created in memory and not yet persisted?
I'm not sure what this means, but we should be able to just add in more library methods to meet our needs. There are several program-related cohort definitions available: ProgramEnrollmentCohortDefinition, PatientStateCohortDefinition, InProgramCohortDefinition, InStateCohortDefinition.
This does appear to be missing. We'd need to ticket this and get it added to the reporting framework.
Hope this helps a little. I'm on vacation this week, so I may be slower following up than normal. @darius FYI.