Conversion to different units in rules
In the Oracle Health Sciences InForm application, when the base unit of an item is in one unit, such as kilograms, but the item allows users to enter different units, such as pounds, the value for the item is stored in the database in two ways—as the entered value (pounds) and the normalized value (pounds converted to kilograms).
For example, if a user types 154 and selects pounds, the value is stored as 154 pounds (for the entered value) and 70 kilograms (for the normalized value). The conversion process from the entered unit to the base unit is called normalization.
Some rules and functions require specific units for item values. For example, a BMI rule might require a weight value to be in kilograms. If a weight item uses pounds instead of kilograms as the base unit, a conversion from pounds to kilograms has to be done in the rule expression.
If the BMI rule is created on a VitalSigns form with Height, Weight, and BMI items, the rule expression with the conversion information could appear as follows:
(this.Weight.Value *
0.45359) / ((this.Height.Value) * (this.Height.Value))
Alternately, you can define a constant that performs the conversion. For example, you can define a LbToKg constant that equals 0.45359 and use the constant in the expression:
(this.Weight.Value * LbtoKg) /
((this.Height.Value) * (this.Height.Value))
Parent topic: About the rule expression language