From 458008b92fe19cec7cc650b7f6b51f51c4d975d5 Mon Sep 17 00:00:00 2001 From: maxramirez84 Date: Thu, 8 Jul 2021 12:36:20 +0200 Subject: [PATCH] Added new column to the model csv file (load) to indicate whether each variable should be loaded to the final destination or not. --- azi.csv | 8 ++++---- death.csv | 4 ++-- main.R | 4 ++++ participant.csv | 40 ++++++++++++++++++++-------------------- sae.csv | 20 ++++++++++---------- screening_log.csv | 28 ++++++++++++++-------------- withdrawal.csv | 6 +++--- 7 files changed, 57 insertions(+), 53 deletions(-) diff --git a/azi.csv b/azi.csv index 269e744..76987eb 100644 --- a/azi.csv +++ b/azi.csv @@ -1,4 +1,4 @@ -"variable", "source", "type" -"int_azi", "db", "logical" -"int_random_letter", "db", "character" -"int_date", "db", "Date" +"variable", "source", "type", "load" +"int_azi", "db", "logical", 1 +"int_random_letter", "db", "character", 1 +"int_date", "db", "Date", 1 diff --git a/death.csv b/death.csv index 3f2a01f..5bc90b6 100644 --- a/death.csv +++ b/death.csv @@ -1,2 +1,2 @@ -"variable", "source", "type" -"death_reported_date", "db", "Date" +"variable", "source", "type", "load" +"death_reported_date", "db", "Date", 1 diff --git a/main.R b/main.R index 2746222..152e31d 100644 --- a/main.R +++ b/main.R @@ -129,6 +129,10 @@ saes$study_number <- substr(saes$sae_number, 1, 9) saes$record_id <- as.integer(saes$record_id) saes <- saes[order(saes$hf, saes$record_id), c("hf", "record_id", "study_number", sae$variable)] + +# Get Screening Log information to create the Screening Log table +logs <- data.log[which(!is.na(data.log$screening_date)), + screening.log$variable[which(screening.log$load == 1)]] # Load data \ No newline at end of file diff --git a/participant.csv b/participant.csv index b3b4974..276aeee 100644 --- a/participant.csv +++ b/participant.csv @@ -1,20 +1,20 @@ -"variable", "source", "type" -#"district", "meta", "factor" -"hf", "meta", "factor" -"record_id", "db", "integer" -"screening_number", "db", "character" -"screening_consent", "db", "logical" -"child_dob", "db", "Date" -"screening_age_weeks_new_2", "db", "integer" -"ic_age_10w", "db", "logical" -"ic_age", "db", "logical" -"screening_weight", "db", "numeric" -"ic_weight", "db", "logical" -"ic_residency_now", "db", "logical", -"ec_other_study", "db", "logical", -"ec_allergies", "db", "logical", -"ec_serious_disease", "db", "logical", -"ec_acute_illness", "db", "logical" -"eligible", "db", "logical" -"study_number", "db", "character" -"screening_date", "db", "Date" +"variable", "source", "type", "load" +#"district", "meta", "factor", 1 +"hf", "meta", "factor", 1 +"record_id", "db", "integer", 1 +"screening_number", "db", "character", 1 +"screening_consent", "db", "logical", 1 +"child_dob", "db", "Date", 1 +"screening_age_weeks_new_2", "db", "integer", 1 +"ic_age_10w", "db", "logical", 1 +"ic_age", "db", "logical", 1 +"screening_weight", "db", "numeric", 1 +"ic_weight", "db", "logical", 1 +"ic_residency_now", "db", "logical", 1 +"ec_other_study", "db", "logical", 1 +"ec_allergies", "db", "logical", 1 +"ec_serious_disease", "db", "logical", 1 +"ec_acute_illness", "db", "logical", 1 +"eligible", "db", "logical", 1 +"study_number", "db", "character", 1 +"screening_date", "db", "Date", 1 diff --git a/sae.csv b/sae.csv index 917422a..af6ec53 100644 --- a/sae.csv +++ b/sae.csv @@ -1,10 +1,10 @@ -"variable", "source", "type" -"sae_number", "db", "character" -"sae_report_type", "db", "factor" -"sae_icd_10", "db", "factor" -"sae_onset", "db", "Date" -"sae_death", "db", "logical" -"sae_death_date", "db", "Date" -"sae_relationship", "db", "factor" -"sae_severity", "db", "factor" -"sae_action", "db", "factor" +"variable", "source", "type", "load" +"sae_number", "db", "character", 1 +"sae_report_type", "db", "factor", 1 +"sae_icd_10", "db", "factor", 1 +"sae_onset", "db", "Date", 1 +"sae_death", "db", "logical", 1 +"sae_death_date", "db", "Date", 1 +"sae_relationship", "db", "factor", 1 +"sae_severity", "db", "factor", 1 +"sae_action", "db", "factor", 1 diff --git a/screening_log.csv b/screening_log.csv index f8e39ba..b658e61 100644 --- a/screening_log.csv +++ b/screening_log.csv @@ -1,14 +1,14 @@ -"variable", "source", "type" -"record_id", "db", "integer" -"hf", "meta", "character" -"hf_bombali", "db", "integer" -"hf_port_loko", "db", "integer" -"hf_tonkolili", "db", "integer" -"screening_date", "db", "Date" -"n_penta1", "db", "integer" -"n_approached", "db", "integer" -"n_underweight", "db", "integer" -"n_over_age", "db", "integer" -"n_consent", "db", "integer" -"n_screening_failures", "db", "integer" -"n_previously_invited", "db", "integer" \ No newline at end of file +"variable", "source", "type", "load" +"record_id", "db", "integer", 1 +"hf", "meta", "character", 1 +"hf_bombali", "db", "integer", 0 +"hf_port_loko", "db", "integer", 0 +"hf_tonkolili", "db", "integer", 0 +"screening_date", "db", "Date", 1 +"n_penta1", "db", "integer", 1 +"n_approached", "db", "integer", 1 +"n_underweight", "db", "integer", 1 +"n_over_age", "db", "integer", 1 +"n_consent", "db", "integer", 1 +"n_screening_failures", "db", "integer", 1 +"n_previously_invited", "db", "integer", 1 \ No newline at end of file diff --git a/withdrawal.csv b/withdrawal.csv index 46f32c6..a27c864 100644 --- a/withdrawal.csv +++ b/withdrawal.csv @@ -1,3 +1,3 @@ -"variable", "source", "type" -"wdrawal_reason", "db", "factor" -"wdrawal_reported_date", "db", "Date" +"variable", "source", "type", "load" +"wdrawal_reason", "db", "factor", 1 +"wdrawal_reported_date", "db", "Date", 1