cli::cli_inform(c(v="Initializer {.file helper-local.R} loaded")) # use_cache=TRUE # use_cache="write" # Read functions ------------------------------------------------------------------------------ read_atezolacc = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading ATEZOLACC") file_atezo = test_path("local_nogit/ATEZO_ExportTemplate_2020_12_31_SAS_XPORT_2024_02_26_10_38.zip") read_trialmaster(file_atezo, pw="SamplePassword", use_cache=use_cache, verbose=FALSE) } read_hrnbl2 = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading HRNBL2") file_hrnbl2 = test_path("local_nogit/HRNBL2_Export_Stat_avec_missing_SAS_XPORT_2023_11_02_13_54.zip") read_trialmaster(file_hrnbl2, pw="0", use_cache=use_cache, verbose=FALSE) } read_hrnbl2_multi = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading multiple HRNBL2") file_hrnbl2 = test_path(c( "local_nogit/HRNBL2_Export_blank_SAS_XPORT_2022_12_01_14_47.zip", "local_nogit/HRNBL2_Export_Stat_avec_missing_SAS_XPORT_2023_11_02_13_54.zip", "local_nogit/HRNBL2_Export_Stat_avec_missing_SAS_XPORT_2024_05_24_14_50.zip" )) rtn = file_hrnbl2 %>% map(~read_trialmaster(.x, pw="0", use_cache=use_cache, verbose=FALSE)) names(rtn) = map_chr(rtn, ~glue("hrnbl2_{d}", d=format(.x$datetime_extraction, "%Y_%m_%d"))) rtn } read_hypog = function(use_cache=TRUE, subdir=FALSE){ if(interactive()) cli_inform("Loading HYPOG01") path = test_path("local_nogit/HYPOG") read_all_sas(path, format_file="formats.sas7bcat", verbose=FALSE) %>% set_project_name("HYPOG") } read_icarus = function(use_cache=TRUE, subdir=FALSE){ if(interactive()) cli_inform("Loading ICARUS-Breast") file_icarus = test_path("local_nogit/ICARUS-BREAST_SAS_EXPORT_ALL_SAS_XPORT_2024_04_16_11_17.zip") # file_icarus = test_path("local_nogit/ICARUS-BREAST_SAS_EXPORT_ALL_SAS_XPORT_2024_08_13_11_56.zip") read_trialmaster(file_icarus, pw="icare", use_cache=use_cache, subdirectories=subdir, verbose=FALSE) } read_medea = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading MEDEA") file_medea = test_path("local_nogit/MEDEA_Export_sas_V2_stat_SAS_XPORT_2023_09_05_14_24.zip") read_trialmaster(file_medea, pw="medea", use_cache=use_cache, verbose=FALSE) } read_mucila = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading MUCILA") file_mucila = test_path("local_nogit/MUCILA_Sas_export_SAS_XPORT_2023_10_13_12_04.zip") read_trialmaster(file_mucila , pw="mucila", use_cache=use_cache, verbose=FALSE) } read_nivoglio = function(use_cache=TRUE, date=TRUE){ if(interactive()) cli_inform("Loading NIVOGLIO") path = test_path("local_nogit/NIVOGLIO") if(isTRUE(date)) path = test_path("local_nogit/NIVOGLIO_2024-04-25") # read_all_sas(path, format_file="formats.sas7bdat", use_cache=use_cache, verbose=T) %>% read_all_sas(path, format_file="formats.sas7bdat", verbose=T) %>% set_project_name("NIVOGLIO") } read_princeps = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading PRINCEPS") path = test_path("local_nogit/PRINCEPS") read_all_sas(path, format_file="formats.sas7bcat", verbose=FALSE) %>% set_project_name("PRINCEPS") } read_rego = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading REGO-INTER-EWING") file_rego = test_path("local_nogit/REGO-INTER-EWING_REGO-INTER-EWING-1_MSC011_SAS_XPORT_2025_04_01_17_12.zip") read_trialmaster(file_rego, pw="dcdk01", use_cache=use_cache, verbose=FALSE) } read_geftrem = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading GEFTREM") path = test_path("local_nogit/GEFTREM") read_all_sas(path, format_file="formats.sas7bcat", verbose=FALSE) %>% set_project_name("GEFTREM") } read_utf = function(use_cache=TRUE){ if(interactive()) cli_inform("Loading NIVOGLIO") path = test_path("local_nogit/NIVOGLIO") path = test_path("local_nogit/testutf_ExportTemplate_2020_12_31_SAS_XPORT_2024_02_26_10_38.zip") read_trialmaster(path, pw="SamplePassword", use_cache=F, verbose=FALSE) } update_caches = function(){ read_atezolacc(use_cache="write") read_hrnbl2(use_cache="write") read_icarus(use_cache="write") read_medea(use_cache="write") read_mucila(use_cache="write") read_nivoglio(use_cache="write") "OK" } # update_caches = purrr::quietly(update_caches) # x=update_caches() # GO! ---------------------------------------------------------------------------------------- if(!is_testing() && !is_checking()){ use_cache="write" # use_cache=TRUE # tm = edc_example(N=200) # tm = read_atezolacc(use_cache) # tm = read_rego(use_cache) # tm = read_atezolacc(use_cache) %>% edc_unify_subjid() %>% edc_split_mixed(mh) %>% edc_clean_names() # tm = read_icarus(use_cache=TRUE) # tm = read_icarus(use_cache=FALSE, subdir=TRUE) # tm = read_icarus(use_cache=FALSE, subdir=FALSE) # tm = read_hrnbl2(use_cache) # tm = read_medea(use_cache) # tm = read_mucila(use_cache) # tm = read_nivoglio(use_cache) %>% # edc_unify_subjid(preprocess=~as.numeric(str_sub(.x, -3))) tm = read_nivoglio(use_cache, date=TRUE) # tm = read_princeps(use_cache) #ne marche pas :-( # tm = read_geftrem(use_cache) #ne marche pas :-( # tm = read_hypog(use_cache) #semble marcher... # tm = edc_example() # a = tm$data1 # b = tm$enrol # tm = edc_unify_subjid(tm) # tm = edc_split_mixed(tm) # tm = edc_clean_names(tm) # tm$datetime_extraction=tm$datetime_extraction-10000000 # attr(edcimport_env$lookup, "datetime_extraction") = tm$datetime_extraction load_database(tm, remove=FALSE, env=rlang::global_env()) load_database(tm, remove=FALSE) # edc_swimmerplot(include=c("enrolres", "fu", "eot", "eos"), # exclude=c("visitdt")) # edc_swimmerplot(include=c("fu", "ltfu", "sd"), # exclude=c("el", "visitdt"), # origin="el$INCDT", time_unit="years", # group="dm$GENDER") %>% print() # edc_swimmerplot(include=c("fu", "eot", "eos"), # exclude=c("enrolres", "visitdt"), # origin="enrolres$ENROLLDT", time_unit="years", # group="enrolres$ARM") %>% print() # if(x$is_alive()) stop("Alive !") # x=edc_viewer(background=FALSE) # x=edc_viewer(background=FALSE, port=1919) # edc_find_value("dede") %>% print # app_dir <- system.file("edc_viewer", package = "EDCimport") # shiny::runApp(app_dir) # edc_viewer(mtcars, background=FALSE, port=1111) # edc_viewer(lst(mtcars, crosstable::iris2), background=FALSE, port=1111) # readr::read_lines("tests/testthat/errors") %>% walk(cat, sep="\n") # readr::read_lines("tests/testthat/out") %>% walk(cat, sep="\n") # lastnews_table(prefer=c("fu", "eos")) # lastnews_table() # options( # ggplot2.discrete.colour=ggsci::scale_colour_lancet, # ggplot2.discrete.fill=ggsci::scale_fill_lancet # ) # edc_swimmerplot(plotly=F) %>% print() # edc_swimmerplot(plotly=F, group="enrolres$ARM", id_subset=1:50) %>% print() # edc_swimmerplot(origin="el$INCDT", plotly=TRUE) # edc_patient_gridplot() %>% print() # edc_patient_gridplot(preprocess=~as.numeric(.x)) %>% print() # edc_patient_gridplot(preprocess=~as.numeric(.x), gradient=TRUE) %>% print() # edc_crf_plot() %>% print() # edc_crf_plot(details=TRUE) %>% print() # edc_crf_plot(details=TRUE, reverse=TRUE) %>% print() # edc_crf_plot(reverse=TRUE) %>% print() }