Converts a FHIR search query string into a Spark Column representing a boolean filter condition.
The returned Column can be used with sparklyr DataFrame operations such as sdf_filter to
filter resources matching the search criteria.
pc_search_to_column(pc, resource_type, search_expression)A Spark Column object (spark_jobj) representing the boolean filter condition.
Other context functions:
pathling_filter(),
pathling_with_column(),
pc_fhirpath_to_column()
if (FALSE) { # \dontrun{
pc <- pathling_connect()
data_source <- pc %>% pathling_read_ndjson(pathling_examples("ndjson"))
patients <- data_source %>% ds_read("Patient")
# Filter patients by gender.
gender_filter <- pc_search_to_column(pc, "Patient", "gender=male")
filtered <- sparklyr::spark_dataframe(patients) %>%
sparklyr::j_invoke("filter", gender_filter) %>%
sparklyr::sdf_register()
# Multiple search parameters (AND).
combined_filter <- pc_search_to_column(pc, "Patient", "gender=male&active=true")
pathling_disconnect(pc)
} # }