Previous Topic

Next Topic

Book Contents

Conversion object

The InForm application allows you to define CRF components that you specify as units. You can define unit CRF components with reference to other units, so that data can be displayed online as one unit and stored in the database, after conversion, as the other. For example, you can design a CRF so that a CRC can choose whether to enter a weight in ounces or pounds, and specify that the weight is always stored in the database in ounces. The unit in which data is stored in the database after conversion is called the base unit, and the data value, after conversion to the base unit, is called the normalized value.

To perform conversions between the entered and base unit values, you create rules with a rule type of Conversion. The scripts for these rules can use the Data object.

Data object

The Data object allows you to specify how to perform a conversion between the item entered value and the normalized value stored in the database after conversion. A conversion rule is attached in an XML file to a unit definition, which includes the RefName of the rule.

The Data object has the following properties:

Data object properties

Property

Type

Purpose

Result

FLOAT

Holds the result of the conversion.

BaseValue

NUMERIC

Contains the value to be converted.

Example

The following conversion rule script converts from centimeters to millimeters:

Data.Result=Data.BaseValue*10

Send Feedback