Muhammadtaha12 commited on
Commit
978364c
·
verified ·
1 Parent(s): be9ce02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +113 -12
app.py CHANGED
@@ -1,53 +1,154 @@
1
  import streamlit as st
2
 
3
  # Define the healthcare knowledge base with a wider set of diseases and conditions
4
- health_knowledge_base = {
5
  "flu": {
6
  "symptoms": ["fever", "cough", "sore throat", "body aches", "fatigue"],
7
- "treatment": "Rest, fluids, pain relievers, and anti-viral medications if prescribed.",
8
  },
9
  "headache": {
10
  "symptoms": ["head pain", "nausea", "sensitivity to light"],
11
- "treatment": "Rest, hydration, over-the-counter painkillers, and avoid triggers.",
12
  },
13
  "diabetes": {
14
  "symptoms": ["increased thirst", "frequent urination", "fatigue", "blurred vision"],
15
- "treatment": "Insulin therapy, lifestyle changes, and dietary management.",
16
  },
17
  "cold": {
18
  "symptoms": ["sore throat", "runny nose", "cough", "sneezing", "mild body aches"],
19
- "treatment": "Rest, hydration, decongestants, and over-the-counter pain relief.",
20
  },
21
  "asthma": {
22
  "symptoms": ["shortness of breath", "wheezing", "chest tightness", "coughing"],
23
- "treatment": "Inhalers, bronchodilators, corticosteroids, and avoiding triggers.",
24
  },
25
  "pneumonia": {
26
  "symptoms": ["cough with mucus", "fever", "shortness of breath", "chest pain"],
27
- "treatment": "Antibiotics for bacterial pneumonia, rest, fluids, and pain relievers.",
28
  },
29
  "hypertension": {
30
  "symptoms": ["headaches", "dizziness", "shortness of breath", "nosebleeds"],
31
- "treatment": "Medications like beta-blockers, ACE inhibitors, lifestyle changes including exercise and diet.",
32
  },
33
  "anxiety": {
34
  "symptoms": ["excessive worry", "restlessness", "fatigue", "difficulty concentrating", "irritability"],
35
- "treatment": "Cognitive-behavioral therapy (CBT), medications like SSRIs, relaxation techniques.",
36
  },
37
  "depression": {
38
  "symptoms": ["persistent sadness", "loss of interest", "fatigue", "changes in appetite or sleep patterns"],
39
- "treatment": "Antidepressants, therapy (CBT), exercise, and social support.",
40
  },
41
  "arthritis": {
42
  "symptoms": ["joint pain", "swelling", "stiffness", "reduced range of motion"],
43
- "treatment": "Pain relievers, anti-inflammatory drugs, physical therapy, and joint protection.",
44
  },
45
  "covid-19": {
46
  "symptoms": ["fever", "dry cough", "fatigue", "loss of taste or smell", "shortness of breath"],
47
- "treatment": "Rest, fluids, over-the-counter medications, and antiviral drugs if prescribed.",
48
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
 
51
  # Function to search for health information in the knowledge base
52
  def get_health_info(query):
53
  query = query.lower()
 
1
  import streamlit as st
2
 
3
  # Define the healthcare knowledge base with a wider set of diseases and conditions
4
+ {
5
  "flu": {
6
  "symptoms": ["fever", "cough", "sore throat", "body aches", "fatigue"],
7
+ "treatment": "Rest, fluids, pain relievers, and anti-viral medications if prescribed."
8
  },
9
  "headache": {
10
  "symptoms": ["head pain", "nausea", "sensitivity to light"],
11
+ "treatment": "Rest, hydration, over-the-counter painkillers, and avoid triggers."
12
  },
13
  "diabetes": {
14
  "symptoms": ["increased thirst", "frequent urination", "fatigue", "blurred vision"],
15
+ "treatment": "Insulin therapy, lifestyle changes, and dietary management."
16
  },
17
  "cold": {
18
  "symptoms": ["sore throat", "runny nose", "cough", "sneezing", "mild body aches"],
19
+ "treatment": "Rest, hydration, decongestants, and over-the-counter pain relief."
20
  },
21
  "asthma": {
22
  "symptoms": ["shortness of breath", "wheezing", "chest tightness", "coughing"],
23
+ "treatment": "Inhalers, bronchodilators, corticosteroids, and avoiding triggers."
24
  },
25
  "pneumonia": {
26
  "symptoms": ["cough with mucus", "fever", "shortness of breath", "chest pain"],
27
+ "treatment": "Antibiotics for bacterial pneumonia, rest, fluids, and pain relievers."
28
  },
29
  "hypertension": {
30
  "symptoms": ["headaches", "dizziness", "shortness of breath", "nosebleeds"],
31
+ "treatment": "Medications like beta-blockers, ACE inhibitors, lifestyle changes including exercise and diet."
32
  },
33
  "anxiety": {
34
  "symptoms": ["excessive worry", "restlessness", "fatigue", "difficulty concentrating", "irritability"],
35
+ "treatment": "Cognitive-behavioral therapy (CBT), medications like SSRIs, relaxation techniques."
36
  },
37
  "depression": {
38
  "symptoms": ["persistent sadness", "loss of interest", "fatigue", "changes in appetite or sleep patterns"],
39
+ "treatment": "Antidepressants, therapy (CBT), exercise, and social support."
40
  },
41
  "arthritis": {
42
  "symptoms": ["joint pain", "swelling", "stiffness", "reduced range of motion"],
43
+ "treatment": "Pain relievers, anti-inflammatory drugs, physical therapy, and joint protection."
44
  },
45
  "covid-19": {
46
  "symptoms": ["fever", "dry cough", "fatigue", "loss of taste or smell", "shortness of breath"],
47
+ "treatment": "Rest, fluids, over-the-counter medications, and antiviral drugs if prescribed."
48
  },
49
+ "abdominal_aortic_aneurysm": {
50
+ "symptoms": ["back pain", "abdominal pain", "pulsating mass in the abdomen"],
51
+ "treatment": "Surgical intervention, blood pressure control, and monitoring."
52
+ },
53
+ "acute_lymphoblastic_leukemia": {
54
+ "symptoms": ["fever", "pale skin", "unexplained weight loss", "easy bruising"],
55
+ "treatment": "Chemotherapy, bone marrow transplant, and supportive care."
56
+ },
57
+ "acute_myeloid_leukemia": {
58
+ "symptoms": ["fatigue", "fever", "easy bruising or bleeding", "shortness of breath"],
59
+ "treatment": "Chemotherapy, stem cell transplant, and supportive care."
60
+ },
61
+ "acromegaly": {
62
+ "symptoms": ["enlarged hands and feet", "joint pain", "thickened skin", "enlarged facial features"],
63
+ "treatment": "Surgery, radiation therapy, and medication to control growth hormone production."
64
+ },
65
+ "actinomycosis": {
66
+ "symptoms": ["abscesses", "fever", "painful lumps", "swelling"],
67
+ "treatment": "Long-term antibiotics such as penicillin."
68
+ },
69
+ "acute_renal_failure": {
70
+ "symptoms": ["decreased urine output", "fatigue", "swelling in the legs", "confusion"],
71
+ "treatment": "Dialysis, fluid management, and treatment of underlying causes."
72
+ },
73
+ "addisons_disease": {
74
+ "symptoms": ["fatigue", "muscle weakness", "low blood pressure", "darkening of the skin"],
75
+ "treatment": "Corticosteroid therapy and lifestyle modifications."
76
+ },
77
+ "adhd": {
78
+ "symptoms": ["impulsivity", "difficulty focusing", "hyperactivity", "forgetfulness"],
79
+ "treatment": "Stimulant medications, therapy (CBT), and lifestyle management."
80
+ },
81
+ "aids": {
82
+ "symptoms": ["weight loss", "fever", "night sweats", "fatigue", "recurrent infections"],
83
+ "treatment": "Antiretroviral therapy (ART) to manage the virus and prevent complications."
84
+ },
85
+ "albinism": {
86
+ "symptoms": ["pale skin", "light-colored eyes", "vision problems", "sensitivity to light"],
87
+ "treatment": "UV protection, corrective lenses for vision, and skin protection."
88
+ },
89
+ "alcoholic_hepatitis": {
90
+ "symptoms": ["nausea", "abdominal pain", "yellowing of the skin (jaundice)", "loss of appetite"],
91
+ "treatment": "Avoid alcohol, medications to manage symptoms, and possible liver transplant."
92
+ },
93
+ "alcoholism": {
94
+ "symptoms": ["strong cravings for alcohol", "inability to control drinking", "neglect of responsibilities"],
95
+ "treatment": "Behavioral therapy, support groups, medications like disulfiram, and rehabilitation."
96
+ },
97
+ "alkaptonuria": {
98
+ "symptoms": ["dark urine", "arthritis", "heart disease", "darkening of the ears or eyes"],
99
+ "treatment": "Managing symptoms, physical therapy, and joint replacement if necessary."
100
+ },
101
+ "allergies": {
102
+ "symptoms": ["sneezing", "itchy eyes", "runny nose", "hives", "swelling"],
103
+ "treatment": "Antihistamines, decongestants, and avoiding triggers."
104
+ },
105
+ "alzheimers_disease": {
106
+ "symptoms": ["memory loss", "difficulty with tasks", "confusion", "personality changes"],
107
+ "treatment": "Cognitive-enhancing drugs, therapy, and support for caregivers."
108
+ },
109
+ "amyotrophic_lateral_sclerosis": {
110
+ "symptoms": ["muscle weakness", "difficulty speaking or swallowing", "breathing problems"],
111
+ "treatment": "Symptom management, physical therapy, and breathing support."
112
+ },
113
+ "anemia": {
114
+ "symptoms": ["fatigue", "pale skin", "dizziness", "shortness of breath"],
115
+ "treatment": "Iron supplements, B12 injections, or blood transfusions depending on the cause."
116
+ },
117
+ "aneurysm": {
118
+ "symptoms": ["severe headache", "nausea", "blurred vision", "pain in the chest or abdomen"],
119
+ "treatment": "Surgical repair, blood pressure control, and monitoring."
120
+ },
121
+ "angelman_syndrome": {
122
+ "symptoms": ["delayed development", "lack of speech", "seizures", "smiling and laughter"],
123
+ "treatment": "Physical therapy, speech therapy, and medications for seizures."
124
+ },
125
+ "anorexia_nervosa": {
126
+ "symptoms": ["extreme weight loss", "fear of gaining weight", "distorted body image", "restricted eating"],
127
+ "treatment": "Nutritional rehabilitation, psychotherapy, and medical monitoring."
128
+ },
129
+ "anthrax": {
130
+ "symptoms": ["fever", "cough", "chest pain", "difficulty breathing", "swelling"],
131
+ "treatment": "Antibiotics and in some cases, vaccination."
132
+ },
133
+ "antiphospholipid_syndrome": {
134
+ "symptoms": ["recurrent miscarriages", "blood clots", "stroke", "rashes"],
135
+ "treatment": "Blood thinners and management of clotting disorders."
136
+ },
137
+ "aortic_stenosis": {
138
+ "symptoms": ["chest pain", "shortness of breath", "fatigue", "fainting"],
139
+ "treatment": "Surgical valve replacement or balloon valvuloplasty."
140
+ },
141
+ "aortic_dissection": {
142
+ "symptoms": ["severe chest or back pain", "difficulty breathing", "sweating", "loss of consciousness"],
143
+ "treatment": "Emergency surgery, blood pressure control, and monitoring."
144
+ },
145
+ "apraxia": {
146
+ "symptoms": ["difficulty planning and coordinating muscle movements", "speech and motor difficulties"],
147
+ "treatment": "Speech therapy, physical therapy, and occupational therapy."
148
+ }
149
  }
150
 
151
+
152
  # Function to search for health information in the knowledge base
153
  def get_health_info(query):
154
  query = query.lower()