Takes a Coding column as its input. Returns a Column that contains the values of properties for this coding with specified names and types. The type of the result column depends on the types of the properties. Primitive FHIR types are mapped to their corresponding SQL primitives. Complex types are mapped to their corresponding structs.
tx_property_of(
coding,
property_code,
property_type = "string",
accept_language = NULL
)
A Column containing a struct representation of a Coding.
The code of the property to retrieve.
The type of the property to retrieve.
The optional language preferences for the returned property values. Overrides the parameter `accept_language` in `PathlingContext.create`.
The Column containing the result of the operation (array of property values).
Pathling documentation - Retrieving properties
Other terminology functions:
tx_display()
,
tx_member_of()
,
tx_subsumed_by()
,
tx_subsumes()
,
tx_translate()
pc <- pathling_connect()
# Get the (first) value of the `inactive` property of the first coding of the Condition resource.
pc %>% pathling_example_resource('Condition') %>%
sparklyr::mutate(id,
is_inavtive = (!!tx_property_of(code[['coding']][[0]],
"inactive",PropertyType$BOOLEAN))[[0]],
.keep='none'
)
#> # Source: SQL [?? x 2]
#> # Database: spark_connection
#> id is_inavtive
#> <chr> <lgl>
#> 1 c879c300-7fdf-4b53-aa6a-a2b4a266b30c FALSE
#> 2 bb9c4fc1-795a-4492-b065-1f497fe18bb2 FALSE
#> 3 e620d7ee-6cfe-4f04-ba06-1d0b39f7624d FALSE
#> 4 0447de38-1f2a-411c-9fd2-a9c62ab1f221 FALSE
#> 5 4025ceb3-04a6-41fb-8569-16a8dcce7ccc TRUE
#> 6 7ed34fb1-0bbf-4c41-a101-1316ec483aa7 FALSE
#> 7 5ef84858-0480-4a34-8f43-fc962fe627b2 FALSE
#> 8 5378726d-7f2b-4c83-9762-eaf385915fa7 FALSE
#> 9 31393667-dd7f-4c94-90c3-6cde75c67d3e FALSE
#> 10 6464e20b-55ec-4685-be3e-55bc3b9602d4 FALSE
#> # ℹ more rows
pathling_disconnect(pc)