Skip to contents

adds \_name based on \_concept_id e.g. drug_concept_id to get drug_name etc.

Usage

omop_join_name_all(df, columns = c("concept_name"))

ojoinall(df, columns = c("concept_name"))

Arguments

df

dataframe, or a list of multiple dataframes

columns

which columns from omop concept table to join on. Option of "all", default=c("concept_name"), e.g. c("concept_name","domain_id")

Value

dataframe based on input df with 1 extra column added for each concept_id column, or a list of multiple dataframes

Examples

data.frame(concept_id=(c(3571338L,3655355L)),
           drug_concept_id=(c(4000794L,35628998L))) |>
           omop_join_name_all()
#> # A tibble: 2 × 4
#>   concept_id concept_name         drug_concept_id drug_concept_name             
#>        <int> <chr>                          <int> <chr>                         
#> 1    3571338 Problem behaviour            4000794 BUZZ OFF                      
#> 2    3655355 Erectile dysfunction        35628998 Retired SNOMED UK Drug extens…
data.frame(domain_concept_id_1=(c(3571338L,3655355L))) |> omop_join_name_all()
#> # A tibble: 2 × 2
#>   domain_concept_id_1 domain_concept_name_1
#>                 <int> <chr>                
#> 1             3571338 Problem behaviour    
#> 2             3655355 Erectile dysfunction 
#examples commented for now mostly to speed package build
#data.frame(route_concept_id=(c(4132161L,  4171047L)),
#          drug_concept_id=(c(1550560L,  35780880L))) |>
#          omop_join_name_all()
#df2 <- drug_exposure |>
#       head(100)) |>
#       omop_join_name_all()
#df3 <- omop_concept_relationship() |> head() |>
#          dplyr::collect() |> omop_join_name_all()
# multiple tables in a list
#df4 <- data.frame(concept_id=(c(3571338L,3655355L)))
#list1 <- list(df4,df4)
#list2 <- list1 |> omop_join_name_all(columns="all")
data.frame(concept_id=(c(3571338L,3655355L)),
           drug_concept_id=(c(4000794L,35628998L))) |>
           ojoinall()
#> # A tibble: 2 × 4
#>   concept_id concept_name         drug_concept_id drug_concept_name             
#>        <int> <chr>                          <int> <chr>                         
#> 1    3571338 Problem behaviour            4000794 BUZZ OFF                      
#> 2    3655355 Erectile dysfunction        35628998 Retired SNOMED UK Drug extens…