Skip to content

Commit

Permalink
refresh script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rsh52 committed Oct 16, 2024
1 parent 6a43395 commit d395eae
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 71 deletions.
8 changes: 7 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ REDCapTidieR's
RStudio
Recode
Recoding
Stata
Supertibble
Supertibbles
TRUEs
Tibble
Tibble's
Tibbles
Expand All @@ -30,6 +32,7 @@ analytics
api
appendings
cli
de
dplyr
dropdown
edu
Expand All @@ -38,6 +41,7 @@ ggplot
gtsummary
https
httptest
interpretable
labelled
multiselection
nonrepeat
Expand All @@ -48,12 +52,15 @@ preprocess
recode
recoded
recodes
recoding
skimr
summarise
supertbl
supertibble
supertibble's
supertibbles
tableStyleLight
tbl
tibble
tibble's
tibbles
Expand All @@ -62,7 +69,6 @@ tidyverse
truefalse
undirected
unlabelled
wb
xlsx
yesno
4 changes: 2 additions & 2 deletions man/convert_checkbox_vals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/testthat/test-read_redcap.R
Original file line number Diff line number Diff line change
Expand Up @@ -680,5 +680,4 @@ test_that("get_repeat_event_types() works", {
)

expect_equal(out, expected_out)

})
47 changes: 22 additions & 25 deletions utility/cli_message_examples_reprex.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ read_redcap(letters[1:3], classic_token)
read_redcap("https://www.google.com", classic_token)
#> Error in `read_redcap()`:
#> ✖ The REDCapR export operation was not successful.
#> ! An unexpected error occured.
#> ℹ This means that you probably discovered a bug!
#> ℹ Please consider submitting a bug report here:
#> <https://github.com/CHOP-CGTInformatics/REDCapTidieR/issues>.
#> Caused by error in `redcap_metadata_read()`:
#> ! The REDCapR metadata export operation was not successful. The error message was:
#> <html><body><h1>404 Not Found</h1></body></html>
#> ! The URL returned the HTTP error code 405 (POST Method not allowed).
#> ℹ Are you sure the URI points to an active REDCap API endpoint?
#> ℹ URI: `https://www.google.com`

read_redcap("https://www.google.comm", classic_token)
#> Error in `read_redcap()`:
Expand All @@ -63,13 +59,13 @@ read_redcap(redcap_uri, letters[1:3])

read_redcap(redcap_uri, "")
#> Error in `read_redcap()`:
#> ✖ The token is an empty string, not a valid 32-character hexademical
#> value.
#> ✖ The token is an empty string, which is not allowed.
#> ℹ API token: ``

read_redcap(redcap_uri, "CC0CE44238EF65C5DA26A55DD749AF7") # 31 hex characters
#> Error in `read_redcap()`:
#> ✖ The token is not a valid 32-character hexademical value.
#> ✖ The token does not conform with the regex
#> `^([0-9A-Fa-f]{32})(?:\n)?$`.
#> ℹ API token: `CC0CE44238EF65C5DA26A55DD749AF7`

read_redcap(redcap_uri, "CC0CE44238EF65C5DA26A55DD749AF7A") # will be rejected by server
Expand Down Expand Up @@ -259,7 +255,7 @@ withr::with_tempdir({
})
#> Error:
#> ✖ File
#> ''/private/var/folders/9c/k1m0bzys7gb1v32g86hfn5sn5k86h1/T/Rtmp1QPC0p/file5c744dd73619/temp.csv''
#> ''/private/var/folders/qc/mmjjyjq50530z9r_7mfqcqfhxkkk67/T/Rtmph4LQ3Z/filee5aa7b9bea48/temp.csv''
#> already exists.
#> ℹ Overwriting files is disabled by default. Set `overwrite = TRUE` to overwrite
#> existing file.
Expand Down Expand Up @@ -300,25 +296,26 @@ withr::with_tempdir({
write_redcap_xlsx(file = filepath)
})
#> Warning in write_redcap_xlsx(., file = filepath): ! No extension provided for `file`:
#> '/private/var/folders/9c/k1m0bzys7gb1v32g86hfn5sn5k86h1/T/Rtmp1QPC0p/file5c7456597c2b/temp'
#> '/private/var/folders/qc/mmjjyjq50530z9r_7mfqcqfhxkkk67/T/Rtmph4LQ3Z/filee5aa11455c98/temp'
#> ℹ The extension '.xlsx' will be appended to the file name.

# Printed supertibble

read_redcap(Sys.getenv("REDCAP_URI"), Sys.getenv("REDCAPTIDIER_CLASSIC_API")) %>%
suppressWarnings()
#> # A REDCapTidieR Supertibble with 9 instruments
#> redcap_form_name redcap_form_label redcap_data redcap_metadata structure
#> <chr> <chr> <list> <list> <chr>
#> 1 nonrepeated Nonrepeated <tibble> <tibble> nonrepea…
#> 2 nonrepeated2 Nonrepeated2 <tibble> <tibble> nonrepea…
#> 3 repeated Repeated <tibble> <tibble> repeating
#> 4 data_field_types Data Field Types <tibble> <tibble> nonrepea…
#> 5 text_input_validation… Text Input Valid… <tibble> <tibble> nonrepea…
#> 6 api_no_access API No Access <tibble> <tibble> nonrepea…
#> 7 api_no_access_2 API No Access 2 <tibble> <tibble> nonrepea…
#> 8 survey Survey <tibble> <tibble> nonrepea…
#> 9 repeat_survey Repeat Survey <tibble> <tibble> repeating
#> # A REDCapTidieR Supertibble with 10 instruments
#> redcap_form_name redcap_form_label redcap_data redcap_metadata structure
#> <chr> <chr> <list> <list> <chr>
#> 1 nonrepeated Nonrepeated <tibble> <tibble> nonrepea…
#> 2 nonrepeated2 Nonrepeated2 <tibble> <tibble> nonrepea…
#> 3 repeated Repeated <tibble> <tibble> repeating
#> 4 data_field_types Data Field Types <tibble> <tibble> nonrepea…
#> 5 text_input_validatio… Text Input Valid… <tibble> <tibble> nonrepea…
#> 6 api_no_access API No Access <tibble> <tibble> nonrepea…
#> 7 api_no_access_2 API No Access 2 <tibble> <tibble> nonrepea…
#> 8 survey Survey <tibble> <tibble> nonrepea…
#> 9 repeat_survey Repeat Survey <tibble> <tibble> repeating
#> 10 labelled_vignette Labelled Vignette <tibble> <tibble> nonrepea…
#> # ℹ 5 more variables: data_rows <int>, data_cols <int>, data_size <lbstr_by>,
#> # data_na_pct <formttbl>, form_complete_pct <formttbl>

Expand All @@ -343,4 +340,4 @@ read_redcap(redcap_uri, Sys.getenv("REDCAPTIDIER_MDC_API"))
#> # data_na_pct <formttbl>, form_complete_pct <formttbl>
```

<sup>Created on 2024-04-10 with [reprex v2.1.0](https://reprex.tidyverse.org)</sup>
<sup>Created on 2024-10-16 with [reprex v2.1.0](https://reprex.tidyverse.org)</sup>
82 changes: 41 additions & 41 deletions utility/microbenchmark_results.csv
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
min,lq,mean,median,uq,max,neval,description,source
1.15,1.15,1.15,1.15,1.15,1.15,1,simple static (read-only) test project,ouhsc
1.7,1.7,1.7,1.7,1.7,1.7,1,longitudinal (read-only) ARM test project,ouhsc
0.83,0.83,0.83,0.83,0.83,0.83,1,simple write data,ouhsc
1.79,1.79,1.79,1.79,1.79,1.79,1,Russian Characters,ouhsc
3.37,3.37,3.37,3.37,3.37,3.37,1,"super-wide --3,000 columns",ouhsc
1,1,1,1,1,1,1,static (not longitudinal) survey test project,ouhsc
0.82,0.82,0.82,0.82,0.82,0.82,1,"Clinical Trial (Fake) --Read-only, contributed by @higgi13425",ouhsc
0.77,0.77,0.77,0.77,0.77,0.77,1,nonnumeric record_id,ouhsc
0.94,0.94,0.94,0.94,0.94,0.94,1,DAG Read,ouhsc
0.82,0.82,0.82,0.82,0.82,0.82,1,potentially problematic values,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,Repeating Instruments,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,simple write metadata,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,DAG Write -admin,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,DAG Write -group A,ouhsc
129.61,129.61,129.61,129.61,129.61,129.61,1,"super-wide #3--35,000 columns",ouhsc
0.82,0.82,0.82,0.82,0.82,0.82,1,Repeating Instruments --Sparse,ouhsc
0.8,0.8,0.8,0.8,0.8,0.8,1,Delete Single Arm,ouhsc
1.29,1.29,1.29,1.29,1.29,1.29,1,Delete Multiple Arm,ouhsc
1.55,1.55,1.55,1.55,1.55,1.55,1,longitudinal single arm,ouhsc
0.78,0.78,0.78,0.78,0.78,0.78,1,decimal comma and dot,ouhsc
0.82,0.82,0.82,0.82,0.82,0.82,1,decimal comma,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,decimal dot,ouhsc
0.87,0.87,0.87,0.87,0.87,0.87,1,Validation Types,ouhsc
0.81,0.81,0.81,0.81,0.81,0.81,1,Blank for Gray Status,ouhsc
0.97,0.97,0.97,0.97,0.97,0.97,1,Checkboxes 1,ouhsc
0.83,0.83,0.83,0.83,0.83,0.83,1,Vignette: Longitudinal & Repeating Measures,ouhsc
1.11,1.11,1.11,1.11,1.11,1.11,1,classic,redcaptidier
0.98,0.98,0.98,0.98,0.98,0.98,1,classic no repeat,redcaptidier
1.7,1.7,1.7,1.7,1.7,1.7,1,longitudinal,redcaptidier
1.67,1.67,1.67,1.67,1.67,1.67,1,longitudinal no arms,redcaptidier
1.51,1.51,1.51,1.51,1.51,1.51,1,longitudinal no repeat,redcaptidier
1.96,1.96,1.96,1.96,1.96,1.96,1,deep dive vignette,redcaptidier
0.99,0.99,0.99,0.99,0.99,0.99,1,repeat first instrument,redcaptidier
1.51,1.51,1.51,1.51,1.51,1.51,1,repeat event,redcaptidier
1.04,1.04,1.04,1.04,1.04,1.04,1,restricted access,redcaptidier
0.97,0.97,0.97,0.97,0.97,0.97,1,large sparse db,redcaptidier
1.13,1.13,1.13,1.13,1.13,1.13,1,data access groups,redcaptidier
1.78,1.78,1.78,1.78,1.78,1.78,1,longitudinal data access groups,redcaptidier
2.06,2.06,2.06,2.06,2.06,2.06,1,mixed structure repeat no repeat,redcaptidier
4.62,4.62,4.62,4.62,4.62,4.62,1,prodigy db,redcaptidier
5.26,5.26,5.26,5.26,5.26,5.26,1,cart comprehensive db,redcaptidier
0.96,0.96,0.96,0.96,0.96,0.96,1,simple static (read-only) test project,ouhsc
2.35,2.35,2.35,2.35,2.35,2.35,1,longitudinal (read-only) ARM test project,ouhsc
0.99,0.99,0.99,0.99,0.99,0.99,1,simple write data,ouhsc
4.29,4.29,4.29,4.29,4.29,4.29,1,Russian Characters,ouhsc
6.67,6.67,6.67,6.67,6.67,6.67,1,"super-wide --3,000 columns",ouhsc
1.72,1.72,1.72,1.72,1.72,1.72,1,static (not longitudinal) survey test project,ouhsc
1.43,1.43,1.43,1.43,1.43,1.43,1,"Clinical Trial (Fake) --Read-only, contributed by @higgi13425",ouhsc
1.12,1.12,1.12,1.12,1.12,1.12,1,nonnumeric record_id,ouhsc
0.97,0.97,0.97,0.97,0.97,0.97,1,DAG Read,ouhsc
0.9,0.9,0.9,0.9,0.9,0.9,1,potentially problematic values,ouhsc
1.13,1.13,1.13,1.13,1.13,1.13,1,simple write metadata,ouhsc
0.89,0.89,0.89,0.89,0.89,0.89,1,DAG Write -admin,ouhsc
0.95,0.95,0.95,0.95,0.95,0.95,1,DAG Write -group A,ouhsc
1278.89,1278.89,1278.89,1278.89,1278.89,1278.89,1,"super-wide #3--35,000 columns",ouhsc
0.99,0.99,0.99,0.99,0.99,0.99,1,Repeating Instruments --Sparse,ouhsc
1.1,1.1,1.1,1.1,1.1,1.1,1,Delete Single Arm,ouhsc
2.35,2.35,2.35,2.35,2.35,2.35,1,Delete Multiple Arm,ouhsc
2.13,2.13,2.13,2.13,2.13,2.13,1,longitudinal single arm,ouhsc
1.25,1.25,1.25,1.25,1.25,1.25,1,decimal comma and dot,ouhsc
1.32,1.32,1.32,1.32,1.32,1.32,1,decimal comma,ouhsc
1.09,1.09,1.09,1.09,1.09,1.09,1,decimal dot,ouhsc
1.21,1.21,1.21,1.21,1.21,1.21,1,Validation Types,ouhsc
0.99,0.99,0.99,0.99,0.99,0.99,1,Blank for Gray Status,ouhsc
1.32,1.32,1.32,1.32,1.32,1.32,1,Checkboxes 1,ouhsc
1.13,1.13,1.13,1.13,1.13,1.13,1,Vignette: Longitudinal & Repeating Measures,ouhsc
3.01,3.01,3.01,3.01,3.01,3.01,1,classic,redcaptidier
3.34,3.34,3.34,3.34,3.34,3.34,1,classic no repeat,redcaptidier
3.1,3.1,3.1,3.1,3.1,3.1,1,longitudinal,redcaptidier
2.88,2.88,2.88,2.88,2.88,2.88,1,longitudinal no arms,redcaptidier
3.5,3.5,3.5,3.5,3.5,3.5,1,longitudinal no repeat,redcaptidier
5.16,5.16,5.16,5.16,5.16,5.16,1,deep dive vignette,redcaptidier
2.8,2.8,2.8,2.8,2.8,2.8,1,repeat first instrument,redcaptidier
4.69,4.69,4.69,4.69,4.69,4.69,1,repeat event,redcaptidier
2.42,2.42,2.42,2.42,2.42,2.42,1,restricted access,redcaptidier
1.99,1.99,1.99,1.99,1.99,1.99,1,large sparse db,redcaptidier
1.63,1.63,1.63,1.63,1.63,1.63,1,data access groups,redcaptidier
3.62,3.62,3.62,3.62,3.62,3.62,1,longitudinal data access groups,redcaptidier
3.16,3.16,3.16,3.16,3.16,3.16,1,mixed structure repeat no repeat,redcaptidier
11.29,11.29,11.29,11.29,11.29,11.29,1,prodigy db,redcaptidier
15.8,15.8,15.8,15.8,15.8,15.8,1,cart comprehensive db,redcaptidier
34.07,34.07,34.07,34.07,34.07,34.07,1,bmt outcomes db,redcaptidier
3 changes: 2 additions & 1 deletion utility/test_creds.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ ouhsc_creds <- readr::read_csv(file = "utility/redcapr.example.credentials", ski
select(redcap_uri, token, comment)

# Remove identified APIs that don't work
ouhsc_creds <- ouhsc_creds[-c(5,6,10,15,19),]
ouhsc_creds <- ouhsc_creds[-c(5,6,10,14,15,19),]
# Empty rows (dataframe with 0 rows, 0 columns)
# Single Column (dataframe with 0 rows, 0 columns)
# Missing/invalid token, "---" (REDCapR errors as well)
# Potentially problematic dictionary (dataframe with 0 rows, 0 columns)
# super-wide #2--5,785 columns (dataframe with 0 rows, 0 columns)
# repeat instrument, no longer a working api key

# Load REDCapTidieR and CGTI creds
redcaptidier_creds <- tibble::tribble(
Expand Down

0 comments on commit d395eae

Please sign in to comment.