_CalculateBMI
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
- The Body-Mass index is calculated using the following formula:
weight / (height * height)
- Height is assumed to be in centimeters, and weight is assumed to be in kilograms.
Exceptions
An exception of type Argument Exception is returned if the height measurement equals zero. This exception results in:
- Failure of the rule execution.
- An InForm Server Error in the InForm client application.
- An entry in the Event log on the InForm server computer.
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