Table of Contents |
---|
...
Capitation report starts periodically based on the value of configuration parameter CAPITATION_REPORT_SCHEDULE
Configuration
Parameter | Description | Value |
---|---|---|
CAPITATION_REPORT_SCHEDULE | (Cron Format) How often to run capitation report | `* 1 * * *` |
CAPITATION_REPORT_VALIDATE_SIGNATURE | true |
Specification
Prepare dataset
...
4. Find active declarations signed with Active employee
Active Declarations - declaration that meets the following conditions and is signed with active employee
Attribute | Condition |
---|---|
declarations.employee_id | = contract_employees.employee_id |
declarations.division_id | = contract_employees.division_id |
declaration_status_hstr.status = active declaration_status_hstr.inserted_at | Declaration was active on billing_date |
5. Determine age_group for each declaration
There are following age groups right now:
Group | Condition |
---|---|
0 - 5 | EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 0 and 6 |
6 - 17 | EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 6 and 17 where persons.id = declarations.person_id |
18 - 39 | EXTRACT(YEAR FROM AGE(now(), persons.birth_date)) between 18 and 39 where persons.id = declarations.person_id |
40 - 65 | EXTRACT(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)) > where persons.id = declarations.person_id |
6. (Optional) Validate signed content
7. Aggregate and save data to DB
Save data to DB