ℹ️ This page is for Data Managers responsible for study design.
In OpenClinica, the Form Template is an Excel spreadsheet in the XLSForm format that defines a form: one row per question, plus sheets for settings and response options. This step-by-step tutorial uses the Form Template to build a simple Vital Signs electronic case report form (eCRF), from a blank spreadsheet to a form version you can test. It builds the same form as Build Your First Form in Form Designer.
If you are new to OpenClinica, read Building Forms in OpenClinica: Start Here first. For details on any column used here, see Build a Form with the Form Template.
Prerequisites
Check that you have what you need in OpenClinica before you start the tutorial.
- You must be able to open the study in Study Designer.
- The study must have at least one event (a study visit or time point), such as Screening. To add an event, see Events & Forms.
- You need Excel or another spreadsheet program.
- This example creates a new form. If your study already has a Vital Signs form, use another name, such as Vital Signs Example.
Get the Blank Template
Download the blank OpenClinica Form Template from Study Designer.
- In Study Designer, click Form Template in the header bar.
- Open the downloaded file and save a copy named vital_signs.xlsx.
Fill In the Settings Sheet
The settings sheet of the Form Template holds the form's title, version, and layout. On the settings sheet, enter these values in row 2.
| form_title | version | style |
|---|---|---|
| Vital Signs | 1 | theme-grid |
The form_title is the title shown at the top of the form, the version identifies this version of the form, and the theme-grid style lets related measurements sit side by side.
Add the Questions on the Survey Sheet
The survey sheet of the Form Template holds one row per question. Enter these rows, and leave the columns not shown here blank.
| type | name | label | bind::oc:itemgroup | required | calculation |
|---|---|---|---|---|---|
| integer | sysbp | Systolic blood pressure (mmHg) | VS | yes | |
| integer | diabp | Diastolic blood pressure (mmHg) | VS | yes | |
| select_one position | vspos | Position | VS | ||
| decimal | weight | Weight (kg) | VS | ||
| decimal | height | Height (cm) | VS | ||
| calculate | bmi | VS | round(${weight} div ((${height} div 100) * (${height} div 100)), 1) | ||
| note | bmi_display | BMI: ${bmi} |
The type column sets the item type, name is the Item Name (the variable name in data extracts), label is the question text, bind::oc:itemgroup is the Item Group (the dataset the item is stored in), and required makes the question mandatory. Every question uses the same Item Group (VS), which keeps the vital signs together in data extracts. The calculate row works out body mass index (BMI) from weight and height, and the note shows the result on the form.
Add the Response Options on the Choices Sheet
The choices sheet of the Form Template holds the answer options for Select One and Select Multiple questions. The Position question's type is select_one position, so its options use position as their list_name.
| list_name | label | name |
|---|---|---|
| position | Sitting | 1 |
| position | Supine | 2 |
The list_name links the options to the question, label is the answer text users see, and name is the value stored in the database. Save the spreadsheet.
Upload and Preview the Form
Upload the spreadsheet in OpenClinica Study Designer and check the form in the preview.
- In Study Designer, find the Screening event and click + Add a form.
- Enter Vital Signs as the form name.
- On the form, click Upload and select vital_signs.xlsx.
- Click Preview and enter some test values.
- Check that each question appears as expected and that the BMI value calculates from the weight and height you entered.
An uploaded spreadsheet becomes a form version immediately; there is no draft step. You can now publish the study to the Test environment and test data entry. See Publishing Your Study.
If the Upload Fails
These are the upload errors new Form Template users see most often in OpenClinica.
- The "version" column in the "settings" worksheet must have a value in row 2.: enter 1 in the version column of the settings sheet.
- Element "X" must be assigned to an Item Group: enter VS in the bind::oc:itemgroup column for that question.
- Element "X" cannot have a value in column "calculation" unless it is read-only.: check that the BMI row's type is calculate.
For more upload errors and how to fix them, see Common Form Template Upload Errors.
What's Next
Continue with these OpenClinica articles.
- Add skip logic, edit checks, and required logic. See Form Logic.
- Make edit checks and required items hard, or add cascading selects. See Build a Form with the Form Template.
- Choose other item types and display options in Item Types and Appearance Reference.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article