Versions Compared

Key

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

This error occurs if the null check condition is not added for the fields or custom forms (that are non-mandatory) that are used in any of the edit check rules present in the workflow. Hence, before accessing such fields/forms, it is essential that we must put a ‘not null’ check.
This check is defined in the ‘when’ part of the edit check syntax.


Here is an example:
Checking the combination of ‘Primary Site’ values from the ‘Demo Pathology’ form with respect to concerning participant gender.
We need to check that the form is filled, and the value for ‘Primary Site’ in the form exists by adding the ‘not null’ condition in the ‘when’ part of the edit check.
"when" : "#cpr.participant.gender == 'Female' && #cpr.registrationDate != null && #visit.visitDate != null && #visitForms['demoPathologyForm'] != null && #visitForms['demoPathologyForm']['primarySite'] != null"

Code Block
languagejs
{
        "records" : [ "cpr", "visit" ],
        "forms" : 
        {
          "visit" : [ "demoPathologyForm" ]
        },
        "rules" : 
        [
          {
            "when" : "#cpr.participant.gender == 'Female' && #cpr.registrationDate != null && #visit.visitDate != null && #visitForms['demoPathologyForm'] != null && #visitForms['demoPathologyForm']['primarySite'] != null",
            "expr" : "!{'Penis, NOS', 'Prostate gland', 'Testis, NOS', 'Scrotum, NOS', 'Male genital organs, NOS'}.contains(#visitForms['demoPathologyForm']['primarySite'])",
            "description" : "Check the Primary Site values with respect to gender"
          }
        ]
    }

Please note that even if the null check is missed in any of the edit checks, it will give an error for all the pages included in the edit check block whenever the user tries to add/update any data. So make sure that all the non-mandatory fields/forms are checked for being ‘NOT NULL’.