# \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({
#how many resources are on the server?
count <- fhir_count_resource(
base_url = 'https://hapi.fhir.org/baseR4',
resource = "Patient",
parameters = "gender=female")
#randomly sample 30 of them
bundles <- fhir_sample_resources(
base_url = 'https://hapi.fhir.org/baseR4',
resource = "Patient",
parameters = "gender=female",
sample_size = 30,
seed = 1)
bundles
}, silent = TRUE)
# }
Run the code above in your browser using DataLab