Skip to contents

string search of concept_name in omop concepts table

super short name func to search concepts by concept_name

Usage

omop_names(
  findstring,
  ignore_case = TRUE,
  exact = FALSE,
  fixed = FALSE,
  c_ids = NULL,
  d_ids = NULL,
  v_ids = NULL,
  cc_ids = NULL,
  standard = NULL,
  messages = TRUE
)

onames(
  findstring,
  ignore_case = TRUE,
  exact = FALSE,
  fixed = FALSE,
  c_ids = NULL,
  d_ids = NULL,
  v_ids = NULL,
  cc_ids = NULL,
  standard = NULL,
  messages = TRUE
)

Arguments

findstring

to search for or regex, e.g. "^a" to find those starting with A

ignore_case

ignore case in string comparison, default TRUE

exact

TRUE for exact string search, "start" for exact start, "end" for exact end, default=FALSE for str_detect

fixed

default FALSE allows regex,TRUE uses grepl exact matching

c_ids

one or more concept_id to filter by, default NULL for all

d_ids

one or more domain_id to filter by, default NULL for all

v_ids

one or more vocabulary_id to filter by, default NULL for all

cc_ids

one or more concept_class_id to filter by, default NULL for all

standard

one or more standard_concept to filter by, default NULL for all, S,C

messages

whether to print info messages, default=TRUE

Examples

omop_names("AJCC/UICC Stage")
#> returning 36 concepts
#> # A tibble: 36 × 10
#>    concept_id concept_name        domain_id   vocabulary_id   concept_class_id
#>         <int> <chr>               <chr>       <chr>           <chr>           
#>  1    1633754 AJCC/UICC Stage 0   Measurement Cancer Modifier Staging/Grading 
#>  2    1635410 AJCC/UICC Stage 0a  Measurement Cancer Modifier Staging/Grading 
#>  3    1634049 AJCC/UICC Stage 0is Measurement Cancer Modifier Staging/Grading 
#>  4    1633306 AJCC/UICC Stage 1   Measurement Cancer Modifier Staging/Grading 
#>  5    1635790 AJCC/UICC Stage 1A  Measurement Cancer Modifier Staging/Grading 
#>  6    1633565 AJCC/UICC Stage 1A1 Measurement Cancer Modifier Staging/Grading 
#>  7    1635611 AJCC/UICC Stage 1A2 Measurement Cancer Modifier Staging/Grading 
#>  8    1634353 AJCC/UICC Stage 1A3 Measurement Cancer Modifier Staging/Grading 
#>  9    1634494 AJCC/UICC Stage 1B  Measurement Cancer Modifier Staging/Grading 
#> 10    1634019 AJCC/UICC Stage 1B1 Measurement Cancer Modifier Staging/Grading 
#> # ℹ 26 more rows
#> # ℹ 5 more variables: standard_concept <chr>, concept_code <chr>,
#> #   valid_start_date <date>, valid_end_date <date>, invalid_reason <chr>
#omop_names("chemotherapy", v_ids="LOINC")
#omop_names("chemotherapy", v_ids=c("LOINC","SNOMED"), d_ids=c("Observation","Procedure"))
#set the findstring to "" to get all rows satisfying the other conditions
#omop_names("", v_ids="Gender")
#omop_names("", d_ids="Type Concept", standard="S")
#exact= options
#t1 <- onames("tobacco")
#returning 616 concepts
#t2 <- onames("tobacco",exact=TRUE)
#returning 2 concepts
#t3 <- onames("tobacco",exact="start")
#returning 229 concepts
#t4 <- onames("tobacco",exact="end")
#returning 54 concepts
# onames("chemotherapy", v_ids="LOINC")
# because of R argument matching, you can just use the first unique letters of
# arguments e.g. v for v_ids, cc for cc_ids
# to get all clinical drugs starting with A
onames("^a", d="DRUG", v="SNOMED", cc="Clinical Drug")
#> returning 1168 concepts
#> # A tibble: 1,168 × 10
#>    concept_id concept_name              domain_id vocabulary_id concept_class_id
#>         <int> <chr>                     <chr>     <chr>         <chr>           
#>  1   37151230 Azithromycin 20 mg/mL or… Drug      SNOMED        Clinical Drug   
#>  2   37151437 Alprazolam 1 mg prolonge… Drug      SNOMED        Clinical Drug   
#>  3   37151438 Alprazolam 500 microgram… Drug      SNOMED        Clinical Drug   
#>  4   37151439 Alprazolam 250 microgram… Drug      SNOMED        Clinical Drug   
#>  5   37151466 Aztreonam (as aztreonam … Drug      SNOMED        Clinical Drug   
#>  6   37151561 Amitriptyline (as amitri… Drug      SNOMED        Clinical Drug   
#>  7   37151626 Ampicillin (as ampicilli… Drug      SNOMED        Clinical Drug   
#>  8   37151790 Acyclovir 50 mg/g and hy… Drug      SNOMED        Clinical Drug   
#>  9   37151862 Azithromycin 10 mg/mL ey… Drug      SNOMED        Clinical Drug   
#> 10   37151871 Ampicillin (as ampicilli… Drug      SNOMED        Clinical Drug   
#> # ℹ 1,158 more rows
#> # ℹ 5 more variables: standard_concept <chr>, concept_code <chr>,
#> #   valid_start_date <date>, valid_end_date <date>, invalid_reason <chr>
# to get all 'chop' cancer regimens
#chops <- onames("chop", d="Regimen")