Skip to content

Error when more than one subsetCohortId in deathCohort() #702

@cecicampanile

Description

@cecicampanile
cdm <- omock::mockCdmFromDataset(source = "duckdb")
#> ℹ Loading bundled GiBleed tables from package data.
#> ℹ Adding drug_strength table.
#> ℹ Creating local <cdm_reference> object.
#> ℹ Inserting <cdm_reference> into duckdb.

cdm$pop <- CohortConstructor::demographicsCohort(cdm, sex = c("Male", "Female"), ageRange = list(c(0,20), c(21, 150)), name = "pop")
#> ℹ Building new trimmed cohort
#> Adding demographics information
#> Creating initial cohort
#> Trim sex
#> Trim age
#> ✔ Cohort trimmed

cdm$death_cohort <- CohortConstructor::deathCohort(cdm, name = "death_cohort", subsetCohort = "pop", subsetCohortId = c("demographics_1", "demographics_2"))
#> Error in `updateCohortNames()`:
#> ! cohort_name in the cohort_set must be unique

Created on 2026-02-17 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions