fhir_table_description-class {fhircrackr}R Documentation

A S4 class describing the form of a table produced by fhir_crack()

Description

A fhir_table_description holds the information fhir_crack() needs to flatten (aka crack) FHIR resources from a FHIR bundle and is created with its constructor function fhir_table_description(). Each fhir_table_description describes a table for a specific resource type as fhir_crack() will create one data.frame/data.table per resource type. See Details.

Details

A fhir_table_description consists of the following elements:

A full fhir_table_description looks for example like this:

fhir_resource_type: Patient

fhir_columns:
column name | xpath expression
------------------------
name        | name/family
gender      | gender
id          | id

sep:           ':::'
brackets:      '[', ']'
rm_empty_cols: FALSE
format:        'compact'
keep_attr:     FALSE

Slots

resource

An object of class fhir_resource_type defining the resource type that should be extracted.

cols

An object of class fhir_columns describing which columns should be created and how. If this is an empty fhir_columns object, the call to fhir_crack() will extract all available elements and put them in automatically named columns.

sep

A character of length one containing the separator string used for separating multiple entries in cells when format = "compact". ignored when format = "wide".

brackets

A character of length one or two used for the indices of multiple entries. The first one is the opening bracket and the second one the closing bracket. Vectors of length one will be recycled. Defaults to character(0), i.e. no brackets, meaning that multiple entries won't be indexed.

rm_empty_cols

A logical of length one indicating whether empty columns should be removed from the resulting table or not. Defaults to FALSE.

format

A character of length one indicating whether the resulting table should be cracked to a wide or compact format. wide means multiple entries will be distributed over several columns with indexed names. compact means multiple entries will be pasted into one cell/column separated by sep . Defaults to compact.

keep_attr

A logical of length one indicating whether the attribute name of the respective element (⁠@value⁠ in most cases) should be attached to the name of the variable in the resulting table. Defaults to FALSE

See Also

fhir_resource_type(),fhir_columns(), fhir_design(), fhir_crack()


[Package fhircrackr version 2.2.0 Index]