| pathling_fhirpath_to_column | R Documentation |
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)
pc |
The PathlingContext object. |
resource_type |
A string containing the FHIR resource type code (e.g., "Patient", "Observation"). |
fhirpath_expression |
A FHIRPath expression to evaluate (e.g., "gender = 'male'", "name.given.first()"). |
The expression should evaluate to a single value per resource row.
A Spark Column object (spark_jobj) representing the evaluated expression.
Other context functions:
pathling_evaluate_fhirpath(),
pathling_filter(),
pathling_search_to_column(),
pathling_with_column()
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.