
Use achilles counts to filter a codelist to keep only the codes used in the database
subsetToCodesInUse.Rd
Use achilles counts to filter a codelist to keep only the codes used in the database
Usage
subsetToCodesInUse(
x,
cdm,
minimumCount = 0L,
table = c("condition_occurrence", "device_exposure", "drug_exposure", "measurement",
"observation", "procedure_occurrence", "visit_occurrence")
)
Examples
# \donttest{
cdm <- mockVocabRef("database")
#> 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
#> 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
codes <- getCandidateCodes(cdm = cdm,
keywords = "arthritis",
domains = "Condition",
includeDescendants = FALSE)
#> Limiting to domains of interest
#> Getting concepts to include
#> Search completed. Finishing up.
#> ✔ 3 candidate concepts identified
#> Time taken: 0 minutes and 0 seconds
x <- subsetToCodesInUse(list("cs1" = codes$concept_id,
"cs2" = 999),
cdm = cdm)
#> No codes from codelist cs2 found in the database
x
#> $cs1
#> [1] 4 5
#>
CDMConnector::cdmDisconnect(cdm)
# }