Converts a FHIRPath expression into a Spark Column that can be used in DataFrame operations such as filtering and selection. Boolean expressions can be used for filtering, while other expressions can be used for value extraction.
pathling_fhirpath_to_column(pc, resource_type, fhirpath_expression)A Spark Column object (spark_jobj) representing the evaluated expression.
The expression should evaluate to a single value per resource row.
Other context functions:
pathling_evaluate_fhirpath(),
pathling_filter(),
pathling_search_to_column(),
pathling_with_column()
if (FALSE) { # \dontrun{
pc <- pathling_connect()
data_source <- pc %>% pathling_read_ndjson(pathling_examples("ndjson"))
patients <- data_source %>% ds_read("Patient")
# Filter patients using a boolean FHIRPath expression.
filtered <- patients %>%
pathling_filter(pc, "Patient", "gender = 'male'")
# Value expression for selection.
name_col <- pathling_fhirpath_to_column(pc, "Patient", "name.given.first()")
pathling_disconnect(pc)
} # }