Sample data-entry rules that use mappings

Example 1

Characteristic Description

Description

Create a rule called rulCompletionLaterThanDOV that checks whether the completion date is later than any of the visit dates entered. If not, issue a query.

Scope

Global; rule is on the Study Completion form, using data from every instance of the DOV form.

Study structure

  • fmStudyCompletion (form)
    • itmCompletionDate (item)
  • fmDOV (form in each study event)
    • itmDOV (Item)
  • VisitDates (mapping)
    • VisitDatesDataSet (data set)
      • DOVs (data series with itmDOV item mapped using the Always mapping type so the item is available in every form and every study event where it occurs)

Rule summary

evaluate on Form Submission

value = _IsValueGreaterThanOrEqualToArray
(this.Value,this.VisitDatesDataSet.DOVs.Values)

when value is false
    issue query: Termination Date must be later than any visit date.

Example 2

Characteristic Description

Description

Create a rule called rulHemoglobinRange that checks whether the entered hemoglobin range is between 140 and 180 for males or between 120 and 160 for females. If not, issue a query.

Scope

Global; rule is on the Hematology form, using data from the Demographics form.

Study structure

  • fmHematology (form)
    • itmHgb (item)
  • fmDemog (form)
    • itmGender (item)
  • Demog (mapping)
    • DemogDataSet (data set)
      • GenderDataSeries (data series with itmGender item mapped)
Rule summary
evaluate on Form Submission

this.DemogDataSet.GenderDataSeries.GenderCodes.Female &&
this.Value >= Constants.HgbRanges.HgbLowF &&
this.Value <=Constants.HgbRanges.HgbHighF) ||
(this.DemogDataSet.GenderDataSeries.Value ==
this.DemogDataSet.GenderDataSeries.GenderCodes.Male &&
this.Value >=Constants.HgbRanges.HgbLowM && this.Value <=
Constants.HgbRanges.HgbHighM)

when value is false
    issue query: This {EnteredValue} is outside valid hemoglobin range for {EnteredGender}s.