The following lists all the supported functions within Clinical Studio Computed Fields and the required format to call the function:
Single Parameter Functions
SQR: Square function which can be used as SQR(X)
SIN: Sinus function which can be used as SIN(X), X is a real-type expression. Sin returns the sine of the angle X in radians.
COS: Cosinus function which can be used as COS(X), X is a real-type expression. COS returns the cosine of the angle X in radians.
ATAN: ArcTangent function which can be used as ATAN(X)
SINH: Sinus Hyperbolic function which can be used as SINH(X)
COSH: Cosinus Hyperbolic function which can be used as COSH(X)
COTAN: which can be used as COTAN(X)
TAN: which can be used as TAN(X)
EXP: which can be used as EXP(X)
LN: natural log, which can be used as LN(X)
LOG: 10 based log, which can be used as LOG(X)
SQRT: which can be used as SQRT(X)
ABS: absolute value, which can be used as ABS(X)
SIGN: SIGN(X) returns -1 if X<0; +1 if X>0, 0 if X=0; it can be used as SQR(X)
TRUNC: Discards the fractional part of a number. e.g. TRUNC(-3.2) is -3, TRUNC(3.2) is 3.
CEIL: CEIL(-3.2) = 3, CEIL(3.2) = 4
FLOOR: FLOOR(-3.2) = -4, FLOOR(3.2) = 3
Functions That Take Two Parameters
INTPOW: The INTPOW function raises Base to an integral power. INTPOW(2, 3) = 8. Note that result of INTPOW(2, 3.4) = 8 as well.
POW: The Power function raises Base to any power. For fractional exponents or exponents greater than MaxInt, Base must be greater than 0.
LOGN: The LogN function returns the log base N of X. Example: LOGN(10, 100) = 2
MIN: MIN(2, 3) is 2.
MAX: MAX(2, 3) is 3.
Functions That Take No Parameters
RND: RND() function generates a random number (double value) between 0 and 1.
Functions That Take Unlimited Parameters
SUM: SUM(2,3,5,...) functions returns the sum of its arguments. There is no preset limit on the number of parameters.
IF: The IF(b, case1, case2) function provides branching capability. If b is not 0, then it returns case1, else it returns case2. Behavior is similar to C#'s: return b ? case1 : case2;
If b==0 then case1 will not be Evaluated, and vice versa. Example: IF(HEIGHT, 3/HEIGHT, 3) will make sure 3/HEIGHT does not cause division by zero.
Computed fields can be used to calculate any number of time measurements. There is always a target field. That is the field that we create our computed field conditional action on. The computed field conditional action will always contain a formula. It can optionally contain a condition. That condition will execute the formula if it is true. If no condition is supplied, then the formula will always be executed.
Computed fields can be tested in the Preview window of the Form Builder. This allows the designer to test all computations right from the form builder.
Computed fields will always have a calculator icon next to or below the field. That icon, when clicked, will evaluate the condition and if true, will execute the formula.
All computed fields will also be executed each time a form is saved.