View source: R/build_resources.R
| fhir_build_resource | R Documentation | 
This function takes a single row from a wide table as produced by fhir_crack() and builds a fhir_resource_xml object from it. The column names of the table
must represent the XPath expression of the respective element with indices for repeating items. A table like this is produced when FHIR resources have
been cracked with fhir_crack() without assigning explicit column names in the fhir_design/fhir_table_description and with format set to "wide".
fhir_build_resource(row, brackets, resource_type)
| row | Single row from a wide table as produced by  | 
| brackets | A character vector of length one. The brackets used for cracking. | 
| resource_type | A character vector of length one or fhir_resource_type object indicating which resource type the table is build from. | 
A fhir_resource_xml object.
fhir_cast(), fhir_crack(), fhir_build_bundle(), fhir_post(), fhir_put()
#unserialize example
bundles <- fhir_unserialize(bundles = example_bundles1)
#crack fhir resources
Pat <- fhir_table_description(
    resource = "Patient",
    brackets = c("[", "]"),
    sep      = " ",
    format   = "wide"
)
df <- fhir_crack(bundles = bundles, design = Pat)
#build resource
resource <- fhir_build_resource(
                row           = df[1,],
                brackets      = c('[', ']'),
                resource_type = "Patient"
            )
#print to console
resource
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.