Sanity check

A sanity check step can help to do basic completeness and correctness checks on the request, for example when the system provides ways to extend the authorization through dynamic fields. It is possible that the dynamic fields should have some specific values in agreement with other fields on the authorization for a specific form and type. Such a check can be performed through a validation rule.

In this example, a validation rule is defined to check if the age and gender of the person for whom the authorization is requested are in agreement with the age and gender of each of the requested procedures. If the age and gender requirement are not met for any of the procedures in the request, the validation rule evaluates to true and a message is attached.

The process step 'Sanity Check' is configured as:

Process Step Rule Step

Sanity Check

Validation Rule

The validation rule is setup as follows:

Field Value

Code

VAL_SANITYCHECK

Description

Check if the age and gender of the person are in agreement with the configuration on the procedure

Dynamic Logic Condition

DYLO_VAL_SANITYCHECK

Dynamic Logic Function

-

Message

MSG_VAL_SANITYCHECK_FAILED

Inherit?

N

Enabled?

Y

DYLO_VAL_SANITYCHECK is implemented as below:

for (authorizationLine in authorization.authorizationLineList) {
  def procedureSetting = authorizationLine.procedure.procedureSettingList.asOf(authorizationLine.startDate)
  if(procedureSetting.gender!=null && authorization.person.gender!=null && !authorization.person.gender.equals(procedureSetting.gender)) {
    return true;
  }
  if((procedureSetting.ageFrom!=null && authorization.person.getAge()< procedureSetting.ageFrom)
   &&(procedureSetting.ageTo!=null && authorization.person.getAge()> procedureSetting.ageTo)) {
    return true;
  }
}
return false;

Suppose that the authorization is requested for a male person aged 25 for a procedure ABC and procedure ABC is configured so that no age restrictions apply but is allowed only for the gender 'Female'. In this situation, the validation will evaluate to true and the message MSG_VAL_SANITYCHECK_FAILED will be attached to the authorization.

The message MSG_VAL_SANITYCHECK_FAILED is setup with a severity 'Fatal'. Therefore the system does not execute any subsequent process steps and moves to the finalize step where the authorization is denied.

If the authorization was requested for a female person for procedure ABC or if the procedure requested was something else, the sanity checks would pass and the system would move on to the next configured process step.

The image below summarizes the processing details:

Scenario sanity Check