Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2021
Kelas D
PT Gizi Sehat - Dietela
Dietela Backend
Commits
986ced5a
Commit
986ced5a
authored
Mar 22, 2021
by
Ami
Browse files
[REFACTOR] removing code duplication in formulas
parent
c837d854
Pipeline
#64771
passed with stage
in 38 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dietela_quiz/formulas.py
View file @
986ced5a
...
...
@@ -114,15 +114,12 @@ def program_recommendation(condition, target, disease):
score
=
condition
+
target
+
disease
programs_dictionary
=
{}
if
(
22
<=
score
<=
30
):
if
(
22
<=
score
<=
30
)
or
(
70
<=
score
<=
79
)
:
programs_dictionary
[
'priority_1'
]
=
ProgramRecommendationResponse
.
BABY_1
programs_dictionary
[
'priority_2'
]
=
ProgramRecommendationResponse
.
TRIAL
elif
(
31
<=
score
<=
69
):
programs_dictionary
[
'priority_1'
]
=
ProgramRecommendationResponse
.
BABY_3
programs_dictionary
[
'priority_2'
]
=
ProgramRecommendationResponse
.
BABY_1
elif
(
70
<=
score
<=
79
):
programs_dictionary
[
'priority_1'
]
=
ProgramRecommendationResponse
.
BABY_1
programs_dictionary
[
'priority_2'
]
=
ProgramRecommendationResponse
.
TRIAL
elif
(
80
<=
score
<=
99
):
programs_dictionary
[
'priority_1'
]
=
ProgramRecommendationResponse
.
GOALS_3
programs_dictionary
[
'priority_2'
]
=
ProgramRecommendationResponse
.
GOALS_1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment