Describing a REDCap Form to RED-I¶
RED-I needs to know certain information about REDCap forms and events so that it can correctly translate and insert clinical data into them.
The description of the forms is done in two XML files called `Form
Events <#form-events>`__ and `Translation
Table <#translation-table>`__. The location of these files is
specified in the settings.ini
configuration file.
*See:* How to Add a Simple REDCap Form to RED-I
Form Events¶
- Format: XML
- Configuration:
- Key: form_events_file
- Default: formEvents.xml
Sample¶
<?xml version="1.0" encoding="UTF-8"?>
<redcapProject>
<name>Project</name>
<form>
<name>cbc</name>
<formDateField>cbc_date</formDateField>
<formCompletedFieldName>cbc_done</formCompletedFieldName>
<formCompletedFieldValue>2</formCompletedFieldValue>
<formImportedFieldName>cbc_imported</formImportedFieldName>
<formImportedFieldValue>Y</formImportedFieldValue>
<event>
<name>1_arm_1</name>
</event>
<event>
<name>2_arm_1</name>
</event>
</form>
</redcapProject>
Root Element¶
Form Elements¶
The follow are children elements of each redcap/form
element.
Event Elements¶
The following are children elements of each redcap/form/event
element.
Required? | Name or Path | Description | Max |
---|---|---|---|
Required | name |
Name of the REDCap Event | 1 |
Translation Table¶
- Format: XML
- Configuration:
- Key: translation_table_file
- Default: translationTable.xml
Sample¶
<rediFieldMap>
<clinicalComponent>
<loinc_code>34714-6</loinc_code>
<clinicalComponentName>INR</clinicalComponentName>
<redcapFormName>inr</redcapFormName>
<redcapFieldNameValue>inr_lab_result</redcapFieldNameValue>
<redcapFieldNameValueDescriptiveText>INR</redcapFieldNameValueDescriptiveText>
<redcapStatusFieldName>inr_lab_status</redcapStatusFieldName>
<redcapStatusFieldValue>NOT_DONE</redcapStatusFieldValue>
</clinicalComponent>
<clinicalComponent>
<loinc_code>11011-4</loinc_code>
<clinicalComponentName>Hepatitis C virus RNA</clinicalComponentName>
<redcapFormName>hcv_rna</redcapFormName>
<redcapFieldNameValue>hcv_lab_result</redcapFieldNameValue>
<redcapFieldNameUnits>hcv_lab_result_units</redcapFieldNameUnits>
<redcapFieldNameValueDescriptiveText>HCV RNA results</redcapFieldNameValueDescriptiveText>
</clinicalComponent>
</rediFieldMap>
Clinical Components¶
Clinical Component is a generic term for test, measurement, or
observation. Each Clinical Component is represented by a
clinicalComponent
XML element whose children elements are as
follows:
How to Add a Simple REDCap Form to RED-I¶
Remember, when “adding a form” you are describing it to RED-I. So, you can open your browser and use the actual REDCap Form to guide you.
- Edit
formEvents.xml
- Copy the contents of the sample data for a
form
element. - Replace the text of all XML Elements using the descriptions above.
- Edit
translationTable.xml
- Copy the contents of the sample data for a
clinicalComponent
element - Replace the text of all XML Elements using the descriptions above.
- Repeat for as many clinical components as needed.
Note¶
You can lookup a field’s ID using REDCap’s Data Collection Instruments editor.
- Click Project Setup
- Under Design your data collection instruments, click Online Designer.
- Find the name of your form (called an Instrument), such as “Demographics”.
- Find the field you are looking for and copy it’s Variable name.