Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Merge requests
!253
Resolve "import of serology data"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "import of serology data"
335-import-of-serology-data
into
master
Overview
0
Commits
10
Pipelines
5
Changes
15
Merged
Piotr Gawron
requested to merge
335-import-of-serology-data
into
master
4 years ago
Overview
0
Commits
10
Pipelines
5
Changes
1
Expand
Closes
#335 (closed)
,
#336 (closed)
Edited
4 years ago
by
Piotr Gawron
0
0
Merge request reports
Compare
version 3
version 3
77b5c140
4 years ago
version 2
d3f85fa4
4 years ago
version 1
ca62b153
4 years ago
master (base)
and
latest version
latest version
a074fd8d
10 commits,
4 years ago
version 3
77b5c140
8 commits,
4 years ago
version 2
d3f85fa4
7 commits,
4 years ago
version 1
ca62b153
6 commits,
4 years ago
Show latest version
1 file
+
42
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
smash/web/models/mail_template.py
+
42
−
26
Options
@@ -82,34 +82,39 @@ class MailTemplate(models.Model):
(
"
##S_ND_NUMBER##
"
,
"
Subject
'
s ND number
"
,
""
),
(
"
##S_DATE_ADDED##
"
,
"
Subject
'
s date of creation
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_1_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 1
"
,
(
"
##
S_
VIRUS_1_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 1
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_2_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 2
"
,
(
"
##
S_
VIRUS_2_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 2
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_3_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 3
"
,
(
"
##
S_
VIRUS_3_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 3
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_4_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 4
"
,
(
"
##
S_
VIRUS_4_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 4
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_5_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 5
"
,
(
"
##
S_
VIRUS_5_SAMPLE_COLLECTION_DATE##
"
,
"
Virus test collection date in visit 5
"
,
get_formatted_time
(
DATE_FORMAT_SHORT
)),
(
"
##VIRUS_1_RESULT##
"
,
"
Virus test results in visit 1
"
,
"
Positive
"
),
(
"
##VIRUS_2_RESULT##
"
,
"
Virus test results in visit 2
"
,
"
Negative
"
),
(
"
##VIRUS_3_RESULT##
"
,
"
Virus test results in visit 3
"
,
"
Inconclusive
"
),
(
"
##VIRUS_4_RESULT##
"
,
"
Virus test results in visit 4
"
,
""
),
(
"
##VIRUS_5_RESULT##
"
,
"
Virus test results in visit 5
"
,
""
),
(
"
##VIRUS_1_IGA_STATUS##
"
,
"
IgA Status in visit 1
"
,
"
Positive
"
),
(
"
##VIRUS_2_IGA_STATUS##
"
,
"
IgA Status in visit 2
"
,
"
Negative
"
),
(
"
##VIRUS_3_IGA_STATUS##
"
,
"
IgA Status in visit 3
"
,
"
Borderline
"
),
(
"
##VIRUS_4_IGA_STATUS##
"
,
"
IgA Status in visit 4
"
,
""
),
(
"
##VIRUS_5_IGA_STATUS##
"
,
"
IgA Status in visit 5
"
,
""
),
(
"
##VIRUS_1_IGG_STATUS##
"
,
"
IgG Status in visit 1
"
,
"
Positive
"
),
(
"
##VIRUS_2_IGG_STATUS##
"
,
"
IgG Status in visit 2
"
,
"
Negative
"
),
(
"
##VIRUS_3_IGG_STATUS##
"
,
"
IgG Status in visit 3
"
,
"
Borderline
"
),
(
"
##VIRUS_4_IGG_STATUS##
"
,
"
IgG Status in visit 4
"
,
""
),
(
"
##VIRUS_5_IGG_STATUS##
"
,
"
IgG Status in visit 5
"
,
""
),
(
"
##S_VIRUS_1_RESULT##
"
,
"
Virus test results in visit 1
"
,
"
Positive
"
),
(
"
##S_VIRUS_2_RESULT##
"
,
"
Virus test results in visit 2
"
,
"
Negative
"
),
(
"
##S_VIRUS_3_RESULT##
"
,
"
Virus test results in visit 3
"
,
"
Inconclusive
"
),
(
"
##S_VIRUS_4_RESULT##
"
,
"
Virus test results in visit 4
"
,
""
),
(
"
##S_VIRUS_5_RESULT##
"
,
"
Virus test results in visit 5
"
,
""
),
(
"
##S_VIRUS_1_IGA_STATUS##
"
,
"
IgA Status in visit 1
"
,
"
Positive
"
),
(
"
##S_VIRUS_2_IGA_STATUS##
"
,
"
IgA Status in visit 2
"
,
"
Negative
"
),
(
"
##S_VIRUS_3_IGA_STATUS##
"
,
"
IgA Status in visit 3
"
,
"
Borderline
"
),
(
"
##S_VIRUS_4_IGA_STATUS##
"
,
"
IgA Status in visit 4
"
,
""
),
(
"
##S_VIRUS_5_IGA_STATUS##
"
,
"
IgA Status in visit 5
"
,
""
),
(
"
##S_VIRUS_1_IGG_STATUS##
"
,
"
IgG Status in visit 1
"
,
"
Positive
"
),
(
"
##S_VIRUS_2_IGG_STATUS##
"
,
"
IgG Status in visit 2
"
,
"
Negative
"
),
(
"
##S_VIRUS_3_IGG_STATUS##
"
,
"
IgG Status in visit 3
"
,
"
Borderline
"
),
(
"
##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
"
,
""
),
]
@@ -321,21 +326,32 @@ 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
=
"
##VIRUS_{}_RESULT##
"
.
format
(
i
)
virus_test_field
=
"
##
S_
VIRUS_{}_RESULT##
"
.
format
(
i
)
virus_test_value
=
virus_test_to_str
(
getattr
(
study_subject
,
"
virus_test_{}
"
.
format
(
i
)),
getattr
(
study_subject
,
"
virus_test_{}_updated
"
.
format
(
i
)))
virus_test_date_field
=
"
##VIRUS_{}_SAMPLE_COLLECTION_DATE##
"
.
format
(
i
)
virus_test_date_field
=
"
##
S_
VIRUS_{}_SAMPLE_COLLECTION_DATE##
"
.
format
(
i
)
virus_test_date_value
=
date_to_str
(
getattr
(
study_subject
,
"
virus_test_{}_collection_date
"
.
format
(
i
)),
DATE_FORMAT_SHORT
)
virus_iga_status_field
=
"
##VIRUS_{}_IGA_STATUS##
"
.
format
(
i
)
virus_iga_status_field
=
"
##
S_
VIRUS_{}_IGA_STATUS##
"
.
format
(
i
)
virus_iga_status_value
=
getattr
(
study_subject
,
"
virus_test_{}_iga_status
"
.
format
(
i
))
if
virus_iga_status_value
is
None
:
virus_iga_status_value
=
""
virus_igg_status_field
=
"
##VIRUS_{}_IGG_STATUS##
"
.
format
(
i
)
virus_igg_status_field
=
"
##
S_
VIRUS_{}_IGG_STATUS##
"
.
format
(
i
)
virus_igg_status_value
=
getattr
(
study_subject
,
"
virus_test_{}_igg_status
"
.
format
(
i
))
if
virus_igg_status_value
is
None
:
virus_igg_status_value
=
""
Loading