-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
92 lines (66 loc) · 2.29 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
welcome_prompt = "Welcome doctor, what would you like to do today?\n - To list all patients, press 1\n - To run a new "\
"diagnosis, press 2\n - To quit, press q\n "
name_prompt = "What is the patient's name?\n"
appearance_prompt = "How is the patient's general appearance?\n - 1: Normal appearance\n - 2: Irritable or lethargic\n"
eye_prompt = "How are the patient's eyes?\n - 1: Eyes normal or slightly sunken\n - 2: Eyes very sunken\n"
severe_dehydration = "Severe dehydration"
some_dehydration = "Some dehydration"
no_dehydration = "No dehydration"
skin_prompt = "How is the patient's skin when you pinch it?\n - 1: Normal skin pinch\n - 2: Slow skin pinch\n"
severe_irritation = "Severe Irritation"
no_irritation = "No Irritation"
error_message = "Could not save patient and diagnosis due to invalid input"
patients_and_diagnosis = [
"Mike - Severe dehydration",
"Sally - No dehydration",
"Kate - Some dehydration"
]
def assess_eyes(eyes):
if eyes == "1":
return no_dehydration
elif eyes == "2":
return severe_dehydration
else:
return ""
def assess_skin(skin):
if skin == "1":
return no_irritation
elif skin == "2":
return severe_irritation
else:
return ""
def assess_appearance():
appearance = input(appearance_prompt)
if appearance == "1":
eyes = input(eye_prompt)
return assess_eyes(eyes)
elif appearance == "2":
skin = input(skin_prompt)
return assess_skin(skin)
else:
return ""
def list_patients():
for patient in patients_and_diagnosis:
print(patient)
def save_new_diagnosis(name, diagnosis):
if name == "" or diagnosis == "":
print(error_message)
return
final_diagnosis = name + " - " + diagnosis
patients_and_diagnosis.append(final_diagnosis)
print("Final diagnosis: ", final_diagnosis, "\n")
def start_new_diagnosis():
name = input(name_prompt)
diagnosis = assess_appearance()
save_new_diagnosis(name, diagnosis)
def main():
while True:
selection = input(welcome_prompt)
if selection == "1":
list_patients()
elif selection == "2":
start_new_diagnosis()
elif selection == "q":
return
print(selection)
main()