join omop concept names onto all *_concept_id columns in a dataframe
Source:R/omop_join_name.R
omop_join_name_all.Rd
adds \_name based on \_concept_id e.g. drug_concept_id to get drug_name etc.
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…