@Chris_Knoll, @Patrick_Ryan @Konstantin_Yaroshove,
I’ve long ignored this line at the end of the ATLAS generated cohort definition SQL:
DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id;
INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date)
select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date
FROM #final_cohort CO
;
I’m in a spot where I need to use this to run a cohort. Can you help me understand what goes in these global variables?
I’m assuming I need to make the @target_cohort_table:
CREATE TABLE @target_database_schema.@target_cohort_table ( person_id varchar(50) NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL
)
DISTKEY(person_id);
But what do I put in for @target_cohort_id? Is that an arbitrary value I assign to the cohort I’m building?
Appreciate your help demystifying this!
Kristin