Converts a Column containing codes into a Column that contains a SNOMED Coding struct.
tx_to_snomed_coding(coding_column, version = NULL)
The Column containing the codes.
The version of the code system.
A Column containing a Coding struct.
The Coding struct Column can be used as an input to terminology functions such as
tx_member_of
and tx_translate
. Please note that inside
sparklyr
verbs such as mutate
the functions calls need to be preceded with
!!
, e.g: !!tx_to_coding(CODE, SNOMED_URI)
.
Other terminology helpers:
tx_to_coding()
,
tx_to_ecl_value_set()
,
tx_to_loinc_coding()
pc <- pathling_connect()
condition_df <- pathling_spark(pc) %>% sparklyr::copy_to(conditions)
# Convert codes to SNOMED CT codings.
# Equivalent to: tx_to_coding(CODE, "http://snomed.info/sct")
condition_df %>% sparklyr::mutate(snomedCoding = !!tx_to_snomed_coding(CODE), .keep = 'none')
#> # Source: SQL [?? x 1]
#> # Database: spark_connection
#> snomedCoding
#> <list>
#> 1 <named list [2]>
#> 2 <named list [2]>
#> 3 <named list [2]>
#> 4 <named list [2]>
#> 5 <named list [2]>
#> 6 <named list [2]>
#> 7 <named list [2]>
#> 8 <named list [2]>
#> 9 <named list [2]>
#> 10 <named list [2]>
#> # ℹ more rows
pathling_disconnect(pc)