Benefits Checks
In this example, the system reads the enrollment response and checks for policy products to which the person or object must be enrolled for specific service types. A fatal message is attached to the authorization if the person or object is not enrolled for any of the required products.
Process Step | Rule Step |
---|---|
Benefits Check |
Validation Rule |
The validation rule is setup as follows:
Field | Value |
---|---|
Code |
VAL_SERVICE_TYPE_PROD_ENROLL |
Description |
Service type - product enrollment |
Dynamic Logic Condition |
DYLO_VAL_SERVICE_TYPE_PROD |
Dynamic Logic Function |
- |
Message |
MSG_SERVICE_TYPE_PROD |
Inherit? |
Y |
Enabled? |
Y |
The dynamic logic condition requires a reference sheet to be set up. This reference sheet contains the list of service types and product mappings. The list of products that is returned after addressing the reference sheet is then validated against the policy products received from the enrollment response.
The reference sheet is setup as shown in the image below:

The reference sheet is associated to the dynamic logic condition 'DYLO_VAL_SERVICE_TYPE_PROD'. The condition dynamic logic evaluates to true if the person or object is not enrolled for any of the required products and the message 'MSG_SERVICE_TYPE_PROD' is then attached to the authorization.
Sample dynamic logic function:
def serviceTypeProductList=[]; for ( authorizationServiceType in authorization.authorizationServiceTypeList){ /* for all the service types on the authorization find the related reference sheet lines */ def SearchBuilder baseSearch = new SearchBuilder(ReferenceSheetLine.class).join("serviceTypeProductMapping").by("serviceType").eq(authorizationServiceType.serviceType.code).and().by("startDate").lte(authorization.startDate); if(authorization.endDate != null) { baseSearch = baseSearch.and().group().by("endDate").eq(null).or().by("endDate").gte(authorization.endDate).end(); } def serviceTypeProductMappingList = baseSearch.execute(); serviceTypeProductList.addAll(serviceTypeProductMappingList) } def productExists=false; def checkedProduct =[]; for(serviceTypeProduct in serviceTypeProductList){ /* Check enrollment for the product from the reference sheet line */ if (!checkedProduct.contains( serviceTypeProduct.product)) { productExists=true; for(policyProduct in authorization.policyProductList){ checkedProduct.add(serviceTypeProduct.product) if(serviceTypeProduct.product.equals(policyProduct.product.code) && policyProduct.startDate<= authorization.startDate && (policyProduct.endDate!=null && policyProduct.endDate>= authorization.startDate) && (policyProduct.endDate == null || authorization.endDate ==null ||policyProduct.endDate >= authorization.endDate )){ productExists=false; /* enrollment found */ } } if(productExists){ break; } } } return productExists;