as_fhir: Coerce character vector to fhir_bundle_list

View source: R/download_resources.R

as_fhirR Documentation

Coerce character vector to fhir_bundle_list

Description

Tries to convert a character vector containing xml strings representing FHIR bundles to an object of class fhir_bundle_list.

Usage

as_fhir(x)

Arguments

x

A character vector where each element is a string representing an xml FHIR bundle.

Examples


#character vector containing fhir bundles
bundle_strings <- c(
"<Bundle>
 <type value='searchset'/>
 <entry>
  <resource>
    <Patient>
       <id value='id1'/>
	      <name>
	         <given value='Marie'/>
	      </name>
    </Patient>
  </resource>
 </entry>
</Bundle>",
"<Bundle>
 <type value='searchset'/>
 <entry>
  <resource>
    <Patient>
       <id value='id2'/>
	      <name>
	         <given value='Max'/>
	      </name>
    </Patient>
  </resource>
 </entry>
</Bundle>"
)

#convert to FHIR bundle list
bundles <- as_fhir(bundle_strings)


POLAR-fhiR/fhircrackr documentation built on Dec. 24, 2024, 3:06 a.m.