Premium Feature — Available in the Professional Plus and Enterprise Editions. Also available as an Add-on to the Professional Edition. Learn more or contact LabKey

LabKey Server can import data collected using REDCap online surveys and forms. Existing REDCap projects can be directly imported into a LabKey Server study using the REDCap API.

REDCap data objects are imported into LabKey Server as follows:

REDCap data objectLabKey Server data objectNotes
form00000000000000dataset0000000000000000000000Forms are imported as Labkey Server study datasets. You can specify which forms should be imported as demographic datasets using the configuration property demographic.
eventvisit or dateEvents are imported as either LabKey Server visits or dates. You can specify 'visit' or 'date' import using the configuration property timepointType.
multichoice fieldslookupsMultiple choice fields are imported as lookups. Possible values are imported into separate Lists.

You can also set up data reloading on a recurring schedule to capture new data in the REDCap project.

Note: REDCap forms must have the status 'complete' to be imported. If forms are marked 'incomplete,' the data structure will be created, but it will be empty.

Enable the REDCap Module

  • In your study folder, go to: Admin > Folder > Management and click the Folder Type tab.
  • Under Modules, place a checkmark next to REDCap.
  • Click Update Folder.

Connect and Configure REDCap Projects

  • In your study folder, click the Manage tab.
  • Click Manage External Reloading.
  • Click Configure REDCap.
  • Configure connections and reloading on the three tabs: Authentication, Reloading, and Configuration Setting.
Authentication

The information you enter here is used to communicate with a remote REDCap server or servers. For each REDCap project from which you wish to load data, there must be a separate row of connection information.

  • token: A hexidecimal value used by the REDCap server to authenticate the identity of LabKey Server as a client. (Get the token value from your REDCap server, located on the REDCap API settings page of the project you are exporting from.)
  • project: The name of the target REDCap project. This value should match the project name in the configuration XML specified in the Configuration Setting tab.

Reloading

On the Reloading tab, enable data reloading on a repeating schedule.

  • Enable Reloading: Place a checkmark here to start reloading.
  • Load On: Set the start date for the reloading schedule.
  • Repeat (days): Repeat the reload after this number of days.
  • Click Save to confirm your changes.
  • Click Reload Now to manually reload the data.

Configuration Settings

Enter configuration information in the text box. Use the example XML as a template. Available configuration options are described below:

  • serverUrl: Required. The URL of the REDCap server api (https://redcap.test.org/redcap/api/).
  • projectName: Required. The name of the REDCap project (used to look up the project token from the netrc file). The projectName must match the project name entered on the Authentication tab.
  • subjectId: Required. The field name in the REDCap project that corresponds to LabKey Server's participant id column.
  • timepointType: Optional. the timepoint type (possible values are either 'visit' or 'date'), the default value is: 'date'.
  • matchSubjectIdByLabel: Optional. Boolean value. If set to true, the import process will interpret 'subjectId' as a regular expression. Useful in situations where there are slight variations in subject id field names across forms in the REDCap project.
  • duplicateNamePolicy: Optional. How to handle duplicate forms when exporting from multiple REDCap projects. If the value is set to 'fail' (the default), then the import will fail if duplicate form names are found in the projects. If the value is set to 'merge', then the records from the duplicate forms will be merged into the same dataset in LabKey Server (provided the two forms have an identical set of column names).
  • formName: Optional. The name of a REDCap form to import into LabKey Server as a dataset.
  • dateField: Optional. The field that holds the date information in the REDCap form.
  • demographic: Optional. Boolean value indicating whether the REDCap form will be imported into LabKey Server as a 'demographic' dataset.

Example Configuration File

<red:redcapConfig xmlns:red="http://labkey.org/study/xml/redcapExport">
<red:projects>
<red:project>
<red:serverUrl>https://redcap.test.org/redcap/api/</red:serverUrl>
<red:projectName>MyCaseReports</red:projectName>
<red:subjectId>ParticipantId</red:subjectId>
<red:matchSubjectIdByLabel>true</red:matchSubjectIdByLabel> <!--Optional-->
<red:demographic>true</red:demographic> <!--Optional-->
<red:forms> <!--Optional-->
<red:form>
<red:formName>IntakeForm</red:formName>
<red:dateField>StartDate</red:dateField>
<red:demographic>true</red:demographic>
</red:form>
</red:forms>
</red:project>
</red:projects>
<red:timepointType>visit</red:timepointType> <!--Optional-->
<red:duplicateNamePolicy>merge</red:duplicateNamePolicy> <!--Optional-->
</red:redcapConfig>

Related Resources


previousnext
 
expand allcollapse all