Validations

A validation is a piece of dynamic logic that takes a value as its input and returns a Boolean result. The input value is referenced within the dynamic logic as value. Policies can use dynamic logic validations to configure the following items:

  • Bank accounts

  • Fields.

Per item, a signature is specified. A signature specifies the expected in- and output for a specific piece of dynamic logic.

The following sections each elaborate on one of these signatures.

Bank Account

Every bank account number has a related bank account validation. Every bank account validation has a dynamic logic validation attached to validate the value of the bank account number. The following signature applies:

Table 1. Bank Account
In / Out Name Type Description

In

value

String

The value of the bank account number

Out

n/a

Boolean

True when the bank account is valid

This signature does not specify a default as-of-date. This dynamic logic validation is executed when entering a new bank account number.

Field

A field can have zero or one dynamic logic validation defined. The following signature applies:

Table 2. Field
In / Out Name Type Description

In

value

Same as the field data type

The value of the field

Out

n/a

Boolean

True when the value is valid

The output will be interpreted by Oracle Health Insurance according to Groovy truth logic, meaning that in case a NULL value is returned, this will be interpreted as false.

This signature does not specify a default as-of-date. The execution moment depends on the field type; for free fields, the dynamic logic validation is executed when entering a value for the free field; for flex fields, the dynamic logic validation is executed when entering a flex code.

Consider some simple following examples of field validations:

The dynamic logic to accept only values in uppercase:

value == value.toUpperCase()

To accept only values is in lowercase:

value == value.toLowerCase()

To accept only values that can be parsed as an integer:

value.isInteger()

To accept only values that have no more than 40 characters:

maxLength = 40
value.length() <= maxLength

To accept only values between two numerical values:

min = 18
max = 65
value >= min && value <= max

To accept only values in a specified list:

allowedValues = [ "A", "B", "C" ]
allowedValues.contains(value)

User Defined Validation (Registration)

A dynamic logic signature with User defined validation (Registration) can be used for user-defined validations on the registration entity.

The system automatically executes this dynamic logic in the last step of the creation or updation of a registration using the generic API (PUT, POST, or PATCH) operations. Once the system executes this dynamic logic:

  • If the validation is successful, the registration is created or updated accordingly.

  • If the validation fails, the registration is not created or updated, and the API returns a message (FIN-REGI-VAL-001) with the error details.

When using a collection patch operation (multiple updates sent as part of a single patch request), the system will validate each registration individually and not as a single update; that is, each registration in the payload will be treated as a separate update and validated separately. If the validation fails for any registration, the entire payload/transaction is rejected; data is not persisted, and an error is returned.

This validation is not triggered for system created registrations, registrations created/updated using addRegistration and updateRegistration predefined methods, or when using the registrations integration point.

The following signature applies:

Table 3. User Defined Validation (Registration)
In / Out Name Type Description

In

newRegistration

Object

The new version of the registration that is being evaluated.

In

action

String

C (create) or U (update).

In

userDefinedParameters[0]

String

Variables to add a user-defined substitution message parameter.

In

n/a

Boolean

Result of the validation process.

  • It is allowed to have only one dynamic logic of type validation with the signature User Defined Validation (Registration).

  • Header parameter ignoreUserValidations can override the user-defined validations; when set to true, the system ignores any user-defined validations for the registrations entity.