-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inclusion impact analysis where censor period is being used (#66)
* Added cohort_censor_stats table. * censor stats only calculated when there is a censor window specified.
- Loading branch information
1 parent
b5ec99c
commit 98911c6
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/resources/resources/cohortdefinition/sql/cohortCensoredStats.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- calculate censored | ||
delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; | ||
insert into @results_database_schema.cohort_censor_stats (cohort_definition_id, lost_count) | ||
select @target_cohort_id as cohort_definition_id, coalesce(FCC.total_people - TC.total, 0) as lost_count | ||
FROM | ||
(select count_big(distinct person_id) as total_people from #final_cohort) FCC, | ||
(select count_big(distinct subject_id) as total from @target_database_schema.@target_cohort_table t where t.cohort_definition_id = @target_cohort_id) TC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters