redcapAPI
redcapAPI copied to clipboard
Version 2.0.0
Most of the core code won't change, but I'm going through each of the functions and trying to tidy up the code, improve readability, add all of the currently available features (as of 6.5.0), optimize things as much as possible, and transition to using checkmate for as many error checks as possible.
API Functions
- [x] exportRecords
- [x] exportReports
- [x] importRecords
- [x] exportMetaData (still needs version logic)
- [x] exportFieldNames
- [x] exportFile
- [x] importFile
- [x] deleteFile
- [x] exportInstruments (still needs version logic)
- [x] exportPDF
- [ ] exportSurveyLink
- [ ] exportSurveyQueueLink (combine with
exportSurveyLinkwithqueue = TRUE?) - [ ] exportSurveyReturnCode
- [x] exportEvents (still needs version logic)
- [x] exportArms
- [x] exportMappings
- [x] exportUsers (still needs version logic)
- [x] exportProjectInformation (still needs version logic)
- [x] exportVersion
And since I tend to be sloppy about documenting as I go, I want to make sure I do a separate checklist of writing the documentation with each function. Things that should be included in the documentation for each function:
-
@section REDCap Version:in which the API function was introduced -
@section Known limitations:of the API (such asfieldsandformsnot active inexportMetaData; orarmsforcing empty data frames inexportArms), if any -
@section REDCap Documentation:that gives, verbatim, the description of the action from the REDCap documentation page.
Documentation
- [x] exportRecords
- [x] exportRecords_offline
- [x] exportReports
- [x] importRecords
- [x] exportMetaData
- [x] exportFieldNames
- [x] exportFile
- [x] importFile
- [x] deleteFile
- [x] exportInstruments
- [x] exportPDF
- [ ] exportSurveyLink
- [ ] exportSurveyQueueLink (combine with
exportSurveyLinkwithqueue = TRUE?) - [ ] exportSurveyReturnCode
- [x] exportEvents
- [x] exportArms
- [x] exportMappings
- [x] exportUsers
- [x] exportProjectInformation
- [x] exportVersion
Miscellaneous
- [x] exportRecords_offline
- [x] allocationTable
- [x] allocationTable_offline
- [x] parseBranchingLogic
- [x] recodeCheck
- [x] redcapFactorFlip
- [x] Deprecate
redcapDbConnectionmethods
Some more notes for myself:
-
fieldToVarshould be a bigswitchstatement. It would make sense for there to be unexported methods for each variable type. - The
lapplythat callsfieldToVarprobably ought to be anmapply. Nope, changed my mind. This is begging for aforloop. - Factors that are created by
redcapAPIshould have a new class that inheritsfactor. That would make it easier to find them and toggle between labels and levels withredcapFactorFlip. - An additional option for how to handle errors would be good. For example, how to handle errors from
exportEventson classic projects, or any method that isn't supported by the version of REDCap. The options should be to return the error, or to return NULL - For convenience, I'm going to assign anything that happens before REDCap 6.0.0 to REDCap 5.12.2. The only only inefficiency I can think of that this will create is in deciding when to run
syncUnderscoreCodings, since those were fixed in 5.5.21. That's pretty low computational overhead, though, so I'm willing to live with it in order to have the benefit ofexportVersionalways returning something that can be compared.