symptoms_calculator
1class symptomsCalculator: 2 '''The given class calculates all the symptoms of the Diseases using the required constraints from the Medical Reports and outputs the relative result''' 3 4 def acidBaseDisorder(self, minbicarbonate, maxbicarbonate): 5 '''The function calculates whether the patient has Acid Base Disorder utilizing its Medical Report's Constraints''' 6 7 # For Metabolic Acidosis 8 if (minbicarbonate < 18.0): 9 a = True 10 else: 11 a = False 12 13 #For Metabolic Alkalosis 14 if (maxbicarbonate > 30.0): 15 b = True 16 else: 17 b = False 18 19 return a, b 20 21 def hyperCholesterolemia(self, maxcholestrol): 22 '''The function calculates whether the patient has Hyper Cholesterolemia utilizing its Medical Report's Constraints''' 23 24 if (maxcholestrol > 200): 25 return True 26 else: 27 return False 28 29 def hypertension(self, sbp, dbp): 30 '''The function calculates whether the patient has Hypertension utilizing its Medical Report's Constraints''' 31 32 if (sbp > 140) and (dbp > 90): 33 return True 34 else: 35 return False 36 37 def kidneyInjury(self, maxCreatinine, prevMaxCreatinine): 38 '''The function calculates whether the patient has Kidney Injury utilizing its Medical Report's Constraints''' 39 40 # For Acute 41 if (((maxCreatinine) > (1.5 * prevMaxCreatinine)) 42 or ((maxCreatinine > 1.2) and (prevMaxCreatinine <= 1.2))): 43 a = True 44 else: 45 a = False 46 47 #For Chronic 48 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2)): 49 b = True 50 else: 51 b = False 52 53 #For Acute on Chronic 54 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2) 55 and ((maxCreatinine) > (1.5 * prevMaxCreatinine))): 56 c = True 57 else: 58 c = False 59 60 #For Not otherwise specified 61 if (maxCreatinine > 1.2): 62 d = True 63 else: 64 d = False 65 66 return a, b, c, d 67 68 def obesity(self, height, weight): 69 '''The function calculates whether the patient has Obesity utilizing its Medical Report's Constraints''' 70 71 if (height > 0) and (weight > 0): 72 bmi = (weight) / ((height / 100) * (height / 100)) 73 74 if bmi > 30: 75 return True 76 else: 77 return False
class
symptomsCalculator:
2class symptomsCalculator: 3 '''The given class calculates all the symptoms of the Diseases using the required constraints from the Medical Reports and outputs the relative result''' 4 5 def acidBaseDisorder(self, minbicarbonate, maxbicarbonate): 6 '''The function calculates whether the patient has Acid Base Disorder utilizing its Medical Report's Constraints''' 7 8 # For Metabolic Acidosis 9 if (minbicarbonate < 18.0): 10 a = True 11 else: 12 a = False 13 14 #For Metabolic Alkalosis 15 if (maxbicarbonate > 30.0): 16 b = True 17 else: 18 b = False 19 20 return a, b 21 22 def hyperCholesterolemia(self, maxcholestrol): 23 '''The function calculates whether the patient has Hyper Cholesterolemia utilizing its Medical Report's Constraints''' 24 25 if (maxcholestrol > 200): 26 return True 27 else: 28 return False 29 30 def hypertension(self, sbp, dbp): 31 '''The function calculates whether the patient has Hypertension utilizing its Medical Report's Constraints''' 32 33 if (sbp > 140) and (dbp > 90): 34 return True 35 else: 36 return False 37 38 def kidneyInjury(self, maxCreatinine, prevMaxCreatinine): 39 '''The function calculates whether the patient has Kidney Injury utilizing its Medical Report's Constraints''' 40 41 # For Acute 42 if (((maxCreatinine) > (1.5 * prevMaxCreatinine)) 43 or ((maxCreatinine > 1.2) and (prevMaxCreatinine <= 1.2))): 44 a = True 45 else: 46 a = False 47 48 #For Chronic 49 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2)): 50 b = True 51 else: 52 b = False 53 54 #For Acute on Chronic 55 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2) 56 and ((maxCreatinine) > (1.5 * prevMaxCreatinine))): 57 c = True 58 else: 59 c = False 60 61 #For Not otherwise specified 62 if (maxCreatinine > 1.2): 63 d = True 64 else: 65 d = False 66 67 return a, b, c, d 68 69 def obesity(self, height, weight): 70 '''The function calculates whether the patient has Obesity utilizing its Medical Report's Constraints''' 71 72 if (height > 0) and (weight > 0): 73 bmi = (weight) / ((height / 100) * (height / 100)) 74 75 if bmi > 30: 76 return True 77 else: 78 return False
The given class calculates all the symptoms of the Diseases using the required constraints from the Medical Reports and outputs the relative result
def
acidBaseDisorder(self, minbicarbonate, maxbicarbonate):
5 def acidBaseDisorder(self, minbicarbonate, maxbicarbonate): 6 '''The function calculates whether the patient has Acid Base Disorder utilizing its Medical Report's Constraints''' 7 8 # For Metabolic Acidosis 9 if (minbicarbonate < 18.0): 10 a = True 11 else: 12 a = False 13 14 #For Metabolic Alkalosis 15 if (maxbicarbonate > 30.0): 16 b = True 17 else: 18 b = False 19 20 return a, b
The function calculates whether the patient has Acid Base Disorder utilizing its Medical Report's Constraints
def
hyperCholesterolemia(self, maxcholestrol):
22 def hyperCholesterolemia(self, maxcholestrol): 23 '''The function calculates whether the patient has Hyper Cholesterolemia utilizing its Medical Report's Constraints''' 24 25 if (maxcholestrol > 200): 26 return True 27 else: 28 return False
The function calculates whether the patient has Hyper Cholesterolemia utilizing its Medical Report's Constraints
def
hypertension(self, sbp, dbp):
30 def hypertension(self, sbp, dbp): 31 '''The function calculates whether the patient has Hypertension utilizing its Medical Report's Constraints''' 32 33 if (sbp > 140) and (dbp > 90): 34 return True 35 else: 36 return False
The function calculates whether the patient has Hypertension utilizing its Medical Report's Constraints
def
kidneyInjury(self, maxCreatinine, prevMaxCreatinine):
38 def kidneyInjury(self, maxCreatinine, prevMaxCreatinine): 39 '''The function calculates whether the patient has Kidney Injury utilizing its Medical Report's Constraints''' 40 41 # For Acute 42 if (((maxCreatinine) > (1.5 * prevMaxCreatinine)) 43 or ((maxCreatinine > 1.2) and (prevMaxCreatinine <= 1.2))): 44 a = True 45 else: 46 a = False 47 48 #For Chronic 49 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2)): 50 b = True 51 else: 52 b = False 53 54 #For Acute on Chronic 55 if ((maxCreatinine > 1.2) and (prevMaxCreatinine > 1.2) 56 and ((maxCreatinine) > (1.5 * prevMaxCreatinine))): 57 c = True 58 else: 59 c = False 60 61 #For Not otherwise specified 62 if (maxCreatinine > 1.2): 63 d = True 64 else: 65 d = False 66 67 return a, b, c, d
The function calculates whether the patient has Kidney Injury utilizing its Medical Report's Constraints
def
obesity(self, height, weight):
69 def obesity(self, height, weight): 70 '''The function calculates whether the patient has Obesity utilizing its Medical Report's Constraints''' 71 72 if (height > 0) and (weight > 0): 73 bmi = (weight) / ((height / 100) * (height / 100)) 74 75 if bmi > 30: 76 return True 77 else: 78 return False
The function calculates whether the patient has Obesity utilizing its Medical Report's Constraints