Unboxing refers to the process of both unmerging a column, either a label or a strip, while also separating rowwise by the `sep` argument. It is meant to isolate the Concept attributes from a merge column while also taking in account that rowwise aggregates may have also occurred, and without separating these values out, some concepts in the source data may be misparsed.
unbox_strip( data, strip_col, sep = "\n", suffix = NULL, prefix = NULL, remove = TRUE, r_trimws = TRUE )
Other concept format functions:
filter_at_all_strip()
,
filter_at_any_strip()
,
filter_strip()
,
get_strip()
,
label_to_strip()
,
merge_label()
,
merge_strip()
,
unbox_label()
,
unmerge_label()
,
unmerge_strip()
Other unboxing functions:
unbox_label()
library(tidyverse) library(chariot) get_strip(concept_id = 1112807, vocab_schema = "omop_vocabulary")#> [2021-05-26 16:07:55] Connected to 'athena' #> [2021-05-26 16:07:55] Loading Cache... #> [2021-05-26 16:07:55] Cached SQL: SELECT * FROM omop_vocabulary.concept c WHERE c.concept_id IN (1112807) #> [2021-05-26 16:07:55] Cached resultset found... #> [2021-05-26 16:07:55] Postgres connection to 'athena' closed#> [1] "[V] [S] 1112807 aspirin [RxNorm 1191] [Drug] [Ingredient]"test_strip <- tibble::tibble(concept = "[V] [S] 1112807 aspirin [RxNorm 1191] [Drug] [Ingredient]") unmerge_strip(test_strip, strip_col = concept)#> # A tibble: 1 x 8 #> concept_id concept_name domain_id vocabulary_id concept_class_id #> <chr> <chr> <chr> <chr> <chr> #> 1 1112807 aspirin Drug RxNorm Ingredient #> # … with 3 more variables: standard_concept <chr>, concept_code <chr>, #> # invalid_reason <chr>unbox_strip(test_strip, strip_col = concept)#> # A tibble: 1 x 8 #> concept_id concept_name domain_id vocabulary_id concept_class_id #> <chr> <chr> <chr> <chr> <chr> #> 1 1112807 aspirin Drug RxNorm Ingredient #> # … with 3 more variables: standard_concept <chr>, concept_code <chr>, #> # invalid_reason <chr>test_strip <- tibble::tibble(concept = "[V] [S] 1112807 aspirin [RxNorm 1191] [Drug] [Ingredient]\n[V] [S] 1112807 aspirin [RxNorm 1191] [Drug] [Ingredient]") unbox_strip(test_strip, strip_col = concept)#> # A tibble: 2 x 8 #> concept_id concept_name domain_id vocabulary_id concept_class_id #> <chr> <chr> <chr> <chr> <chr> #> 1 1112807 aspirin Drug RxNorm Ingredient #> 2 1112807 aspirin Drug RxNorm Ingredient #> # … with 3 more variables: standard_concept <chr>, concept_code <chr>, #> # invalid_reason <chr>