Previous Topic

Next Topic

Book Contents

EnteredValue

EnteredValue

Characteristic

Description

Icon

Icon for integer items. or Icon for float items.

Availability

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

Return type

One of the following:

  • Int32 (for Central Designer Integer and YesNo types).
  • Double (for Central Designer float types).

Description

Returns the entered value for an item for which a base unit was selected.

Purpose

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.

Send Feedback