Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Capitation report starts periodically based on the value of configuration parameter CAPITATION_REPORT_SCHEDULE

Configuration

ParameterDescriptionValue
CAPITATION_REPORT_SCHEDULE(Cron Format) How often to run capitation report

`* 1 * * *` for prod

`****15` for dev

CAPITATION_REPORT_VALIDATE_SIGNATURE
true

Specification

Prepare dataset

...

AttributeCondition
contract.start_date< billing_date
contract.end_date>= billing_date
contract.statusin (ACTIVE)
contract.typein (capitation)

4. Find active employees declared in Active contract's

...

GroupCondition
0 - 5
EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 0 and 65
where persons.id = declarations.person_id
6 - 17EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 6 and 17
where persons.id = declarations.person_id
18 - 39EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 18 and 39
where persons.id = declarations.person_id
40 - 65EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 40 and 65
where persons.id = declarations.person_id
65 +EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) > 65
where persons.id = declarations.person_id

...

Create report record in capitation_reportsResult with zero values are also saved to report.

  1. For each contract in billing prepare temporary dataset with zero values for each key (age group | mountain group)
  2. Update this dataset with real number of declarations for each key
AttributeDescription
idGenerated on Step 2 report_id
billing_dateDetermined on Step 1 billing_date
created_atCreated at date time

...