pathling_read_bulk | R Documentation |
Creates a data source by downloading data from a FHIR server that implements the FHIR Bulk Data Access API.
pathling_read_bulk(
pc,
fhir_endpoint_url,
output_dir,
group_id = NULL,
patients = NULL,
types = NULL,
output_format = "application/fhir+ndjson",
since = NULL,
elements = NULL,
type_filters = NULL,
include_associated_data = NULL,
output_extension = "ndjson",
timeout = NULL,
max_concurrent_downloads = 10,
auth_config = NULL
)
pc |
The PathlingContext object. |
fhir_endpoint_url |
The URL of the FHIR server to export from. |
output_dir |
The directory to write the output files to. |
group_id |
Optional group ID for group-level export. |
patients |
Optional list of patient IDs for patient-level export. |
types |
List of FHIR resource types to include. |
output_format |
The format of the output data. Defaults to "application/fhir+ndjson". |
since |
Only include resources modified after this timestamp. |
elements |
List of FHIR elements to include. |
type_filters |
FHIR search queries to filter resources. |
include_associated_data |
Pre-defined set of FHIR resources to include. |
output_extension |
File extension for output files. Defaults to "ndjson". |
timeout |
Optional timeout duration in seconds. |
max_concurrent_downloads |
Maximum number of concurrent downloads. Defaults to 10. |
auth_config |
Optional authentication configuration list with the following possible elements:
|
A DataSource object that can be used to run queries against the data.
Pathling documentation - Reading from Bulk Data API
Other data source functions:
pathling_read_bundles()
,
pathling_read_datasets()
,
pathling_read_delta()
,
pathling_read_ndjson()
,
pathling_read_parquet()
,
pathling_read_tables()
## Not run:
pc <- pathling_connect()
# Basic system-level export
data_source <- pc %>% pathling_read_bulk(
fhir_endpoint_url = "https://bulk-data.smarthealthit.org/fhir",
output_dir = "/tmp/bulk_export"
)
# Group-level export with filters
data_source <- pc %>% pathling_read_bulk(
fhir_endpoint_url = "https://bulk-data.smarthealthit.org/fhir",
output_dir = "/tmp/bulk_export",
group_id = "group-1",
types = c("Patient", "Observation"),
elements = c("id", "status"),
since = as.POSIXct("2023-01-01")
)
# Patient-level export with auth
data_source <- pc %>% pathling_read_bulk(
fhir_endpoint_url = "https://bulk-data.smarthealthit.org/fhir",
output_dir = "/tmp/bulk_export",
patients = c(
"123", # Just the ID portion
"456"
),
auth_config = list(
enabled = TRUE,
client_id = "my-client-id",
private_key_jwk = '{ "kty":"RSA", ...}',
scope = "system/*.read"
)
)
pathling_disconnect(pc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.