this instanceof check should be wrapped around everything (i.e. *CohortDefinition only apply to PatientDSD)