Build Your First Form with the Form Template

Modified on Fri, 20 Nov at 4:57 PM

 

ℹ️ 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.

  1. In Study Designer, click Form Template in the header bar.
  2. 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_titleversionstyle
Vital Signs1theme-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.

typenamelabelbind::oc:itemgrouprequiredcalculation
integersysbpSystolic blood pressure (mmHg)VSyes
integerdiabpDiastolic blood pressure (mmHg)VSyes
select_one positionvsposPositionVS
decimalweightWeight (kg)VS
decimalheightHeight (cm)VS
calculatebmiVSround(${weight} div ((${height} div 100) * (${height} div 100)), 1)
notebmi_displayBMI: ${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_namelabelname
positionSitting1
positionSupine2

 

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.

  1. In Study Designer, find the Screening event and click + Add a form.
  2. Enter Vital Signs as the form name.
  3. On the form, click Upload and select vital_signs.xlsx.
  4. Click Preview and enter some test values.
  5. 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.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article