Edit a Computation

To edit a computation, click the Edit button on the item’s design surface card.

Neutral Specification vs Native Code

At the top of the computation editor is a toggle labeled Use Native Code. When using native code, custom Blaise code can be specified and will be included in the RULES section of the generated Blaise survey.

Note

The visual editor for the neutral specification will be included in a future version of Colectica Questionnaires.

Description

The Description tab lets you specify basic metadata about the computation.

Name
A short name used to refer to the computation.
Label
A label used to denote the computation in documentation.
Description
A description of what the computation performs.

Inputs

The Inputs tab lets you specify what values are necessary to perform the computation.

To add an input:

  1. Click the plus button.
  2. The Select an Input dialog is displayed
  3. Choose an item from the survey to use as an input to the computation.
  4. The input will now be available as a token on the Code tab.

Code

The Code tab lets you specify Blaise code that will be included in the RULES section.

Input and output tokens are displayed above the code entry box. These should be surrounded by double curly braced. For example, to refer to the fields named dogYears and dogAge, code like the following can be used.

{{dogYears}} := {{dogAge}} * 7

When generating Blaise code, Blaise Colectica Questionnaires will replace the terms with the appropriate field names. This allows custom Blaise code to be re-used across instruments, even when the fields used as input to the computation may have different names in different instruments.

Outputs

The Outputs tab lets you specify what fields are made available after the computation.

To add an output:

  1. Click the plus button.
  2. Enter a name for the output.
  3. Choose the scope of the output (Field, Local, or AuxField).
  4. Choose the type of the output (text, numeric, code, date/time).
  5. If the output is a code type, either choose an existing code list or create a new code list to define which code list defines the type.