Returns a codelist with clinical codes that match the provided description pattern.
Arguments
- pattern
The description to search for. See
stringr::str_detect()for details.- type
character. Type of clinical code system to be searched. Optional if input is a data frame with code_type column. Depends on what is available in the lookup tables. See
add_lookup_table()on how to add new lookup tables. This can also be configured through thecodeminer.code_typeoption.- lookup_version
character. Version of the lookup table to use. Default:
"latest". Can be configured through thecodeminer.lookup_versionoption.- ignore_case
If
TRUE(default), ignore case indescription.- preferred_description_only
logical. IfTRUE(default), return only preferred descriptions.- col_filters
Column filters to apply. See
CODES()for details.
Examples
# build dummy database
create_dummy_database()
#> ✔ Dummy database ready to use!
#> ℹ To reconnect to your previous database:
#> `Sys.setenv(CODEMINER_DB_PATH = "/tmp/RtmpXyzdMY/file19d42b2b31a3.duckdb")`
#> `codeminer_connect()`
# lookup ICD10 code descriptions matching 'cyst'
DESCRIPTION("cyst", type = "ICD-10")
#> ℹ Using 'UKB v4' as latest version
#> <codeminer_codelist>: 2 codes
#> Code type: "ICD-10"
#>
#> # A tibble: 2 × 3
#> code description code_type
#> <chr> <chr> <chr>
#> 1 L721 Trichilemmal cyst ICD-10
#> 2 N330 Tuberculous cystitis ICD-10