_CalculateWaistHipRatio

Calculates the waist-to-hip ratio.

Syntax

_CalculateWaistHipRatio(waist,hip)

Parameters

Parameter Definition Data type

waist

Waist measurement of the subject.

Float

hip

Hip measurement of the subject.

Float

Returns

Waist-to-hip ratio (Float).

Notes

  • Waist-to-hip ratio is calculated as waist/hip.
  • Both measurements must be in the same units. For example, if one measurement is in centimeters, the other must be, as well.

Exceptions

An exception of type Argument Exception is returned if the hip measurement equals zero. This exception results in:
  • Failure of the rule execution.
  • An Oracle Health Sciences InForm Server Error in the Oracle Health Sciences InForm client application.
  • An entry in the Event log on the Oracle Health Sciences InForm server computer.

Example

The following rule is attached to the Vital Signs form and does not need any objects from outside the form. The form includes a waistCircumference item to record the measurement of waist circumference and a hipCircumference item to record the measurement of hip circumference. Both allow the value to be recorded in centimeters or inches, but both values are normalized to centimeters.

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 = _CalculateWaistHipRatio(this.waistCircumference.Value, this.hipCircumference.Value)
alwys
   set this.whRatio.Value = value