Make cohort creation for across trial db-agnostic