Activities

Document output, like a summary plan description or an id card for a person on a policy, can be generated on a periodic basis. The generation can also be triggered by changes related to the policy or person or object (described in more detail in the Change Events guide) or it can be forced by a user in the View and Edit Policy page (described in more detail in View and Edit Policy), for example when a person loses his or her person id card.

This chapter describes the activities that are used during the generation of output. Activities are output generation threads that can run in parallel. Some activities do nothing more than split up the work into other activities with a smaller scope, while others execute the actual output generation.

This chapter describes the following activities:

Activity Name Purpose

Generate Output

Starts the overall process for output generation.
Selects eligible policies and divides the workload over the policies.
Creates the data file set and the data files containing the output.

Generate Output per Policy

Generates output for a single policy or policy enrollments on a single policy.

Generate Output

The Generate Output activity is started by the user. This is the only activity that is started by a user; the Generate Output per Policy activity is automatically started by the system itself. The user can control the scope of the output generation by selecting values for the following parameters:

Name Description

Output Definition

The output definition that defines the output that needs to be generated.

Brand

If specified, the output generation only picks up policies for that brand. If not, then the output generation picks up policies due for output generation from any brand.

Group Account

If specified, the output generation only picks up policies for that group account. If not, then the output generation picks up policies due for output generation from any account.
If the value unspecified is keyed in (it is not available in the pick list), the output generation only picks up individual policies.

Reference Date

If specified, it prevents the system from generating output for policies or policy enrollments that are ended before this date.

Only Periodic Output?

If unspecified or set to Yes, the system only looks at periodic output in the policy output history to check if the policy or policy enrollment is due for output generation.

The purpose of this activity is to select all policies that may be eligible for output generation, start separate policy level activities for the eligible policies, create the data file set (including the data files containing the generated output) and send a notification to an external system.

The following messages can occur during this activity:

Code Severity Message Text

POL-VL-GOUT-001

Fatal

Output definition code {code} is unknown

POL-VL-GOUT-002

Fatal

Brand code {code} is unknown

POL-VL-GOUT-003

Fatal

Group account code {code} is unknown

ACT-FL-DAFI-001

Informative

Messages are written to the Data File Set(s) {comma separated list of data file set codes}

Select Policies

To select eligible policies the system looks at the specified parameters, the status of the policy, the generation period of the output definition and existing policy mutations. For each of the eligible policies, this activity starts a new Generate Output per Policy activity.

Parameters and Status

Policies that meet all of the following are selected:

  • Belong to the specified group account, or - if the group account parameter has the value unspecified - have no group account

  • Belong to the specified brand

  • Have at least one policy enrollment product that has not ended before the specified reference date

  • Have at least one policy enrollment (only for output definitions of level Enrollment)

  • Fulfill one of these conditions on policy version and status:

    • The status of the latest version is Approved.
      The output will be generated for this policy version in status Approved.

    • The status of the latest version is Edit or Pended and at least one policy mutation (matching gid) exists for the specified output definition with cause 'Manual Output Generation'.
      The output will be generated for this policy version in status Edit or Pended.

    • The status of the latest version is Edit or Pended, no policy mutation (matching gid) exists for the specified output definition with cause 'Manual Output Generation', but a previous version exists.
      The output will be generated for the previous policy version in status Approved.

If a single group account (X) includes policies that belong to brand A and other policies that belong to brand B, it is possible to start output generation for only those policies that belong to account X and brand A, or only those policies that belong to account X and brand B. If the user specifies account X as a parameter - and leaves the brand empty - then the output generation picks up all policies that belong to account X, both for brand A and B.

Policy Mutations and Generation Period

The policies that are selected based on the parameters and status are further filtered based on the existence of policy mutations and the generation period that is specified on the output definition.

The policies that have at least one policy mutation (matching gid) for the specified output definition are eligible for output generation. The policies that do not have policy mutations for the specified output definition and where the output definition does not specify a generation period, are not eligible for output generation. If a generation period is specified, then for all policies that do not have policy mutations for the specified output definition, the generation period and the policy output history is checked to see if they are eligible for output generation. The mechanism differs per level of the output definition.

Policy Level

The system checks the policy output history to see if the policy is due for output generation:

  • If the 'Only Periodic Output?' parameter is unspecified or set to Yes:

    • The policies that do not have a policy output history record (matching gid and output definition) with cause 'Periodic Output Generation' and a generation date that falls within the generation period (looking back from the activity start date) are eligible for output generation

    • The policies that have a policy output history record as specified above are not eligible for output generation* If the 'Only Periodic Output?' parameter is set to No, the system checks the policy output history to see if the policy is due for output generation in the same way as specified above, but regardless of the cause.

Enrollment Level

The system checks the policy output history to see if at least one of the policy enrollments on the policy is due for output generation:

  • If the 'Only Periodic Output?' parameter is unspecified or set to Yes:

    • The policies that have at least one policy enrollment that does not have a policy output history record (matching gid, person or object and output definition) with cause 'Periodic Output Generation' and a generation date that falls within the generation period (looking back from the activity start date) are eligible for output generation

    • The policies that have a policy output history record as specified above for all policy enrollments on the policy are not eligible for output generation

  • If the 'Only Periodic Output?' parameter is set to No, the system checks the policy output history to see if the policy is due for output generation in the same way as specified above, but regardless of the cause

Create Files and Send Notification

The system creates a data file set that will contain the data files and message POL-FL-GOUT-001 is attached to the Generate Output activity. After the output is generated by the Generate Output per Policy activities that are started by the global activity (described in more detail in the next section), it is written to one or more data files. The system processes a fixed number of Generate Output per Policy activities in one transaction; the output that is created by those activities will be written to one data file. The maximum size of the data file can be set in the properties file. If the output definition specifies a Header and/or Footer dynamic logic function, that dynamic logic is used to generate the header and/or footer of each data file.

The system provides the following common notification to the endpoint. The property to set the endpoint to send out the notification is ohi.outputgeneration.datafile.notification.endpoint If the financial message endpoint requires Authentication, please use Authentication Use Case: OutputGenerationNotificationClient to set authentication. Please see section Outbound RESTful Service Invocations in Integration Guide for the process and more properties.

<notification correlationId="" workId="{activityId}" status="Success/Failure">
   <links>
     <link rel='file' href='http://host:port/api/datafilesets/{datafilesetcode}/datafile/{datafilecode}/data'/>
     <link rel='file' href='http://host:port/api/datafilesets/{datafilesetcode}/datafile/{datafilecode}/data'/>
     ...
    </links>
</notification>

The data file(s) can be downloaded by using the "Get details of a data file" request from the data file set integration point described in the cross area guide.

Generate Output per Policy

Each Generate Output activity creates one or more Generate Output per Policy activities (if the selection results in one or more policies being eligible for output generation). The purpose of this activity is to generate output for the eligible policies. The mechanism differs per level of the output definition.

Policy Level

For output definitions of level Policy the system checks if the policy meets the dynamic logic condition specified (optional) on the output definition. If the policy meets the condition or if there is no condition specified, the system generates the output for the specific policy (using the Repeat Element dynamic logic function).

After generating the output, the system creates a policy output history record for the specific policy and output definition. If the policy was not selected based on the existence of policy mutations, a policy output history record is created with the cause set to 'Periodic Output Generation'. If the policy was selected based on the existence of policy mutations, those mutations are discarded and a policy output history record is created with the cause set to 'Periodic Output Generation' or copied from the mutation with the earliest effective date, depending on the generation period check as specified for the global level activity:

  • If the policy is not due for output generation, the cause is copied from the mutation

  • If the policy is due for output generation, the cause is set to 'Periodic Output Generation' (this means that when the generation is both due and triggered by an event or manually, the cause is still 'Periodic Output Generation')

  • If the output definition does not specify a generation period, the cause is copied from the mutation

Enrollment Level

For output definitions of level Enrollment the system selects the eligible policy enrollments on the policy, and for each eligible policy enrollment, the system generates the output (using the Repeat Element dynamic logic function). Policy enrollments that meet all of the following are selected:

  • Have at least one policy enrollment product that has not ended before the specified reference date

  • Meet the dynamic logic condition specified on the output definition

The policy enrollments that are selected based on the reference date and the dynamic logic condition are further filtered based on the existence of policy mutations and the generation period that is specified on the output definition.

The policy enrollments that have at least one policy mutation (matching gid and person or object) for the specified output definition are eligible for output generation. The policy enrollments that do not have policy mutations for the specified output definition and where the output definition does not specify a generation period, are not eligible for output generation. If a generation period is specified, then for all policy enrollments that do not have policy mutations for the specified output definition, the generation period and the policy output history is checked to see if they are eligible for output generation:

  • If the 'Only Periodic Output?' parameter is unspecified or set to Yes:

    • The policy enrollments that do not have a policy output history record (matching gid, person or object and output definition) with cause 'Periodic Output Generation' and a generation date that falls within the generation period (looking back from the activity start date) are eligible for output generation

    • The policy enrollments that have a policy output history record as specified above are not eligible for output generation

  • If the 'Only Periodic Output?' parameter is set to No, the system checks the policy output history to see if the policy enrollment is due for output generation in the same way as specified above, but regardless of the cause.

After generating the output, the system creates a policy output history record for the specific policy, person or object and output definition. If the policy enrollment was not selected based on the existence of policy mutations, a policy output history record is created with the cause set to 'Periodic Output Generation'. If the policy enrollment was selected based on the existence of policy mutations, those mutations are discarded and a policy output history record is created with the cause set to 'Periodic Output Generation' or copied from the mutation with the earliest effective date, depending on the generation period check as specified above:

  • If the policy enrollment is not due for output generation, the cause is copied from the mutation

  • If the policy enrollment is due for output generation, the cause is set to 'Periodic Output Generation' (this means that when the generation is both due and triggered by an event or manually, the cause is still 'Periodic Output Generation')

  • If the output definition does not specify a generation period, the cause is copied from the mutation