darwin-eu / CDMConnector

A pipe friendly way to interact with an OMOP Common Data Model
https://darwin-eu.github.io/CDMConnector/
Apache License 2.0
13 stars 9 forks source link

generateConceptCohortSet fails when one concept id is not in a concept in the cdm #17

Open nmercadeb opened 3 months ago

nmercadeb commented 3 months ago

The code below used to work but I encountered this error in CRAN version 1.3.1:

followback  <- 180
  cdm <- DrugUtilisation::generateConceptCohortSet(
    cdm = DrugUtilisation::mockDrugUtilisation(numberIndividuals = 200),
    conceptSet = list(c_1 = 317009, c_2 = 1),
    name = "cases",
    end  = "observation_period_end_date",
    requiredObservation = c(followback,followback),
    overwrite = TRUE
  )
#> ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 90% | ETA: 0s
#> Error in `validateGeneratedCohortSet()`:
#> ! There are cohort_definition_id that appear in cohort and not in
#>   cohort_codelist:
#> • cohort_codelist: 1, 2
#> • cohort_set: 1