Merges default app options with the changes made in the UI
Value
list containing the current state of the app including default values from the yaml file as well as any changes made by the user. The list has the following structure:
yaml: Full contents of the supplied yaml file.
MC: Module components of the yaml file.
DM:
isgood: Boolean object indicating if the file was successfully loaded.
checksum: This is an MD5 sum of the contents element and can be used to detect changes in the state.
MOD_TYPE: Character data containing the type of module
"DM"
id: Character data containing the module id module in the session variable.
FM_yaml_file: App configuration file with FM as main section.
MOD_yaml_file: Module configuration file with MC as main section.
Examples
# Within shiny both session and input variables will exist,
# this creates examples here for testing purposes:
sess_res = DM_test_mksession()
#> → ASM: including file
#> → ASM: source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → ASM: dest: file.path("config","report.docx")
#> → ASM: including file
#> → ASM: source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → ASM: dest: file.path("config","report.pptx")
#> → ASM: including file
#> → ASM: source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → ASM: dest: file.path("config","report.yaml")
#> → ASM: State initialized
#> → ASM: setting word placeholders:
#> → ASM: -> setting docx ph: HEADERLEFT = left header
#> → ASM: -> setting docx ph: HEADERRIGHT = right header
#> → ASM: -> setting docx ph: FOOTERLEFT = left footer
#> → ASM: module isgood: TRUE
#> → DM: including file
#> → DM: source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → DM: dest: file.path("config","report.docx")
#> → DM: including file
#> → DM: source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → DM: dest: file.path("config","report.pptx")
#> → DM: including file
#> → DM: source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → DM: dest: file.path("config","report.yaml")
#> → DM: module checksum updated: 441abbd92e02d893eb5136ccdfcc717d
#> → DM: State initialized
#> → DM: ds checksum updated: 641fcbc6616d24d05acded4317a3bb12
#> → DM: module checksum updated: 5c077c5702479f330bf233040eb4a51b
#> → DM: adding preload sources
#> → DM: - file added: TEST_DATA.xlsx
#> → DM: added: TEST_DATA.xlsx
#> → DM: - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_PC.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_PC.csv
#> → DM: - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_EX.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_EX.csv
#> → DM: - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_DM.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_DM.csv
#> → DM: loading element idx: 1
#> → DM: ds checksum updated: 90805ca6c41a39696e1572d9b0a75868
#> → DM: module checksum updated: e23d5c825540acc0ebc26cb74c8b151a
#> → DM: added element idx: 1
#> → DM: loading element idx: 2
#> → DM: ds checksum updated: 6d729365541518fe35f1ca5103b90e4a
#> → DM: module checksum updated: fdec1bbb8935bd96af2bfea1c8262b82
#> → DM: added element idx: 2
#> → DM: loading element idx: 3
#> → DM: ds checksum updated: 6cbb3f2086e69ca2ada5c3f89de40a2d
#> → DM: module checksum updated: 35ecbd8ae888480b51430be8472c5634
#> → DM: added element idx: 3
#> → DM: loading element idx: 4
#> → DM: ds checksum updated: e27dac3a9d571f02035304a3dd82df5e
#> → DM: module checksum updated: 77e9ad3289ee9442fba7e478fc0e7c50
#> → DM: added element idx: 4
#> → DM: module isgood: TRUE
#> → # preload_complete is good: TRUE ------------------------------------------
session = sess_res$session
input = sess_res$input
# Configuration files
FM_yaml_file = system.file(package = "formods", "templates", "formods.yaml")
MOD_yaml_file = system.file(package = "formods", "templates", "DM.yaml")
# Creating an empty state object
state = DM_fetch_state(id = "DM",
input = input,
session = session,
FM_yaml_file = FM_yaml_file,
MOD_yaml_file = MOD_yaml_file,
react_state = NULL)