Predefined Methods
This section describes the pre-defined methods available per object. These pre-defined methods can be divided into two categories: methods that are available on all or many objects, called generic methods, and 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.
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.
In or Out | Type | Description |
---|---|---|
In |
String |
The usage name |
In |
String |
The record’s key attribute value, or |
- Examples
-
Assume an existing person has the following three values for the
dynRecord1
record. This dynamic record has two attributes:code
anddescription
, wherecode
is configured as the key.
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)
lookUpFlexCode
Returns the flex code object that matches the input character string.
- Availability
-
This method can be called without a base object.
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")
test
A method that tests a dynamic logic:
-
Follows the security restrictions of the unit under test (UUT).
-
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).
In or Out | Type | Description |
---|---|---|
In |
|
Dynamic logic Code of the UUT |
In |
|
Map with the input parameters of the UUT |
Out |
|
Contains the result of the test and the exception class if the test encounters any errors. Attributes of this object are:
|
- 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.
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
, andlevel
, wherecode
is configured as the key.
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
andendDate
, this time-valid dynamic record has two attributes:code
,description
, wherecode
is configured as the key.
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 ] )
Please refer to the Claims Developer Guide for the complete list of available generic methods.
Specific Methods
In this section, the methods are described that are only available on specific objects. For each method, the following information is given:
-
The purpose of the method.
-
On which object(s) the method can be called.
-
Description of the parameters.
-
An example of the usage.
getParameterValue
Gets the parameter value of a product that is defined for a parameter alias at a given point in time. If a value is defined at the parameter alias value level, then it will also return that value.
- Availability
-
This method is available on product objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
The code of the parameter alias. Mandatory. |
In |
Date |
As of date for time validity. Optional. |
Out |
List |
The parameter value list defined for the parameter alias in context of the product. Null if no parameter value is defined. |
- Example
parameterValue = product.getParameterValue("PCP_COPAY","2014-01-21")
getProductLimitRenewalPeriod
Gets the product limit renewal period of a product that is defined for a limit at a given point in time.
- Availability
-
This method is available on product objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
The code of the limit. Mandatory. |
Out |
Product Limit Renewal Period |
The product limit renewal period defined for the limit in context of the product. Null if no product limit renewal period is defined. |
- Example
productLimitRenewalPeriod = product.getproductLimitRenewalPeriod("DEDUCTIBLE")
getProductProviderGroup
Gets the product provider group of a product that is defined for a provider group at a given point in time.
- Availability
-
This method is available on product objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
The code of the provider group. Mandatory. |
In |
Date |
As of date for time validity. Optional. |
Out |
Product Provider Group |
The product provider group defined for the provider group in context of the product. Null if no product provider group is defined. |
- Example
productProviderGroup = product.getProductProviderGroup("NY NETWORK","2014-01-21")
getProductServiceDefinition
Gets the product service definition of a product that is defined for a service definition at a given point in time.
- Availability
-
This method is available on product objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
The code of the service option. Mandatory. |
In |
String |
The code of the service. Mandatory. |
In |
String |
The code of the service definition. Mandatory. |
In |
String |
The type of the service definition ("A","C","R","W"). Mandatory |
In |
Date |
As of date for time validity. Mandatory. |
Out |
Product Service Definition |
The product service definition defined for the service definition in context of the product. Null if no product service definition is defined. |
- Example
productServiceDefinition = product.getproductServiceDefinition("PHYSICAL THERAPY","SERVICES","PROFESSIONAL","C","2014-01-21")
setDynamicField
The method sets the dynamic field to an object.
- Availability
-
This method is available for all objects that support dynamic fields.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
A usage name |
In |
Object |
Structure of the dynamic field |
- Example
-
The following logic sets a time-valid field usage:
policy.setDynamicField("policyCoverage", new DynamicFieldPeriod(polCovRef.policyCoverage,polCovRef.startDate,polCovRef.endDate))
The recommended way to use the dynamic field is mentioned in the Writing section. |