Skip to content

redcap export metadata

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

redcap-export-metadata exports the Metadata (i.e. Data Dictionary) for a REDCap project.

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".
'forms "[form]" Retrieves metadata for the given form.
'fields "[field]" Retrieves metadata for the given field.

Examples

Example 1: Exporting metadata of a project.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-export-metadata redcap:hostname redcap:token)
((("field_name" . "participant_id")
  ("form_name" . "demographics")
  ("section_header" . "")
  ("field_type" . "text")
  ("field_label" . "Participant ID")
  ("select_choices_or_calculations" . "")
  ("field_note" . "")
  ("text_validation_type_or_show_slider_number" . "")
  ("text_validation_min" . "")
  ("text_validation_max" . "")
  ("identifier" . "")
  ("branching_logic" . "")
  ("required_field" . "")
  ("custom_alignment" . "")
  ("question_number" . ""))
  [...]

Example 2: Exporting metadata only for the email field.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-export-metadata redcap:hostname redcap:token 'fields "email")
((("field_name" . "email")
  ("form_name" . "form_3")
  ("section_header" . "")
  ("field_type" . "text")
  ("field_label" . "Email")
  ("select_choices_or_calculations" . "")
  ("field_note" . "")
  ("text_validation_type_or_show_slider_number" . "email")
  ("text_validation_min" . "")
  ("text_validation_max" . "")
  ("identifier" . "")
  ("branching_logic" . "")
  ("required_field" . "")
  ("custom_alignment" . "")
  ("question_number" . "")
  ("matrix_group_name" . "")
  ("matrix_ranking" . "")
  ("field_annotation" . "")))
Clone this wiki locally