Skip to contents

Find unmapped concepts related to codelist

Usage

summariseUnmappedCodes(
  x,
  cdm,
  table = c("condition_occurrence", "device_exposure", "drug_exposure", "measurement",
    "observation", "procedure_occurrence")
)

Arguments

x

A codelist.

cdm

A cdm reference via CDMConnector.

table

Names of clinical tables in which to search for unmapped codes. Can be one or more of "condition_occurrence", "device_exposure", "drug_exposure", "measurement", "observation", and "procedure_occurrence".

Value

A summarised result of unmapped concepts related to given codelist.

Examples

# \donttest{
cdm <- mockVocabRef("database")
#> Warning: There are observation period end dates after the current date: 2025-04-11
#>  The latest max observation period end date found is 2025-12-31
#> Warning: There are observation period end dates after the current date: 2025-04-11
#>  The latest max observation period end date found is 2025-12-31
codes <- list("Musculoskeletal disorder" = 1)
cdm <- omopgenerics::insertTable(cdm, "condition_occurrence",
dplyr::tibble(person_id = 1,
              condition_occurrence_id = 1,
              condition_concept_id = 0,
              condition_start_date  = as.Date("2000-01-01"),
              condition_type_concept_id  = NA,
              condition_source_concept_id = 7))
summariseUnmappedCodes(x = list("osteoarthritis" = 2), cdm = cdm,
table = "condition_occurrence")
#> Warning: ! `codelist` casted to integers.
#> Searching for unmapped codes related to osteoarthritis
#> # A tibble: 1 × 13
#>   result_id cdm_name group_name    group_level    strata_name strata_level
#>       <int> <chr>    <chr>         <chr>          <chr>       <chr>       
#> 1         1 mock     codelist_name osteoarthritis overall     overall     
#> # ℹ 7 more variables: variable_name <chr>, variable_level <chr>,
#> #   estimate_name <chr>, estimate_type <chr>, estimate_value <chr>,
#> #   additional_name <chr>, additional_level <chr>

CDMConnector::cdmDisconnect(cdm)
# }