Error in `.make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)`: invalid non-character version specification 'x' (type: double)

test_generate_concept_cohort_set <- function(con, cdm_schema, write_schema) {
# withr::local_options("CDMConnector.cohort_as_temp" = FALSE) # temp cohort tables are not implemented yet
con = con, cdm_name = "eunomia", cdm_schema = cdm_schema,
cohort <- readCohortSet(system.file("cohorts3", package = "CDMConnector")) %>%
dplyr::filter(cohort_name %in% c("gibleed_default", "GiBleed_default")) %>%
cdm <- generateCohortSet(cdm, cohortSet = cohort, name = "gibleed2", overwrite = TRUE)
dplyr::arrange(.data$cohort_definition_id, .data$subject_id, .data$cohort_start_date, .data$cohort_end_date) %>%
dplyr::mutate_if(~ "integer64" %in% class(.), as.integer)
# remove attributes since they are a bit different
# TODO should the attributes be the exact same? probably. but it will take time to implement that.
attr(actual, 'cohort_attrition') <- attr(expected, 'cohort_attrition') <- NULL
attr(actual, 'cohort_set') <- attr(expected, 'cohort_set') <- NULL
conceptSet = list(gibleed = 192671), name = "gibleed3",
conceptSet = list(gibleed = 192671), name = "gibleed4",
conceptSet = list(gibleed = Capr::cs(Capr::descendants(192671), name = "gibleed")),
dplyr::filter(cohort_name %in% c("gibleed_default_with_descendants", "GiBleed_default_with_descendants")) %>%
# but some attributes might differ (e.g. cohort attrition)
dplyr::filter(cohort_name %in% c("gibleed_all", "GiBleed_all")) %>%
# all occurrences (no descendants) fixed end date ----
cohort <- readCohortSet(system.file("cohorts3", package = "CDMConnector"))
cdm <- generateCohortSet(cdm, cohortSet = cohort, name = "gibleed2",
conceptSet = list("acetaminophen_1" = 1127433,
# cohort generation with a cohort subset ------
conceptSet = list(gibleed_1 = 192671, gibleed_2 = 4112343),
start_person_count <- cdm$person %>% dplyr::tally() %>% dplyr::pull("n")
cdm <- generate_concept_cohort_set(cdm = cdm,
concept_set = list("diclofenac" = 1124300,
end_person_count <- cdm$person %>% dplyr::tally() %>% dplyr::pull("n")
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran() else skip_if_not_installed("duckdb")
skip_if(any(write_schema == "") || any(cdm_schema == "") || is.null(con))
test_that("missing domains produce warning", {
con = con, cdm_name = "eunomia", cdm_schema = "main", write_schema = "main"
cdm <- generateConceptCohortSet(cdm, name = "celecoxib",
test_that("Regimen domain does not cause error", {
# create a fake concept with domain "Regimen"
DBI::dbExecute(con, "UPDATE main.concept SET domain_id = 'Regimen' WHERE concept_id = 19129655")
cdm <- generateConceptCohortSet(cdm = cdm,
generate_concept_cohort_set(concept_set = list("acetaminophen" = c(1125315,