Skip to content

redcap export records

Chris Petersen edited this page Oct 16, 2014 · 7 revisions

redcap-export-records export records from REDCap

Parameter Description
host Server hostname
token Authentication token (project and user specific!)
xargs Optional: Additional parameters, such as records using 'records (list "2" "3") or fields using 'fields ("first_name" "last_name") can be used here

Example

Example 1: Exporting records with subject_ids "1" and "4" from a project.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-export-records redcap:hostname redcap:token 'records (list "4" "1"))
((("participant_id" . "1")
  ("study_id" . "1")
  ("first_name" . "John")
  ("last_name" . "Smith")
  ("number_test" . "")
  ("test_file" . "[document]")
  ("test1" . "helloWorld")
  [...]

Example 2:

>(redcap-export-records redcap:hostname redcap:token 'format "csv" 'fields 
   (list "study_id" "spo2_site" "spo2_median" "hr_median" "sqi_avg" "spo2_date"))
"participant_id,study_id\n\"1\",\"1\"\n\"2\",\"\"\n\"4\",\"\"\n\"4\",\"\"\n"

Clone this wiki locally