Make cohort creation for across trial db-agnostic
Support for core impl. of xtrials