
Compare two codelists
compareCodelists.Rd
Compare two codelists
Examples
# \donttest{
cdm <- mockVocabRef()
#> Warning: There are observation period end dates after the current date: 2025-02-19
#> ℹ The latest max observation period end date found is 2025-12-31
codes1 <- getCandidateCodes(
cdm = cdm,
keywords = "Arthritis",
domains = "Condition",
includeDescendants = TRUE
)
#> Limiting to domains of interest
#> Getting concepts to include
#> Adding descendants
#> Search completed. Finishing up.
#> ✔ 3 candidate concepts identified
#> Time taken: 0 minutes and 0 seconds
codes2 <- getCandidateCodes(
cdm = cdm,
keywords = c("knee osteoarthritis", "arthrosis"),
domains = "Condition",
includeDescendants = TRUE
)
#> Limiting to domains of interest
#> Getting concepts to include
#> Adding descendants
#> Search completed. Finishing up.
#> ✔ 2 candidate concepts identified
#> Time taken: 0 minutes and 0 seconds
compareCodelists(
codelist1 = codes1,
codelist2 = codes2
)
#> # A tibble: 4 × 3
#> concept_id concept_name codelist
#> <int> <chr> <chr>
#> 1 3 Arthritis Only codelist 1
#> 2 4 Osteoarthritis of knee Both
#> 3 5 Osteoarthritis of hip Only codelist 1
#> 4 2 Osteoarthrosis Only codelist 2
# }