# NOT RUN {
bundle <- xml2::read_xml(
"<Bundle>
<Patient>
<id value='id1'/>
<address>
<use value='home'/>
<city value='Amsterdam'/>
<type value='physical'/>
<country value='Netherlands'/>
</address>
<birthDate value='1992-02-06'/>
</Patient>
<Patient>
<id value='id2'/>
<address>
<use value='home'/>
<city value='Rome'/>
<type value='physical'/>
<country value='Italy'/>
</address>
<address>
<use value='work'/>
<city value='Stockholm'/>
<type value='postal'/>
<country value='Sweden'/>
</address>
<birthDate value='1980-05-23'/>
</Patient>
</Bundle>"
)
dfs <- fhir_crack(bundles = list(bundle),
design = list(Patients = list(resource = "/Bundle/Patient")),
brackets = c("[", "]"),verbose = 2)
df_indices_removed <- fhir_rm_indices(dfs[[1]], brackets=c("[", "]"))
# }
Run the code above in your browser using DataLab