Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application d'un montant minimal de l'AAH en cas d'hospitalisation/incarceration #1274

Merged
merged 17 commits into from
Mar 12, 2019

Conversation

mtifarine
Copy link
Contributor

@mtifarine mtifarine commented Feb 15, 2019

Connected to #999

  • Évolution du système socio-fiscal.

  • Périodes concernées : toutes.

  • Zones impactées :

    • model/prestations/minima_sociaux/aah.
    • parameters/prestations/minima_sociaux/aah/mva.
    • parameters/prestations/minima_sociaux/aah/taux_aah_hospitalise_ou_incarcere.
    • parameters/prestations/minima_sociaux/aah/taux_capacite_travail.
    • parameters/prestations/minima_sociaux/caah/garantie_ressources.
  • Détails :

    • Implémente des compléments à l'AAH (le complément de ressources et la majoration pour vie autonome).
    • Applique un montant minimal de l'AAH en cas d'hospitalisation ou incarcération.
    • Ajoute les variables:
      • taux_capacite_travail
      • aah_date_debut_incarceration
      • aah_date_debut_hospitalisation
      • complement_ressources_aah
      • eligibilite_caah

Note de @sandcha : mva supprimée de la liste parce que la classe existait, malgré l'absence de formule.

@mtifarine mtifarine added the contrib:msa Identification des sujets MSA label Feb 15, 2019
@sandcha
Copy link
Contributor

sandcha commented Feb 21, 2019

Merci @mtifarine pour cette évolution et les tests associés !
Avec @Morendil, nous avons débuté la revue.
Notre première question est : dans caah, un commentaire a été supprimé et on ne le retrouve pas revu ou déplacé ailleurs. Est-ce bien volontaire ?

@mtifarine
Copy link
Contributor Author

Merci @sandcha,
Oui, c'est moi qui l'ai supprimé et remplacé par les liens législatifs.
Le commentaire servait surtout à rendre clair l'amas de code regroupé dans caah.
Avec la dernière version, caah a été séparé en deux (mva et complement_ressources_aah) et les références on été incluse, nous pensions donc le commentaire devenu superflu.
Le commentaire prends exactement le texte législatif.

@@ -1,4 +1,4 @@
- name: 'Cas 1: Personne bénéfice du complément de Ressources'
- name: 'Cas 1 : Personne bénéfice du Complément de Ressources'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bénéfice -> bénéficie

Copy link
Contributor

@sandcha sandcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci @mtifarine pour cette mise à jour !
Il me semble essentiellement rester quelques ajustements de dates.

Note au cas où :

Les messages grisés comme ici ne sont que des suggestions.

# caah
# mva
aah_param = parameters(period).prestations.minima_sociaux.aah
m_2 = datetime64(period.offset(-2, 'month').start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La référence législative évoquant un délais de soixante jours, utiliser des jours en offset ?
D'où m_2 = datetime64(period.offset(-60, 'day').start).

pour répondre à la condition "premier jour d'après" de cet extrait de la référence : "A partir du premier jour du mois suivant une période de soixante jours révolus".

entity = Individu
definition_period = MONTH
set_input = set_input_divide_by_period

def formula(individu, period, parameters):
aah_base = individu('aah_base', period)
# caah
# mva
aah_param = parameters(period).prestations.minima_sociaux.aah
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indiquer dans le nom qu'il s'agit de plusieurs paramètres ? aah_parameters ?

@@ -0,0 +1,5 @@
description: Le pourcentage minimal de la capacité de travail pour bénéficier du complément de ressources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourcentage maximal (en place de minimal) puisque la capacité de travail ne doit pas dépasser ce % ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrigé

@@ -5,6 +5,6 @@ values:
2006-01-01:
value: 101.80
2007-01-01:
value: 119.72
value: 103.63
2015-01-01:
value: 104.77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Montant de 104.77 à partir du 18 septembre 2008 ? 🤔 cf. décret 2008-988

definition_period = MONTH

def formula(individu, period, parameters):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formula_2015_07_01 tel que cela était le cas lorsque la mva était intégrée au caah ?

Plus généralement, la MVA serait en vigueur depuis le 1er juillet 2005 d'après le sous-titre de cet article mais j'ignore le delta entre 2005 et 2015.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrigé


return max_(complement_ressources, mva)
def formula_2015_07_01(individu, period, parameters):
complement_ressources_aah = individu('complement_ressources_aah', period)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci, c'est nettement plus clair ainsi !

Cela apporte aussi une duplication de conditions d'éligibilité. @Morendil Des conseils à ce sujet ? Je ne sais pas si, par exemple, une eligibilite_caah aurait du sens d'un point de vue législatif.

Copy link
Contributor

@Morendil Morendil Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui je pense qu'il faudrait factoriser, il y a pas loin d'une vingtaine de lignes en commun entre les deux.

Je n'ai pas lu les textes officiels en détail mais la description sur SP (section "cumul avec d'autres aides") est assez explicite sur la notion d'éligibilité à un cumul, avec l'obligation de choisir entre les deux. Le choix fait dans cette PR est de retenir le max, ce qui semble raisonnable.

benef_asi = (asi_eligibilite * (asi > 0))

eligible_mva = ((al > 0) *
(taux_incapacite >= taux_incapacite_min) *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Bien vu pour l'égalité !

individus:
parent1:
age: 58
taux_incapacite: 0.81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mettre à 0.8 pour la valeur seuil ? De même pour le test suivant.

Copy link
Contributor

@sandcha sandcha Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mis à jour

@@ -16,6 +18,30 @@
# https://www.legifrance.gouv.fr/affichCode.do;jsessionid=157287C570B3AE9450A0BD88AA902970.tplgfr38s_1?idSectionTA=LEGISCTA000006141593&cidTexte=LEGITEXT000006073189&dateTexte=20180731


class taux_capacite_travail(Variable):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion d'amélioration: regrouper cette variable ainsi que taux_incapacite dans un seul fichier (par exemple model/caracteristiques/capacite_travail.py) afin d'éviter qu'on les confonde l'une avec l'autre et expliciter leur différence.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, je le trouve plus évident ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Morendil @sandcha je m'occupe de ça?

@sandcha sandcha force-pushed the msa_complements_aah branch from 58687f6 to c3bf076 Compare March 12, 2019 10:08
@sandcha sandcha force-pushed the msa_complements_aah branch from c3bf076 to 3121a02 Compare March 12, 2019 10:10
@sandcha
Copy link
Contributor

sandcha commented Mar 12, 2019

Merci @mtifarine pour ces améliorations 🙌
Rebase fait. Je mets à jour le changelog et la version pour merge.

@mtifarine
Copy link
Contributor Author

Merci @sandcha,
La variable taux_incapacite est utilisée pour le calcul des autres variables (AL, rente_accident_travail) et pas seulement pour l'aah, je trouve donc que ce lien législatif et cette description sont pour le paramètre "aah/taux_incapacite.yaml" et ne sont pas pour la variable taux_incapacite.

@sandcha sandcha merged commit 2712421 into master Mar 12, 2019
@sandcha sandcha deleted the msa_complements_aah branch March 12, 2019 10:42
@Morendil
Copy link
Contributor

@mtifarine Bien noté pour cette remarque, j'ai pris note qu'il faudrait qu'on revienne plus tard sur les différentes notions de handicap/invalidité/incapacité/capacité pour s'assurer qu'elles sont cohérentes entre elles et avec les textes qui y font référence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contrib:msa Identification des sujets MSA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants