createStudyPopulation function

Create a study population