This won't work because the parameters are not passed into the cohort definition.  Instead of creating the Mapped as you are, you should probably be using:  Mapped.mapStraightThrough(cohortDefinition)