Predefined Methods

This section describes the pre-defined methods available per object. These pre-defined methods have two categories:

  1. Methods that are available on all or multiple objects, called generic methods.

  2. Methods that are only available on particular objects, called specific methods.

Generic Methods

addDynamicRecord

Adds a new dynamic record to an object. If the record’s usage is configured as time-valid, then the record supports two additional attributes. They are startDate and endDate, of which the former is mandatory.

Availability

This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.

Table 1. addDynamicRecord
In or Out Type Description

In

String

The usage name

In

Map

The attributes of the record, structured as name and value pairs

Example: Add a Non-Time-Valid Record

The following logic adds a non-time-valid record:

person.addDynamicRecord( "occurrence"
                      , [ code        : "06"
                        , description : "Crime victim"
                        ]
                      )
Example: Add A Time-Valid Record

Add a time-valid record in the same manner, except the map contains two extra attributes:

person.addDynamicRecord( "dynRecord1"
                      , [ code        : "06"
                        , description : "dynRecord 1 value 6"
                        , startDate   : person.dateOfBirth
                        , endDate     : person.endDate
                        ]
                      )

deleteDynamicRecord

Deletes an existing dynamic record. If a key attribute is configured on the record’s definition, then the second input argument can delete a dynamic record with a specific key value. If no record with a matching key value is found, nothing is deleted. If multiple records match with the input key value, only one record is deleted. If the input key is NULL, or if no key attribute is configured at all, then all associated dynamic records are deleted.

Availability

This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.

Table 2. deleteDynamicRecord
In or Out Type Description

In

String

The usage name

In

String

The record’s key attribute value, or null.

Examples

Assume an existing person has the following three values for the dynRecord1 record. This dynamic record has two attributes: code and description, where code is configured as the key.

Table 3. Examples
Code Description

01

dynRecord1 value 1

02

dynRecord1 value 2

03

dynRecord1 value 3

The following logic deletes the record with code 02 while leaving the other two records intact.

person.deleteDynamicRecord("dynRecord1", "02")

The following logic deletes all three occurrences in records.

person.deleteDynamicRecord("dynRecord1", null)

getDynamicRecords

Retrieves the dynamic record or records of a particular object. The output parameter type depends on the record’s definition. Check the detailed description in the section below.

Dynamic records are also available as attributes of an entity. Access them directly from the object with a usage name, instead of explicitly invoking this method. See examples.

Availability

This method is available for all objects that support dynamic records.

Single-value and Non-time-valid

This method will return a single record if the record definition has both single-value and non-time-valid configurations.

Table 4. getDynamicRecords
In or Out Type Description

In

String

A usage name.

Out

Map

The attributes of the record can be a name and a value pair.

Example

assert claim.getDynamicRecords("hobby").name == "Cricket"
assert claim.getDynamicRecords("hobby").level.code == "BEGINNER"

assert claim.hobby.name == "Cricket"
assert claim.hobby.level.code == "BEGINNER"

Multi-value or Time-valid

This method will return a list of records if the record definition has either multi-value or time-valid configurations.

Table 5. Multi-value or Time-valid
In or Out Type Description

In

String

A usage name.

Out

List

A list of records. Each record represents a map of attribute names or value pairs.

Example

assert claim.getDynamicRecords("hobbies").size() == 2
assert claim.getDynamicRecords("hobbies")[0].name == "Cricket"
assert claim.getDynamicRecords("hobbies")[1].name == "Soccer"

assert claim.hobbies.size() == 2
assert claim.hobbies[0].name == "Cricket"
assert claim.hobbies[1].name == "Soccer"

getSequenceNumber

Allows retrieval of a unique number from a user-defined sequence. Passes the Code of the user-defined sequence. Note that it is important to configure the sequence via the /usersequences resource before using it.

Table 6. getSequenceNumber
In or Out Type Description

In

String

Code of the user-defined sequence

Example
batchNumber = getSequenceNumber("batch_sequence")

getSystemProperty

Returns the value of the property with the passed key as input.

Availability

This method is available in the dynamic logic (Groovy script).

Table 7. getSystemProperty
In or Out Type Description

In

String

Key of the property

Out

String

Value of the property

lookUp

Looks up the object in the system on the passed input parameters.

Availability

This method is available in the dynamic logic (Groovy script).

Table 8. lookUp
In or Out Type Description

In

Class<?>

Class of the object that needs looking up.

In

Map<String,Object>

Map of key and value pairs to identify the object uniquely The key of the map must be an attribute name to search on, like Code or Start Date. The value must be the value that needs searching. So, it must be a string for Code or a date for a Date type argument.

Out

Object

Object that the search finds It is advisable to pass the parameters with restraint as the lookup restricts in providing only the first object.

Example
def premiumSchedule = lookUp(PremiumSchedule.class, ['code': 'PS1'])

lookUpFlexCode

Returns the flex code object that matches the input character string.

Availability

This method can be called without a base object.

Table 9. lookUpFlexCode
In / Out Type Description

In

String

Key value of the flexCode

In

String

Definition code of the flexCode

Out

flexCode

The flex code

Example
person.dynamicFieldYesNoIndicator = lookUpFlexCode("YES", "YES_NO")

lookUpInsurableEntity

Looks up the Insurable Entity in the system on the input parameters passed.

Availability

This method is available in the Dynamic Logic (Groovy script).

Table 10. lookUpInsurableEntity
In or Out Type Description

In

String

Code of the object or Person

In

String

Usage name of the Insurable Entity Type of the Insurable Entity

Out

Insurable Entity

Insurable Entity

lookUpPerson

Looks up the Person in the system on the input parameters passed.

Availability

This method is available in the Dynamic Logic (Groovy script).

Table 11. lookUpPerson
In or Out Type Description

In

String

Code of the Person

Out

Person

Person

lookUpProvider

Looks up the Provider in the system on the input parameters passed.

Availability

This method is available in the Dynamic Logic (Groovy script).

Table 12. lookUpProvider
In or Out Type Description

In

String

Code of the Provider

In

String

Definition Code of the Provider

Out

provider

Provider

lookUpRelation

Looks up the Person or Organization in the system based on input parameters passed.

Availability

This method is available in the Dynamic Logic (Groovy script).

Table 13. lookUpRelation
In or Out Type Description

In

String

Code of the Relation.

Out

Relation

Relation

test

A method that tests a dynamic logic:

  1. Follows the security restrictions of the unit under test (UUT).

  2. The application sets the transaction to rollback only. Any data changes to the database are temporary.

    Availability

    This method is available for a Dynamic Logic (Groovy script).

Table 14. test
In or Out Type Description

In

String

Dynamic logic Code of the UUT

In

Map<String,Object>

Map with the input parameters of the UUT

Out

DynamicLogicResult

Contains the result of the test and the exception class if the test encounters any errors.

Attributes of this object are:

  • result

  • exception

Example
def result = test("SPECIAL_BENEFIT_SELECT", [
    "claim" : claim
])

updateDynamicRecord

Updates the attributes of an existing dynamic record. To find the correct record to update, match on the record’s key attribute value. If none of the existing records have a matching key value, nothing is updated. If multiple records match with the key value, only one of them is updated. If no key is configured at all, executing this method results in adding a record. This applies to both non-time-valid and time-valid dynamic records, so time-validity does not play a role in finding the record to update.

Only the attributes that are present in the input map are updated. Attributes that are not mentioned are left untouched.

Availability

This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.

Table 15. updateDynamicRecord
In / Out Type Description

In

String

A usage name.

In

Map

The attributes of the record, that can have a structure of name or value pairs.

Example, Update a Multi-Value Record

Assume an existing person has the following three values for the dynRecord1 record. This dynamic record has three attributes: code, description, and level, where code is configured as the key.

Table 16. Update a Multi-Value Record
Code Description Level

01

dynRecord1 value 1

3

02

dynRecord1 value 2

7

03

dynRecord1 value 3

12

The following logic updates the level of the record with code 02 from 7 to 6. Its description is retained.

person.updateDynamicRecord( "dynRecord1"
                         , [ code  : "02"
                           , level : 6
                           ]
                         )
Example: Update a Time-Valid Record

Update a record’s start and end date attribute in the same way as other attributes. Assume an existing person has the following two values for the dynRecord1 record. Besides, startDate and endDate, this time-valid dynamic record has two attributes: code, description, where code is configured as the key.

Table 17. Update a Time-Valid Record
Code Description StartDate EndDate

01

dynRecord1 value 1

2015-01-01

2015-12-31

02

dynRecord1 value 2

2016-01-01

The following logic sets the endDate of the second record to the person’s end date. Its other attributes are retained.

person.updateDynamicRecord("dynRecord1"
                         , [ code    : "02"
                           , endDate : person.endDate
                           ]
                         )

Search Methods

Please refer to the Claims – Developer Guide for the list of search methods.

Object Methods

This section describes the methods that are available on specific objects. It mentions the following information for each method:

  • The purpose of the method.

  • On which object or objects to call the method.

  • The description of the parameters.

addAssignedProvider

Adds an Assigned Provider to a Person (for example, through a Policy Validation Rule).

If the provider type is specified, then this method creates a new provider record when one does not already exist.

The new provider is created with the following fields already set: code, flex code definition, language and type. The function that calls this method is responsible for setting all other provider fields, including those that are required.

Availability

This method is available for the Person object in the following signatures:

  • Callout Function

  • Policy Validation Rule Function (all three levels)

  • Bulk update

Parameters:

Table 18. addAssignedProvider
In or Out Type Description

In

String

The Provider Code (mandatory).

In

String

The Provider Flex Code Definition Code (mandatory).

In

String

The Provider Assignment Type Code (mandatory).

In

Date

The Assigned Provider Start Date (mandatory)

In

Date

The Assigned Provider End Date (optional).

In

String

The Provider Type (optional). Either I for an individual provider or an O for an organization provider.

Out

Provider

If the method created a new provider, the provider object is returned. Null otherwise.

Example
// Assign new an Individual Provider to a Person
// If the Individual Provider does not exist, it is created

// Order of the parameters:
// 1: The Individual Provider code (mandatory)
// 2: The Individual Provider Flex Code Definition Code (mandatory)
// 3: The Individual Provider Assignment Type Code (mandatory)
// 4: The Assigned Provider Start Date (mandatory)
// 5: The Assigned Provider End Date (optional)
// 6: The Individual Provider Type (optional)

// The Individual Provider type (6) is optional
// but required for the use case where new Individual Providers need to be created

Provider newProvider=policyEnrollment.person.addAssignedProvider('1234567890', 'NPI', 'PCP', java.sql.Date.valueOf('2017-01-01'), null, 'I')
def funcDylo = lookUp(DynamicLogic.class, ['code': 'NAFMDFLTPROV'])
if (newProvider != null)
// set fields if provider is new
{
  newProvider.name = "Jones"
  newProvider.startDate = java.sql.Date.valueOf('2020-02-02')
  newProvider.endDate = java.sql.Date.valueOf('2023-12-31')
  newProvider.functionDynamicLogic(funcDylo)
}

addBrokerAgent

Creates a Policy Broker Agent with the passed Broker, Agent, and Start Date values. The method adds the new policyBrokerAgent to the policyBrokerAgent detail list. The Dynamic Logic using this method results in failure with a technical error (OHI-DYLO-007) if the passed values in broker or agent do not exist in the system.

Availability

This method is available on a Policy.

Parameters:

Table 19. addBrokerAgent
In or Out Type Description

In

String

The Broker Code of the new Policy Broker Agent.

In

String

The Agent Code of the new Policy Broker Agent.

In

Date

The Start Date of the new Policy Broker Agent. It is mandatory.

Out

Policy Broker Agent

The new copy of the Policy Broker Agent.

Example
def newPolicyBrokerAgent = policy.addBrokerAgent("newBROKERA", null, java.sql.Date.valueOf("2021-01-01"))

addContractAlignment

Adds a contract alignment to a Person (for example, through a Policy Validation Rule).

Availability

This method is available for a Person object. Its purpose is to have the possibility to add a contract alignment through the function Dynamic Logic.

Parameters:

Table 20. addContractAlignment
In or Out Type Description

In

String

Capitation contract Code (mandatory)

In

Date

Contract alignment Start Date (mandatory)

In

Date

Contract alignment End Date (optional)

Example
person.addContractAlignment('CONTR001', java.sql.Date.valueOf('2017-01-01'), java.sql.Date.valueOf('2017-12-12'))

addGroupClientEvent

Adds an event record to a Group Client. The method stamps the username of the user responsible for creating the event on the event record.

Availability

This method is available for Group Client. Its purpose is to add an event record to the Group Client.

Parameters:

Table 21. addGroupClientEvent
In or Out Type Description

In

String

The Description of the event. It is mandatory.

In

Datetime

The date and time of when the event occurs. It is mandatory.

In

String

The Code of the Policy related to the Group Client event. This is optional.

In

String

The Code of the Group Account related to the Group Client event. This is optional.

In

String

The Activity ID of the message that goes out related to the Group Client.

Example

In the below example, two dynamic fields on the Group Client event (user and ext_id) are populated:

groupClient.addGroupClientEvent('New Group Account added'
                               , java.sql.Date.valueOf("2021-01-01")
                               , 'POL1234'
                               , 'GRAC_ABC'
                                  )

addMessage

The method adds a message to a Policy or a Group Client (for example, through a Policy Validation Rule).

Availability

This method is available for Policy and Group Client. Its purpose is to have the possibility to add a message through function Dynamic Logic.

Parameters:

Table 22. addMessage
In or Out Type Description

In

String

Contains a message Code. It is mandatory.

In

Object[]

Contains message arguments. It is optional.

Example
policy.addMessage('CMPL_01')
groupClient.addMessage('CRCL_01')

addParameterValue

The method adds a parameter value to the Policy Enrollment Product.

Availability

This method is available for policyEnrollmentProduct.

Parameters:

Table 23. addParameterValue
In or Out Type Description

In

Object

The value of the parameter.

Example
def parameterAlias = lookUp(ParameterAlias.class, ['code': 'PARAM_01'])
def policyParameterValue = new ParameterValue()
policyParameterValue.parameterAlias = parameterAlias
policyParameterValue.amount = Money.create(100.00,'USD')
policyParameterValue.startDate = java.sql.Date.valueOf("2021-01-01")
policy.policyEnrollmentList[0].policyEnrollmentProductList[0].addParameterValue(policyParameterValue)

addPersonCoveredService

The method adds a Person Covered Service to a erson.

Availability

This method is available for the Person object. Its purpose is to add a Person Covered Service through a Dynamic Logic Function of signature Person Covered Service.

Parameters:

Table 24. addPersonCoveredService
In or Out Type Description

In

Object

The Person Covered Service name (mandatory).

Example
PersonCoveredService peco = new PersonCoveredService()
peco.product = lookUp(Product.class, ['code': 'GOLD'])
peco.coveredServiceType = "L"
peco.startDate = java.sql.Date.valueOf("2019-01-01")
peco.locked = false
peco.serviceOptionServiceCode = "DENTAL"
peco.waitStartDate = java.sql.Date.valueOf("2019-03-01")

person.addPersonCoveredService(peco)

addPolicyAddOn

Adds an Add-on to the Policy Enrollment Product.

Availability

This method is available for policyEnrollmentProduct.

Parameters:

Table 25. addPolicyAddOn
In or Out Type Description

In

Object

The Policy Add-on

Example
def addOn = lookUp(AddOn.class, ['code': 'ADDON_01'])
def policyAddOn = new PolicyAddOn()
policyAddOn.addOn = addOn
policyAddOn.startDate = java.sql.Date.valueOf("2021-01-01")
policy.policyEnrollmentList[0].policyEnrollmentProductList[0].addPolicyAddOn(policyAddOn)

addPolicyBillReceiver

This method adds a bill receiver to the Policy Premium Bill Allocation.

Availability

This method is available for policyPremiumBillAllocation.

Parameters:

Table 26. addPolicyBillReceiver
In or Out Type Description

In

String

Relation Code (optional)

In

BigDecimal

Percentage (mandatory)

In

String

Billing Account Code (optional)

Example
policyPremiumBillAllocation.addPolicyBillReceiver("REL83746", 50, "")

addPolicyBulkUpdateHistory

Adds a Bulk Update History to the policy

Availability

This method is available on a Policy within the Bulk Update Function signature.

Parameters:

Table 27. addPolicyBulkUpdateHistory
In or Out Type Description

In

String

The Bulk Update Definition Code

Out

Object

The Policy Bulk Update History

Policy GID, version, datetime and user are derived from context.

Example
def newPolicyBulkUpdateHistory = policy.addPolicyBulkUpdateHistory("BUDEF12345")

addPolicyEnrollmentEvent

Creates a Policy Enrollment Event of the type 'Business' with the passed values.

Availability

This method is available on a Policy within the Bulk Update Function dynamic logic signature.

Parameters:

Table 28. addPolicyEnrollmentEvent
In or Out Type

In

String

The Business Event Definition Code (mandatory)

In

String

Description (optional)

In

String

The Person Code (optional)

In

Object[]

Business Event Display text arguments (optional)

Out

Object

The Policy Enrollment Event

The method takes 4 parameters and returns a PolicyEnrollmentEvent instance. The customer can set the other fields themselves explicitly. For example, if the policyEnrollmentEvent is intended for a specific version of the policy, set the policy id of that policy version.

A description is not applicable to Business policy enrollment events and can be left empty.

If the policyEnrollmentEvent is intended for a specific member on the policy, the person code must be included.

Example
// Parameter 1: Business Event Defintion code
// Parameter 2: Description
// Parameter 3: Person code

def newPolicyEnrollmentEvent = policy.addPolicyEnrollmentEvent("BEDE001", "Member reached age 26", "PERSON54321")

addPolicyEnrollmentInsurableClass

This method adds an Insurable Class to the Policy Enrollment.

Availability

This method is available for policyEnrollment.

Parameters:

Table 29. addPolicyEnrollmentInsurableClass
In or Out Type Description

In

String

The Code of the Insurable Class (mandatory).

In

Date

The Start Date of the new Policy Enrollment Insurable Class (mandatory).

Example
policyEnrollment.addPolicyEnrollmentInsurableClass("EMPLOYEE", java.sql.Date.valueOf("2021-01-01"))

addPolicyEnrollmentProduct

Adds a policy enrollment product to the list of policy enrollment products.

If the policy has a Policy group account on the parameter start date, then the created policy enrollment product links towards a group account product. Otherwise, the created product enrollment product links to an enrollment product

Availability

This method is available on PolicyEnrollment in the following signatures:

  • Callout Function

  • Policy Validation Rule Function (all three levels)

  • Bulk update

Parameters:

Table 30. addPolicyEnrollmentProduct
In or Out Type Description

In

String

The code of the enrollment product (mandatory)

In

Date

The start date of the new policy enrollment product (mandatory)

In

Date

The end date of the new policy enrollment product (optional)

Out

policyEnrollmentProduct

The new policy enrollment product

Example
PolicyEnrollmentProduct pep = policyEnrollmentList[0].addPolicyEnrollmentProduct("BASIC", java.sql.Date.valueOf('2020-02-01'), null)

addPolicyGroupAccount

Adds a Group Account to the Policy.

Availability

This method is available for a Policy.

Parameters:

Table 31. addPolicyGroupAccount
In or Out Type Description

In

String

Contains the Group Account Code (mandatory).

In

Date

The Start Date of the new Policy Group Account (mandatory).

Example
policy.addPolicyGroupAccount("ORCL", java.sql.Date.valueOf("2021-01-01"))

addPolicyPremiumBillAllocation

Adds a Policy Premium Bill Allocation to the Policy.

Availability

This method is available for a Policy.

Parameters:

Table 32. addPolicyPremiumBillAllocation
In or Out Type Description

In

String

Contains the Schedule Definition Code. It is optional.

In

String

Contains a Policy Addon Code. It is optional.

In

String

Contains the Enrollment Product Code. It is optional.

In

String

Contains the Insurable Class Code. It is optional.

In

String

Contains the Enrollment Product Category Code. It is optional.

In

String

Contains the Premium Schedule Type Code. It is optional.

In

Date

Contains the Start Date of the new Policy Premium Bill Allocation. It is mandatory.

In

Boolean

Identifies active status. It is mandatory.

Example
policy.addPolicyPremiumBillAllocation("", "", "GOLD", "", "", "", java.sql.Date.valueOf("2021-01-01"),true)

copy

The method creates a copy of the object that calls this method. It creates a deep copy of the object along with its details. Copying the object Policy Enrollment Product also copies the parameter values defined at the Policy Enrollment Product level.

Availability

This method is available for PolicyEnrollmentProduct, Policyholder, PolicyContractPeriod, PolicyCollectionSetting, PolicyBrokerAgent, PolicyAddOn, and PolicyPremiumBillAllocation Its purpose is to have the possibility to create a copy of an existing object (of the aforementioned types) and add it to the respective parent. This can be useful for bulk updates functionality where new objects need to be created for new periods that are usually copies of original rows except for a few details (For example, dates).

Parameters:

Table 33. copy
In or Out Type Description

Out

<object type of the calling method>

This is the same object type for calling the method.

Example
def newPolicyEnrollmentProduct = existingPolicyEnrollmentProduct.copy()

copyAndEndDateBrokerAgent

The method creates a copy of the latest Policy Broker Agent with the passed Broker, Agent, and Start Date values. The method sets an End Date to the latest Policy Broker Agent if the current End Date is NULL or is on or the date provided as a parameter to the method. If sets the current End Date of the latest Policy Broker Agent is before the passed parameter date, then no change happens to the End Date. Adds the newly created copy to the policyBrokerAgent detail list.

If the passed Broker or Agent does not exist in the system, the Dynamic Logic using this method fails with a technical error (OHI-DYLO-007).

If there is no existing brokerAgent detail on the Policy, nothing happens, and the method returns NULL.

Availability

This method is available on Policy.

Parameters:

Table 34. copyAndEndDateBrokerAgent
In or Out Type Description

In

String

The Broker Code of the new Policy Broker Agent.

In

String

The Agent Codeof the new Policy Broker Agent.

In

Date

The Start Date of the new Policy Broker Agent(mandatory).

Out

Policy Broker Agent

The new copy of the Policy Broker Agent.

Example
def newPolicyBrokerAgent = policy.copyAndEndDateBrokerAgent("BROKERA", null, java.sql.Date.valueOf("2021-01-01"))

copyAndEndDateCollectionSetting

The method creates a copy of the latest policyCollectionSetting. The method sets an End Date to the latest Policy Collection Setting if the current End Date is NULL or is on or after the date provided as a parameter to the method. If the current End Date of the latest Policy Collection Setting is before the passed parameter date, then no change happens to the End Date. It also puts the Start Date of the new copy as the passed parameter date. Adds the newly created copy of the Policy Collection Setting to the policyCollectionSetting detail list.

If there is no existing Collection Setting detail on the Policy, nothing happens, and the method returns NULL.

Availability

This method is available on Policy.

Parameters:

Table 35. copyAndEndDateCollectionSetting
In or Out Type Description

In

Date

The Start Date of the new Policy Collection Setting (mandatory).

Out

Policy Collection Setting

The newly created copy of the olicy Collection Setting.

Example
def newPolicyCollectionSetting = policy.copyAndEndDateCollectionSetting(java.sql.Date.valueOf("2021-01-01"))

copyAndEndDateContractPeriod

The method creates a copy of the latest policyContractPeriod (Policy Contract Period). The Contract Period duration of the new Contract Period is the same as that of the latest Policy Contract Period copied. The new copy of the Contract Period adds to the policyContractPeriod detail list.

If there is no existing Contract Period detail on the Policy, nothing happens, and the method returns NULL.

Availability

This method is available on Policy.

Parameters:

Table 36. copyAndEndDateContractPeriod
In or Out Type Description

In

Date

The Start Date of the new Policy Contract Period (mandatory).

Out

Policy Contract Period

The new copy of the Policy Contract Period.

Example
def newPolicyContractPeriod = policy.copyAndEndDateContractPeriod(java.sql.Date("2021-01-01"))

copyAndEndDateEnrollmentInsurableClass

The method creates a copy of the latest Policy enrollment Insurable Class with the passed Insurable Class and Start Date. It sets an End Date to the latest Policy Enrollment Insurable Class if the current End Date is NULL or is on or after the date provided as a parameter to the method. If the current End Date of the latest Policy Enrollment Insurable Class is before the passed parameter date, then no change happens to the End Date. The method adds the newly created copy to the Policy Enrollment Insurable Class list. The Dynamic Logic using this method fails with a technical error (OHI-DYLO-007) if the passed Insurable Class does not exist in the system.

Nothing happens if there is no existing Policy Enrollment Insurable Class on the Policy, returning a NULL.

Availability

This method is available on Policy Enrollment.

Parameters:

Table 37. copyAndEndDateEnrollmentInsurableClass
In or Out Type Description

In

String

The Insurable Class Code (mandatory).

In

Date

The Start Date of the new Policy Enrollment Insurable Class (mandatory).

Out

Policy Enrollment Insurable Class

The newly created copy of the Policy Enrollment Insurable Class.

Example
def newPolicyEnrollmentInsurableClass = policyEnrollment.copyAndEndDatePolicyEnrollmentInsurableClass("ADULT", java.sql.Date.valueOf("2021-01-01"))

copyAndEndDateEnrollmentProduct

This method creates a copy of the Policy Enrollment Product with the Code - that you mention in the first parameter, Start Date before the specified date (third parameter), and an End Date on or after the specified date (third parameter). If the Start Date of the Policy Enrollment Product is the same as the specified date (third parameter), the method replaces the pre-existing Policy Enrollment Product with a new one.

The method copies all fields (native fields, dynamic fields, and dynamic records) from the existing Policy Enrollment Product to the newly created Policy Enrollment Product.

There is a time range for each policy addon set by the Start Date and the End Date of the policy addon. If the copy addons flag (fourth parameter) is true, the method copies all the policy addons (all fixed and dynamic fields) that have the third parameter lie within this time range.

Each policy can have multiple addons. There can be more than one addon for a particular addon. In such cases, the method only copies addons with the date nearest to the third parameter.

Parameter values have a time range set by the start date and the end date of the parameter value. If the copy parameter values flag (fifth parameter) is true, the method copies parameter values(all fixed and dynamic fields) that have the third parameter lie within this time range.

There are cases when multiple parameter values exist for the same parameter alias. In such cases, the method copies the parameter values having the start date nearest to the third parameter.

The method does:

  • There can be cases when the third parameter specifies a date within the time range of an existing policy enrollment product. In such cases, the method sets the end date of the pre-existing policy enrollment product to one day prior to the third parameter. The method also copies:

    • Policy Addons that have a Start Date before the third parameter and an End Date on or after the third parameter.

    • Parameter values that have a Start Date before the third parameter and an End Date on or after the third parameter.

  • Replaces the Policy Enrollment Product when the Start Date is the same as the third parameter.

  • Removes Policy Addons that start on or after the third parameter.

  • Removes the parameter values that start on or after the third parameter.

If the Enrollment Product Code does not exist, the Dynamic Logic using this method fails with a technical error (OHI-DYLO-007). If the method does not find a Policy Enrollment Product with the Code with the date from the third parameter, the method returns NULL.

If the policy group account is time valid as of the start date passed in the method, the method creates policy enrollment product records with a functional key to a group account product.

If the policy group account is not time valid, it creates policy enrollment product records with a functional key to an enrollment product.

The method is designed to set the end date of the new policy enrollment product to null. So, if the policy group account has an end date, it is necessary to manually set the end date (within the time validity of the group account) of the new policy enrollment product.

Availability

This method is available on the Policy Enrollment object.

Parameters:

Table 38. copyAndEndDateEnrollmentProduct
In or Out Type Description

In

String

The Enrollment Product Code of the Policy Enrollment Product for copying and setting an End Date (mandatory).

In

String

The Enrollment Product Code of the new Policy Enrollment Product (mandatory).

In

Date

The Start Date of the new Policy Enrollment Product (mandatory).

In

Boolean

The flag to copy Policy Addons (mandatory).

In

Boolean

The flag to copy parameter values (mandatory).

Out

Policy Enrollment Product

The newly created Policy Enrollment Product.

Example
def newPolicyEnrollmentProduct  = policyEnrollment.copyAndEndDateEnrollmentProduct("EPA1", "EPA2", java.sql.Date.valueOf("2021-01-01"), false, false)

copyAndEndDatePolicyGroupAccount

Creates a copy of the latest Policy Group Account with the passed Policy Group Account and the Start Date. The method sets the End Date to the latest Policy Group Account if the current End Date is NULL or is on or after the date provided in a parameter to the method. There is no change to End Date if the current End Date of the latest Policy Group Account is before the passed parameter date. Adds the newly created copy to the policyGroupAccount detail list.

The Dynamic Logic using this method fails with a technical error (OHI-DYLO-007) if the passed Group Account does not exist in the system.

Nothing happens, and the method returns NULL if there is no existing policyGroupAccount detail on the Policy.

Availability

This method is available on Policy.

Parameters:

Table 39. copyAndEndDatePolicyGroupAccount
In or Out Type Description

In

String

The Group Account Code of the new Policy Group Account (mandatory).

In

Date

The Start Date of the new Policy Group Account (mandatory).

Out

Policy Group Account

The new copy of the Policy Group Account.

Example
def newPolicyGroupAccount  = policy.copyAndEndDatePolicyGroupAccount("ORCL", java.sql.Date.valueOf("2021-01-01"))

copyAndEndDatePolicyholder

This method creates a copy of the latest Policyholder with the passed policyholder and startDate values. It sets an End Date value to the latest Policyholder if the current End Date is NULL or is on or after the date provided as a parameter to the method. If the current End Date of the latest Policyholder with the passed parameter date, then no change happens to the End Date. The new copy adds to the policyholder detail list. If the passed Policyholder does not exist in the system, the Dynamic Logic using this method fails with a technical error (OHI-DYLO-007).

If there is no existing Policyholder on the Policy, nothing happens, and the method returns NULL.

Availability

This method is available on Policy.

Parameters:

Table 40. copyAndEndDatePolicyholder
In or Out Type Description

In

String

The Policyholder Code (Person Code) (mandatory).

In

Date

The Start Date of the new Policyholder (mandatory).

Out

Policyholder

The newly created copy of the Policyholder.

Example
def newPolicyholder = policy.copyAndEndDatePolicyholder(personCode, java.sql.Date.valueOf("2021-01-01"))

endEnrollment

The method sets the End Date for all Enrollment Products under the Policy enrollment and removes any Enrollment Products that start after the parameter End Date.

The enrollment products that are marked as never in force are ignored.

Availability

This method is available on PolicyEnrollment.

Parameters:

Table 41. endEnrollment
In or Out Type Description

In

Date

The date for setting as the End Date.

Example
policyEnrollment.endEnrollment(java.sql.Date.valueOf("2021-12-31"))

endPolicy

Sets the End Date for all Enrollment Products under the Policy and removes any Enrollment Products that start after the parameter End Date.

The enrollment products that are marked as never in force are ignored.

Availability

This method is available on Policy.

Parameters:

Table 42. endPolicy
In or Out Type Description

In

Date

The date for setting as the End Date.

Example
policy.endPolicy(java.sql.Date.valueOf("2021-12-31"))

getAge

Calculates the age of a Person at the specified date. Returns the age in years.

Availability

This method is only available for a Person object.

Parameters:

Table 43. getAge
In or Out Type Description

In

Date

as-of date for time validity (optional in case the signature defines a default date).

Out

Integer

Age of the invoking Person on the as-of date.

Example
def age = person.getAge()

getAllPolicyEnrollmentProducts

This method searches for all the policy enrollment products for a person in the application. It returns a list of all the policy enrollment products for each policy that the person has. The policy enrollment products are from the latest versions of an approved policy. The never in force policy enrollment products are ignored.

Availability

This method is available for person in the person covered service dynamic logic.

Parameters:

Table 44. getAllPolicyEnrollmentProducts
In or Out Type Description

Out

List<PolicyEnrollmentProduct>

The policy enrollment product list

Example
person.getAllPolicyEnrollmentProducts()

getCalendarYearDays

This method returns the number of days of a *Calendar Year based on a reference date.

  • Sets the number of days that make up the year including the 29th of February if the reference data falls within a Policy contract period. Setting the number of days to 366 if the contract period includes the 29th of February, else the number of days is 365.

  • If the reference date does not fall within a Policy contract period, the number of days that make up the year is the number of days of the Calendar Year up to the reference date.

    Availability

    This method is available for Policy objects.

Parameters:

Table 45. getCalendarYearDays
In or Out Type Description

In

Date

The reference date (mandatory).

Out

Number

The number of days of the Calendar Year.

Example

Use this method to calculate the daily Premium using the withinAdjustment Dynamic Logic functions.

def dailyPremium = yearlyAmount / policyEnrollmentProduct.policyEnrollment.policy.getCalendarYearDays(referenceDate)

getCountryRegions (Provider)

This method gets the Country regions of a Provider using the provided Addresses. Returns the Country regions if it finds them, NULL otherwise.

Availability

This method is available on Provider objects.

Parameters:

Table 46. getCountryRegions (Provider)
In or Out Type Description

In

Date

The as-of date for time validity (optional in case the signature defines a default date).

Out

CountryRegionList

For Individual Providers, returns the Country regions of the invoking Provider’s rendering Addresses (specified on the related service Addresses) on the as-of date. For Organization Providers, the method returns the Country regions of the invoking Provider’s service Addresses on the as-of date.

Example
countryRegions = provider.getCountryRegions()

getDerivedEnrollmentProduct

This method returns the Enrollment Product that is directly or indirectly linked to the Policy Enrollment Product (through the Group Account Product in case of Policy with a Group Account).

Availability

This method is available for policyEnrollmentProduct.

Parameters:

Table 47. getDerivedEnrollmentProduct
In or Out Type Description

Out

EnrollmentProduct

The Enrollment Product.

getEnrolledProducts

This method returns a list of enrollment product for an insurable object. For insurable persons, this method can identity the person based on the OHI person code but also on an associated relation identifier. The method tries to match on relation code first. If no person could be matched, the person code is matched on enabled relation identifiers.

Availability

This method is available in the 'Enrollment Response Definition' dynamic logic function.

Parameters:

Table 48. getEnrolledProducts
In or Out Type Description

In

String

The usage name of the insurable entity type

In

String

The code or identifier of the person or object

In

String

The relation identifier type (optional)

In

Date

The start date of the period for which enrollment details are required

In

Date

The end date of the period for which enrollment details are required

Out

EnrollmentProductList

The Policy Enrollment Product list

getExchangeRate

This method returns the converted Currency.

Availability

The method is static. The purpose of the method is to have the possibility to convert all Amounts during Premium Calculation when function Dynamic Logic creates new financial transactions.

This method has two following versions:

Parameters:

Version 01:

Table 49. getExchangeRate: Version 01
In or Out Type Description

In

String

Currency from

In

String

Currency to

In

Date[]

Reference Date

In

String

Context

Example

The following example displays the exchange rate from USD to EUR on 12th December 2021 with context.

return getExchangeRate("USD", "EUR", java.sql.valueOf("2021-12-12"), "LIBERTY")

Version 02:

Table 50. getExchangeRate: Version 02
In or Out Type Description

In

String

Currency from

In

String

Currency to

In

Date[]

Reference Date

Example

The following example displays the exchange rate from USD to EUR on 12th December 2021 in default or no context.

return getExchangeRate("USD", "EUR", java.sql.Date.valueOf("2021-12-12"))

getGroupAccount

This method returns the Group Account the Policy belongs to on the specified date. Giving no date to the method returns the Group Account the Policy belongs on the system date. The method returns NULL if the Policy does not belong to a Group Account on the specified date (or system date).

Availability

This method is available for a Policy object.

Parameters:

Table 51. getGroupAccount
In or Out Type Description

In

Date

The as-of date for time validity (optional).

Out

Group Account

Group Account.

Example
def polGroupAccount = policy.getGroupAccount(java.sql.Date.valueOf("2021-01-01"))

getPolicies

This method searches for the latest end-state (Approved or Canceled) Version of the Policies for a Person or object within the system. It returns the list of Policies where the Person or object has a Policy Enrollment.

Availability

This method is available for Insurable Entity.

Parameters:

Table 52. getPolicies
In or Out Type Description

Out

List of Policies

The Policy list.

Example
pols = insurableEntity.getPolicies
pols.each{ pol ->
      if (pol.insuranceType.code != "HEALTH') {
          return
      }
      ...

In the example, the getPolicies method fills a list with all enrolled Policies for this Insurable Entity. The next step checks each entry in the list for the Policy that has the Insurance TypeFor HTTP API services the default endpoint is: as HEALTH.

getPolicyAccountBalance

This method returns the sum of all non-reversed transactions that meet the criteria. The method returns a Money object. The Currency of this Money object is the currency on the Policy Account Definition.

The AsOfDate specifies, in combination with the Policy Account Definition period, the period for which the method calculates account balance. Omitting the asOfDate in the method returns the account balance for the system date.

The method returns a zero balance if one or more of the following is true:

  • The actual Policy Account Transactions sum is zero.

  • Finds no Policy Account Transactions that meet the criteria.

  • Finds no Policy Account that meets the criteria.

  • The Policy Account Definition, Policy Account Transaction Type, or Person in the criteria are unknown.

If there is an unknown Policy Account Definition in the criteria, the method returns zero balance. The method sets the Currency of that balance to the system’s default Currency.

This method does not differentiate between the situation where the actual transaction sum is zero or where no Policy Account is found. Use the method getPolicyAccountNumber to verify the existence of a Policy Account.

Availability

This method is available for a Policy.

Parameters:

Table 53. getPolicyAccountBalance
In or Out Type Description

In

String

The Policy Account Definition Code (mandatory).

In

String

The Policy Account Transaction Type Code (optional).

In

Date

asOfDate (optional).

In

String

The Policy Enrollment Person Code (optional).

Out

Money

The balance of the account.

Example
def newPolicyAccountBalance = policy.getPolicyAccountBalance("HSA", "PREM", java.sql.Date.valueOf("2021-01-01"),"Person123")

getPolicyAccountNumber

This method returns the Account Number of the Policy account that meets the criteria.

Availability

This method is available for a Policy object.

Parameters:

Table 54. getPolicyAccountNumber
In or Out Type Description

In

String

The Policy Account Definition Code (mandatory).

In

String

The Policy Enrollment Person Code (optional).

Out

String

The Policy Account Number.

Example
def newPolicyAccountNumber = policy.getPolicyAccountNumber("HSA","Person123")

Omitting the Person Code returns only a Policy Account of the definition level Policy (if it exists). Filling the erson Codereturns only a Policy Account of the definition level Person (if it exists). Returns NULL if no Policy Account matches the criteria.

getPolicyBillingAccounts

This method returns the Policy Billing Accounts of a Policy.

Availability

This method is available for Policy.

Parameters:

Table 55. getPolicyBillingAccounts
In or Out Type Description

Out

List<PolicyBillingAccount>

The Policy Billing Account list.

Example
List<PolicyBillingAccount> policyBillingAccounts = policy.getPolicyBillingAccounts()

getPolicyCalculationPeriods

This method searches for the relevant Policy Calculation Periods. It returns the Policy Calculation Periods that have an overlap with the period that Start Date and End Date denotes.

Because of the possibly large number of results, the method does not return a list containing all Policy Calculation Periods, but only a subset (called a page). The property ohi.dynamiclogic.pagesize controls the number of entries per page.

Availability

This method is available for Policy.

Parameters:

Table 56. getPolicyCalculationPeriods
In or Out Type Description

In

Date

The Start Date for time validity.

In

Date

The End Date for time validity (optional).

In

Integer

The number of pages to retrieve. The value must be greater or equal to zero.

Out

List<PolicyCalculationPeriod>

The subset of the Policy Calculation Periods that belong to page N. If the page size is 50, and the page is 3, returns 151-200 as periods (assuming they exist).

Example
int page = 0
while (true) {
    def periods = policy.getPolicyCalculationPeriods(exampleStartDate, exampleEndDate, page++)
    if (periods.size() == 0) {
        break
    }
    periods.each { policyCalculationPeriod ->
        // Execute any further logic, For example, set a (dynamic) field
        policyCalculationPeriod.exampleField = exampleValue
    }
}

Every invocation of getPolicyCalculationPeriods does a separate database query. When some other process is mutating Policy Calculation Periods simultaneously, it affects the results of the following pages that the method retrieves.

getPolicyEnrollmentProducts

This method searches for the relevant Policy Enrollment Products for a Person or object within the system. It returns the list of Policy Enrollment Products that have an overlap in time validity with the period that the Start Date and End Date define. These Policy Enrollment Products belong to the latest Approved Version of the Policy.

Availability

This method is available for Insurable Entities.

Parameters:

Table 57. getPolicyEnrollmentProducts
In or Out Type Description

In

Date

The Start Date for time validity (optional).

In

Date

The End Date for time validity (optional).

Out

List of PolicyEnrollmentProducts

The Policy Enrollment Product list.

Example
peps = insurableEntity.getPolicyEnrollmentProducts(java.sql.Date.valueOf(Date.parse.valueOf("2021-01-01")
                                                                       ,java.sql.Date.valueOf("2021-12-31"))
peps.each{ pep ->
      if (pep.policyEnrollment.policy.insuranceType.code != "HEALTH') {
          return
      }
      ...

In the example, the getPolicyEnrollmentProducts method fills the list with enrolled Enrollment Products for all Policies for this Insurable Entity, where the Enrollment Products have a time validity that overlaps with the period 1st January 2021 to 31st December 2021.

The next step checks each entry in the list for a Policy that has the Insurance Type as HEALTH.

getPolicyEnrollments

This method searches for the relevant Policy Enrollments for a Person or object within the system. The method returns the list of Policy Enrollment that has an overlap in time validity with the period that Start Date and End Date give. These Policy Enrollments belong to the latest Approved Version of the Policy.

Availability

This method is available for Insurable Entity objects.

Parameters:

Table 58. getPolicyEnrollments
In or Out Type Description

In

Date

The Start Date for time validity (optional).

In

Date

The End Date for time validity (optional).

Out

List of PolicyEnrollments

The Policy enrollment list.

NOTE

To avoid errors, add null as input parameter to run this method without a start date or an end date.

Example
peps = insurableEntity.getPolicyEnrollments(java.sql.Date.valueOf("21-01-01")
                                                                       ,java.sql.Date.valueOf("2021-12-31"))
peps.each{ pep ->
      if (pep.policyEnrollment.policy.insuranceType.code != "HEALTH') {
          return
      }
      ...

In the example, the getPolicyEnrollments method fills a list with enrollments for all Policies that this Insurable Entity is enrolling on, where the enrollments have a time validity that overlaps with the period from 1st January 2021 to 31st December 2021.

The next step checks each entry in the list for a Policy that has the Insurance Type as HEALTH.

getProviderGroups

This method searches for the Assigned Provider Groups of a Policy Enrollment Product. The method returns the list of Enrollment Product Provider Groups or Group Account Product Provider Groups overlapping in the time validity period that the Start Date and the End Date denote. Finding both Enrollment Product Provider Groups and Group Account Provider Groups for a Policy Enrollment Product overlapping in time validity with the period between Start Date and End Date returns only the Group Account Product Provider Groups.

Availability

This method is available for Policy Enrollment Products.

Parameters:

Table 59. getProviderGroups
In or Out Type Description

In

Date

The Start Date for time validity (optional).

In

Date

The End Date for time validity (optional).

Out

List of EnrollmentProductProviderGroups or GroupAccountProductProviderGroups

The assigned Provider Group list.

Refer to the "Enrollment Response Integration Point" specification in the Developer Guide for examples.

getTitles

This method returns a string containing all titles of the Person or Individual Provider with blank space separating each. The method sorts the titles on Display Order. If there is no Display Order available or several titles have the same Display Order, the alphabetic order applies.

Availability

This method is available on Person and Individual Provider objects.

Parameters:

Table 60. getTitles
In or Out Type Description

In

String

From the example below, A returns all post-name titles and B returns all pre-name titles.

Out

String

Space-separated list of the invoking Person’s titles

Example
return person.getTitles('B') + ' ' + person.name + ' ' + person.getTitles('A')

getEnrollmentEventNotifications

This method searches for the enrollment event notifications in the context of the Policy. It returns the list of Enrollment Event Notifications.

Availability

This method is available for Policy object.

Parameters:

Table 61. getEnrollmentEventNotifications
In or Out Type Description

Out

List <EnrollmentEventNotifications>

The Enrollment Event Notification list.

Example
pols = policy.getEnrollmentEventNotifications()
pols.each{ pol ->
      if (pol.enrollmentEventNotification.notificationStatus = "READY") {
          return
      }
      ...
    }

In the example, the getEnrollmentEventNotifications method fills a list with all EnrollmentEventNotifications for this Policy. The next step checks each entry in the list for the Enrollment Event Notification that has the status READY and returns the list.

getWorkflowPendReasons

This method returns a list with an entry for each pend reason in the context of the Policy. Only pend reasons with publishMessage = true" are included.

Availability

This method is available on the Policy object.

Parameters:

Table 62. getWorkflowPendReasons
In or Out Type Description

Out

String

The Code of the pend reason.

Out

Description

The description of the pend reason.

Out

Numeric

The priority of the pend reason.

Out

Boolean

The pend reason list is returned when publishMessage = True.

hasSpecialty

Checks whether a Provider has a Specialty at a certain point in time. Returns true when that is the case, false otherwise.

Availability

This method is available for both Individual Providers and Organizational Providers.

Parameters:

Table 63. hasSpecialty
In or Out Type Description

In

String

The Code of the specialty.

In

Date

The as-of date for time validity (optional in case the signature defines a default date).

Out

Boolean

True, if the invoking Provider has a Provider Specialty that matches the Code on the as-of date.

Example
provider.hasSpecialty('DERMATOLOGY')

inProviderGroup

The method checks whether a Provider is part of a Provider Group at a certain point in time. Returns true when that is the case, false otherwise.

An Organization Provider is part of a Provider Group if:

  • The Organization Provider is affiliated with the Provider Group.

  • Or the Organization Provider is part of an Organization Provider that is affiliated with the Provider Group.

An Individual Provider is part of a Provider Group if:

  • The Individual Provider is affiliated with the Provider Group.

The affiliations must be valid at the as-of date in all cases.

Availability

This method is available for both Individual Providers and Organizational Providers objects.

Parameters:

Table 64. inProviderGroup
In or Out Type Description

In

String

The Code of the Provider Group (mandatory).

In

Date

The as-of date for time validity (optional in case the signature defines a default date).

Out

Boolean

True if the invoking Provider belongs to the group on the as-of date.

Example
individualProvider.inProviderGroup('CORE')

redetermineWaitStartDate

This method re-determines the wait Start Date of the Person Covered Services for a Person.

The functionality of this method is much like Determine Wait Start Date part of the setPersonCoveredService method.

The method skips Person Covered Services that have an End Date before the reference Input Date. Leaving the parameters empty does not skip Person Covered Services based on their End Date.

The method skips Person Covered Services that are for Transfer Certificates, that is for the entered Product Code as a parameter. Leaving the parameters empty does not skip Person Covered Services on the Product Code.

The method skips locked Person Covered Services if the input parameter Redetermine Locked Lines? is false (which is the default value). The method re-determines the wait Start Date of locked Person Covered Services if it is true.

See Functions for an example of the usage of this pre-defined method in setting Person Covered Services.

Availability

This method is only available on the Person object in Dynamic Logic functions of signature Person Covered Service.

Parameters:

Table 65. redetermineWaitStartDate
In or Out Type Description

In

Date

The date for re-determining the wait Start Date.

In

String

The max number of gap days between Products.

In

String

The Code of the Product that is used for Transfer Certificates.

In

Boolean

Should locked lines be redetermined?

Example
person.redetermineWaitStartDate(java.sql.Date.valueOf("2021-01-01"), 60, 'TC', false)

removeParameterValue

Removes a parameter value of a policy enrollment product from a list of parameter values in a policy enrollment product.

Availability

This method is available on policyEnrollment in the following signatures:

  • Callout Function

  • Policy Validation Rule Function (all three levels)

  • Bulk update

Parameters

.removeParameterValue

In or Out Type Description

In

parametervalue

The parameter value of the policy enrollment product that is to be removed.

Example
policyEnrollment[0].policyEnrollmentProduct[0].removeParameterValue(parametervalue)

removePersonCoveredService

This method removes a Person Covered Services from a Person. The method takes a personCoveredService object as an input parameter.

Availability

This method is available on Person in dynamic logic functions of signature Person Covered Service.

Example

In this example, the system removes all Person Covered Services for the Person in context, except for those that are locked, or for the product with code as TC.

for (personCoveredService in person.personCoveredServiceList) {
  if (personCoveredService.locked = true || personCoveredService.productCode = 'TC') {
    person.removePersonCoveredService(personCoveredService)
  }
}

removePolicyEnrollment

Removes a policy enrollment from the list of policy enrollments and cascade deletes all details. The method does not remove the person.

Availability

This method is available on policy in the following signatures:

  • Callout Function

  • Policy Validation Rule Function (all three levels)

  • Bulk update

Parameters:

Table 66. removePolicyEnrollment
In or Out Type Description

In

PolicyEnrollment

The policy enrollment that is to be removed

Example
policy.removePolicyEnrollment(policyEnrollment)

removePolicyEnrollmentProduct

Removes a policy enrollment product from the list of policy enrollment products and cascade deletes all details.

Availability

This method is available on policyEnrollment in the following signatures:

  • Callout Function

  • Policy Validation Rule Function (all three levels)

  • Bulk update

Parameters:

Table 67. removePolicyEnrollmentProduct
In or Out Type Description

In

PolicyEnrollmentProduct

The policy enrollment product that is to be removed

Example
policyEnrollment[0].removePolicyEnrollmentProduct(policyEnrollmentProduct)

setField

The usual way to assign a value is to use the assignment operator. For example:

groupAccount.displayName = 'A group account description'

A direct assignment is not possible because with a dynamic field that is in a FlexCode Set as it needs the Code of the FlexCode Definition.

This method sets the value for a dynamic field that is in a FlexCode Set. The field is a single value and non-time-valid.

Availability

This method is only available for functions that allow a value that sets using the Dynamic Logic.

Parameters:

Table 68. setField
In or Out Type Description

In

String

The name of the field which is to be set.

In

String, Date, or Number

The value of the field is to be set. For Flex Codes, the key field value.

In

String

The Code of the FlexCode Definition.

Example

This example assigns a value to the groupSize field on the groupAccount. The field groupSize is of type groupSizeCatagory which is defined as a flex code set GROUP_SIZE_CATAGORY. Typical values for the group size are SMALL, MEDIUM, and LARGE. Use the following code for setting the MEDIUM group size for the Group Account in context.

groupAccount.setField('groupSize','MEDIUM','GROUP_SIZE_CATAGORY')

setGroupClientStatus

The method sets the status of a Group Client.

Availability

This method is available for Group Client. The status is set to CHANGED. Setting the status to APPROVED is not allowed.

Parameters:

The method has no parameters.

Example
groupClient.setgroupClientStatus()

setPersonCopy

This method links a Person to another Person as an unapproved updated Person record. The Person copy represents the active Person details with the updates from the working copy Person.

If the active Person already has a working copy of a Person for the same Policy, the method ignores the update. It is not possible to make a Person, a working copy of another Person if another entity, other than Policy Enrollment, Policyholder or Policy Bill Receiver, is referencing it.

Person copies are always for a Policy.

The typical use for this method is a situation where the Policy In Integration Point creates a new Person because it finds no matching Person. A call-out to an external system matches the new Person to an existing Person. This pre-defined method makes the new Person a working copy of the existing, active Person.

Availability

This method is available on Person. This method is only available on call-out rules.

Parameters:

Table 69. setPersonCopy
In or Out Type Description

In

String

The Person Code to which the Person needs linking.

In

String

The Policy GID of the Policy in the context.

Example
person.setPersonCopy('MEM52672','POL849284')

setPersonCoveredService

This method replaces the list of Person Covered Services for a Person using enrollment information about that Person and Product Covered Services.

The method takes the following input parameters:

  • Reference Input Date (optional)

  • Number of Portability days (optional)

  • Product Code for Transfer Certificates (optional)

Step 1

The method removes all Person Covered Services that

  1. have the end date on or after the reference and input date and

  2. are not locked and

  3. are not transfer certificates (having the Transfer Certificates Product Code).

Set the reference input date to restrict the replacement of the Person Covered Services as of a specific date. Not setting it removes all Person Covered Services for this Person (except those that are locked or for Transfer Certificates).

Step 2

The method selects the Person’s Policy Enrollment Products for which it currently is or ever was enrolled. For each Policy Enrollment Product, the method selects the Products that are linked through the Enrollment Product details.

The result is a list of Products with a Start and End Date. Derive these dates directly from the Policy Enrollment Product. The same Product can be on the list multiple times, with different dates. When two or more periods are contingent on the same Product, the method merges the results into one list item.

Next, the system splits the results based on the Policy product parameter Start and End Dates. The result is a list in which each list item represents a combination of a Product, a Start Date, and an End Date. Product time windows is the name for these list items. Consider the image below that clarifies how to derive Product time windows.

Select Product Windows

Assuming that Policy Enrollment Product GOLD 2019 and GOLD 2020 are linked to Product Plan A and Policy Enrollment Product SILVER 2021 is linked to Product Plan B and Product Plan C, the system derives the following Product time windows:

Table 70. setPersonCoveredService: Step 2
Product Start Date End Date

Plan A

January 1, 2019

June 30, 2020

Plan A

July 1, 2020

December 31, 2020

Plan B

January 1, 2021

December 31, 2021

Plan C

January 1, 2021

December 31, 2021

  • The time window for Policy Enrollment Product GOLD 2019 continues in the Policy Enrollment Product GOLD 2020. There is continuous enrollment in Product Plan A. As a result, there is no split for Product Plan A on January 1, 2020.

  • During the enrollment on Policy Enrollment Product GOLD 2020, one of the parameters change on July 1, 2020. This causes a split in the Product time windows for Product Plan A and results in two Product time windows for product Plan A.

  1. For each Product time window, the method adds a copy of all the Product’s Product Covered Services to the Person Covered Services. The method:

    1. Copies only Product Covered Services that are valid on the current date (the current date is between Start Date and End Date).

    2. Does not create Person Covered Services that have an End Date before the reference input date.

    3. Copies the Start Date and End Date from the selected Product time window in the previous step.

    4. Copies the Product Code, service option’s service Code, Covered Service Type, Covered Service Tier, and Score from the Product Covered Service.

    5. Sets the Indicator Locked to No.

    6. Leaves Indicator Waived and Waiver Reason empty.

    7. Sets the Wait Start Date according to Determine Wait Start Date description below.

Determine Wait Start Date

Default

The method checks if a previous connecting Product time window exists. Previous connecting means:

  1. The Start Date of the current Product time window is the End Date +1 of the previous Product.

  2. The Product in the previous Product time window has a Product Covered Service with the same service option’s service Code, but an equal or better score[1] as the Person Covered Service, the method is currently creating.

To find the earliest Start Date of the service in a previous Product, the system keeps moving back in the Product History, as long as the previously covered service has an equal or better score.

If the previously Covered Service has a lower score than the current Covered Service, the system does not move back and considers the Start Date of the current Product time window as the waiting Start Date.

Please see Examples, for more detailed examples on how to determine the Wait Start Date.

In Case of Portability (Transfer Certificates)

Specifying the Number of Portability Days and the Product Code for Transfer Certificates parameters of the pre-defined method makes the method search for Person Covered Services for the specified Transfer Certificate Product [2][3].

If the Start Date of the current Product time window is between Start Date + 1 and End Date + 1 + Number of Portability Days, of the Transaction Certificate Person Covered Service, the method uses the Start Date of that Person Covered Service plus the number of gap days as the wait Start Date for the new Person Covered Service.

Transfer Certificate OK

If the Start Date is not within that range, the system uses the Start Date of the current Product time window.

Transfer Certificate not OK

With Locked Person Covered Services in Place

If a to-be-created Person Covered Service overlaps with an existing locked Person Covered Service, the method adjusts the Start Date or End Date of the new Person Covered Service in such a way that the date of the new and existing Person Covered Service or Person Covered Services aligns with the locked one.

The method does not automatically lock the new Person Covered Service.

With Locked and Waived Person Covered Services in Place

If a to-be-created Person Covered Service overlaps with an existing locked and Waived Person Covered Service, the additionally created Person Covered Services (aligning with the existing one), are also waived with the same waive reason, and they are locked.

Availability

This method is only available on the Person object and of Dynamic Logic functions of signature Person Covered Service.

Parameters:

Table 71. With Locked and Waived Person Covered Services in Place
In or Out Type Description

In

Date

The date for setting the Person Covered Services.

In

String

The max number of gap days between Products.

In

String

The Code of the Product that is used for Transfer Certificates.

Example
person.setPersonCoveredService(java.sql.Date.valueOf("2021-01-01"), 60, "TC")

split

This method splits a Policy Calculation Period into multiple smaller ones on the provided input dates. An input date represents the start of a new Policy Calculation Period, so the preceding Policy Calculation Period ends a day earlier.

For example, splitting the Policy Calculation Period on 10th January 2021 results in two Policy Calculation Periods:

  1. From the 1st to the 9th

  2. From the 10th to the 31st

Splitting the same Policy Calculation Period of January 2021 on both the 10th and the 20th of January, the result is three Policy Calculation Periods:

  1. From the 1st to the 9th

  2. From the 10th to the 19th

  3. From the 20th to the 31st

If none of the input dates lay within the Policy Calculation Period, the returned list simply contains the original Policy Calculation Period.

Adjusts the Days attribute on the resulting Policy Calculation Periods by linear interpolation. The method copies all other fields, including dynamic fields, from the original Policy Calculation Period to the new ones.

Availability

This method is available for Policy Calculation Periods.

Parameters:

Table 72. split
In or Out Type Description

In

A single Date, multiple Dates, or a List<Date>

The date for splitting the Policy Calculation Period.

Out

List<PolicyCalculationPeriod>

The split Policy Calculation Periods.

Example 1: Single Date
import java.sql.Date

Date myDate = Date.valueOf("2000-01-01")

List<PolicyCalculationPeriod> splitPolicyCalculationPeriods = policyCalculationPeriod.split(myDate)

assert splitPolicyCalculationPeriods.size() == 2
assert splitPolicyCalculationPeriods[0].startDate == policyCalculationPeriod.startDate
assert splitPolicyCalculationPeriods[0].endDate == myDate - 1
assert splitPolicyCalculationPeriods[1].startDate == myDate
assert splitPolicyCalculationPeriods[1].endDate == policyCalculationPeriod.endDate
Example 2: Multiple Dates
import java.sql.Date

Date myDate1 = Date.valueOf("2000-01-01")
Date myDate2 = Date.valueOf("2000-01-02")
Date myDate3 = Date.valueOf("2000-01-03")

List<PolicyCalculationPeriod> splitPolicyCalculationPeriods = policyCalculationPeriod.split(myDate1, myDate2, myDate3)

assert splitPolicyCalculationPeriods.size() == 4
Example 3: List
import txt.sql.Date

Date myDate1 = Date.valueOf("2000-01-01")
Date myDate2 = Date.valueOf("2000-01-02")
List<Date> myDateList = [myDate1, myDate2]

List<PolicyCalculationPeriod> splitPolicyCalculationPeriods = policyCalculationPeriod.split(myDateList)

assert splitPolicyCalculationPeriods.size() == myDateList.size() + 1

1. an empty score is considered the best score
2. The member does not need to have a Policy Product for this Transfer Certificate Product
3. If the pre-defined method parameter is left empty, the method searches for Person Covered Services without a Product Code