For this vignette we are going to create codelists for identifying a acetaminophen, looking in the drug domain.
# postgres database connection details
serverDbi <- Sys.getenv("server")
user <- Sys.getenv("user")
password <- Sys.getenv("password")
port <- Sys.getenv("port")
host <- Sys.getenv("host")
db <- DBI::dbConnect(RPostgres::Postgres(),
dbname = serverDbi,
port = port,
host = host,
user = user,
password = password
)
# name of vocabulary schema
vocabularyDatabaseSchema <- "vocabulary"
First we can follow the approach of identifying high-level codes and include all their descendants.
acetaminophen1 <- getCandidateCodes(
cdm = cdm,
keywords = "acetaminophen",
domains = "drug",
standardConcept = "standard",
includeDescendants = TRUE
)
acetaminophen1 %>% dplyr::glimpse()
#> Rows: 22,782
#> Columns: 15
#> $ concept_id <int> 587290, 587473, 587705, 587929, 588401, 58…
#> $ concept_name <chr> "Acetaminophen 0.0501 MG/MG / Antipyrine 0…
#> $ domain_id <chr> "drug", "drug", "drug", "drug", "drug", "d…
#> $ concept_class_id <chr> "clinical drug", "branded drug", "branded …
#> $ vocabulary_id <chr> "rxnorm extension", "rxnorm extension", "r…
#> $ found_from <chr> "From initial search", "From initial searc…
#> $ ingredient_concept_id <int> 1134439, 1134439, 1036059, 1135766, 113576…
#> $ amount_value <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
#> $ amount_unit_concept_id <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
#> $ numerator_value <dbl> 1.25e-02, 1.25e-02, 7.49e-02, 7.42e-03, 6.…
#> $ numerator_unit_concept_id <int> 8576, 8576, 8576, 8576, 8576, 8576, 8576, …
#> $ denominator_value <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
#> $ denominator_unit_concept_id <int> 8576, 8576, 8576, 8576, 8576, 8576, 8576, …
#> $ box_size <int> NA, NA, 100, 10, NA, 100, 5, NA, 5, 10, NA…
#> $ dose_form <chr> "Oral Solution", "Oral Solution", "Oral So…