Open couthcommander opened 5 months ago
Here's an example - the old approach:
REDCAP_SYSTEM_FIELDS <- c("redcap_event_name",
"redcap_data_access_group",
"redcap_repeat_instrument",
"redcap_repeat_instance",
"redcap_survey_identifier")
incomplete approach:
REDCAP_SYSTEM_FIELDS <- .getStructure('f_SYSTEM', '14.4.0')
The final approach would replace all instances of "REDCAP_SYSTEM_FIELDS" with .getStructure('f_SYSTEM', rcon$version())
@couthcommander I changed this to a draft PR.
@nutterb thoughts?
The existing structure is easier but will grow increasingly complex over time. This is to make it driven by an editable configuration file.
Ignore my previous comment. For some reason I thought @couthcommander 's work used a json file somewhere. And then proceeded to describe exactly what he has coded.
I think I might be sleep deprived.
But yes, I think this is a necessary change. And having independently determined that this approach would be a feasible strategy, I'm on board with it.
I'm ready for this to move from draft to being considered.
This PR is to create a discussion. do not merge
Rather than hard-code validation into vectors/data.frames (which will not support branching logic with version), the code in "redcapDataStructure" could be updated into functions. This could grow into something very difficult to maintain. I have an incomplete version to at least start a dialogue about the best approach. I have moved the hard-coded information into a CSV file.