fhir_save_design: Write design to xml

View source: R/design.R

fhir_save_designR Documentation

Write design to xml

Description

Writes a fhir_design for use with fhir_crack() to an xml file.

Usage

fhir_save_design(design, file = "design.xml")

Arguments

design

A fhir_design object. See fhir_design().

file

A string specifying the file to write to, defaults to writing 'design.xml' into the current working directory.

See Also

fhir_design(), fhir_table_description(), fhir_load_design()

Examples

#create and save design
table_desc1 <- fhir_table_description(
    resource = 'Patient',
    cols     = c(
        id     = 'id',           # column names with xpaths
        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', # only xpaths
        'code/coding/code'
    )
)

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

fhir_save_design(design = design, file = tempfile())

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