redcap import file - part-cw/lambdanative GitHub Wiki
(redcap-import-file host token record field filename . xargs)
redcap-import-file
uploads a file to a REDCap project.
Parameter | Description |
---|---|
host | Server hostname |
token | Authentication token (project and user specific!) |
record | Primary id of record |
field | Field variable name for which the file is uploaded |
filename | Filename of the file being uploaded. Include full path if needed. |
xargs | Optional parameters; see below |
Optional parameters must come in pairs of 'symbol "string"
.
Optional Parameter | Description |
---|---|
'event "[event]" | Uploads to the record with the given event in longitudinal projects. |
'repeat "[repeat]" | Uploads to the record with the given instance number in projects with repeatable events. |
Examples
Example 1: Importing a file to study 1's test_event_arm_1
event under the field "file2" in a longitudinal project.
> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-import-file redcap:hostname redcap:token "1" "file2" "data.csv" 'event "test_event_arm_1")
#t