as_fhir {fhircrackr}R 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)


[Package fhircrackr version 2.2.0 Index]