Skip to content

redcap export records

Dustin edited this page Apr 6, 2017 · 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"), fields using 'fields ("first_name" "last_name"), or a filter using 'filter "[age] < 5" 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"))
"study_id,spo2_site,spo2_median,hr_median,sqi_avg,spo2_date\n1,1,97,85,99,2017-04-04\n2,3,99,75,87,2017-04-05\n"

Clone this wiki locally