Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accident Compensation Act - Loss of Earnings and Loss of Potential Ea…
…rnings
- Loading branch information
Showing
17 changed files
with
434 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
openfisca_aotearoa/parameters/acc/weekly_compensation_abatement.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: ACC Weekly Compensation Abatement | ||
reference: http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM104829.html | ||
values: | ||
2001-04-01: | ||
value: 0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
- name: Test LOPE for person in last day of continous training since their 18th birthday | ||
period: 2020-09 | ||
absolute_error_margin: 0 | ||
input: | ||
acc__earner: false | ||
acc__has_cover: | ||
"2010-08-03": true | ||
acc__part_2__suffered_personal_injury: true | ||
acc__part_3__has_lodged_claim: true | ||
acc__sched_1__engaged_fulltime_study_or_training: false | ||
acc__sched_1__incapacitated_for_6_months: true | ||
acc__sched_1__weekly_earnings: 500 | ||
date_of_birth: "2002-08-03" | ||
date_of_injury: "2020-08-05" | ||
finish_date_of_full_time_study_training_bridging_18th_birthday: "2020-08-05" | ||
incapacity_for_employment__corporation_determination: true | ||
acc__lope__incapacity_for_employment__by_covered_injury: true | ||
output: | ||
acc__potential_earner: | ||
"2020-08-06": true | ||
acc__sched_1__lope_eligible: | ||
"2020-09-06": true | ||
acc__part_2__suffered_personal_injury: | ||
"2020-08-06": true | ||
acc__has_cover: | ||
"2020-08-06": true | ||
age: | ||
"2020-08-06": 18 | ||
|
||
- name: Test LOPE for person injured day after their last day of continous training since their 18th birthday | ||
period: 2020-09 | ||
absolute_error_margin: 0 | ||
input: | ||
acc__earner: false | ||
acc__has_cover: true | ||
acc__part_2__suffered_personal_injury: true | ||
acc__part_3__has_lodged_claim: true | ||
acc__sched_1__engaged_fulltime_study_or_training: false | ||
acc__sched_1__incapacitated_for_6_months: true | ||
date_of_birth: "2002-08-03" | ||
date_of_injury: "2021-08-06" | ||
finish_date_of_full_time_study_training_bridging_18th_birthday: "2021-08-05" | ||
acc__lope__incapacity_for_employment__by_covered_injury: true | ||
incapacity_for_employment__corporation_determination: true | ||
output: | ||
acc__sched_1__lope_eligible: | ||
"2021-08-06": false | ||
|
||
- name: Simple test for LOPE eligibility for person before and after their 18th birthday | ||
period: 2020-09 | ||
absolute_error_margin: 0 | ||
input: | ||
acc__earner: false | ||
acc__has_cover: true | ||
acc__part_2__suffered_personal_injury: true | ||
acc__part_3__has_lodged_claim: true | ||
acc__sched_1__engaged_fulltime_study_or_training: false | ||
acc__sched_1__incapacitated_for_6_months: true | ||
date_of_birth: "2002-08-03" | ||
date_of_injury: "2019-02-02" | ||
incapacity_for_employment__corporation_determination: true | ||
acc__lope__incapacity_for_employment__by_covered_injury: true | ||
output: | ||
acc__sched_1__lope_eligible: | ||
"2018-01-01": false | ||
"2019-01-01": false | ||
"2020-01-01": false | ||
"2021-01-01": true | ||
"2022-01-01": true | ||
|
||
- name: Simple test for LOPE eligibility with entitlement calculation | ||
period: 2020-09 | ||
absolute_error_margin: 0 | ||
input: | ||
acc__earner: false | ||
acc__has_cover: true | ||
acc__part_2__suffered_personal_injury: true | ||
acc__part_3__has_lodged_claim: true | ||
acc__sched_1__engaged_fulltime_study_or_training: false | ||
acc__sched_1__incapacitated_for_6_months: true | ||
acc__sched_1__weekly_earnings: | ||
"2018-01-01": 0 | ||
"2019-01-01": 0 | ||
"2020-01-01": 300 | ||
"2021-01-01": 0 | ||
"2022-01-01": 300 | ||
acc__sched_1__minimum_weekly_earnings: 900 | ||
date_of_birth: "2002-08-03" | ||
date_of_injury: "2019-02-02" | ||
incapacity_for_employment__corporation_determination: true | ||
acc__lope__incapacity_for_employment__by_covered_injury: true | ||
output: | ||
acc__sched_1__lope_eligible: | ||
"2018-01-01": false | ||
"2019-01-01": false | ||
"2020-01-01": false | ||
"2021-01-01": true | ||
"2022-01-01": true | ||
acc__sched_1__lope_weekly_compensation: | ||
"2018-01-01": 0 | ||
"2019-01-01": 0 | ||
"2020-01-01": 0 | ||
"2021-01-01": 708 | ||
"2022-01-01": 408 |
20 changes: 20 additions & 0 deletions
20
openfisca_aotearoa/variables/acts/acc/105/incapacitated.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class incapacity_for_employment__corporation_determination(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = DAY | ||
label = u"Corporation determination of incapacity" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM101462.html" | ||
|
||
|
||
class acc__lope__incapacity_for_employment__by_covered_injury(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = ETERNITY | ||
label = u"The incapacity is caused by the injury for which they have cover" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM101462.html" |
12 changes: 12 additions & 0 deletions
12
openfisca_aotearoa/variables/acts/acc/26/personal_injury.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class acc__part_2__suffered_personal_injury(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = ETERNITY | ||
label = u"Has suffered a personal injury" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100910.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class acc__fullfils_purpose_of_act(Variable): | ||
label = "The purpose of this Act is to enhance the public good and reinforce the social contract represented by the first accident compensation scheme by providing for a fair and sustainable scheme for managing personal injury that has, as its overriding goals, minimising both the overall incidence of injury in the community, and the impact of injury on the community (including economic, social, and personal costs)," | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
reference = "Section 3 http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100100.html" | ||
|
||
def formula(persons, period, parameters): | ||
return ( | ||
(persons('acc__promotes_measures_to_reduce_incidence_and_severity_of_personal_injury', period) | ||
+ persons('acc__the_corporation_exercised_discretion_for_child_care_as_per_section_68_3', period) | ||
) | ||
* persons('acc__has_a_covered_injury', period) | ||
* persons('acc__part_3__has_lodged_claim', period) | ||
* persons('acc__assessed_as_having_a_need_caused_by_this_covered_injury', period) | ||
) | ||
|
||
|
||
class acc__promotes_measures_to_reduce_incidence_and_severity_of_personal_injury(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
label = "establishing as a primary function of the Corporation the promotion of measures to reduce the incidence and severity of personal injury" | ||
|
||
# (b) | ||
|
||
# providing for a framework for the collection, co-ordination, and analysis of injury-related information: | ||
# (c) | ||
|
||
# ensuring that, where injuries occur, the Corporation’s primary focus should be on rehabilitation with the goal of achieving an appropriate quality of life through the provision of entitlements that restores to the maximum practicable extent a claimant’s health, independence, and participation: | ||
# (d) | ||
|
||
# ensuring that, during their rehabilitation, claimants receive fair compensation for loss from injury, including fair determination of weekly compensation and, where appropriate, lump sums for permanent impairment: | ||
# (e) | ||
|
||
# ensuring positive claimant interactions with the Corporation through the development and operation of a Code of ACC Claimants’ Rights: | ||
# (f) | ||
|
||
# ensuring that persons who suffered personal injuries before the commencement of this Act continue to receive entitlements where appropriate. |
12 changes: 12 additions & 0 deletions
12
openfisca_aotearoa/variables/acts/acc/32/loss_of_earnings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class weekly_compensation__loss_of_earnings_payable(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Engaged in full-time study or training, does not include full-time study or training in living or social skills" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM104891.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class acc__part_3__has_lodged_claim(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = ETERNITY | ||
label = u"Has lodged a claim with the Corporation" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100910.html" | ||
|
||
def formula(persons, period, parameters): | ||
return ( | ||
persons('acc__lodged_claim_for_cover_for_personal_injury', period) | ||
+ persons('acc__lodged_claim_for_cover_and_specified_entitlement_for_personal_injury', period) | ||
+ persons('acc__assessed_as_having_a_need_caused_by_this_covered_injury', period) | ||
) | ||
|
||
# Missing variables | ||
# acc__lodged_claim_for_cover_and_specified_entitlement_for_personal_injury | ||
# acc__assessed_as_having_a_need_caused_by_this_covered_injury |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
from numpy import logical_not | ||
|
||
|
||
class acc__earner(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = ETERNITY | ||
label = u"A natural person who engages in employment" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100103.html#DLM100167" | ||
|
||
|
||
class acc__potential_earner(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = ETERNITY | ||
label = u"Is a potential earner" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100103.html#DLM100322" | ||
|
||
def formula(persons, period, parameters): | ||
birth = persons('date_of_birth', period) | ||
eighteenth_year = birth.astype('datetime64[Y]').astype(int) + 1970 + 18 | ||
eighteenth_month = birth.astype('datetime64[M]').astype(int) % 12 + 1 | ||
eighteenth_day = (birth - birth.astype('datetime64[M]') + 1).astype(int)\ | ||
|
||
date_of_injury = persons('date_of_injury', period) | ||
injury_year = date_of_injury.astype('datetime64[Y]').astype(int) + 1970 | ||
injury_month = date_of_injury.astype('datetime64[M]').astype(int) % 12 + 1 | ||
injury_day = (date_of_injury - date_of_injury.astype('datetime64[M]') + 1).astype(int)\ | ||
|
||
injured_under_18 = ((injury_year < eighteenth_year) | ||
+ ((injury_year == eighteenth_year) * (injury_month < eighteenth_month)) | ||
+ ((injury_year == eighteenth_year) * (injury_month == eighteenth_month) * (injury_day < eighteenth_day)) | ||
) > 0 | ||
|
||
finish_date = persons('finish_date_of_full_time_study_training_bridging_18th_birthday', period) | ||
finish_year = finish_date.astype('datetime64[Y]').astype(int) + 1970 | ||
finish_month = finish_date.astype('datetime64[M]').astype(int) % 12 + 1 | ||
finish_day = (finish_date - finish_date.astype('datetime64[M]') + 1).astype(int)\ | ||
|
||
injured_while_studying = ((injury_year < finish_year) | ||
+ ((injury_year == finish_year) * (injury_month < finish_month)) | ||
+ ((injury_year == finish_year) * (injury_month == finish_month) * (injury_day <= finish_day)) | ||
) > 0 | ||
|
||
injured_over_18_in_study = logical_not(injured_under_18) * injured_while_studying | ||
|
||
return (injured_under_18 + injured_over_18_in_study) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class acc__has_cover(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = DAY | ||
label = u"Has cover for a personal injury" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM100605.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
openfisca_aotearoa/variables/acts/acc/schedule_1/42/minimum_weekly_earnings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openfisca_core.model_api import * | ||
from openfisca_aotearoa.entities import Person | ||
|
||
|
||
class acc__sched_1__minimum_weekly_earnings(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = DAY | ||
label = u"Minimum weekly earnings" | ||
reference = "http://www.legislation.govt.nz/act/public/2001/0049/latest/DLM104874.html" |
Oops, something went wrong.