There are multiple data types, including:
A text value.
The maximum length of the string can be indicated.
Optionally a regular expression pattern can be entered in the pattern field of the cde definition
- hello world ( a string containing a space)
- Mary ( a word)
- ” ” ( blank no quotes)
- The string 123
- ^^%%$^%$ff ( non alphanumeric characters )
A whole number. Integer DEs can have a max or min value entered.
12, -1,0 etc.
For more sophisticated DEs, a DE can incorporate Permitted Value Groups (PVG).
A set of allowed values (usually represented as drop down list)
Ranges in RDRF are specified by the datatype keyword “range” and then selecting the appropriate Permitted Value Group This entails that permitted value groups be created first.
- shoe size : big, medium, small
- colour: red, blue , green
Calculated (Derived Data Element)¶
A value which is computed client-side from other values on the form.
To created a calculated DE enter “calculated” as the datatype and then fill in the calculation field of the DE.
A calculation (for BMI) could be coded as:
var height = parseFloat(context.CDEHeight); var mass = parseFloat(context.CDEMass); context.result = mass / ( height * height );
The “context” here is an abstraction representing the other cdes on the containing form. (Hence these other DEs must be present in some section of same form as the form containing the calculated field, else an error will result).
A file DE presents a file chooser widget to the user, allowing upload (and download) of a file from the user’s local file system. NB. Only the uploaded file name is displayed - not the content.
A consent form field.