EnteredUnit

Characteristic Description

Icon


Icon for integer icons

Availability

An item with a base unit selected on the Design tab for the item.

Return type

String (for Oracle Central Designer string types).

Description

Returns the localized name of the unit, or null if a unit was not selected. For example, you can use this property in query or email text.

Purpose

If you allow Oracle Health Sciences InForm users to choose between metric and imperial units but want to require that the user is consistent within a form, use this property to check that the values are from the same measurement system. Consider that values entered in the Oracle Health Sciences InForm application are normalized to their base unit. For example, if kg is the base unit, a value of 150 lbs. is stored in the database as 68.0388555 kg.

Some unit conversions are not absolute, which can make writing rules difficult. For example, converting mmol/L requires knowledge of a chemical’s molecular weight.
  • To convert mmol/L of glucose to mg/dL, you multiply by 18.
  • To convert mmol/L of LDL cholesterol to mg/dL, you multiply by 39.
You have the following options for recording this information:
  • If you use a single item, you must create separate unit definitions for each chemical that is measured.
  • If you use a compound item, with one child to store the value and one child to store the unit, you must perform a conversion to normalize the values for reporting or CDD purposes.
  • If you use EnteredValue and EnteredUnit, you can store the true normalized value in a hidden field, which you can use for reporting or CDD.

The following rule example uses EnteredUnit and EnteredValue to convert glucose from mmol/L to mg/dL, and stores that value in the itmNormalizedGlucose item. Consider that a conversion is not done if another unit is chosen; if the base unit is selected, EnteredValue and Value are the same.

value = this.itmGlucose.EnteredUnit == "mmol/L" ?
this.itmGlucose.EnteredValue * 18 : this.itmGlucose.Value
always
    set this.itmNormalizedGlucose = value

You can write a similar rule to convert cholesterol, triglycerides, and other measurements. Additionally, you can replace numerical values, such as 18 and 39, with constants such as Constants.Conversions.Glucose and Constants.Conversions.Cholesterol. You define the constants in the study or a library.