Creates a data source from a directory containing NDJSON files. The files must be named with the resource type code and must have the ".ndjson" extension, e.g. "Patient.ndjson" or "Observation.ndjson".

pathling_read_ndjson(pc, path, extension = "ndjson", file_name_mapper = NULL)

Arguments

pc

The PathlingContext object.

path

The URI of the directory containing the NDJSON files.

extension

The file extension to use when searching for files. Defaults to "ndjson".

file_name_mapper

An optional function that maps a filename to the set of resource types that it contains. Currently not implemented.

Value

A DataSource object that can be used to run queries against the data.

Examples

pc <- pathling_connect()
data_source <- pc %>% pathling_read_ndjson(pathling_examples('ndjson'))
data_source %>% ds_read('Patient') %>% sparklyr::sdf_nrow()
#> [1] 9
pathling_disconnect(pc)