pathling_search_to_column: Convert a FHIR search expression to a Spark Column

View source: R/context.R

pathling_search_to_columnR Documentation

Convert a FHIR search expression to a Spark Column

Description

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.

Usage

pathling_search_to_column(pc, resource_type, search_expression)

Arguments

pc

The PathlingContext object.

resource_type

A string containing the FHIR resource type code (e.g., "Patient", "Observation").

search_expression

A FHIR search query string in URL query format (e.g., "gender=male&birthdate=ge1990-01-01"). An empty string matches all resources.

Value

A Spark Column object (spark_jobj) representing the boolean filter condition.

See Also

Other context functions: pathling_evaluate_fhirpath(), pathling_fhirpath_to_column(), pathling_filter(), pathling_with_column()

Examples

## Not run: 
pc <- pathling_connect()
data_source <- pc %>% pathling_read_ndjson(pathling_examples("ndjson"))
patients <- data_source %>% ds_read("Patient")

# Filter patients by gender.
filtered <- patients %>%
  pathling_filter(pc, "Patient", "gender=male", type = "search")

# Multiple search parameters (AND).
filtered <- patients %>%
  pathling_filter(pc, "Patient", "gender=male&active=true", type = "search")

pathling_disconnect(pc)

## End(Not run)

pathling documentation built on June 3, 2026, 9:08 a.m.