fhir_style: Create fhir_style object

View source: R/fhir_style.R

fhir_styleR Documentation

Create fhir_style object

Description

[Deprecated] This function was used to create an object of class fhir_style in fhircrackr < 2.0.0. It is now deprecated, the information that used to be coded in fhir_style has been moved to the fhir_table_description.

Usage

fhir_style(sep = ":::", brackets = character(), rm_empty_cols = FALSE)

Arguments

sep

A character vector of length one to separate pasted multiple entries. Defaults to ":::"

brackets

A character vector of length two defining the brackets surrounding indices for multiple entries, e.g. c("<|", "|>"). If this is empty (i.e. character of length zero, the default) or 'NULL', no indices will be added to multiple entries. If it is a character vector of length one, it will be recycled to length two, i.e. "|" will become c("|", "|"). Empty strings ("") are not allowed.

rm_empty_cols

A logical vector of length one. Remove empty columns? Defaults to FALSE.

Details

A fhir_style object is part of a fhir_table_description which in turn is part of a fhir_design and ultimately used in fhir_crack(). A fhir_style object contains three elements:

  • sep: A string defining the separator used to separate multiple entries for the same element in a FHIR resource, e.g. multiple address/city elements in a Patient resource.

  • brackets: A character vector of length two defining the brackets surrounding indices for multiple entries, e.g. c("<|", "|>"). If this is empty (i.e. character of length 0, the default), no indices will be added to multiple entries. Empty strings ("") are not allowed.

  • rm_empty_cols: A logical scalar defining whether or not to remove empty columns after cracking. Empty columns arise when you try to extract an element that doesn't appear in any of the resources. A fhir_style object looks for example like this:

sep: ':::'
brackets: '<|' '|>'
rm_empty_cols: FALSE

Value

A fhir_style object

Examples


#instead of this:

style <- fhir_style(sep           = ":::",
                    brackets      = c("<|", "|>"),
                    rm_empty_cols = TRUE)

table_description <- fhir_table_description(
                        resource = "Patient",
                        style = style)
#use this:
table_description <- fhir_table_description(
                        resource       = "Patient",
                        sep            = ":::",
                        brackets       = c("<|", "|>"),
                         rm_empty_cols = TRUE)


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