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. However, 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 / 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'

lookUpFlexCode

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

Availability

This method can be called without a base object.

Parameters

In / 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 based on the input parameters passed.

Availability

This method is available in the dynamic logic (groovy script)

Parameters

In / Out Type Description

In

String

Code of the person ;

Out

Person

Person

lookUpProvider

Looks up the provider based on the input parameters passed.

Availability

This method is available in the dynamic logic (groovy script)

Parameters

In / 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 the input parameters passed.

Availability

This method is available in the dynamic logic (groovy script)

Parameters

In / Out Type Description

In

String

Code of the relation

Out

Relation

Relation

getSystemProperty

Returns the value of the property whose key is passed as input.

Availability

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

Parameters

In / Out Type Description

In

String

Key of the property

Out

String

Value of the property

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 / 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 / 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'))

dynamicRecord (add, update, delete and get)

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, 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.

Parameters

In / Out Type Description

In

String

The usage name

In

Map

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

Example, adding a non-time-valid record

The following logic will add a non-time-valid record:

person.addDynamicRecord( 'dynRecord1'
                      , [ code        : '06'
                        , description : 'dynRecord 1 value 6'
                        ;]
                      )

Example, adding a time-valid record

Adding a time-valid record is done similarly, except the map contains two extra attributes:

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

updateDynamicRecord

Updates the attributes of an existing dynamic record. Finding the correct record to update, is done by matching on the record’s key attribute value. If none of the existing record have a matching key value, nothing will be updated. If multiple records match with the key value, only one of them will be updated. If no key has been configured at all, executing this method will result in a new record being added. 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 will be updated, that is, attributes that are not mentioned, will be left untouched.

Availability

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

Parameters

In / Out Type Description

In

String

The usage name

In

Map

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

Example, updating 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 has been 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 will update the level of the record with code "02" from 7 to 6. Its description will be retained.

person.updateDynamicRecord( 'dynRecord1'
                         , [ code  : '02'
                           , level : 6
                           ;]
                         )

Example, updating a time-valid record

Updating a record’s start and end date attribute is done 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 has been 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 will set the endDate of the second record to the person’s end date. Its other attributes will be retained.

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

deleteDynamicRecord

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

Availability

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

Parameters

In / 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 has been configured as the key.

code description

01

dynRecord1 value 1

02

dynRecord1 value 2

03

dynRecord1 value 3

The following logic will delete the record with code "02", while leaving the other two records intact.

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

The following logic will delete all three occurrences records.

person.deleteDynamicRecord('dynRecord1', null)

getDynamicRecords

Retrieves the dynamic record(s) of a particular object. The output parameter type depends on the record’s definition, described separately in more detail below.

Dynamic records are also available as attributes of an entity. They can be accessed from the object directly with the usage name, instead of explicitly invoking this method. See examples.

Availability

This method is available for all objects that support dynamic records. If the record definition has been configured as both single-value and non-time-valid, this method will return a single record. If the record definition has been configured as either multi-value or time-valid, this method will return a list of records.

Parameters

In / Out Type Description

In

String

The usage name

Out

Map or List

The attributes of the record, structured as name/value pairs or a list of records where each record is represented as a map of attribute name/value pairs

Example (Single Record)

assert person.getDynamicRecords('hobby').name == 'Cricket'
assert person.getDynamicRecords('hobby').level.code == 'BEGINNER'

assert person.hobby.name == 'Cricket'
assert person.hobby.level.code == 'BEGINNER'

Example (List of Records)

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

assert person.hobbies.size() == 2
assert person.hobbies[0].name == 'Cricket'
assert person.hobbies[1].name == 'Soccer'

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 / 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 / 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 / Out Type Description

In

Date

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: returns the country regions of the invoking provider’s service addresses on the as-of date

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 / 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()

getTitles

This method returns a string containing all the titles of the person or individual provider separated by white 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 / 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 / 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 / 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 / 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 / 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 / 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 is not possible because you need to specify 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 / 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. We can 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')