From fa24394108c3430b79b864bcd8e8be7a65061a37 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Fri, 2 Sep 2022 18:25:08 -0500 Subject: [PATCH] @januz's checkbox example ref #420 --- inst/misc/example.credentials | 1 + inst/test-data/checkboxes-1/data.csv | 5 + inst/test-data/checkboxes-1/dictionary.csv | 5 + inst/test-data/checkboxes-1/project.xml | 305 +++++++++++++++++++++ 4 files changed, 316 insertions(+) create mode 100644 inst/test-data/checkboxes-1/data.csv create mode 100644 inst/test-data/checkboxes-1/dictionary.csv create mode 100644 inst/test-data/checkboxes-1/project.xml diff --git a/inst/misc/example.credentials b/inst/misc/example.credentials index 2eaad81d..0d54c073 100644 --- a/inst/misc/example.credentials +++ b/inst/misc/example.credentials @@ -33,3 +33,4 @@ redcap_uri,username,project_id,token,comment "https://bbmc.ouhsc.edu/redcap/api/","myusername","2632","D7DDE242E717619E17F7DF0D3CE582B1","decimal dot" "https://bbmc.ouhsc.edu/redcap/api/","myusername","2634","8F5313CAA266789F560D79EFCEE2E2F1","Validation Types" "https://bbmc.ouhsc.edu/redcap/api/","myusername","3003","1F2EC7059AC339DFDCD5800225DC7A95","Blank for Gray Status" +"https://bbmc.ouhsc.edu/redcap/api/","myusername","3074","5007DC786DBE39CE77ED8DD0C68069A6","Checkboxes 1" diff --git a/inst/test-data/checkboxes-1/data.csv b/inst/test-data/checkboxes-1/data.csv new file mode 100644 index 00000000..dd1bac53 --- /dev/null +++ b/inst/test-data/checkboxes-1/data.csv @@ -0,0 +1,5 @@ +record_id,form_1_complete,check_one___1,check_one___2,check_one___3,check_one___4,check_two___a,check_two___b,check_two___c,check_two___d,check_two___e,desired_result,form_2_complete +1,0,1,0,0,0,1,0,1,0,0,"Should have data for both checkbox items: check_one: - check_one___1 should be 1 - check_one___[2-4] should be 0 check_two: - check_two___a should be 1 - check_two___c should be 1 - check_one___[b;d;e] should be 0 completion status should be 2",2 +2,0,0,0,0,0,0,1,0,1,0,"Should have data only for the second checkbox item: check_one: - check_one___[1-4] should be NA check_two: - check_two___b should be 1 - check_two___d should be 1 - check_one___[a;c;e] should be 0 completion status should be 1",0 +3,0,1,1,1,1,0,0,0,0,0,"Should have data for only the first checkbox item: check_one: - check_one___[1-4] should be 1 check_two: - check_two___[a-e] should be NA - check_two___c should be 1 - check_one___[b;d;e] should be 0 completion status should be 2",2 +4,0,0,0,0,0,0,0,0,0,0,,0 diff --git a/inst/test-data/checkboxes-1/dictionary.csv b/inst/test-data/checkboxes-1/dictionary.csv new file mode 100644 index 00000000..f543942d --- /dev/null +++ b/inst/test-data/checkboxes-1/dictionary.csv @@ -0,0 +1,5 @@ +"Variable / Field Name","Form Name","Section Header","Field Type","Field Label","Choices, Calculations, OR Slider Labels","Field Note","Text Validation Type OR Show Slider Number","Text Validation Min","Text Validation Max",Identifier?,"Branching Logic (Show field only if...)","Required Field?","Custom Alignment","Question Number (surveys only)","Matrix Group Name","Matrix Ranking?","Field Annotation" +record_id,form_1,,text,"Record ID",,,,,,,,,,,,, +check_one,form_2,,checkbox,"check one","1, one | 2, two | 3, three | 4, four",,,,,,,,,,,, +check_two,form_2,,checkbox,"check two","a, A | b, B | c, C | d, D | e, E",,,,,,,,,,,, +desired_result,form_2,,notes,"What should happen for this participant",,,,,,,,,,,,, diff --git a/inst/test-data/checkboxes-1/project.xml b/inst/test-data/checkboxes-1/project.xml new file mode 100644 index 00000000..b611ae8a --- /dev/null +++ b/inst/test-data/checkboxes-1/project.xml @@ -0,0 +1,305 @@ + + + + + test-checkbox-export + This file contains the metadata, events, and data for REDCap project "test-checkbox-export". + test-checkbox-export + 1 + + + 0 + 0 + + 0 + + To test out EAV exports through API + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + + 0 + + ALL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Record ID + + + Complete? + + + + check one + + + + check one + + + + check one + + + + check one + + + + check two + + + + check two + + + + check two + + + + check two + + + + check two + + + + What should happen for this participant + + + Complete? + + + + Incomplete + Unverified + Complete + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Checked + Unchecked + + + Incomplete + Unverified + Complete + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file