· 4 years ago · Feb 16, 2021, 08:24 PM
1from kivymd.app import MDApp
2from kivy.lang import Builder
3from kivymd.uix.dialog import MDDialog
4from kivymd.uix.button import MDFlatButton
5from kivy.uix.screenmanager import Screen
6from kivymd.uix.list import IRightBodyTouch, MDList
7from kivymd.uix.boxlayout import MDBoxLayout
8from kivy.properties import StringProperty
9from kivymd.uix.expansionpanel import MDExpansionPanel, MDExpansionPanelTwoLine
10from kivymd.uix.picker import MDTimePicker
11import json
12import sqlite3 as sql
13import datetime
14import time
15
16
17class Content(MDList):
18 pass
19
20
21class RecordLine(MDBoxLayout):
22 text = StringProperty()
23
24
25class InformationDialog(MDDialog):
26 pass
27
28
29class DemoApp(MDApp):
30 class MainMenuScreen(Screen):
31 pass
32
33 class InputScreen(Screen):
34 pass
35
36 class RestingHeartRateScreen(Screen):
37 pass
38
39 class ResultObeseScreen(Screen):
40 pass
41
42 class ResultNormalScreen(Screen):
43 pass
44
45 class ResultOverweightScreen(Screen):
46 pass
47
48 class ResultUnderweightScreen(Screen):
49 pass
50
51 class LocationSearchScreen(Screen):
52 pass
53
54 class LocationResultScreen(Screen):
55 pass
56
57 class HistoryScreen(Screen):
58 pass
59
60 #conn = sql.connect('USERINFO.db')
61 #cur = conn.cursor()
62 #cur.execute(""" CREATE TABLE IF NOT EXISTS results (
63 # UID INTEGER PRIMARY KEY AUTOINCREMENT,
64 # NAME VARCHAR(50),
65 # RESULT INT,
66 # DATE_TIME TEXT DEFAULT CURRENT_TIMESTAMP)
67 # """)
68#
69 #cur.execute(""" CREATE TABLE IF NOT EXISTS information (
70 # id INTEGER PRIMARY KEY AUTOINCREMENT,
71 # fname VARCHAR(50),
72 # height INT,
73 # weight INT,
74 # age INT,
75 # heartrate INT)
76 # """)
77#
78#
79 #conn.commit()
80 #conn.close()
81
82 def __init__(self, **kwargs):
83 super().__init__(**kwargs)
84 self.list_items = [] # Dictionary where the items is stored
85 self.counter = 0
86 self.counting = {'Item counter': self.counter}
87 self.dialog = None
88 self.selected_category = None
89 self.selected_rec = None
90 self.card_file = \
91 [{'Category': 'Barangay ALABANG',
92 'Record': [
93 {'title': 'Alabang Medical Clinic ( MAIN )',
94 'Details': [
95 ' ADDRESS: \n 297 Montillano St, Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8842 0680']},
96 {'title': 'Alabang Medical Center, Alabang Zapote road',
97 'Details': [
98 ' ADDRESS: \n Ayala Life-FGU Center, Zapote Road Corner Acacia Avenue Madrigal Business Park, Ayala Alabang, Muntinlupa \n TELEPHONE NUMBER: \n 0998 855 9221']},
99 {'title': 'Asian Hospital and Medical Center',
100 'Details': [
101 ' ADDRESS: \n 2205 Civic Dr, Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8771 9000']},
102 {'title': 'Aventus Medical Care, Inc. - Alabang Clinic',
103 'Details': [
104 ' ADDRESS: \n 2/F Sycamore ARCS 1 Building Buencamino Street corner Alabang - Zapote Road Madrigal Business Park, Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8556 3598']},
105 {'title': 'Healthway Medical Festival Mall',
106 'Details': [
107 ' ADDRESS: \n 2nd Floor, Pixie Forest Entrance, Filinvest Ave, Filinvest City, Muntinlupa \n TELEPHONE NUMBER: \n (02) 751 4929']},
108 {'title': 'Healthfirst clinic ALABANG',
109 'Details': [
110 ' ADDRESS: \n G/F, South Supermarket, Filinvest Ave., Filinvest Corporate City \n TELEPHONE NUMBER: \n (+632) 8 821 1423 | 0917 842 8214']},
111 {'title': 'Ospital ng Muntinlupa ( OSMUN )',
112 'Details': [
113 ' ADDRESS: \n Civic Dr, Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8771 0457']},
114 {'title': 'St. Michaels Medical Center',
115 'Details': [
116 ' ADDRESS: \n Starmall Alabang, South Super Hwy, Alabang, Muntinlupa\n TELEPHONE NUMBER: \n 0921 624 4418']},
117 {'title': 'San Roque Medical Clinic',
118 'Details': [' ADDRESS: \n Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8842 2950']},
119 {'title': 'Megason Diagnostic Clinic',
120 'Details': [' ADDRESS: \nAlabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8809 9044']},
121 {'title': 'Tokyo Healthlink 東京ヘルスリンク - Alabang',
122 'Details': [
123 ' ADDRESS: \n Molito Complex, Madrigal Ave, Ayala Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8772 2678']},
124 {'title': 'Research Institute for Tropical Medicine',
125 'Details': [
126 ' ADDRESS: \n Filinvest Corporate City, 9002 Research Dr, Alabang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8807 2631']},
127 ]},
128 {'Category': 'Barangay BAYANAN',
129 'Record': [
130 {'title': 'Silverio Medical Clinic',
131 'Details': [
132 ' ADDRESS: \n 233g National Road, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8862 0223']},
133 {'title': 'Bayanan Health Center (Annex)',
134 'Details': [
135 ' ADDRESS: \n Block 2, Purok 1, 292 M Dolleton St, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8862 0124']},
136 {'title': 'Bayanan Medical Clinic, X-Ray and Laboratory Services',
137 'Details': [
138 ' ADDRESS: \n 231 National Road, Bayanan, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8861 5861']},
139 {'title': 'El Natividad Medical And Maternity Clinic',
140 'Details': [
141 ' ADDRESS: \n 214 National Road, Muntinlupa \n TELEPHONE NUMBER: \n 0923 701 5164']},
142 ]},
143 {'Category': 'Barangay CUPANG',
144 'Record': [
145 {'title': 'Hillside General Hospital',
146 'Details': [
147 ' ADDRESS: \n Km. 23, West Service Road, Cupang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8842 3958']},
148 {'title': 'Alabang Medical Center',
149 'Details': [
150 ' ADDRESS: \n 8 Corregidor, Cupang, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8850 8719']},
151 {'title': 'Cupang Health Center',
152 'Details': [
153 ' ADDRESS: \n Barangay Hall, Beside Cupang, Manuel L. Quezon, Cupang, Muntinlupa \n TELEPHONE NUMBER: \n --']},
154 ]},
155 {'Category': 'Barangay POBLACION',
156 'Record': [
157 {'title': 'Albia Medical & Diagnostic Clinic',
158 'Details': [
159 ' ADDRESS: \n 93 Rizal St, Poblacion, Muntinlupa \n TELEPHONE NUMBER: \n (02)8461204']},
160 {'title': 'Babaran Echavez Medical And Psychiatric Clinic',
161 'Details': [
162 ' ADDRESS: \n 1125 Amparo Corner Sto Nino Street, Poblacion, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8861 3066']},
163 {'title': 'MCC De La Merced Maternity And Childrens Clinic',
164 'Details': [
165 ' ADDRESS: \n 92 Rizal St, Poblacion, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8861 3944']},
166 {'title': 'Mauricestela Medical Clinic',
167 'Details': [
168 ' ADDRESS: \n 212 Pedro Diaz St, Poblacion, Muntinlupa, 1776 Metro Manila \n TELEPHONE NUMBER: \n (02) 8862 2117']},
169 {'title': 'Poblacion Health Center Main',
170 'Details': [
171 ' ADDRESS: \n Poblacion, Muntinlupa \n TELEPHONE NUMBER: \n NONE']},
172 ]},
173 {'Category': 'Barangay PUTATAN',
174 'Record': [
175 {'title': 'Alabang Medical Clinic - Muntinlupa Branch',
176 'Details': [
177 ' ADDRESS: \n 1 National Highway, Putatan, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8861 1779']},
178 {'title': 'IMS Wellth Care, Inc.',
179 'Details': [
180 ' ADDRESS: \n 49 National Road, Putatan, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8861 1592']},
181 {'title': 'Medical Center Muntinlupa',
182 'Details': [
183 ' ADDRESS: \n National Road, Putatan, Muntinlupa \n TELEPHONE NUMBER: \n 8620162']},
184 {'title': 'Muntinlupa Doctors Clinic',
185 'Details': [
186 ' ADDRESS: \n 1 National Road, Putatan, Muntinlupa \n TELEPHONE NUMBER: \n (02) 8842 2718']},
187 {'title': 'Medcare Multi Specialty',
188 'Details': [
189 ' ADDRESS: \n 84-I, National Road, Barangay Putatan, Muntinlupa \n TELEPHONE NUMBER: \n 0922 857 4180']},
190 ]},
191 {'Category': 'Barangay SUCAT',
192 'Record': [
193 {'title': 'Sucat Health Center',
194 'Details': [
195 ' ADDRESS: \n 624 Dir. A. Bunye, Sucat, Muntinlupa \n TELEPHONE NUMBER: \n NONE']},
196 ]},
197 {'Category': 'Barangay TUNASAN',
198 'Record': [
199 {'title': 'Beato-Cauilan Hospital',
200 'Details': [
201 ' ADDRESS: \n Manila S Rd, Tunasan, Muntinlupa \n TELEPHONE NUMBER: \n +632 861-5284']},
202 ]}]
203
204 def on_start(self):
205 for category in self.card_file:
206 panel = MDExpansionPanel(icon="scr2.png", content=Content(),
207 panel_cls=MDExpansionPanelTwoLine(text=category['Category'],
208 secondary_text="Tap to view Hospitals"))
209 self.root.ids.scr_mngr.get_screen('locsearch').ids.rlist.add_widget(panel)
210 for rec in category['Record']:
211 rw = RecordLine(text=rec['title'])
212 print(rec['title'])
213 self.root.ids.scr_mngr.get_screen('locsearch').ids.rlist.children[0].content.add_widget(rw)
214
215 def showinfo(self, cat, r):
216 close_button = MDFlatButton(text="Done", on_release=self.close_dialog)
217 ingredients = self.ingredients_list(cat, r)
218 ingredients_text = ''
219 for ingredient in ingredients:
220 ingredients_text += ingredient
221 self.dialog = InformationDialog(size_hint=(0.8, 0.8), text=ingredients_text, auto_dismiss=True,
222 buttons=[close_button])
223 self.dialog.open()
224
225 def ingredients_list(self, selected_cat, selected_r):
226 self.selected_rec = selected_r
227 self.selected_category = selected_cat
228 for category in self.card_file:
229 if category['Category'] == selected_cat:
230 for rec in category['Record']:
231 if rec['title'] == selected_r:
232 return rec['Details']
233
234 def on_stop(self): # Event handler that triggers when the application has finished running
235 # Creates a json file to saved the all the items in dictionary when closing the app
236 with open('saved_list.txt', 'w') as f:
237 json.dump(self.list_items, f)
238
239 class Container(IRightBodyTouch, MDBoxLayout): # This line position widget to the right.
240 adaptive_width = True
241
242
243 def save_data(self):
244 conn = sql.connect('USERINFO.db')
245 cur = conn.cursor()
246 cur.execute(""" INSERT INTO information (fname,height,weight,age,heartrate) VALUES (?,?,?,?,?)""",
247 (self.root.ids.scr_mngr.get_screen('input').ids.fname.text,
248 self.root.ids.scr_mngr.get_screen('input').ids.height.text,
249 self.root.ids.scr_mngr.get_screen('input').ids.weight.text,
250 self.root.ids.scr_mngr.get_screen('input').ids.age.text,
251 self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text))
252 conn.commit()
253 conn.close()
254
255 def result_condition(self):
256 n = int(10000)
257 h = float(self.root.ids.scr_mngr.get_screen('input').ids.height.text)
258 w = float(self.root.ids.scr_mngr.get_screen('input').ids.weight.text)
259 unix = time.time()
260 date = str(datetime.datetime.fromtimestamp(unix).strftime('%Y-%m-%d %H:%M:%S'))
261 answer = (w / h / h) * n
262 print(answer)
263
264 conn = sql.connect('USERINFO.db')
265 cur = conn.cursor()
266 cur.execute(""" INSERT INTO results (NAME,RESULT,DATE_TIME) VALUES (?,?,?)""",
267 (
268 self.root.ids.scr_mngr.get_screen('input').ids.fname.text,
269 answer,
270 date
271 ))
272 conn.commit()
273 conn.close()
274 if answer <= 18.5:
275 self.root.ids.scr_mngr.current = 'underweight'
276 elif 18.6 <= answer <= 24.9:
277 self.root.ids.scr_mngr.current = 'normal'
278 elif 25.0 <= answer <= 29.9:
279 self.root.ids.scr_mngr.current = 'overweight'
280 else:
281 self.root.ids.scr_mngr.current = 'obese'
282
283 def info1_dialog(self):
284 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
285 self.dialog = MDDialog(title="Details",
286 text="Hospitals listed are still operating up-to-date",
287 size_hint=(0.7, 1),
288 buttons=[close_button])
289 self.dialog.open()
290
291 def show_database(self):
292 conn = sql.connect('USERINFO.db')
293 cur = conn.cursor()
294 cur.execute("""
295 SELECT fname, height, weight, heartrate, RESULT, DATE_TIME
296 FROM information INNER JOIN results
297 ON information.id = results.UID
298 """)
299 data = cur.fetchall()
300 # for data in output:
301 print(data)
302
303 def build(self):
304 self.theme_cls.primary_palette = "Lime"
305 self.theme_cls.theme_style = "Light" # "Light"
306 screen = Builder.load_file("main.kv")
307 return screen
308
309 def back_screen6(self, obj):
310 self.root.ids.scr_mngr.current = 'menu'
311 self.root.ids.scr_mngr.transition.direction = "right"
312
313 def show_alert_dialog(self):
314 close_button = MDFlatButton(text="Okay",
315 on_release=self.okay)
316 more_button = MDFlatButton(text="Cancel", on_press=self.close_dialog)
317
318 self.dialog = MDDialog(title="Confirmation", text="Confirm Details?",
319 size_hint=(0.7, 1),
320 buttons=[close_button, more_button])
321 self.dialog.open()
322
323 def result_dialog(self):
324 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
325 self.dialog = MDDialog(title="Where did we get the Results?",
326 text="Results are Determined based on the Details Given by the User",
327 size_hint=(0.7, 1),
328 buttons=[close_button])
329 self.dialog.open()
330
331 def hakdog(self):
332 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
333 self.dialog = MDDialog(title="Instructions",
334 text="Manual Heartbeat check can be used to determine if you have a normal heart rate for your age. "
335 "If height = feet/inches, Convert to Centimeter (FEET× 30.48 +INCHES× 2.54) ",
336 size_hint=(0.7, 1),
337 buttons=[close_button])
338 self.dialog.open()
339
340 def show_data(self, *args):
341 if self.root.ids.scr_mngr.get_screen('input').ids.fname.text == "" \
342 or self.root.ids.scr_mngr.get_screen('input').ids.height.text == "" \
343 or self.root.ids.scr_mngr.get_screen('input').ids.weight.text == "" \
344 or self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text == "" \
345 or self.root.ids.scr_mngr.get_screen('input').ids.age.text == "" \
346 or self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text == "":
347 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
348 self.dialog = MDDialog(title="Invalid", text="No item added",
349 size_hint=(0.7, 1), buttons=[close_button])
350 self.dialog.open()
351 else:
352 self.show_alert_dialog()
353
354 def okay(self, *args):
355 print(self.root.ids.scr_mngr.get_screen('input').ids.fname.text),
356 print(self.root.ids.scr_mngr.get_screen('input').ids.height.text),
357 print(self.root.ids.scr_mngr.get_screen('input').ids.weight.text),
358 print(self.root.ids.scr_mngr.get_screen('input').ids.age.text),
359 print(self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text)
360 self.save_data()
361 # self.save_result()
362 self.result_condition()
363 self.dialog.dismiss()
364
365 def search_location(self):
366 conn = sql.connect('Hospital.db')
367 cur = conn.cursor()
368 cur.execute("""SELECT * FROM tbl_loc """)
369 output = cur.fetchall()
370
371 for data in output:
372 print(data)
373
374
375 def close_dialog(self, obj):
376 self.dialog.dismiss()
377
378 def history_screen(self, obj):
379 self.root.ids.scr_mngr.current = 'history'
380 self.root.ids.scr_mngr.transition.direction = "right"
381
382 def location_screen(self, obj):
383 self.root.ids.scr_mngr.current = 'locsearch'
384 self.root.ids.scr_mngr.transition.direction = "left"
385
386 def back_screen(self, obj):
387 self.root.ids.scr_mngr.current = 'menu'
388 self.root.ids.scr_mngr.transition.direction = "left"
389
390 def back2_screen(self, obj):
391 self.root.ids.scr_mngr.current = 'input'
392 self.root.ids.scr_mngr.transition.direction = "right"
393
394 def back3_screen(self, obj):
395 self.root.ids.scr_mngr.current = 'menu'
396 self.root.ids.scr_mngr.transition.direction = "right"
397
398 def back4_screen(self, obj):
399 self.root.ids.scr_mngr.current = 'locsearch'
400 self.root.ids.scr_mngr.transition.direction = "right"
401
402
403
404DemoApp().run()
405-----------------------------------------------------------
406
407Screen:
408 ScreenManager:
409 id:scr_mngr
410 MainMenuScreen:
411 name:"menu"
412 InputScreen:
413 name:"input"
414 RestingHeartRateScreen:
415 name:"heartrate"
416 ResultObeseScreen:
417 name:"obese"
418 ResultUnderweightScreen:
419 name:"underweight"
420 ResultOverweightScreen:
421 name:"overweight"
422 ResultNormalScreen:
423 name:"normal"
424 LocationSearchScreen:
425 name:"locsearch"
426 LocationResultScreen:
427 name:"locresult"
428 HistoryScreen:
429 name:"history"
430
431<MainMenuScreen>
432 NavigationLayout:
433 ScreenManager:
434 Screen:
435 BoxLayout:
436 orientation:'vertical'
437 MDToolbar:
438 title:' MD 24/7'
439 elevation:10
440 Widget:
441 MDBottomAppBar:
442 MDToolbar:
443 icon: "account"
444 type: "bottom"
445 on_action_button:
446 root.manager.current='input'
447 root.manager.transition.direction = "right"
448 left_action_items:[["history",lambda x: app.history_screen("history")]]
449 right_action_items:[["google-earth",lambda x: app.location_screen("locsearch")]]
450 MDFloatLayout:
451 MDRaisedButton:
452 text: "Open time picker"
453 pos_hint: {'center_x': .5, 'center_y': .5}
454 on_release: app.show_time_picker()
455
456
457<InputScreen>
458 id:information
459 BoxLayout:
460 orientation: 'vertical'
461 MDToolbar:
462 title:'Input Details'
463 elevation:10
464 left_action_items:[["backspace",lambda x:app.back_screen("menu")]]
465 right_action_items:[["head-question",lambda x:app.info_dialog()]]
466
467 Widget:
468 MDTextField:
469 id:fname
470 required: True
471 hint_text: "Full name"
472 icon_right:"account"
473 pos_hint: {'center_x': 0.5}
474 size_hint_x: None
475 width: '250dp'
476 helper_text:"Please enter your Registered Name"
477 helper_text_mode:"persistent"
478 Widget:
479 height: 35
480
481 MDTextField:
482 id:height
483 required: True
484 hint_text: "Height"
485 icon_right:"human-male-height"
486 pos_hint: {'center_x': 0.5}
487 size_hint_x: None
488 width: '250dp'
489 helper_text:"Must be in centimeters"
490 helper_text_mode:"persistent"
491 Widget:
492 height:35
493
494 MDTextField:
495 id:weight
496 required: True
497 hint_text: "Weight"
498 icon_right:"weight-kilogram"
499 pos_hint: {'center_x': 0.5}
500 size_hint_x: None
501 width: '250dp'
502 helper_text:"Must be in Kilogram"
503 helper_text_mode:"persistent"
504 Widget:
505 height:35
506
507 MDTextField:
508 id:age
509 hint_text: "Age"
510 required: True
511 icon_right:"cake"
512 pos_hint: {'center_x': 0.5}
513 size_hint_x: None
514 width: '250dp'
515 helper_text:"please enter your age"
516 helper_text_mode:"persistent"
517 Widget:
518 height: 35
519
520 MDTextField:
521 id:heartrate
522 required: True
523 hint_text: "Heartrate"
524 icon_right:"heart-pulse"
525 pos_hint: {'center_x': 0.5}
526 size_hint_x: None
527 width: '250dp'
528 helper_text:"Count the beat on your palm for 60 seconds"
529 helper_text_mode:"persistent"
530 Widget:
531 size_hint_y: None
532
533 MDScreen:
534 MDRectangleFlatButton:
535 mode: "rectangle"
536 text: 'Confirm'
537 pos_hint: {'center_x':0.5, 'center_y':0.8}
538 on_press :
539 app.show_data()
540
541 Widget:
542 size_hint_x: None
543
544<ResultObeseScreen>
545 BoxLayout:
546 orientation: 'vertical'
547 MDToolbar:
548 title:'Result: OBESE'
549 elevation:10
550 right_action_items:[["head-question",lambda x:app.result_dialog()]]
551 Widget:
552
553 MDLabel:
554 text: " People with obesity have increased risk of cardiovascular disease,type 2 diabetes, high blood pressure, and other health conditions. Waist-to-hip ratio, waist-to-height ratio, and body fat percentage measurements can provide a more complete picture of any health risks. A person should consult with their healthcare provider and consider making lifestyle changes through healthy eating and fitness to improve their health indicators. \n TIPS: \n *Change your diet. \n *Consider adding physical activity \n *Medication \n *Consume less “bad” fat and more “good” fat. \n *Consume less processed and sugary foods. \n *Eat more servings of vegetables and fruits \n *Eat plenty of dietary fiber. \n *limit your vices (drinking,smoking,etc)"
555 halign: "left"
556
557 Widget:
558
559 MDScreen:
560 MDRectangleFlatButton:
561 mode: "rectangle"
562 text: 'Go to Main Menu'
563 pos_hint: {'center_x':0.5, 'center_y':0.8}
564 on_press : root.manager.current='menu'
565
566<ResultNormalScreen>
567 BoxLayout:
568 orientation: 'vertical'
569 MDToolbar:
570 title:'Result: NORMAL WEIGHT'
571 elevation:10
572 right_action_items:[["head-question",lambda x:app.result_dialog()]]
573 Widget:
574
575 MDLabel:
576 text :" Maintaining a healthy weight may lower the risk of developing certain health conditions, including cardiovascular disease and type 2 diabetes. Waist-to-hip ratio, waist-to-height ratio, and body fat percentage measurements can provide a more complete picture of any health risks. \n TIPS: \n *Limit what you eat \n *exercise \n *sleep 7-8 hours a day \n *maintain a consistent sleeping routine \n *consider eating more healthy foods \n *limit your vices (drinking,smoking,etc)"
577 halign: "left"
578
579 Widget:
580
581 MDScreen:
582 MDRectangleFlatButton:
583 mode: "rectangle"
584 text: 'Go to Main Menu'
585 pos_hint: {'center_x':0.5, 'center_y':0.8}
586 on_press : root.manager.current='menu'
587
588<ResultOverweightScreen>
589 BoxLayout:
590 orientation: 'vertical'
591 MDToolbar:
592 title:'Result: OVERWEIGHT'
593 elevation:10
594 right_action_items:[["head-question",lambda x:app.result_dialog()]]
595 Widget:
596
597 MDLabel:
598 text: " Being overweight may increase the risk of certain health conditions, including cardiovascular disease, high blood pressure, and type 2 diabetes. Waist-to-hip ratio, waist-to-height ratio, and body fat percentage measurements can provide a more complete picture of any health risks. A person should consult with their healthcare provider and consider making lifestyle changes through healthy eating and fitness to improve their health indicators.Being overweight or fat is having more body fat than is optimally healthy \n TIPS: \n *Eat a high protein breakfast. \n *Avoid sugary drinks and fruit juice \n *Drink water before meals. \n *Choose weight-loss-friendly foods. \n *Eat soluble fiber. \n *Drink coffee or tea. \n *Base your diet on whole foods. \n *Eat slowly. \n *limit your vices (drinking,smoking,etc)"
599 halign: "left"
600
601 Widget:
602
603 MDScreen:
604 MDRectangleFlatButton:
605 mode: "rectangle"
606 text: 'Go to Main Menu'
607 pos_hint: {'center_x':0.5, 'center_y':0.8}
608 on_press : root.manager.current='menu'
609
610<ResultUnderweightScreen>
611 BoxLayout:
612 orientation: 'vertical'
613 MDToolbar:
614 title:'Result: UNDERWEIGHT'
615 elevation:10
616 right_action_items:[["head-question",lambda x:app.result_dialog()]]
617 Widget:
618
619 MDLabel:
620 text: " Being underweight may pose certain health risks, including nutrient deficiencies and hormonal changes. Waist-to-hip ratio, waist-to-height ratio, and body fat percentage measurements can provide a more complete picture of any health risks. A person should consult with their healthcare provider and consider making lifestyle changes through healthy eating and fitness to improve their health indicators.Being underweight can cause health problems. An underweight person is a person whose body weight is considered too low to be healthy /n TIPS: /n *eat more frequently /n *choose nutrient-rich foods /n *watch what you eat and drink /n *exercise /n *limit your vices (drinking,smoking,etc)"
621 halign: "left"
622
623 Widget:
624
625 MDScreen:
626 MDRectangleFlatButton:
627 mode: "rectangle"
628 text: 'Go to Main Menu'
629 pos_hint: {'center_x':0.5, 'center_y':0.8}
630 on_press : root.manager.current='menu'
631
632<LocationSearchScreen>
633 BoxLayout:
634 orientation: 'vertical'
635 MDToolbar:
636 title:'Hospital Searcher'
637 elevation:10
638 left_action_items:[["backspace",lambda x:app.back_screen6("menu")]]
639 right_action_items:[["head-question",lambda x:app.info1_dialog()]]
640
641 ScrollView:
642 MDList:
643 id: rlist
644<RecordLine>:
645 adaptive_height: True
646 OneLineListItem:
647 text: root.text
648 on_release: app.showinfo(root.parent.parent.panel_cls.text, self.text)
649
650<InformationDialog>:
651 title: "Details:"
652
653<OneLineAvatarIconListItem>: # The list widget
654 id: icnlst
655 IconLeftWidget:
656 icon: "clipboard"
657 RightCheckbox:
658 id: cb
659 Container:
660 MDIconButton:
661 icon:'close-circle-outline'
662 on_release: app.remove_one_item(root.text)
663
664<HistoryScreen>
665 MDFloatingActionButton:
666 icon: "magnify"
667 md_bg_color: app.theme_cls.primary_color
668 pos_hint: {"center_x": .8, "center_y": .1}
669 user_font_size: "25sp"
670 on_release:
671 app.show_database()
672
673 MDTextField:
674 id: inp
675 hint_text: 'Enter Full Name'
676 size_hint_x: None
677 pos_hint: {"center_x": .4, "center_y": .1}
678 width: '170dp'
679
680 MDCard:
681 size_hint: None, None
682 size: "280dp", "280dp"
683 pos_hint: {"center_x": .5, "center_y": .5}
684 orientation: "vertical"
685
686 ScrollView:
687 MDList:
688 id: list
689
690 MDToolbar:
691 id: toolbar
692 pos_hint: {"top": 1}
693 elevation: 6
694 title: "Check History"
695 left_action_items:[["backspace",lambda x:app.back_screen("menu")]]