Skip to content

redcap export instrument

Jonathan Chan edited this page May 11, 2018 · 4 revisions

redcap-export-instrument exports instruments for a given project from REDCap.

Parameter Description
host Server hostname
token Authentication token (project and user specific!)
xargs Optional parameters; see below

Optional parameters must come in pairs of 'symbol "string".

Optional Parameter Description
'format "[fmt]" Sets desired output format. "[fmt]" may be one of "csv", "xml", or "json" (which will return a list of lists). Default is "json".

Examples

Example 1: Exporting instruments.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-export-instrument redcap:hostname redcap:token)
((("instrument_name" . "form_1") ("instrument_label" . "Form 1"))
 (("instrument_name" . "form_2") ("instrument_label" . "Form 2"))
 (("instrument_name" . "form_3") ("instrument_label" . "Form 3")))

Example 2: Exporting instruments in CSV format.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-export-instrument redcap:hostname redcap:token 'format "csv")
"instrument_name,instrument_label\nform_1,\"Form 1\"\nform_2,\"Form 2\"\nform_3,\"Form 3\"\n"
Clone this wiki locally