Skip to content

Initialize cohort attrition and enhance mockCohort tests#293

Merged
ilovemane merged 2 commits intomainfrom
cohort_table
Apr 29, 2026
Merged

Initialize cohort attrition and enhance mockCohort tests#293
ilovemane merged 2 commits intomainfrom
cohort_table

Conversation

@ilovemane
Copy link
Copy Markdown
Collaborator

No description provided.

Compute an explicit cohortAttritionTable in mockCohort(): select cohort_definition_id, left-join aggregated cohort counts (number_records, number_subjects), coalesce missing values to 0, and populate reason_id, reason and excluded_* fields. Pass this table as cohortAttritionRef to newCohortTable instead of relying on an attribute. Add a test that builds a mock CDM, extracts attrition, and asserts initial attrition fields (reason_id, reason, excluded_* ) and that the stored counts match the aggregated cohort counts.
@ilovemane ilovemane merged commit 38e031b into main Apr 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cohortAttritionRef = attr(cohort, "cohort_attrition") is there any chance this is not NULL (in mockCohort)

1 participant