You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

A RangeCheck defines a constraint on the value of the enclosing item. It represents an expression that evaluates to True when the ItemData value is valid or False when the ItemData value is invalid. The expression is specified using either Comparator and CheckValue or using FormalExpressions.

Element NameRangeCheck
Parent ElementsItemDef, WhereClauseDef
Element XPath(s)

/ODM/Study/MetaDataVersion/WhereClauseDef/RangeCheck

/ODM/Study/MetaDataVersion/ItemDef/RangeCheck

Element Textual ValueNone
AttributesComparator, SoftHard, ItemOID
Child Elements((CheckValue+ | (MethodSignature?, FormalExpression+)), ErrorMessage?)
Usage/Business Rules

AttributeSchema Datatype or EnumerationUsageDefinitionBusiness Rules
Comparator(LT | LE | GT | GE | EQ | NE | IN | NOTIN)ConditionalComparison operator used to compare the item and value(s).Required when at least a child element CheckValue is present.
SoftHard(Soft | Hard)ConditionalType of range check. Soft indicates that a warning occurs  when the RangeCheck fails. Hard indicates that an error occurs when the RangeCheck fails.Required when Comparator is present.
ItemOIDoidrefConditionalIdentifies a variable to compare against.

Required when Comparator is present.

Must match the ItemOID for an ItemRef sibling element within the ItemGroupDef.

Range Checks using Comparator and CheckValue
When using Comparator and Check Value each Range Check represents a one-sided constraint. Multiple Range Checks can be used to specify more complex constraints, e.g., an upper and lower bound would require two Range Checks.

Each constraint is equivalent to:

itemValue comparator checkValue(s)

If an actual data value fails the constraint, it is either rejected (a Hard constraint) or a warning is produced (a Soft constraint).

For the following comparison operators, one Check Value is required.

LTLess than
LELess than or equal to
GTGreater than
GEGreater than or equal to
EQEqual to
NENot equal to


A set of Check Values is required for these comparators:

INOne of listed values
NOTINNot any of list values


If a Measurement Unit is specified, the corresponding Item values must have interconvertible Measurement Units (either explicitly or by default). Proper conversion of units must be done as part of the Range Check. If a Measurement Unit is not specified, the corresponding Item values must not have Measurement Units (either explicitly or by default).


Example

RangeCheck: Value must be positive
<RangeCheck Comparator="GT">
    <CheckValue>0</CheckValue>
</RangeCheck>

Example

RangeCheck: Value IN (list)
<RangeCheck Comparator="IN">
    <CheckValue>1</CheckValue>
    <CheckValue>3</CheckValue>
    <CheckValue>5</CheckValue>
</RangeCheck>

Example

RangeCheck: Value between 18 to 65 inclusive
<RangeCheck Comparator="GE">
    <CheckValue>18</CheckValue>
</RangeCheck>
<RangeCheck Comparator="LE">
    <CheckValue>65</CheckValue>
</RangeCheck>

Range Checks using FormalExpression
When using FormalExpression a Range Check can represent anything, e.g., one sided or multi-sided checks. These type of checks must not provide CheckValue or Comparator as they would all be expressed in the FormalExpression itself. The FormalExpression takes the value of the ItemData element and returns a boolean value which is the result of the expression. Multiple FormalExpressions can be provided if each has a different Context attribute, allowing the same expression to be represented in forms appropriate to multiple systems. Multiple different expressions, with different meanings, must be represented as separate RangeChecks

Example

RangeCheck: Formal Expression: item between 18 to 65 inclusive
                <RangeCheck>
                    <FormalExpression Context="PL/SQL">
                        <Code>IT.DM.AGE between 18 and 65</Code>
                    </FormalExpression>
                </RangeCheck>



  • No labels