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
Add functions to handle REDCap text validation rules. REDCap data structures that enumerate all of the field types and text validation types are available in the REDCapR source code.
In between, you'll need to write a function to set the appropriate values for generating data that conforms to this TVT. In this step you are not generating the data--you are setting parameters to be feed into the functions that will generate the data.
For the number_* fields, just point their functions at tvt_number. e.g. tvt_number_1dp <- tvt_number.
For the time fields, copy tvt_datetime and strip out the date elements. Set mean = 3600 * 12 (aka 12 noon). Set sd = 3600 * 10 / 6 to get most dates between 7 am and 5 p.m.
For number_*dp, consider parameterizing digits in tvt_number
...setting a default of 2 for digits.
Then add tiny shell functions for the number_*dp TVTs that call tvt_number with the write values for digits.
time*
For the time* copy tvt_datetime but have it generate a number of seconds using mean and sd, convert that to the appropriate precision time. Review the lubridate functions as they might streamline the process.
Tests
Revises the exists test for these functions to challenge the new features.
The text was updated successfully, but these errors were encountered:
Add functions to handle REDCap text validation rules. REDCap data structures that enumerate all of the field types and text validation types are available in the REDCapR source code.
These types are done:
The text validation types (TVTs) should be next:
get_long_text_fields.R
Look first at get_long_text_fields.R. Add you next TVT at these two places:
redcapfiller/R/get_long_text_fields.R
Line 50 in 48b4a73
redcapfiller/R/get_long_text_fields.R
Line 177 in 48b4a73
In between, you'll need to write a function to set the appropriate values for generating data that conforms to this TVT. In this step you are not generating the data--you are setting parameters to be feed into the functions that will generate the data.
For the number_* fields, just point their functions at
tvt_number
. e.g.tvt_number_1dp <- tvt_number
.For the time fields, copy
tvt_datetime
and strip out the date elements. Setmean = 3600 * 12
(aka 12 noon). Setsd = 3600 * 10 / 6
to get most dates between 7 am and 5 p.m.get_long_text_field_values.R
Then look at get_long_text_field_values.R. Add functions for each TVT type added above.
number_*dp
For
number_*dp
, consider parameterizingdigits
in tvt_number...setting a default of 2 for digits.
Then add tiny shell functions for the
number_*dp
TVTs that calltvt_number
with the write values fordigits
.time*
For the
time*
copy tvt_datetime but have it generate a number of seconds using mean and sd, convert that to the appropriate precision time. Review the lubridate functions as they might streamline the process.Tests
Revises the exists test for these functions to challenge the new features.
The text was updated successfully, but these errors were encountered: