fhir_is_empty {fhircrackr}R Documentation

Check if Bundle/Bundlelist is empty

Description

Checks if a fhir_bundle_xml or fhir_bundle_list is empty, i.e. does not contain any resources.

Usage

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)

Arguments

bundles

A FHIR search result as returned by fhir_search()

Details

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:

Value

TRUE if the bundle/bundle list is empty, FALSE if it is not empty.

Examples

#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)


[Package fhircrackr version 2.3.0 Index]