Predefined Methods
This section describes the predefined methods available per object. These predefined 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
This section describes generic methods available on all objects. A number if these methods return time valid information. As a consequence, most methods take an as-of date as one of the input parameters. The as-of date parameter is always optional. If left unspecified, the method defaults to the as-of date specified by the signature.
asOf
The asOf method can be used to filter the elements of a list based on time-validity. It returns a list of the elements that are valid on a given date. For single-value dynamic fields, only one element can be valid at any given time, so this method will return that element (instead of a list containing the element). The latter only applies to dynamic fields, not to dynamic records.
- Availability
-
This method is available on all lists containing time-valid elements. This includes lists of detail entities, lists of dynamic fields, and lists of dynamic records.
Parameters
In or Out | Type | Description |
---|---|---|
In |
java.sql.Date |
The date on which the elements in the list should be valid (this parameter is optional if not specified, the default date that is associated with the dynamic logic signature will be used) |
Out |
For single-value dynamic fields: the dynamic field’s datatype. For all others: List </ul> |
<ul> <li>For single-value dynamic fields: the dynamic field value for the date</li> <li>For all others: the list of elements that are valid on the date</li> </ul> |
Example
Assume a certain person has the below addresses.
Type | City | StartDate | EndDate |
---|---|---|---|
Site |
New York |
2000-01-01 |
|
Mailing |
New York |
2000-01-01 |
2000-12-31 |
Mailing |
Washington |
2001-01-01 |
def date = java.sql.Date.valueOf("2001-04-21") assert person.addressList.size() == 3 assert person.addressList.asOf(date).size() == 2 assert person.addressList.asOf(date).find({address -> address.addressType.code == "M"}).city == "Washington"
getSystemProperty
Returns the value of the property with the passed key as input.
- Availability
-
This method is available in the dynamic logic (Groovy script).
In or Out | Type | Description |
---|---|---|
In |
String |
Key of the property |
Out |
String |
Value of the property |
lookUpFlexCode
Returns the flex code object that matches the input character string.
- Availability
-
This method can be called without a base object.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
Key value of the FlexCode |
In |
String |
Definition code of the FlexCode |
Out |
FlexCode |
Flex Code |
- Example
capitationContract.dynamicFieldYesNoIndicator = lookUpFlexCode("YES", "YES_NO")
lookUpPerson
Looks up the Person in the system on the input parameters passed.
- Availability
-
This method is available in the Dynamic Logic (Groovy script).
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).
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).
In or Out | Type | Description |
---|---|---|
In |
String |
Code of the Relation. |
Out |
Relation |
Relation |
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
])
Object 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
addAssignedProvider
Adds an assigned provider to a person.
- Availability
-
This method is available for the Person object. Its purpose is to have the possibility to add an assigned provider through function dynamic logic.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
Provider code (mandatory) |
In |
String |
Provider flex code definition code (mandatory) |
In |
String |
Provider assignment type code (mandatory) |
In |
Date |
Assigned provider start date (mandatory) |
In |
Date |
Assigned provider end date (optional) |
- Example
person.addAssignedProvider("1234567890", "US_PROVIDER", "PCP", java.sql.Date.valueOf("2017-01-01"))
addContractAlignment
Adds a contract alignment to a person.
- Availability
-
This method is available for the Person object. Its purpose is to have the possibility to add a contract alignment through function dynamic logic.
Parameters
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"))
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)
generateSequenceNumber
Generates a unique sequence number for a person or organization.
- Availability
-
This method is available for Person and Organization. Its purpose is to have the possibility to generate a sequence number through function dynamic logic that can be used to compose a person or organization code:
Parameters
In or Out | Type | Description |
---|---|---|
Out |
Number |
The sequence number of the person or organization |
- Example
def personSequenceNumber = person.generateSequenceNumber()
getAge
Calculates the age of a person at a given date and returns the age in years.
- Availability
-
This method is only available for person objects.
Parameters
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()
getCountryRegions (Provider)
Get the country regions of a provider. Use addresses at given point in time. Returns the country regions if found, null otherwise.
- Availability
-
This method is available on provider objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
Date |
As of date for time validity (optional in case the signature defines a default date) |
Out |
CountryRegionList |
|
- Example
countryRegions = provider.getCountryRegions()
getCountryRegion (Relation)
Get the country region of a relation. Use address of given type at given point in time. Returns the country region if found, null otherwise.
- Availability
-
This method is available on relation objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
Date |
As of date for time validity (optional in case the signature defines a default date) |
In |
String |
Address type code. Optional, when not specified, the default address type is used. |
Out |
CountryRegion |
Returns the country region of the invoking relation’s address on the as-of date |
- Example
countryRegion = person.getCountryRegion()
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 |
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.
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.
In or Out | Type | Description |
---|---|---|
In |
String |
A usage name. |
Out |
List |
A list of records. Each record represents a map of attribute |
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"
getTitles
This method returns a string containing all the titles of the person or individual provider separated by blank spaces. The titles are sorted on display order. If no display order is available or several titles have the same display order, the alphabetic ordering of the title applies.
- Availability
-
This method is available on person and individual provider objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
"A" returns all post-name titles, "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")
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 provider objects, both individual and organizational providers.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
Code of the specialty |
In |
Date |
As of date for time validity (optional in case the signature defines a default date) |
Out |
Boolean |
True the invoking provider has a provider specialty that matches the code on the as-of date |
- Example
if provider.hasSpecialty("DERMATOLOGY")
inFlexCodeGroup
Checks whether a flex code is part of a flex code group or of at least one flex code group if a list of flex code groups is passed at a certain point in time. Returns true when that is the case, false otherwise.
- Availability
-
This method is only available for flex code objects.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
Code of one flex code group or a comma-separated list of flex code groups (mandatory) |
In |
Date |
As of date for time validity (optional in case the signature defines a default date) |
Out |
Boolean |
True if the invoking flex code belongs to the given group or at least one of the given groups on the as-of date |
- Example
-
Check whether a procedure is part of a specific procedure group:
return(flexCode.inFlexCodeGroup("FLEXCODEGROUP1"))
Check whether a flex code is part of at least one flex code group in a list of groups:
return(flexCode.inFlexCodeGroup("FLEXCODEGROUP1,FLEXCODEGROUP2,FLEXCODEGROUP3"))
If it is required to check if a flex code is in at least one of a list of flex code groups (on a certain date) use the comma-separated list capability for efficiency reasons.
inProviderGroup
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 to the provider group OR
-
the organization provider is part of an organization provider that is affiliated to the provider group
An individual provider is part of a provider group if:
-
the individual provider is affiliated to the provider group
The affiliations must be valid at the as of date in all cases.
- Availability
-
This method is available for provider objects, both individual and organizational providers.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
Code of the provider group (mandatory) |
In |
Date |
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")
isOrganization
Returns true when the relation is of subtype Organization (not a Bank), false otherwise.
- Availability
-
This method is available on relation objects.
Parameters
In or Out | Type | Description |
---|---|---|
Out |
Boolean |
True if the invoking relation is an organization |
- Example
relation.isOrganization()
isPerson
Returns true when the relation is of subtype Person, false otherwise.
Parameters
In or Out | Type | Description |
---|---|---|
Out |
Boolean |
True if the invoking relation is a person |
- Example
relation.isPerson()
setField
The usual way to assign a value is to use the assignment operator, for example:
capitationContract.dynamicField1 = 3
In the case of a dynamic field that is in a FlexCode Set, a direct assignment without specifying the code of the FlexCode Definition.
This method sets the value for a dynamic field or a provider field. The field has to be single value and non-time-valid.
- Availability
-
This method is only available for functions that allow a value to be set within the dynamic logic.
Parameters
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 to be set (for flex codes, the key field value) |
In |
String |
Code of the FlexCode Definition |
- Example
-
This example assigns a value to a flex code field on the Oracle Health Insurance Value-Based Payments contract. The field flexCode1 is of type Flex Codes Set, which is defined as flex code set. Use the following code to do the same where "1234" is the code of the flex code and "DEFINITION1" is the code of the flex code definition for the flex code.
capitationContract.setField("flexCode1","1234","DEFINITION1")
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. |
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 ] )