Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • CDMS
  • Castor CDMS Manual
  • Fields and field properties

The 'Calculation' field in CDMS

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • CDMS
    Castor CDMS Manual Castor CDMS Calculations Manual Frequently Asked Questions Articles for Data Managers Castor CDMS Compliance Release Documents
  • eConsent
    Castor eConsent Manual Castor eConsent Compliance Release Documents
  • SMS
    Castor SMS Manual Castor SMS Compliance Release Documents
  • Castor Connect
    Castor Connect Compliance Release Documents Castor Connect Manual Castor Connect - Participant Quick Start Guide
  • Helpdesk
    News Other Resources Castor products knowledge resources
  • Status page
  • Completing a Study
+ More

Table of Contents

Common JavaScript syntax Referring to surveys

A calculation field allows you to specify a formula or calculation in reference to variables present within the study.

 

We have a calculation manual where you can find more information about how to use and create calculation templates. 

 

To make calculations with values of different fields, it must be possible to reference other fields. This is done by using the 'Variable name' entered into study fields. Before creating a calculation field, please enter and note the "Variable name" for the fields that are to be used in the calculation, e.g. to reference the field value of "Is the patient older than 18?" you need its variable {INCL03}:

 

 

To create a calculation field, select the appropriate button in the form builder field list:

 

 

Within the dialog window, complete the field as normal. The 'Summary/Calculation template' field is used to specify the formula/calculation you wish to perform. To reference other fields, place braces '{ }' around the field variable name e.g. {INCL03}. See the image below for a full example:

 

 

Please note that the calculation field value is updated when the fields that are used in the calculation are filled in, and if a user opens the form for a participant in which the calculation field is located. It is always necessary to open the form which contains the calculation field to make sure the calculation is updated. For example, if we want to calculate the BMI using two fields 'weight' and 'height' and the fields 'weight' and 'height' are located in the form Baseline while the BMI calculation field is located in the BMI form, it is necessary to open the BMI form to run the calculation.

 

Common JavaScript syntax

To get you started, here are a few common JavaScript operators to use for basic calculations along with their description.

Description Operator
Variable {Variable}
Addition +
Subtraction -
Division /
Multiplication *

Exponential

(x to the power of y)

Math.pow(x, y)
Equal to ==
Not equal to !=
Greater than >
Greater than or equal >=
Less than <
Less than or equal <=
Logical "AND" &&
Logical "OR" ||

 

Referring to surveys

It is also possible to base the calculations in study forms upon data entered in a survey. When creating the calculation field, enter the variable names defined in your survey fields.

 

For example, using responses from a survey where the patient provides information about weight and height with variable names {surv_pat_weight} and {surv_pat_height}. These variables can be used to create a calculation field inside the study forms that refers to that field, for example: 

 

{surv_pat_weight}/Math.pow({surv_pat_height},2)

 

Please note - Castor can only calculate in reference to the latest filled in version of a survey. This means that it is not possible for calculations to refer to different versions of a survey inside a participant’s record, only to the most recent version provided.

calculation edc/cdms

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Create a new field in CDMS
  • The 'Remark' field in CDMS
  • Field properties: validations (edit checks) and dependencies (field logic) in CDMS
ISO 27001
FDA - 21 CFR part 11
ICH GCP compliant
HIPAA compliant
CDISC
ISO 9001
gdpr compliant

Products & Industries

  • Electronic Data Capture (EDC)
  • ePRO
  • eConsent
  • Decentralized Clinical Trials (DCT)
  • Clinical Data Management
  • Medical Device & Diagnostics
  • Biotech & Pharma
  • CROs
  • Academic Research

Resources

  • Thought Leadership
  • Blog
  • Castor Academy
  • Knowledge Base

 

Company

  • About Us
  • Careers
  • News
  • Contact Support
  • Contact Us

Legal & Compliance

  • Terms of Use
  • Privacy & Cookie Statement
  • Responsible Disclosure Policy
  • Good Clinical Practice (GCP)
  • ISO Compliance Certificates
  • GDPR & HIPAA Compliance
  • Security Statement

© 2022, Castor. All Rights Reserved.

Follow us on social media


Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand