knitr::opts_chunk$set(echo = TRUE)
library(epiuf)
# create model action sheet
InfoSource <- "list(\"0\" = \"vacccard\",\"1\" = \"registry\",\"2\" = \"hospnotes\",\"3\" = \"gpnotes\",\"4\" = \"pharmnotes\",\"5\" = \"patient\",\"6\" = \"family\",\"7\" = \"dnk\",\"9\" = \"oth\",\"10\" = \"insurance\")"

actiondf <- data.frame(variable = c("Vaccs1", "Vaccs2")
                                  ,action_group = c("expand", "expand")
                      ,parameters = c(InfoSource))

# Create epiDictionaryFiles environement used to manage dictionary values
epidictionaryfiles_env <- new.env(parent = emptyenv())

# assign action sheet
epidictionaryfiles_env$actions <- actiondf

# Create test data
df <- data.frame(Id = 1:3 ,
                Vaccs1 = c("1|2|3", "5", "6|1")
                ,Vaccs2 = c("7|4", "2", "1|8")
                )

Testing set up to retrieve action dictionary - this is currently not working thus cannot test function

getDictionaryActions()

getVarActionParameters("Vaccs1", "expand")

getActionGroup("expand")

Test function

# 
# df <- expandVarAll(df)
# head(df)


Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.