Object Model

The object model describes the structure of an entity to use in a dynamic logic. An entity is a Groovy class that has methods and fields. We often refer to fields as attributes or properties. To access the values of an entity, you need to know the field type of the value.

There are two types of fields in Oracle Health Insurance: native and dynamic. Native fields are predefined fields for an entity. Dynamic fields are fields that a user can configure. To access a list of all the fields available for the application, see the View Objects page on the user interface. This chapter describes the different fields types.

Native Fields

Native Fields are predefined attributes that are part of the system’s data model and are fixed. You can access them but cannot create them. Any access is through a dynamic logic. There are two types of dynamic logic that work on native fields:

  • Dynamic logic Validations and Conditions return either true or false.

  • Dynamic logic Functions for data modifications. The function’s signature defines the input and return types.

Dynamic Fields

You can access a dynamic field of an object through its Usage Name. Two factors determine the working of a dynamic field. One is the field’s definition (for example, a Character field of 30 characters). The other is the time-valid and multi-value indicators. The indicators suggest multiple values for a dynamic field.

Multi-Value and Time-Valid Dynamic Fields

  • A single-value non-time-valid dynamic field holds one value for an object’s property. Editing the value replaces the original value.

    Example

    A person who holds a single occupation for their lifetime. A change in occupation requires overwriting the original occupation.

  • A multi-value non-time-valid dynamic field holds multiple values for an object’s property.

    Example

    A person who holds multiple positions. With such fields, you can add more fields or overwrite the pre-existing ones.

  • A single-value time-valid dynamic field holds multiple values with each having a period. A mandatory start date and an optional end date sets the period. The values must not overlap in time.

    Example

    A person who has multiple roles over time, but each role has a separate duration. The person does not hold two positions at any point in time. To add a new role, you need to mention a period that does not overlap with the period of any other pre-existing value.

  • A multi-value time-valid dynamic field contains multiple values, with each value having a period. The value can have a period that overlaps with the period of the other values.

    Example

    A person holding two or more jobs at one time.

Lists

A list on the object represents a dynamic field with multiple values.

  • For non-time-valid dynamic fields, the element type depends on the configured data type. For example, a Character dynamic field becomes List<String>. A Code dynamic field becomes List<FlexCode>.

  • For Time-Valid Dynamic Fields, each value coincides with a time validity: a start and an end date. A DynamicFieldPeriod object captures the information. The resulting dynamic field’s type is always List<DynamicFieldPeriod>. The structure of a time-valid class looks like this:

    class DynamicFieldPeriod {
      Date startDate
      Date endDate
      Object value
    }

The asOf Method

The asOf method helps find a valid value of a field on a particular date.

  • For single-value dynamic fields, the asOf method returns the value, not a DynamicFieldPeriod object.

  • For multi-value dynamic fields, the asOf method returns a list of values, not a List<DynamicFieldPeriod>.

To see examples on how to use the asOf method, see Groovy Examples.

The asOf method can have either one or two parameters.

  • In case of a single parameter: this parameter must be of type Date (referenceDate).

    This asOf method must be applied on a List. It returns a value from that list which has a startDate and endDate enclosing the referenceDate.

  • In case of two parameters: one parameters must be of type Date (referenceDate) and the other parameter must be of type String (entityName), the order is irrelevant.

    This asOf method must be applied on a single valued field. It searches for a subresource as indicated by the entityName. From this subresource, it returns a value which has a startDate and endDate enclosing the referenceDate.
    Therefore, the subresource must be a List with time valid values.
    When the asOf method is used with two parameters on a List, the entityName is ignored and the method returns a value from that list based on the referenceDate.

Dynamic Records

You can access a dynamic record through its Usage Name. The data type of dynamic records depends on the configured multi-value and time-valid indicators. Since a dynamic record comprises multiple fields, it does not have a single-value attribute. You can access each field of a record individually. To see examples on how to access dynamic records, see Groovy Examples.