· 4 years ago · Feb 17, 2021, 07:16 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 newsapi import NewsApiClient
11import json
12import sqlite3 as sql
13import datetime
14import time
15import requests
16
17newsapi = NewsApiClient(api_key='0a2a06f5a843426ca8384f89111bfe99')
18
19
20class Content(MDList):
21 pass
22
23
24class RecordLine(MDBoxLayout):
25 text = StringProperty()
26
27
28class InformationDialog(MDDialog):
29 pass
30
31
32class DemoApp(MDApp):
33 class MainMenuScreen(Screen):
34 pass
35
36 class InputScreen(Screen):
37 pass
38
39 class RestingHeartRateScreen(Screen):
40 pass
41
42 class ResultObeseScreen(Screen):
43 pass
44
45 class ResultNormalScreen(Screen):
46 pass
47
48 class ResultOverweightScreen(Screen):
49 pass
50
51 class ResultUnderweightScreen(Screen):
52 pass
53
54 class LocationSearchScreen(Screen):
55 pass
56
57 class LocationResultScreen(Screen):
58 pass
59
60 class HistoryScreen(Screen):
61 pass
62
63 conn = sql.connect('USERINFO.db')
64 cur = conn.cursor()
65 cur.execute(""" CREATE TABLE IF NOT EXISTS results (
66 UID INTEGER PRIMARY KEY AUTOINCREMENT,
67 NAME VARCHAR(50),
68 RESULT INT,
69 DATE_TIME TEXT DEFAULT CURRENT_TIMESTAMP)
70 """)
71 cur.execute(""" CREATE TABLE IF NOT EXISTS information (
72 id INTEGER PRIMARY KEY AUTOINCREMENT,
73 fname VARCHAR(50),
74 height INT,
75 weight INT,
76 age INT,
77 heartrate INT)
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 def save_data(self):
243 conn = sql.connect('USERINFO.db')
244 cur = conn.cursor()
245 cur.execute(""" INSERT INTO information (fname,height,weight,age,heartrate) VALUES (?,?,?,?,?)""",
246 (self.root.ids.scr_mngr.get_screen('input').ids.fname.text,
247 self.root.ids.scr_mngr.get_screen('input').ids.height.text,
248 self.root.ids.scr_mngr.get_screen('input').ids.weight.text,
249 self.root.ids.scr_mngr.get_screen('input').ids.age.text,
250 self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text))
251 conn.commit()
252 conn.close()
253
254 def news(self):
255 url = ('http://newsapi.org/v2/top-headlines?'
256 'country=ph&category=health&'
257 'apiKey=0a2a06f5a843426ca8384f89111bfe99')
258 response = requests.get(url)
259 print(response.json())
260 news_json = json.loads(response.text)
261
262 count = 4
263
264 for news in news_json['articles']:
265 if count > 0:
266 print(str(news['title']), '\n')
267 print(str(news['description']), "\n")
268 print(str(news['url']), "\n")
269 print(str(news['urlToImage']), "\n")
270 count -= 1
271
272 def result_condition(self):
273 n = int(10000)
274
275 h = int(self.root.ids.scr_mngr.get_screen('input').ids.height.text)
276
277 w = int(self.root.ids.scr_mngr.get_screen('input').ids.weight.text)
278
279 unix = time.time()
280 date = str(datetime.datetime.fromtimestamp(unix).strftime('%Y-%m-%d %H:%M:%S'))
281 answer = (w / h / h) * n
282 print(answer)
283
284 conn = sql.connect('USERINFO.db')
285 cur = conn.cursor()
286 cur.execute(""" INSERT INTO results (NAME,RESULT,DATE_TIME) VALUES (?,?,?)""",
287 (
288 self.root.ids.scr_mngr.get_screen('input').ids.fname.text,
289 answer,
290 date
291 ))
292 conn.commit()
293 conn.close()
294 if answer <= 18.5:
295 self.root.ids.scr_mngr.current = 'underweight'
296 elif 18.6 <= answer <= 24.9:
297 self.root.ids.scr_mngr.current = 'normal'
298 elif 25.0 <= answer <= 29.9:
299 self.root.ids.scr_mngr.current = 'overweight'
300 else:
301 self.root.ids.scr_mngr.current = 'obese'
302
303 def clear_inputs(self): # set each of the inputs to an empty string
304 self.root.ids.scr_mngr.get_screen('input').ids.fname.text = ""
305 self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text = ""
306 self.root.ids.scr_mngr.get_screen('input').ids.age.text = ""
307 self.root.ids.scr_mngr.get_screen('input').ids.height.text = ""
308 self.root.ids.scr_mngr.get_screen('input').ids.weight.text = ""
309
310 def info1_dialog(self):
311 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
312 self.dialog = MDDialog(title="Details",
313 text="Hospitals listed are still operating up-to-date",
314 size_hint=(1, 1),
315 buttons=[close_button])
316 self.dialog.open()
317
318 def show_database(self):
319 conn = sql.connect('USERINFO.db')
320 cur = conn.cursor()
321 cur.execute("""
322 SELECT fname, height, weight, heartrate, RESULT, DATE_TIME
323 FROM information INNER JOIN results
324 ON information.id = results.UID
325 """)
326 output = cur.fetchall()
327 for data in output:
328 print(data)
329
330 def build(self):
331 self.theme_cls.primary_palette = "Lime"
332 self.theme_cls.theme_style = "Light" # "Light"
333 screen = Builder.load_file("main.kv")
334 return screen
335
336 def back_screen6(self, obj):
337 self.root.ids.scr_mngr.current = 'menu'
338 self.root.ids.scr_mngr.transition.direction = "right"
339
340 def show_alert_dialog(self):
341 close_button = MDFlatButton(text="Okay",
342 on_release=self.okay)
343 more_button = MDFlatButton(text="Cancel", on_press=self.close_dialog)
344
345 self.dialog = MDDialog(title="Confirmation", text="Confirm Details?",
346 size_hint=(1, 1),
347 buttons=[close_button, more_button])
348 self.dialog.open()
349
350 def result_dialog(self):
351 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
352 self.dialog = MDDialog(title="Where did we get the Results?",
353 text="Results are Determined based on the Details Given by the User",
354 size_hint=(1, 1),
355 buttons=[close_button])
356 self.dialog.open()
357
358 def hakdog(self):
359 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
360 self.dialog = MDDialog(title="Instructions",
361 text="Manual Heartbeat check can be used to determine if you have a normal heart rate for your age. "
362 "If height = feet/inches, Convert to Centimeter (FEET× 30.48 +INCHES× 2.54) ",
363 size_hint=(1, 1),
364 buttons=[close_button])
365 self.dialog.open()
366
367 def show_data(self, *args):
368 if self.root.ids.scr_mngr.get_screen('input').ids.fname.text == "" \
369 or self.root.ids.scr_mngr.get_screen('input').ids.height.text == "" \
370 or self.root.ids.scr_mngr.get_screen('input').ids.weight.text == "" \
371 or self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text == "" \
372 or self.root.ids.scr_mngr.get_screen('input').ids.age.text == "" \
373 or self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text == "":
374 close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
375 self.dialog = MDDialog(title="Invalid", text="No item added",
376 size_hint=(1, 1), buttons=[close_button])
377 self.dialog.open()
378 else:
379 self.show_alert_dialog()
380
381 def okay(self, *args):
382 print(self.root.ids.scr_mngr.get_screen('input').ids.fname.text),
383 print(self.root.ids.scr_mngr.get_screen('input').ids.height.text),
384 print(self.root.ids.scr_mngr.get_screen('input').ids.weight.text),
385 print(self.root.ids.scr_mngr.get_screen('input').ids.age.text),
386 print(self.root.ids.scr_mngr.get_screen('input').ids.heartrate.text)
387 self.save_data()
388 self.result_condition()
389 self.clear_inputs()
390 self.dialog.dismiss()
391
392 def search_location(self):
393 conn = sql.connect('Hospital.db')
394 cur = conn.cursor()
395 cur.execute("""SELECT * FROM tbl_loc """)
396 output = cur.fetchall()
397
398 for data in output:
399 print(data)
400
401 def close_dialog(self, obj):
402 self.dialog.dismiss()
403
404 def history_screen(self, obj):
405 self.root.ids.scr_mngr.current = 'history'
406 self.root.ids.scr_mngr.transition.direction = "right"
407
408 def location_screen(self, obj):
409 self.root.ids.scr_mngr.current = 'locsearch'
410 self.root.ids.scr_mngr.transition.direction = "left"
411
412 def back_screen(self, obj):
413 self.root.ids.scr_mngr.current = 'menu'
414 self.root.ids.scr_mngr.transition.direction = "left"
415
416 def back2_screen(self, obj):
417 self.root.ids.scr_mngr.current = 'input'
418 self.root.ids.scr_mngr.transition.direction = "right"
419
420 def back3_screen(self, obj):
421 self.root.ids.scr_mngr.current = 'menu'
422 self.root.ids.scr_mngr.transition.direction = "right"
423
424 def back4_screen(self, obj):
425 self.root.ids.scr_mngr.current = 'locsearch'
426 self.root.ids.scr_mngr.transition.direction = "right"
427
428
429DemoApp().run()
430______________________________________________________
431
432Screen:
433 ScreenManager:
434 id:scr_mngr
435 MainMenuScreen:
436 name:"menu"
437 InputScreen:
438 name:"input"
439 RestingHeartRateScreen:
440 name:"heartrate"
441 ResultObeseScreen:
442 name:"obese"
443 ResultUnderweightScreen:
444 name:"underweight"
445 ResultOverweightScreen:
446 name:"overweight"
447 ResultNormalScreen:
448 name:"normal"
449 LocationSearchScreen:
450 name:"locsearch"
451 LocationResultScreen:
452 name:"locresult"
453 HistoryScreen:
454 name:"history"
455
456<MainMenuScreen>
457 MDNavigationLayout:
458 ScreenManager:
459 Screen:
460 BoxLayout:
461 orientation:'vertical'
462 screen: app.news()
463
464 MDToolbar:
465 title:' MD 24/7'
466 elevation:10
467 Widget:
468
469 MDLabel:
470
471
472 MDBottomAppBar:
473 MDToolbar:
474 icon: "account"
475 type: "bottom"
476 on_action_button:
477 root.manager.current='input'
478 root.manager.transition.direction = "right"
479 left_action_items:[["history",lambda x: app.history_screen("history")]]
480 right_action_items:[["google-earth",lambda x: app.location_screen("locsearch")]]
481 MDFloatLayout:
482
483
484
485<InputScreen>
486 on_pre_enter: app.clear_inputs()
487 id:information
488 BoxLayout:
489 orientation: 'vertical'
490 MDToolbar:
491 title:'Input Details'
492 elevation:10
493 left_action_items:[["backspace",lambda x:app.back_screen("menu")]]
494 right_action_items:[["head-question",lambda x:app.hakdog()]]
495
496 Widget:
497 MDTextField:
498 id:fname
499 required: True
500 hint_text: "Full name"
501 icon_right:"account"
502 pos_hint: {'center_x': 0.5}
503 size_hint_x: None
504 width: '250dp'
505 helper_text:"Please enter your Registered Name"
506 helper_text_mode:"persistent"
507 Widget:
508 height: 35
509
510 MDTextField:
511 id:height
512 required: True
513 hint_text: "Height"
514 icon_right:"human-male-height"
515 pos_hint: {'center_x': 0.5}
516 size_hint_x: None
517 width: '250dp'
518 helper_text:"Must be in centimeters"
519 helper_text_mode:"persistent"
520 Widget:
521 height:35
522
523 MDTextField:
524 id:weight
525 required: True
526 hint_text: "Weight"
527 icon_right:"weight-kilogram"
528 pos_hint: {'center_x': 0.5}
529 size_hint_x: None
530 width: '250dp'
531 helper_text:"Must be in Kilogram"
532 helper_text_mode:"persistent"
533 Widget:
534 height:35
535
536 MDTextField:
537 id:age
538 hint_text: "Age"
539 required: True
540 icon_right:"cake"
541 pos_hint: {'center_x': 0.5}
542 size_hint_x: None
543 width: '250dp'
544 helper_text:"please enter your age"
545 helper_text_mode:"persistent"
546 Widget:
547 height: 35
548
549 MDTextField:
550 id:heartrate
551 required: True
552 hint_text: "Heartrate"
553 icon_right:"heart-pulse"
554 pos_hint: {'center_x': 0.5}
555 size_hint_x: None
556 width: '250dp'
557 helper_text:"Count the beat on your palm for 60 seconds"
558 helper_text_mode:"persistent"
559 Widget:
560 size_hint_y: None
561
562 MDScreen:
563 MDRectangleFlatButton:
564 mode: "rectangle"
565 text: 'Confirm'
566 pos_hint: {'center_x':0.5, 'center_y':0.8}
567 on_press :
568 app.show_data()
569
570 Widget:
571 size_hint_x: None
572
573<ResultObeseScreen>
574 BoxLayout:
575 orientation: 'vertical'
576 MDToolbar:
577 title:'Result: OBESE'
578 elevation:10
579 right_action_items:[["head-question",lambda x:app.result_dialog()]]
580 Widget:
581
582 MDLabel:
583 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)"
584 halign: "left"
585
586 Widget:
587
588 MDScreen:
589 MDRectangleFlatButton:
590 mode: "rectangle"
591 text: 'Go to Main Menu'
592 pos_hint: {'center_x':0.5, 'center_y':0.8}
593 on_press : root.manager.current='menu'
594
595<ResultNormalScreen>
596 BoxLayout:
597 orientation: 'vertical'
598 MDToolbar:
599 title:'Result: NORMAL WEIGHT'
600 elevation:10
601 right_action_items:[["head-question",lambda x:app.result_dialog()]]
602 Widget:
603
604 MDLabel:
605 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)"
606 halign: "left"
607
608 Widget:
609
610 MDScreen:
611 MDRectangleFlatButton:
612 mode: "rectangle"
613 text: 'Go to Main Menu'
614 pos_hint: {'center_x':0.5, 'center_y':0.8}
615 on_press : root.manager.current='menu'
616
617<ResultOverweightScreen>
618 BoxLayout:
619 orientation: 'vertical'
620 MDToolbar:
621 title:'Result: OVERWEIGHT'
622 elevation:10
623 right_action_items:[["head-question",lambda x:app.result_dialog()]]
624 Widget:
625
626 MDLabel:
627 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)"
628 halign: "left"
629
630 Widget:
631
632 MDScreen:
633 MDRectangleFlatButton:
634 mode: "rectangle"
635 text: 'Go to Main Menu'
636 pos_hint: {'center_x':0.5, 'center_y':0.8}
637 on_press : root.manager.current='menu'
638
639<ResultUnderweightScreen>
640 BoxLayout:
641 orientation: 'vertical'
642 MDToolbar:
643 title:'Result: UNDERWEIGHT'
644 elevation:10
645 right_action_items:[["head-question",lambda x:app.result_dialog()]]
646 Widget:
647
648 MDLabel:
649 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)"
650 halign: "left"
651
652 Widget:
653
654 MDScreen:
655 MDRectangleFlatButton:
656 mode: "rectangle"
657 text: 'Go to Main Menu'
658 pos_hint: {'center_x':0.5, 'center_y':0.8}
659 on_press : root.manager.current='menu'
660
661<LocationSearchScreen>
662 BoxLayout:
663 orientation: 'vertical'
664 MDToolbar:
665 title:'Hospital Searcher'
666 elevation:10
667 left_action_items:[["backspace",lambda x:app.back_screen6("menu")]]
668 right_action_items:[["head-question",lambda x:app.info1_dialog()]]
669
670 ScrollView:
671 MDList:
672 id: rlist
673<RecordLine>:
674 adaptive_height: True
675 OneLineListItem:
676 text: root.text
677 on_release: app.showinfo(root.parent.parent.panel_cls.text, self.text)
678
679<InformationDialog>:
680 title: "Details:"
681
682<OneLineAvatarIconListItem>: # The list widget
683 id: icnlst
684 IconLeftWidget:
685 icon: "clipboard"
686 RightCheckbox:
687 id: cb
688 Container:
689 MDIconButton:
690 icon:'close-circle-outline'
691 on_release: app.remove_one_item(root.text)
692
693<HistoryScreen>
694 MDFloatingActionButton:
695 icon: "magnify"
696 md_bg_color: app.theme_cls.primary_color
697 pos_hint: {"center_x": .8, "center_y": .1}
698 user_font_size: "25sp"
699 on_release:
700 app.show_database()
701
702 MDTextField:
703 id: inp
704 hint_text: 'Enter Full Name'
705 size_hint_x: None
706 pos_hint: {"center_x": .4, "center_y": .1}
707 width: '170dp'
708
709 MDCard:
710 size_hint: None, None
711 size: "280dp", "280dp"
712 pos_hint: {"center_x": .5, "center_y": .5}
713 orientation: "vertical"
714
715 ScrollView:
716 MDList:
717 id: list
718
719 MDToolbar:
720 id: toolbar
721 pos_hint: {"top": 1}
722 elevation: 6
723 title: "Check History"
724 left_action_items:[["backspace",lambda x:app.back_screen("menu")]]