fhir_load_design: Load design from xml

fhir_load_designR Documentation

Load design from xml

Description

Loads a fhir_design for use with fhir_crack() from an xml file into R.

Usage

fhir_load_design(file)

Arguments

file

A string specifying the file from which to read.

Value

A fhir_design object. See ?fhir_design.

See Also

fhir_design(), fhir_table_description(), fhir_save_design()

Examples


table_desc1 <- fhir_table_description(
    resource = 'Patient',
    cols     = c(
        id     = 'id',
        name   = 'name/family',
        gender = 'gender'
    ),
    sep           = ':::',
    brackets      = c('[', ']'),
    rm_empty_cols = FALSE,
    format        = 'compact',
    keep_attr     = FALSE
)

table_desc2 <- fhir_table_description(
    resource = 'Observation',
    cols     = c(
        'code/coding/system',
        'code/coding/code'
    )
)

design <- fhir_design(
    Patients     = table_desc1,
    Observations = table_desc2
)
temp <- tempfile()

fhir_save_design(design = design, file = temp)

design <- fhir_load_design(file = temp)


fhircrackr documentation built on Feb. 16, 2023, 8:33 p.m.