Calculates the Body-Mass Index, based on height and weight.
Syntax
_CalculateBMI(height,weight)
Parameters
Parameters for _CalculateBMI
Parameter |
Definition |
Data type |
---|---|---|
height |
Height of the subject, in centimeters. |
Float |
weight |
Weight of the subject, in kilograms. |
Float |
Returns
BMI measurement (Float).
Notes
weight / (height * height)
Exceptions
An exception of type Argument Exception is returned if the height measurement equals zero. This exception results in:
Example
The following rule is created at the form level on the Vital Signs form, which has items Weight and BMI. The rule also refers to the item Ht in a mapping called RulesLS.
Note: Oracle recommends that you include rule logic to clear the calculated value if a referenced item value is cleared. For example, if a rule calculates BMI based on the values entered in the Height and Weight items, the rule should clear the BMI value if the data in the Height item is deleted. For an example of the appropriate rule logic, see Sample data-entry rules that use methods.
evaluate on Form Submission
value = _CalculateBMI(RulesLS.DSRules.Ht.Value, this.Weight.Value)
always
set this.BMI.Value = value
Copyright © 2013, 2016 Oracle and/or its affiliates. All rights reserved.