-
Notifications
You must be signed in to change notification settings - Fork 8
/
Metabase Pre-Shiny Setup.R
39 lines (31 loc) · 1.37 KB
/
Metabase Pre-Shiny Setup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
r_variables_names <- readxl::read_excel("shiny_metadata.xlsx")
data_survey_past_week_all <- r_variables_names %>% filter(location_ID == "survey_past_week")
data_baseline_survey <- r_variables_names %>%
filter(location_ID == "data_baseline_survey") %>%
filter(display == TRUE)
data_baseline_survey$display_name[which(data_baseline_survey$display_name == "app language")] <- " app language"
data_baseline_survey$object_name[which(data_baseline_survey$object_name == "language")] <- "app_language"
if (study == "RCT"){
# filter to just RCT_display == TRUE
}
# TODO, we want a "display RCT option for RCT ones only.
data_completion_level_data <- r_variables_names %>% filter(location_ID == "data_completion_level") %>% filter(display == TRUE)
data_completion_level <- data_completion_level_data$metabase_ID
data_completion_level_names <- data_completion_level_data$display_name
data_habit_parent_points_data <- r_variables_names %>% filter(location_ID == "data_habit_parent_points_all") %>% filter(display == TRUE)
data_habit_parent_points_all <- data_habit_parent_points_data$metabase_ID
data_baseline_survey$object_name
#w_self_care
#w_1on1
#w_praise
#w_instruct
#w_stress
#w_money
#w_rules
#w_consequence
#w_solve
#w_safe
#w_crisis
#w_celebrate
# TODO:
# redefine data_hp_started to use rp.contact.field.task_gp_w_1on1_hp_review_completed instead of rp.contact.field.w_1on1_hp_review_started