# \donttest{
library(CodelistGenerator)
library(omock)
# Create CDM object
cdm <- mockCdmReference()
# Create a codelist with 1st level ATC codes available in the CDM
codelist <- getATCCodes(cdm = cdm,
level = "ATC 1st")
codelist
# Tune the name of the generated codelists
codelist <- getATCCodes(cdm = cdm,
level = "ATC 1st",
nameStyle = "{concept_name}_{concept_code}")
codelist
# Search for a specific ATC name of interest
codelist <- getATCCodes(cdm = cdm,
level = "ATC 2nd",
name = "immunostimulants")
codelist
# Restrict concepts to specific dose forms, dose units, or route categories.
# Remember that you can use `availableDoseForm()`, `availableDoseUnit()` and
# `availableRouteCategory()` to explore your codelist.
codelist <- getATCCodes(cdm = cdm,
level = "ATC 2nd",
doseForm = NULL,
doseUnit = NULL,
routeCategory = NULL,)
codelist
# You can also create directly a codelist_with_details using the argument `type`
codelist <- getATCCodes(cdm = cdm,
level = "ATC 1st",
type = "codelist_with_details")
codelist
# }
Run the code above in your browser using DataLab