You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To the above code, add a call to REDCapR::redcap_project_info_read() before metadata <- REDCapR::redcap_metadata_read( to test the attributes of the project to verify that we can fill it. Test each of these returned values independently
is_longitudinal
has_repeating_instruments_or_events
randomization_enabled
They all need to be logical. In this first version of this function, we support only:
!has_repeating_instruments_or_events
!randomization_enabled
Consider testing these with the methods of the checkmate package.
Get events and event mappings
At picked_values <- (line 111 in the stolen code block), test is_longitudinal. If is_longitudinal,
Call REDCapR::redcap_event_read() and REDCapR::redcap_event_instruments() to get event and event mapping data.
Join it into a single data frame.
Filter that data frame for forms and events in the forms and events vector parameters.
Generate a vector of distinct event names and a same-ordered list of form vectors mapped to each event name.
Create a function
get_project_values()
. The function should accept these parameters:redcap_uri
URL to a REDCap host's API interfacetoken
An API token for the project of interestforms
A vector of forms to fillevents
A vector of events to fillfields_and_responses
a data frame of fields and field responses with weights, means, sds, and other attributes that describe how to fill the fieldsThe function should copy all the code in
redcapfiller/proof_of_concept.R
Lines 26 to 111 in 23a7bca
Test project attributes
To the above code, add a call to REDCapR::redcap_project_info_read() before
metadata <- REDCapR::redcap_metadata_read(
to test the attributes of the project to verify that we can fill it. Test each of these returned values independentlyis_longitudinal
has_repeating_instruments_or_events
randomization_enabled
They all need to be logical. In this first version of this function, we support only:
!has_repeating_instruments_or_events
!randomization_enabled
Consider testing these with the methods of the checkmate package.
Get events and event mappings
At
picked_values <-
(line 111 in the stolen code block), testis_longitudinal
. Ifis_longitudinal
,REDCapR::redcap_event_read()
andREDCapR::redcap_event_instruments()
to get event and event mapping data.forms
andevents
vector parameters....Else if
!is_longitudinal
,redcapfiller/proof_of_concept.R
Lines 36 to 40 in 23a7bca
filter(!form_name %in% c("randomization")) |>
forms
vector parameterc(NA_character)
Turn
redcapfiller/proof_of_concept.R
Lines 103 to 111 in 23a7bca
get_all_rows_in_rectangle()
.Iterate through the events
Iterate over your vector of distinct event names with
purrr::map()
callingget_all_rows_in_rectangle()
for each event.The text was updated successfully, but these errors were encountered: