Rules with multiple conditions

You can create a rule with multiple conditions using the ? : operator. The operator allows you to mimic an if/then/else control structure and present multiple conditions to determine whether a rule passes or fails.

The following is an example of a rule that returns a Boolean value. However, you can create a rule to return any data type—for example, a Boolean value, an integer, or a string—for which you can provide a corresponding action.

For example, a rule is used to determine the following information:

  • Is the subject pregnant? (True or False)
  • Has a severe or life-threatening adverse event occurred? (True or False)

If both are false, the rule passes. If one is true and the other is false, the rule passes. If both are true, the rule checks that the correct termination code was entered when the subject was terminated from the study.

  • If the correct termination code was entered, the rule passes.
  • If an incorrect termination code was entered, the rule fails, and a query is issued, indicating that the correct termination code must be selected.

The rule checks data on the following forms:

  • Demographics form—To determine if the subject is pregnant.
  • AE (Adverse Events) form—To determine if the adverse event that occurred was severe or life threatening.
  • Termination form—To check the termination code that was used when the subject was terminated from the study.

This rule is created at the study design level because the three forms are in the scope of the study design. The query is created on the Termination form.

Example 1-1 A rule with multiple conditions

evaluate on Form Submission
value = this.InitialVisit.Pregnancy.Pregnant.Value == this.InitialVisit.Pregnancy.Pregnant.YesNoCodes.YesNoCode1 && (this.AECM.AdverseEvents.Current().Severity.Value == this.AECM.AdverseEvents.Current().Severity.SeverityCodes.SeverityCode3 || this.AECM.AdverseEvents.Current().Severity.Value == this.AECM.AdverseEvents.Current().Severity.SeverityCodes.SeverityCode4 ) ? this.Termination.TerminationForm.TerminationReason.Value == this.Termination.TerminationForm.TerminationReason.TerminationCodes.TerminationCodePREGSEV : true
when value is false
issue query on this.Termination.TerminationForm.TerminationReason: If the patient is pregnant and a severe or life-threatening AE occurs, Termination Reason must be filled out with a value of “Severe AE during Pregnancy”

In the previous example, the values collected for items (such as the Pregnancy item) are compared to the codelist item names, not the actual values of the codelist items. You can simplify the rule expression by providing the codelist item values in place of the codelist item names (shown in the following example). However, Oracle recommends that you provide RefNames when writing rules, as this eliminates the need for re-work if study object values change.

The following codes are used in the study:

  • In the YesNo codelist:
    • Yes = 1.
  • In the SeverityCodes codelist:
    • Severe = 3.
    • Life-Threatening = 4.
  • In the TerminationCodes codelist:
    • Severe AE during Pregnancy = PREGSEV

Example 1-2 A simplified rule expression in a rule with multiple conditions

Using these values, you could simplify the rule syntax:

evaluate on Form Submission
value = this.InitialVisit.Pregnancy.Pregnant.Value == 1 && (this.AECM.AdverseEvents.Current().Severity.Value == 3 || this.AECM.AdverseEvents.Current().Severity.Value == 4) ? this.Termination.TerminationForm.TerminationReason.Value == PREGSEV : true
when value is false
issue query on this.Termination.TerminationForm.TerminationReason: If the patient is pregnant and a severe or life-threatening AE occurs, Termination Reason must be filled out with a value of “Severe AE during Pregnancy”