Skip to main content

Calculations

Calculations are used to dynamically calculate the value of a question based on the values of other questions.

The extensions that fall under this category are:

Variable

Used to define a variable that is available for use in expressions within the same item and any descendant items. This allows it to be consumed by calculatedExpressions when the renderer executes a calculation.

For more information, refer to http://hl7.org/fhir/uv/sdc/expressions.html#variable.

For usages, refer to the CalculatedExpression section on this page.

CalculatedExpression

The basis of calculations in SDC. Allows an item value to update continuously as the answers to dependent questions change. In Smart Forms, calculated expressions are driven by FHIRPath.

View calculatedExpression usages for various item types in Storybook's Item Type Calculations section.

BMI Calculation usage

Old Absolute Cardiovascular Risk Calculation usage

Chained Calculations usage

Cqf-expression

While calculated expressions are used to update the value of a question dynamically, cqf-expression is used to update the elements/controls within the Questionnaire resource itself during render runtime.

Basic usage

Styled usage