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

add TeleIcare id to declarations #1528

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/etl/teleicare_history/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ def create_declaration_from_teleicare_history():
if latest_ica_declaration.dcl_date_fin_commercialisation
else declaration_creation_date,
siccrf_id=ica_complement_alimentaire.cplalim_ident,
teleicare_id=[
latest_ica_declaration.dcl_annee,
latest_ica_declaration.dcl_mois,
latest_ica_declaration.dcl_numero,
].join("-"),
galenic_formulation=GalenicFormulation.objects.get(
siccrf_id=ica_complement_alimentaire.frmgal_ident
),
Expand Down
7 changes: 7 additions & 0 deletions data/models/declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ class Article(models.TextChoices):
unique=True,
verbose_name="cplalim_ident dans le modèle IcaComplementAlimentaire si la déclaration provient de Teleicare",
)
teleicare_id = models.TextField(
blank=True,
null=True,
editable=False,
unique=True,
verbose_name="identifiant Teleicare connu par les déclarants et indiqué dans les attestations",
)

def create_snapshot(
self,
Expand Down
Loading