-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for filtering forms of metadata
ref #445
- Loading branch information
Showing
7 changed files
with
359 additions
and
25 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...a/specific-redcapr/metadata-read/normal-filter-form-demographics-and-race_and_ethnicity.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
structure(list(field_name = c("record_id", "name_first", "name_last", | ||
"address", "telephone", "email", "dob", "age", "sex", "race", | ||
"ethnicity", "interpreter_needed"), form_name = c("demographics", | ||
"demographics", "demographics", "demographics", "demographics", | ||
"demographics", "demographics", "demographics", "demographics", | ||
"race_and_ethnicity", "race_and_ethnicity", "race_and_ethnicity" | ||
), section_header = c(NA, "Contact Information", NA, NA, NA, | ||
NA, NA, NA, NA, NA, NA, NA), field_type = c("text", "text", "text", | ||
"notes", "text", "text", "text", "text", "radio", "checkbox", | ||
"radio", "truefalse"), field_label = c("Study ID", "First Name", | ||
"Last Name", "Street, City, State, ZIP", "Phone number", "E-mail", | ||
"Date of birth", "Age (years)", "Gender", "Race (Select all that apply)", | ||
"Ethnicity", "Are interpreter services requested?"), select_choices_or_calculations = c(NA, | ||
NA, NA, NA, NA, NA, NA, NA, "0, Female | 1, Male", "1, American Indian/Alaska Native | 2, Asian | 3, Native Hawaiian or Other Pacific Islander | 4, Black or African American | 5, White | 6, Unknown / Not Reported", | ||
"0, Unknown / Not Reported | 1, NOT Hispanic or Latino | 2, Hispanic or Latino", | ||
NA), field_note = c(NA, NA, NA, NA, "Include Area Code", NA, | ||
NA, NA, NA, NA, NA, NA), text_validation_type_or_show_slider_number = c(NA, | ||
NA, NA, NA, "phone", "email", "date_ymd", NA, NA, NA, NA, NA), | ||
text_validation_min = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_), text_validation_max = c(NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), identifier = c(NA, "y", "y", | ||
"y", "y", "y", "y", NA, NA, NA, NA, NA), branching_logic = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), required_field = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), custom_alignment = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), question_number = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), matrix_group_name = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), matrix_ranking = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), field_annotation = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_)), row.names = c(NA, | ||
-12L), class = c("tbl_df", "tbl", "data.frame")) |
32 changes: 32 additions & 0 deletions
32
inst/test-data/specific-redcapr/metadata-read/normal-filter-form-demographics.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
structure(list(field_name = c("record_id", "name_first", "name_last", | ||
"address", "telephone", "email", "dob", "age", "sex"), form_name = c("demographics", | ||
"demographics", "demographics", "demographics", "demographics", | ||
"demographics", "demographics", "demographics", "demographics" | ||
), section_header = c(NA, "Contact Information", NA, NA, NA, | ||
NA, NA, NA, NA), field_type = c("text", "text", "text", "notes", | ||
"text", "text", "text", "text", "radio"), field_label = c("Study ID", | ||
"First Name", "Last Name", "Street, City, State, ZIP", "Phone number", | ||
"E-mail", "Date of birth", "Age (years)", "Gender"), select_choices_or_calculations = c(NA, | ||
NA, NA, NA, NA, NA, NA, NA, "0, Female | 1, Male"), field_note = c(NA, | ||
NA, NA, NA, "Include Area Code", NA, NA, NA, NA), text_validation_type_or_show_slider_number = c(NA, | ||
NA, NA, NA, "phone", "email", "date_ymd", NA, NA), text_validation_min = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), text_validation_max = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), identifier = c(NA, | ||
"y", "y", "y", "y", "y", "y", NA, NA), branching_logic = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), required_field = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), custom_alignment = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), question_number = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), matrix_group_name = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), matrix_ranking = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), field_annotation = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_)), row.names = c(NA, | ||
-9L), class = c("tbl_df", "tbl", "data.frame")) |
25 changes: 25 additions & 0 deletions
25
inst/test-data/specific-redcapr/metadata-read/normal-filter-form-health.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
structure(list(field_name = c("height", "weight", "bmi", "comments", | ||
"mugshot"), form_name = c("health", "health", "health", "health", | ||
"health"), section_header = c(NA, NA, NA, "General Comments", | ||
NA), field_type = c("text", "text", "calc", "notes", "file"), | ||
field_label = c("Height (cm)", "Weight (kilograms)", "BMI", | ||
"Comments", "Mugshot"), select_choices_or_calculations = c(NA, | ||
NA, "round(([weight]*10000)/(([height])^(2)),1)", NA, NA), | ||
field_note = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), text_validation_type_or_show_slider_number = c("number", | ||
"integer", NA, NA, NA), text_validation_min = c("130", "35", | ||
NA, NA, NA), text_validation_max = c("215", "200", NA, NA, | ||
NA), identifier = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), branching_logic = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
), required_field = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), custom_alignment = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
), question_number = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), matrix_group_name = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
), matrix_ranking = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_), field_annotation = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
)), row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame" | ||
)) |
21 changes: 21 additions & 0 deletions
21
inst/test-data/specific-redcapr/metadata-read/normal-filter-form-race_and_ethnicity.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
structure(list(field_name = c("race", "ethnicity", "interpreter_needed" | ||
), form_name = c("race_and_ethnicity", "race_and_ethnicity", | ||
"race_and_ethnicity"), section_header = c(NA_character_, NA_character_, | ||
NA_character_), field_type = c("checkbox", "radio", "truefalse" | ||
), field_label = c("Race (Select all that apply)", "Ethnicity", | ||
"Are interpreter services requested?"), select_choices_or_calculations = c("1, American Indian/Alaska Native | 2, Asian | 3, Native Hawaiian or Other Pacific Islander | 4, Black or African American | 5, White | 6, Unknown / Not Reported", | ||
"0, Unknown / Not Reported | 1, NOT Hispanic or Latino | 2, Hispanic or Latino", | ||
NA), field_note = c(NA_character_, NA_character_, NA_character_ | ||
), text_validation_type_or_show_slider_number = c(NA_character_, | ||
NA_character_, NA_character_), text_validation_min = c(NA_character_, | ||
NA_character_, NA_character_), text_validation_max = c(NA_character_, | ||
NA_character_, NA_character_), identifier = c(NA_character_, | ||
NA_character_, NA_character_), branching_logic = c(NA_character_, | ||
NA_character_, NA_character_), required_field = c(NA_character_, | ||
NA_character_, NA_character_), custom_alignment = c(NA_character_, | ||
NA_character_, NA_character_), question_number = c(NA_character_, | ||
NA_character_, NA_character_), matrix_group_name = c(NA_character_, | ||
NA_character_, NA_character_), matrix_ranking = c(NA_character_, | ||
NA_character_, NA_character_), field_annotation = c(NA_character_, | ||
NA_character_, NA_character_)), row.names = c(NA, -3L), class = c("tbl_df", | ||
"tbl", "data.frame")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
inst/test-data/specific-redcapr/metadata-read/super-wide-3-subset.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
structure(list(field_name = c("record_id", "variable_00002", | ||
"variable_00003", "variable_00004", "variable_00005", "variable_00012", | ||
"variable_00013", "variable_00014", "variable_00015", "variable_00016", | ||
"variable_00017"), form_name = c("form_0001", "form_0001", "form_0001", | ||
"form_0001", "form_0001", "form_0003", "form_0003", "form_0003", | ||
"form_0003", "form_0003", "form_0003"), section_header = c(NA, | ||
NA, NA, NA, NA, "<div class=\"rich-text-field-label\"><p style=\"text-align: center;\"><span style=\"color: #000080;\">Please answer the following questions in form_0003</span></p></div>", | ||
NA, NA, NA, NA, NA), field_type = c("text", "radio", "checkbox", | ||
"notes", "text", "descriptive", "text", "radio", "checkbox", | ||
"notes", "text"), field_label = c("Long description for variable record_id", | ||
"\n <span lang=\"en\">{Name of University} is one part of a super awesome study.\n\n We will also collect some small biological samples, such as saliva.\n\n Do you have any questions about what the study involves?</span>\n\n <span lang=\"es\">La {nombre de la universidad} forma parte de un estudio fabuloso.\n\n También se colectará algunas muestras biológicas, como saliva.\n\n ¿Tiene alguna pregunta sobre lo que implica el estudio?</span>\"\n ", | ||
"Long description for variable variable_00003", "Long description for variable variable_00004", | ||
"Long description for variable variable_00005", "Long description for variable variable_00012", | ||
"Long description for variable variable_00013", "Long description for variable variable_00014", | ||
"Long description for variable variable_00015", "Long description for variable variable_00016", | ||
"Long description for variable variable_00017"), select_choices_or_calculations = c(NA, | ||
"1, Yup | 2, Nope | 3, Other", "1, Yup | 2, Nope | 3, Other", | ||
NA, NA, NA, NA, "1, Yup | 2, Nope | 3, Other", "1, Yup | 2, Nope | 3, Other", | ||
NA, NA), field_note = c("Field note record_id", "Field note variable_00002", | ||
"Field note variable_00003", "Field note variable_00004", "Field note variable_00005", | ||
"Field note variable_00012", "Field note variable_00013", "Field note variable_00014", | ||
"Field note variable_00015", "Field note variable_00016", "Field note variable_00017" | ||
), text_validation_type_or_show_slider_number = c(NA, NA, NA, | ||
NA, "date_ymd", NA, NA, NA, NA, NA, "date_ymd"), text_validation_min = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_ | ||
), text_validation_max = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_), identifier = c(NA, | ||
NA, NA, "y", NA, "y", NA, NA, NA, "y", NA), branching_logic = c(NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_ | ||
), required_field = c(NA, "y", NA, "y", NA, NA, NA, "y", NA, | ||
"y", NA), custom_alignment = c(NA, NA, NA, NA, "RH", NA, NA, | ||
NA, "RH", NA, NA), question_number = c(NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_), | ||
matrix_group_name = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
), matrix_ranking = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
), field_annotation = c(NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_, | ||
NA_character_, NA_character_, NA_character_, NA_character_ | ||
)), row.names = c(NA, -11L), class = c("tbl_df", "tbl", "data.frame" | ||
)) |
Oops, something went wrong.