Closed edward-burn closed 1 month ago
shouldnt this be a problem for omopgenerics::newCodelist() ? @edward-burn
@catalamarti but is omopgenerics::newCodelist() being used in generateDrugUtilisationCohortSet? I suppose that is the first step is that and then the next would be reviewing the validation in omopgenerics. At the moment DUS allows for most special characters, it is just the curly brackets that seem to cause a problem for cli messages
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
#> ■■■■■■■■■■■■■■■■■■■■■■ 70% | ETA: 1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 90% | ETA: 1s
generateDrugUtilisationCohortSet(
cdm = cdm,
name = "drug_cohorts",
conceptSet = list("my (-*: new cohort" = c(1125315, 1125360,
2905077, 43135274))
)
#> Warning: cohort_name must be snake case, the following cohorts will be renamed:
#> • my (-*: new cohort -> my_new_cohort
#>
#> ── # OMOP CDM reference (duckdb) of DUS MOCK ───────────────────────────────────
#> • omop tables: person, observation_period, concept, concept_ancestor,
#> drug_strength, drug_exposure, condition_occurrence, visit_occurrence,
#> observation, concept_relationship
#> • cohort tables: cohort1, cohort2, drug_cohorts
#> • achilles tables: -
#> • other tables: -
generateDrugUtilisationCohortSet(
cdm = cdm,
name = "drug_cohorts",
conceptSet = list("my {-*: new cohort" = c(1125315, 1125360,
2905077, 43135274))
)
#> Error in glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE, : Expecting '}'
Created on 2024-07-01 with reprex v2.1.0
darwin-eu-dev/DrugUtilisation#474
this should be fixed in validateConceptSetArgument():
list("my {-*: new cohort" = c(1125315, 1125360, 2905077, 43135274)) |>
omopgenerics::validateConceptSetArgument()
#>
#> ── 1 codelist ──────────────────────────────────────────────────────────────────
#>
#> - my {-*: new cohort (4 codes)
Created on 2024-08-05 with reprex v2.1.1
from @MimiYuchenGuo - badly formatted names can result in an uninformative error
Created on 2024-06-28 with reprex v2.0.2