Fakultas Ilmu Komputer UI

Commit 986ced5a authored by Ami's avatar Ami
Browse files

[REFACTOR] removing code duplication in formulas

parent c837d854
Pipeline #64771 passed with stage
in 38 minutes and 5 seconds
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment