fhir_is_empty | R Documentation |
Checks if a fhir_bundle_xml or fhir_bundle_list is empty, i.e. does not contain any resources.
fhir_is_empty(bundles)
## S4 method for signature 'fhir_bundle_list'
fhir_is_empty(bundles)
## S4 method for signature 'fhir_bundle_xml'
fhir_is_empty(bundles)
bundles |
A FHIR search result as returned by |
Empty bundles are returned when a search on a FHIR server does not yield any resources, such as when no resources on the server match the specified search criteria. In this case, the server responds with an empty searchset bundle. This function checks whether:
For objects of type fhir_bundle_xml, the bundle contains at least one "entry" element
(if not, the bundle is empty and the functions returns TRUE
)
For objects of type fhir_bundle_list, the first bundle in the list contains at least one "entry" element
(if not, the bundle is empty and the functions returns TRUE
)
TRUE
if the bundle/bundle list is empty, FALSE
if it is not empty.
#Load empty example bundles
bundles <- fhir_unserialize(example_bundles_empty)
bundles
fhir_is_empty(bundles)
#Load non-empty example bundles
bundles <- fhir_unserialize(patient_bundles)
bundles
fhir_is_empty(bundles)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.