Sample data-entry rule that uses constants

Characteristic Description

Description

Create a rule named rulTempRangeCheckInclusive that checks that the Temperature item is >=36.1 and <=37.8. If not create a query: The entered temperature {EnteredTemp} {EnteredTempUnit} is outside the expected range. Use the TempMin and TempMax constants that you created in the expression. Use the EnteredValue and EnteredUnit rule model properties to construct the query text.

Scope

Temperature item on the Vitals form

Study structure

  • Vitls (form)
    • Pulse (item)

Rule summary

evaluate on Form Submission

value = Value must be greater than or equal to {MinValue:Constants.TemperatureRange.TempMin}, and less than or equal to {MaxValue:Constants.TemperatureRange.TempMax}

when value is false
issue query: The entered temperature {EnteredTemp} {EnteredTempUnit} is outside the expected range of {TempMin} to {TempMax}

OR
evaluate on Form Submission

value = this.Value >= (Constants.TemperatureRange.TempMin) &&
this.Value <=(Constants.TemperatureRange.TempMax)

when value is false
    issue query: The entered temperature {EnteredTemp} {EnteredTempUnit} is outside the expected range.

Note:

In the first solution, the rule is defined as an intrinsic rule that uses the range check rule template. In the second solution, the rule is defined as a constraint rule that does not use a template.