From da0de421f5659c97849be0b7bc2f3d9b145d1ef3 Mon Sep 17 00:00:00 2001 From: Chris Knoll Date: Tue, 26 Jan 2021 19:00:56 -0500 Subject: [PATCH] Do not generate censor stats when generateStats is false. --- .../resources/cohortdefinition/sql/generateCohort.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/resources/cohortdefinition/sql/generateCohort.sql b/src/main/resources/resources/cohortdefinition/sql/generateCohort.sql index 081c619c..f2e1636f 100644 --- a/src/main/resources/resources/cohortdefinition/sql/generateCohort.sql +++ b/src/main/resources/resources/cohortdefinition/sql/generateCohort.sql @@ -118,12 +118,13 @@ INSERT INTO @target_database_schema.@target_cohort_table (@cohort_id_field_name, @finalCohortQuery ; +{@generateStats != 0}?{ -- BEGIN: Censored Stats delete from @results_database_schema.cohort_censor_stats where @cohort_id_field_name = @target_cohort_id; @cohortCensoredStatsQuery -- END: Censored Stats - +} {@generateStats != 0 & @ruleTotal != 0}?{ @inclusionRuleTable