Skip to content
Snippets Groups Projects
Commit a074fd8d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

health partner information is available in subject templates

parent 6382d9ec
No related branches found
No related tags found
1 merge request!253Resolve "import of serology data"
Pipeline #27200 passed
......@@ -111,6 +111,11 @@ class MailTemplate(models.Model):
("##S_VIRUS_4_IGG_STATUS##", "IgG Status in visit 4", ""),
("##S_VIRUS_5_IGG_STATUS##", "IgG Status in visit 5", ""),
("##S_HEALTH_PARTNER_NAME##", "Name of the health partner", ""),
("##S_HEALTH_PARTNER_ADDRESS##", "Address of the health partner", ""),
("##S_HEALTH_PARTNER_ZIP_CODE##", "Zip code of the health partner", ""),
("##S_HEALTH_PARTNER_CITY##", "City of the health partner", ""),
]
MAILS_TEMPLATE_VISIT_TAGS = [
......@@ -321,6 +326,17 @@ class MailTemplate(models.Model):
'##S_MAIL_LANGUAGE##': str(study_subject.subject.default_written_communication_language),
'##S_KNOWN_LANGUAGES##': ", ".join([l.name for l in study_subject.subject.languages.all()])
}
if study_subject.health_partner is not None:
result["##S_HEALTH_PARTNER_NAME##"] = str(study_subject.health_partner.name)
result["##S_HEALTH_PARTNER_ADDRESS##"] = str(study_subject.health_partner.address)
result["##S_HEALTH_PARTNER_ZIP_CODE##"] = str(study_subject.health_partner.postal_code)
result["##S_HEALTH_PARTNER_CITY##"] = str(study_subject.health_partner.city)
else:
result["##S_HEALTH_PARTNER_NAME##"] = ""
result["##S_HEALTH_PARTNER_ADDRESS##"] = ""
result["##S_HEALTH_PARTNER_ZIP_CODE##"] = ""
result["##S_HEALTH_PARTNER_CITY##"] = ""
for i in range(1, 6):
virus_test_field = "##S_VIRUS_{}_RESULT##".format(i)
virus_test_value = virus_test_to_str(getattr(study_subject, "virus_test_{}".format(i)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment