# \donttest{
#the try({}, silent = TRUE) statement is only there to catch errors when the server is down
#you can skip it when the server is reachable
try({
#find IDs of all resources representing Homer Simpson
ids <- fhir_get_resource_ids(
base_url = 'https://hapi.fhir.org/baseR4',
resource = "Patient",
parameters = "name=Homer&name=Simpson")
#Sample 10 of them
bundles <- fhir_sample_resources_by_ids(
base_url = 'https://hapi.fhir.org/baseR4',
resource = "Patient",
ids = ids,
sample_size = 10,
seed = 1)
#Have a look at the samples
fhir_crack(
bundles,
fhir_table_description(
resource = "Patient",
cols = list(
ID = "id",
given = "name/given",
family = "name/family")))
}, silent = TRUE)
# }
Run the code above in your browser using DataLab