# NOT RUN {
#unserialize example
bundles <- fhir_unserialize(bundles = example_bundles1)
#crack fhir resources
table_desc <- fhir_table_description(resource = "Patient",
style = fhir_style(brackets = c("[","]"),
sep = " "))
df <- fhir_crack(bundles = bundles, design = table_desc)
#find all column names associated with attribute address
col_names <- fhir_common_columns(df, "address")
#original data frame
df
#only keep address columns
fhir_melt(indexed_data_frame = df, columns = col_names,
brackets = c("[","]"), sep = " ")
#keep all columns
fhir_melt(indexed_data_frame = df, columns = col_names,
brackets = c("[","]"), sep = " ", all_columns = TRUE)
# }
Run the code above in your browser using DataLab