runCohortGeneration function

Run a cohort generation and export results