Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleExpand for the code.
Code Block
languagejson
{
  "name" : "visitsTab",
  "view" : null,
  "ctrl" : null,
  "data" : {
    "anticipatedEvents" : {
      "matchType" : "all",
      "rules" : [ {
        "rule" : "cpr.participant.extensionDetail.attrsMap.marital_status_.indexOf('Married') > -1",
        "events" : [ "C1", "C2", "C3" ]
      }, {
        "rule" : "cpr.participant.extensionDetail.attrsMap.marital_status_.indexOf('Unmarried') > -1",
        "events" : [ "C1", "C3" ]
      }, {
        "rule" : "cpr.participant.extensionDetail.attrsMap.marital_status_.indexOf('EngangedEngaged') > -1",
        "events" : [ "C4", "C5" ]
      }, {
        "rule" : "cpr.participant.extensionDetail.attrsMap.marital_status_.indexOf('Widow') > -1",
        "events" : [ "C6", "C7", "C8", "C1" ]
      }, {
        "rule" : "*",
        "events" : [ "C9" ]
      } ]
    }
  }
}

After adding the above JSON, the visit table on the participant overview page would look like the screenshot added below:

Case 1: 'Marital Status' = 'Married'

Image Added

Case 2: 'Marital Status' = 'Married' & 'Engaged’

Image Added
Info

In both Case 1 and Case 2, Day 9 is showing up because C9 is specified as * in the code.

Note

  1. Rules can be set up to use events of: The first matching rule (matchType = any) OR All the matching rules (matchType = all).

  2. The rule = "*” is a wildcard for catch all.

  3. If no matchType specified/configured, the default setting “any” is considered.