You are on page 1of 64

INSTRUCTOR’S COMMENTS

................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
................................................................................................................................................
REVIEWER’S COMMENTS

............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
ĐẠI HỌC ĐÀ NẴNG  TRƯỜNG ĐẠI HỌC BÁCH KHOA
KHOA CÔNG NGHỆ THÔNG TIN
54, Nguyễn Lương Bằng, Hoà Khánh, Liên Chiểu, TP. Đà Nẵng
Tel. 84.236.3.736.949, Fax. 84.236.842.771 - Website: KhoaCTT.dut.udu.vn - E-mail: cntt@dut.udn.vn

PHIẾU DUYỆT ĐỒ ÁN TỐT NGHIỆP


I. Phần dành cho Sinh viên
1. Họ và tên: Hoàng Đức Thành 2. Mã Sinh viên:102170301
3. Lớp: 17TCLC2
4. Tên đề tài: Smart Health Care System
5. Số điện thoại: 0855061199 6. E-mail : hoangducthanh0611999@gmail.com
7. Họ và tên GVHD: TS. Phạm Công Thắng
II. Phần dành cho Hội đồng

S
Nội dung đánh giá Kết luận
TT

1. Trình bày báo cáo theo đúng mẫu qui định của Khoa

2. Không có sự sao chép nội dung báo cáo và chương trình đã


3. Biên dịch mã nguồn và chạy được chương trình

4. Có kịch bản thực hiện với dữ liệu thử nghiệm

5. Kết quả thực hiện chương trình đúng theo báo cáo

6. Có sự đóng góp, phát triển của tác giả trong đồ án

Ý kiến khác: .........................................................................................................................................................................


.........................................................................................................................................................................................................

Kết luận:  Đạt yêu cầu  Phải sửa chữa lại  Không đạt yêu cầu
Đà Nẵng, ngày tháng năm Cán bộ duyệt kiểm tra
Chủ tịch Hội đồng (Ký và ghi họ tên)
(Ký và ghi họ tên)
スマート健康管理システム
Smart Health Care System
名前:HOANG DUC THANH(ホン・ドック・タイン)
学生番号:102170301
指導教官:PHAM CONG THANG 博士
所属:ダナン大学・工科大学・情報学部
Abstract: Along with the development of humanity, the issues around people are increasingly improved such as
life quality, science, technology, culture, entertainment…especially Information technology.
These are included medical, with the development of society, scientific and technical equipment, medical
examination and treatment for people has also become easier. But that is also the reason why people nowadays
are lack of knowledge about health, which is the most valuable thing.
Therefore, I decided to build an application to provide them information about diseases, furthermore about the
COVID19, the dangerous virus is still at high risk of breaking out,…
なので、できることが多くあります。
1. はじめに  システムの部門を管理すること。
 疾患と症候と食べ物を管理すること。
人類の発展に伴い、生活の質、科学、技術、文化、 3.2.ユーザー:ユーザーは。それで、できること
娯楽、特に情報技術など、人々を取り巻く問題はま はアドミンのより少ないです。
すます改善されています。  ニュースを読める。
これらは医療に含まれ、社会の発展に伴い、科学技  COVID19の情報を探すできる。
術機器、人々の健康診断や治療も容易になりました。  疾患を探できる。
しかし、それはまた、今日の人々が最も価値のある  食べ物を勧めっもられる。
ことである健康についての知識が不足している理由
でもあります。 4. システムの分析
そのため、病気に関する情報、さらには COVID19
に関する情報を提供するアプリケーションを構築す プロジェクトの要件の分析から、ユーザーケース図、
ることにしました。危険なウイルスは、依然として シーケンス図を書きました。
発生するリスクが高いのですが… 4.1.ユースケース図
図1は概要のユースケース図で、全ての作人の行動
2.使用される技術 を表する図です。

2.1.ReactJS
このプロジェクトのアプリケーションのクライアン
ト側は ReactJS という UI のパーツ(構成部品)を
作るためのライブラリで講師くします。
2.2.ReactNative
このプロジェクトのモビルアプリケーションのクラ
イアント側は ReactNative という UI のパーツ(構
成部品)を作るためのライブラリで講師くします。
2.3.Entity フレームワーク
このプロジェクトのウエブサイトのサーバ側 C#と
いうプログラミング言語で構築します。
2.4.MS SQL
このプロジェクトのアプリケーションのデータを管
理するアプリは MS SQL というアプリです。

3. プロジェックとの要件の分析
このシステムの中で、管理される対象は疾患と症候
と食べ物です。それ以外に、このシステムのサービ
スを使うのは2種類の人という作人がいます。その
作人たちはアドミン、ユーザー、。
3.1.アドミン:アドミンはシステムを管理する人 図1 概要のユースケース図
図 1 に書いてある限るでは、システムを使う際にア 勧めっもられます。
ドミンはログインすることが必要があるります。 4.2.シーケンス図
4.1.1. アドミンのユースケース図 システムのサービスの中で、疾患の辞書を見ること
アドミンはログインしなければなりません。アドミ と食べ物を勧めっもられことは外のサービスより少
ンは疾患と症候と食べ物を管理できます。 し良いです、。
以下のシーケンス図はあれの図です。

図2 アドミンのユースケース図

4.1.2. アドミンのユースケース図
疾患といえば、アドミンは作って、修理して、 見 図3 ユーザーのレビューをアップする
て、消せます。 シーケンス図

図3 アドミンのユースケース図

4.1.3. ユーザーのユースケース図 図6 ユーザーのレビューをアップする


シーケンス図

図4 ユーザーのユースケース図

。ユーザーは COVID19情報を読んで、ニュース
を読んで、疾患の辞書をみます。それに、食べ物を 図7 アドミンのレビューをアップする
シーケンス図
6.1.ホームページ アドミン
5. システムの設計

図 10 ホームページ ユーザー 1つ目


図 8 アドミンのレビューをアップする このプロジェクトのウエブサイトをアクセスして、
シーケンス図 ホームページは次のように表示されます。
アドミンはアクセスして、管理することが
システムのモデルはクライアントサーバモデル できます。
をもとにして設計しました。

システムでは 3 つの部分があります。クライアン
ト側では ReactJS と ReactNative で構築し、サー
バ側では C#と Python で構築し、データベース 図9 ホームページ2つ目
は MS SQL というデータベースサーバでデータ
を管理します。

図 11 ホームページ アドミン 2 つ目
6.2.ホームページ ユーザー
ユーザーはアプリにアクセスのに、ログイ
ンしません、自由にアクセスします。後で、
ホームページ 写真ようにあります。

図 9 データベースの設計図

図 7 によると、全部 8 つのテーブルがあります。
ログインを管理はアカウントテーブル、プロファイ
ルテーブルとテーブルです。すぎは、疾患と症候と
食べ物テーブルです。テーブルによって、名前、特
徴、他のテーブルと関係が図で表現されます。

6. プロジェクトの結果 図 12 ホームページ ユーザー


6.4.食べ物を お勧めてもらうページ
6.3.病気辞書ページ ユーザーはこのページにアクセス後で、病気を選べ、
次は病気に参加しているところです。これで、いろ システムは食べ物をおすすめです。
いろな情報があります。

図 15 食べ物ページ

7.結論と開発の方向性
図 13 病気辞書ページ1つ目 7.1.結論
達成された結果:
 クライアントサーバーモデルを理解する。
 ReactJS と ReactNative ライブラリの理解と
使用の成功。
 C#プログラミング言語を理解して正常に
使用する。
 MS SQL を理解して正常に使用する。

また、研究スキル、技術スキル、プレゼンテーショ
ンスキル、英語、その他多くのソフトスキルを含め、
スキルを大幅に向上させました。
プロジェクトについては、卒業プロジェクト期間の
最初の週に作成された計画に従い、その計画のすべ
ての機能を実装しました。さらに、ユーザーエクス
ペリエンスを向上させることを目的とした機能もい
くつか追加しました。

7.2.開発の方向性
評価の部分ですでに述べたいくつかの欠点がありま
すが、このプロジェクトの今後の作業は次のとおり
•ユーザーが最も感心している病気を選択するため
の「いいね」機能を統合します。
•症状とペイントによっていくつかの病気を診断の
AI システムを構築します。
•ミーティング機能を統合して、患者が医師に会い、
健康について質問できるようにします。
図 14 病気辞書ページ2つ目
※参考文献
[1]. クライアントサーバモデル
https://ja.wikipedia.org/wiki/クライアントサ
ーバモデル.
[2]. ReactJS:
https://reactjs.org/.
※連絡先
ダナン大学・工科大学・情報学部
ホン・ドック・タイン
学生番号:102170301
E-mail: hoangducthanh0611999@gmail.com
SUMMARY

Topic title: Smart Health Care System


Student name: Hoang Duc Thanh
Student ID: 102170301 Class: 17TCLC2

Along with the development of humanity, the issues around people are increasingly
improved such as life quality, science, technology, culture, entertainment…especially
Information technology.

These are medical, with the development of society, scientific and technical equipment,
medical examination and treatment for people have also become easier. But that is also the
reason why people today are lack of knowledge about health, which is the most valuable
thing.

Therefore, I decided to build an application to provide them information about diseases,


furthermore about the COVID19, the dangerous virus is still at high risk of breaking out,

THE UNIVERSITY OF DANANG SOCIALIST REPUBLIC OF VIET NAM
UNIVERSITY OF SCIENCE AND Independence – Freedom – Happiness
TECHNOLOGY
INFORMATION TECHNOLOGY FACULTY

GRADUATION PROJECT REQUIREMENTS


Student Name: Hoang Duc Thanh Student No.: 102170301
Class: 17TCLC2 Faculty: Information Technology Major: Software Engineering
1. Topic title: Building a smart health care system
2. Project topic: ☐ has signed intellectual property agreement for final result
3. Initial figure and data: No data.
4. Content of the explanations and calculations:
The content of the thesis includes the following:
INTRODUCTION – This chapter gives information about the context and purpose of
the project as well as giving the scope of the problems which will be focused on the thesis.
Chapter 1: THEORIES AND TECHNOLOGIES – This chapter introduces all
knowledge theories and technologies used in this project.
Chapter 2: ANALYSIS AND DESIGN – This chapter covers the main features,
software requirement specifications, and database design of the project.
Chapter 3: IMPLEMENTATION AND EVALUATION – This chapter shows an
implementation of this project, including pictures and a brief explanation for each main
function.
CONCLUSION – The concluding section of the project simultaneously emphasizes
the problem solved, as well as presenting issues still unresolved, and provides
recommendations and suggestions.
REFERENCES – Presentation about the detail of referenced information used in this
thesis.
5. Drawings, charts (specify the types and sizes of drawings): No drawings, no charts.
6. Supervisor(s): Ph.D. Pham Cong Thang
7. Date of assignment:
8. Date of completion:
Da Nang, date month year 2022
Head of Division…………………. Instructor
ACKNOWLEDGEMENTS

After an intensive period of four months, today is the day: writing this note of thanks is
the finishing touch on my senior project. It has been a period of intense learning for me. I
would like to reflect on the people who have supported and helped me so much during this
period.
I would first like to thank my supervisor, Ph.D. Pham Cong Thang for his continuous
support, supervision, motivation, and guidance throughout the tenure of my project despite
his hectic schedule. He remained a driving spirit in my project and his experience gave me
the understanding in handling research projects, as well as helping me to clarify the abstruse
concepts, requiring knowledge and perception, handling critical situations, and in
understanding the objective of my work.
I also want to thank my families and friends who gave me the strength and confidence
during my time of learning and the implementation phase of this project. They have given
a lot of love and encouragement, which helped pass over the difficulties and fatigues.
Without your generous help, my senior year would not have been successful.

Sincerely,

Hoang Duc Thanh

i
ASSURANCE

I guarantee:
1. The contents of this senior project are performed by myself following the guidance
of my supervisor Ph.D. Pham Cong Thang.
2. All references used in this senior project thesis are quoted with the author’s name,
project name, time, and location to publish clearly and faithfully.
3. All invalid copies, educated statute violations, or cheating will be borne full
responsibility by myself.

Student,

Hoang Duc Thanh

ii
Table of Contents
ACKNOWLEDGEMENTS .............................................................................................i
ASSURANCE ................................................................................................................ ii
LIST OF TABLES, PICTURES ..................................................................................... v
LIST OF ACRONYMS ............................................................................................... vii
INTRODUCTION .......................................................................................................... 1
1. Project preview .................................................................................................... 1
2. Theories ............................................................................................................... 1
3. Structure of the thesis .......................................................................................... 2
Chapter 1: THEORIES AND TECHNOLOGY ............................................................. 3
1.1. ReactJS .......................................................................................................... 3
1.2. React Native .................................................................................................. 4
1.3. RESTful Programming ................................................................................. 5
1.4. SQL Server Database .................................................................................... 8
1.5. .NET Entity Framework ............................................................................... 9
1.6. Python ......................................................................................................... 12
1.7. Conclusion .................................................................................................. 13
Chapter 2: ANALYSIS AND DESIGN ........................................................................ 14
2.1. Requirement analysis and design ................................................................ 14
2.2. System analysis ........................................................................................... 16
2.3. System design ............................................................................................. 28
2.4. Conclusions ................................................................................................. 34
Chapter 3: IMPLEMENTATION AND EVALUATION ............................................ 35
3.1. Development environment .......................................................................... 35
3.2. K-Means Cluster Recommendation ............................................................ 35
3.3. Demo main feature...................................................................................... 39
3.4. Evaluation ................................................................................................... 44
iii
CONCLUSION............................................................................................................ 46
1. Achievement ..................................................................................................... 46
2. Future work...................................................................................................... 46
REFERENCES.............................................................................................................. 47

iv
LIST OF TABLES, PICTURES
1. List of figures
Figure 1.1 React’s Logo ................................................................................................. 3
Figure 1.2 Illustration for example of REST API ........................................................... 5
Figure 1.3 SQL Management Illustration ....................................................................... 8
Figure 1.4 Illustration for Entity Framework Logo ........................................................ 9
Figure 1.5 Illustration for workflow of Entity .............................................................. 10
Figure 1.6 Illustration for workflow of Entity .............................................................. 11
Figure 1.7 Python’s Logo.............................................................................................. 12
Figure 2.1 Smart Health Care System Decomposition Diagram .................................. 15
Figure 2.2 Use-case Diagram for System ..................................................................... 16
Figure 2.3 Use-case Diagram for User ......................................................................... 17
Figure 2.4 Use-case Diagram for Admin ...................................................................... 17
Figure 2.5 Use-case Diagram for Admin Manage Disease .......................................... 18
Figure 2.6 Use-case Diagram for Admin Manage Food ............................................... 18
Figure 2.7 Use-case Diagram for Admin Manage Symptom ....................................... 19
Figure 2.8 Class Diagram.............................................................................................. 28
Figure 2.9 Sequence diagram for Admin Login ........................................................... 29
Figure 2.11 Sequence diagram for Admin managing Food .......................................... 30
Figure 2.10 Sequence diagram for User Managing Disease ......................................... 30
Figure 2.12 Sequence diagram for Admin Managing Disease ..................................... 30
Figure 3.1 Plot for Loss and K of KMeans++ Method ................................................. 36
Figure 3.2 Illustration for Kmeans cluster .................................................................... 37
Figure 3.3 Illustration for KMeans++ cluster ............................................................... 37
Figure 3.4 Login Admin Screen .................................................................................... 39
Figure 3.5 Disease Management Screen ....................................................................... 40
Figure 3.6 Admin Add Form ........................................................................................ 40
Figure 3.7 Admin Edit Form ......................................................................................... 41
Figure 3.8 Home screen ................................................................................................ 42
Figure 3.9 Dictionary Disease Screen ........................................................................... 42
Figure 3.10 Covid Info Screen ...................................................................................... 43
Figure 3.11 Detail Country Info Screen ........................................................................ 43
Figure 3.13 Food for Patient Screen ............................................................................. 44

v
Figure 3.12 Detail Disease Screen ................................................................................ 44
2. List of tables
Table 2.1 Use-case Description for Login .................................................................... 20
Table 2.2 Use-case Description for Creating Disease ................................................. 20
Table 2.3 Use-case description for Creating Symptom ................................................ 21
Table 2.4 Use-case description for Creating Food ....................................................... 22
Table 2.5 Use-case Description for Editing Disease .................................................... 22
Table 2.6 Use-case Description for Editing Symptom ................................................. 23
Table 2.7 Use-case Description for Editing Food ......................................................... 24
Table 2.8 Use-case Description for Deleting Disease .................................................. 24
Table 2.9 Use-case Description for Deleting Food ....................................................... 25
Table 2.10 Use-case Description for Deleting Symptom ............................................. 25
Table 2.11 Use-case Description for Viewing Detail Disease ...................................... 26
Table 2.12 Use-case Description for Asking for Food ................................................. 26
Table 2.13 Description of table: Account ..................................................................... 32
Table 2.14 Description of table: Role ........................................................................... 32
Table 2.15 Description of table: Profile ........................................................................ 32
Table 2.16 Description of table: Disease ...................................................................... 33
Table 2.17 Description of table: Food .......................................................................... 33
Table 2.18 Description of table: Symptom ................................................................... 34

vi
LIST OF ACRONYMS

Abbreviations

No. Items Description


1 API Application Programming Interface
2 JSON JavaScript Object Notation
3 HTML Hypertext Markup Language
4 CSS Cascading Style Sheet
5 REST Representational State Transfer
6 URL Uniform Resource Locator
7 UX User Experience
8 UI User Interface

vii
Project: Building a smart health care system

INTRODUCTION

1. Project preview
1.1. Context
Along with the development of humanity, the issues around people are increasingly
improved such as life quality, science, technology, culture, entertainment…especially
Information technology.
These are medical, with the development of society, scientific and technical equipment,
medical examination and treatment for people have also become easier. But that is also the
reason why people today are lack of knowledge about health, which is the most valuable
thing.
Therefore, I decided to build an application to provide them information about diseases,
furthermore about the COVID19, the dangerous virus is still at high risk of breaking out,

1.2. Statement of problem
The rapid development of society also makes people more and more concerned about
themselves, especially in terms of health, food, drink, healthy way of living, …
In addition to this, the current situation of the COVID-19 epidemic in the world,
including Viet Nam, is still so dangerous. The number of infections is still increasing per
day, so this application that provides information about diseases is necessary for everyone.
It can provide people with useful information about the disease, its symptoms, the way
to prevent it, and how to avoid it.
1.3. Purpose
My purpose is to build an application where people can get more information about
health like news, diseases, the way to avoid, …
The application integrates the recommendation systems for some victims, who always
get problems with their meal when got diseases. The application can be considered as an
electronic dictionary about health.
2. Theories
2.1. Technologies
 ReactJS.
 .NET Entity Framework

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 1


Project: Building a smart health care system

 React Native.
 RESTful programming.
 HTML, CSS.
 Python
2.2. Tools and Environment Development
 Microsoft Visual
 Microsoft Visual Code
 Microsoft SQL Server 2019
3. Structure of the thesis

INTRODUCTION – This chapter gives information about the context and purpose of
the project as well as giving the scope of the problems which will be focused on the thesis.
Chapter 1: THEORIES AND TECHNOLOGIES – This chapter introduces all
knowledge theories and technologies used in this project.
Chapter 2: ANALYSIS AND DESIGN – This chapter covers the main features,
software requirement specifications, and database design of the project.
Chapter 3: IMPLEMENTATION AND EVALUATION – This chapter shows an
implementation of this project, including pictures and a brief explanation for each main
function.
CONCLUSION – The concluding section of the project simultaneously emphasizes
the problem solved, as well as presenting issues still unresolved, and provides
recommendations and suggestions.
REFERENCES – Presentation about the detail of referenced information used in this
thesis.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 2


Project: Building a smart health care system

Chapter 1: THEORIES AND TECHNOLOGY

This system applies current popular technologies and platforms that combine to create
a system that responds to the services that users desire.
To learn more about the technologies, I would like to present the concept of some key
technologies that I used in this project.
1.1. ReactJS

Figure 1.1 React’s Logo

ReactJS is JavaScript library used for building reusable UI components. According to


React official documentation, following is the definition − React is a library for building
compostable user interfaces. It encourages the creation of reusable user interface
components, which present data that change over time. Lots of people use React as the V
in MVC. React abstracts away the DOM from you, offering a simpler programming model
and better performance. React can also be run on the server using Node, and it can power
native apps using React Native. React implements one-way reactive data flow, which
reduces the boilerplate and is easier to reason about than traditional data binding [1].
React Features
 JSX − JSX is JavaScript syntax extension. It is not necessary to use JSX in React
development, but it is recommended.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 3


Project: Building a smart health care system

 Components − React is all about components. You need to think of everything as a


component. This will help you maintain the code when working on larger-scale
projects.
 Unidirectional data flow and Flux − React implements one-way data flow which
makes it easy to reason about your app. Flux is a pattern that helps keep your data
unidirectional.
 License − React is licensed under the Facebook Inc. Documentation is licensed
under CC BY 4.0.
React Advantages
 Uses a virtual DOM which is a JavaScript object. This will improve apps performance
since the JavaScript virtual DOM is faster than the regular DOM.
 Can be used on client and server side as well as with other frameworks.
 Component and data patterns improve readability, which helps to maintain larger apps.
React Limitations
 Covers only the view layer of the app, hence you still need to choose other technologies
to get a complete tooling set for development.
 Uses the inline templating and JSX, which might seem awkward to some developers
[1].
1.2. React Native
For better understanding of React Native concepts, we will borrow a few lines from the
official documentation −
React Native lets you build mobile apps using only JavaScript. It uses the same design
as React, allowing you to compose a rich mobile user interface from declarative
components. With React Native, you don't build a mobile web app, an HTML5 app, or a
hybrid app; you build a real mobile app that's indistinguishable from an app built using
Objective-C or Java. React Native uses the same fundamental UI building blocks as regular
iOS and Android apps. You just put those building blocks together using JavaScript and
React [2].
React Native Features
 React − This is a Framework for building web and mobile apps using JavaScript.
 Native − You can use native components controlled by JavaScript.
 Platforms − React Native supports IOS and Android platforms.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 4


Project: Building a smart health care system

React Native Advantages


The advantages of React Native are as follows:
 JavaScript − You can use the existing JavaScript knowledge to build native mobile
apps.
 Code sharing − You can share most of your code on different platforms.
 Community − The community around React and React Native is large, and you will be
able to find any answer you need.
React Native Limitations
Following are the limitations of React Native −
 Native Components − If you want to create native functionality that has not created
yet, you will need to write some platform-specific code [2].

1.3. RESTful Programming

REST

Figure 1.2 Illustration for example of REST API


The illustration for REST API is shown in Figure 1.2. The REST acronym is defined as
a “REpresentational State Transfer” and is designed to take advantage of existing HTTP
protocols when used for Web APIs. It is very flexible in that it is not tied to resources or
methods and has the ability to handle different calls and data formats. Because REST API
is not constrained to an XML format like SOAP, it can return multiple other formats

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 5


Project: Building a smart health care system

depending on what is needed. If a service adheres to this style, it is considered a “RESTful”


application. REST allows components to access and manage functions within another
application.
REST was initially defined in a dissertation by Roy Fielding’s twenty years ago. He
proposed these standards as an alternative to SOAP (The Simple Object Access Protocol is
a simple standard for accessing objects and exchanging structured messages within a
distributed computing environment). REST (or RESTful) defines the general rules used to
regulate the interactions between web apps utilizing the HTTP protocol for CRUD (create,
retrieve, update, delete) operations [3].
RESTful programming
A RESTful API (or application program interface) uses HTTP requests to GET, PUT,
POST, and DELETE data following the REST standards. This allows two pieces of
software to communicate with each other. In essence, REST API is a set of remote calls
that use standard methods to return data in a specific format.
The systems that interact in this manner can be very different. Each app may use a
unique programming language, operating system, database, etc. So, how do we create a
system that can easily communicate and understand other apps?? This is where the Rest
API is used as an interaction system.
When using a RESTful API, we should determine in advance what resources we want
to expose to the outside world. Typically, the RESTful API service is implemented, keeping
the following ideas in mind:
 Format: There should be no restrictions on the data exchange format.
 Implementation: REST is based entirely on HTTP.
 Service Definition: Because REST is very flexible, API can be modified to ensure
the application understands the request/response format.
 The RESTful API focuses on resources and how efficiently you perform operations
with them using HTTP.
The features of the REST API design style state:
 Each entity must have a unique identifier.
 Standard methods should be used to read and modify the data.
 It should provide support for different types of resources.
 The interactions should be stateless.
For REST to fit this model, we must adhere to the following rules:
Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 6
Project: Building a smart health care system

 Client-Server Architecture: The interface is separate from the server-side data


repository. This affords flexibility and the development of components
independently of each other.
 Detachment: Client connections are not stored on the server between requests.
 Cacheability: It must be explicitly stated whether the client can store responses.
 Multi-level: The API should work whether it interacts directly with a server or
through an additional layer, such as a load balancer.
HTTP methods
 GET − Provides read-only access to a resource.
 PUT − Used to create a new resource.
 DELETE − Used to remove a resource.
 POST − Used to update an existing resource or create a new resource.
 OPTIONS − Used to get the supported operations on a resource.
REST API Subtypes
The Rest API has the 3 most used formats for providing resources. Sometimes, they are
called a subtype.
 REST API XML – This format is similar to the earlier method used by the SOAP
(Simple Object Access Protocol) specifications.
 REST API JSON – This format is used when employing a text format for data
exchange based on JavaScript. This format is the most widely used currently.
 REST API GraphQL – This format was designed to address the need for more
flexibility and efficiency. It is the newest and most popular specification method.
There are quite a few popular topics about which one is better to use and why, as well
as numerous comparisons to use [3].

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 7


Project: Building a smart health care system

1.4. SQL Server Database


The illustration for SQL Server Management is shown in Figure 1.3.

Figure 1.3 SQL Management Illustration

Definition
 It is a software, developed by Microsoft, which is implemented from the
specification of RDBMS.
 It is also an ORDBMS.
 It is platform-dependent.
 It is both GUI and command based software.
 It supports SQL (SEQUEL) language which is an IBM product, non-procedural,
common database, and case-insensitive language.
Usage
 To create databases.
 To maintain databases.
 To analyze the data through SQL Server Analysis Services (SSAS).
 To generate reports through SQL Server Reporting Services (SSRS).
 To carry out ETL operations through SQL Server Integration Services (SSIS).
Components
SQL Server works in client-server architecture, hence it supports two types of
components − (a) Workstation and (b) Server.
 Workstation components are installed on every device/SQL Server operator’s
machine. These are just interfaces to interact with server components. Example:
SSMS, SSCM, Profiler, BIDS, SQLEM, etc.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 8


Project: Building a smart health care system

 Server components are installed in centralized server. These are services. Example:
SQL Server, SQL Server Agent, SSIS, SSAS, SSRS, SQL browser, SQL Server full-
text search, etc [4].
Instance
 An instance is an installation of SQL Server.
 An instance is an exact copy of the same software.
 If we install 'n' times, then 'n' instances will be created.
 There are two types of instance in SQL Server a) Default b) Named.
 Only one default instance will be supported in one Server.
 Multiple named instances will be supported on one Server.
 Default instance will take the server name as the instance name.
 Default instance service name is MSSQLSERVER.
 16 instances will be supported in 2000 version.
 50 instances will supported in 2005 and later versions [4].
Advantages of Instances
 To install different versions in one machine.
 To reduce cost.
 To maintain production, development, and test environments separately.
 To reduce temporary database problems.
 To separate security privileges.
 To maintain standby server [4].
1.5. .NET Entity Framework
Definition
The illustration for Entity Framework Logo is shown in Figure 1.4.

Figure 1.4 Illustration for Entity Framework Logo

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 9


Project: Building a smart health care system

Entity Framework is an open-source object-relational mapper framework


for .NET applications supported by Microsoft. It increases the developer’s productivity, as
it allows developers to work with data using domain-specific classes objects without
focusing on the underlying database tables and columns where this data is stored. It
eliminates the need for most of the data-access code which is used to interact with the
database that developers usually need to write. It provides an abstract level to the developers
to work with a relational table and columns by using the domain-specific object. It also
reduces the code size of the data-specific applications and also the readability of the code
increases by using it. This is a new technology to access the data for Microsoft applications.
The latest version for Entity Framework is 6.0.
The following figures describes where the Entity Framework is present in your
application.

Figure 1.5 Illustration for workflow of Entity


The Figure 1.5 represents how an entity framework interacts with the domain class and
database. It provides a connection between the business entity and data tables in the
database. It saves data stored in the properties of business entities and also retrieves data
from the database and converts it to business entities objects automatically. Entity
Framework will execute the relevant query in the database and then materialize the results
into instances of your domain objects for you to work within your app.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 10


Project: Building a smart health care system

The illustration for workflow of Entity is described in Figure 1.6

Figure 1.6 Illustration for workflow of Entity

The figure 1.6 show the workflow of Entity. When defining the class and features of
entity framework first and then entity framework convert it into the conceptual model first
and it creates database and objects in the database from the conceptual model, this method
is called Code First. Now your object directly works with the database to retrieve or make
changes.
Features of Entity Framework
 It is platform-independent.
 It uses LinQ queries to manipulate the data in the database instead of SQL queries.
 It keep the track of values that have been changed of the properties of entities.
 It also saves changes that are done insert, deletes, or updates operations.
 It also handles concurrency, so the data is overridden by a user and will reflect when
another use fetches it.
 It also handles transaction management automatically and also provides customized
options for transaction management.
 It provides caching which means it stores the result of the frequently used queries.
 It also follows certain conventions for programming so it by default configures the
EF Model [8].

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 11


Project: Building a smart health care system

 It also allows configuring the EF Model by a fluent API to override the default
convention.
 If you made any changes in the database schema then you can reflect those changes
in the EF model by writing migration command in CLI(Command Line Interface).
 It also supports stored procedures.
 It also supports parameterized queries [8].

1.6. Python
Definition

Figure 1.7 Python’s Logo

Python is an interpreted, object-oriented, high-level programming language with


dynamic semantics. It is high-level built-in data structures, combined with dynamic typing
and dynamic binding, make it very attractive for Rapid Application Development, as well
as for use as a scripting or glue language to connect existing components. Python's simple,
easy-to-learn syntax emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which encourages program
modularity and code reuse. The Python interpreter and the extensive standard library are
available in source or binary form free of charge for all major platforms and can be freely
distributed.
Feature of Python
 Python can be used on a server to create web applications.
 Python can be used in conjunction with software to create workflows.
 Python can connect to database systems. It can also read and modify files.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 12


Project: Building a smart health care system

 Python can be used to handle big data and perform complex mathematical
calculations..
 Python can be used for rapid prototyping or production-ready software development.
 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.).
 Python has a simple syntax similar to the English language.
 Python has a syntax that allows developers to write programs with fewer lines than
some other programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as
it is written. This means that prototyping can be very quick.
 Python can be treated procedurally, in an object-oriented way, or in a functional way.
1.7. Conclusion
By studying and learning about the above technologies, I successfully applied the
concepts and their mechanism operating in this project to create a health care system.
Some of these technologies are not new, but they are widely being used and a trend for
the software development industry. Therefore, understanding the concept is very important,
helping to properly apply technology for each project, in order to improve efficiency and
usability.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 13


Project: Building a smart health care system

Chapter 2: ANALYSIS AND DESIGN

This chapter will go into detail about the requirements, describing non-functional
requirements, design constraints, and other factors necessary to provide a complete and
comprehensive description of the requirements for the application. This consists of a
package containing Requirements Specification, Use-Cases of the use-case model, Use
Case Specifications, and Activity Diagram. Shows an overview of what functions the
application can satisfy. In addition, it defines the architecture, modules, and data for a
system to satisfy specified requirements. System design is intended to be the link between
the system architecture and the implementation of technological system elements that
compose the physical architecture model of the system. It could be seen as an application
of systems theory to product development.
The System Design process is to provide sufficiently detailed data and information
about the system, and it is a system element to enable the implementation consistent with
architectural entities as defined in models and views of the system architecture. It shows
the components of the application, the structure of data tables, and the relationship among
the elements that make up the system.
2.1. Requirement analysis and design
User Interaction
My system has two main actors:
User:
This actor is one of two actors of this system.
They can access the mobile application to view the dictionary about diseases,
information about Covid19, …
Admin:
This actor manages all the functions on the Website, from managing diseases,
symptoms, food, and etc.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 14


Project: Building a smart health care system

Decomposition diagram
The first diagram I want to show is the decomposition diagram of my application. It
shows all the features which user and admin can do.

Figure 2.1 Smart Health Care System Decomposition Diagram


As I introduct, admin can manage some objects such as Food, Disease, and Symptom.
About the user, they can read news, see COVID19 information, see the disease dictionary,..

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 15


Project: Building a smart health care system

2.2. System analysis


Use-case diagram
Use-case diagram for system
Beside the decomposition diagram, the next one I want to show is Use-case Diagram, it
will show detail function that each role can do like the figures below.

Figure 2.2 Use-case Diagram for System

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 16


Project: Building a smart health care system

Use-case Diagram for User


The Figure 2.3 describes the use-case for User in my application.

Figure 2.3 Use-case Diagram for User

Use-case Diagram for Admin


The use-case for Admin is shown from figure 2.4 to 2.7. They are simple functions for
an admin to manage the information of the website.

Figure 2.4 Use-case Diagram for Admin

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 17


Project: Building a smart health care system

Manage Disease Use-case Diagram

Figure 2.5 Use-case Diagram for Admin Manage Disease

Manage Food Use-case Diagram

Figure 2.6 Use-case Diagram for Admin Manage Food

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 18


Project: Building a smart health care system

Manage Symptom Use-case Diagram

Figure 2.7 Use-case Diagram for Admin Manage Symptom

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 19


Project: Building a smart health care system

Description for main use-cases


The next ones I will describe each use-case in detail to help you get more information.
The use case for admin login is described in Table 2.1.
Table 2.1 Use-case Description for Login

Use Case ID UC-01


Actor User
Brief description This use-case is for logging in.
Pre-conditions The user who has account to access the application.
Post-conditions The user logged in successfully.
Actor Input System Response
1 User opens the website
2 System shows the login form.
User enters the username and
Flow of events 3 password. Click the Login
button.
System validates account that
4 user filled and submit. Show
the home screen.

The use case for admin creating disease is described in Table 2.2.
Table 2.2 Use-case Description for Creating Disease

Use Case ID UC-02


Actor Admin
Brief description This use case for creating diseases in the system.
Pre-conditions Admin who has account to access the application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “Disease” in the
Flow of events 1
navigation bar.
2 System shows disease page.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 20


Project: Building a smart health care system

User clicks to button “Create


3
Disease”.
4 System shows a disease form.
User fills the necessary
5 information into the form and
presses “add”.
System will validate data and
6
save data in the database.

The use case for admin creating symptoms is described in Table 2.3.
Table 2.3 Use-case description for Creating Symptom

Use Case ID UC-03


Actor Admin
Brief description This use case for creating symptoms in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “Symptom” in
1
navigation bar.
2 System shows symptom page.
Flow of events
User clicks to button “Create
3
Symptom”.
System shows a symptom
4
form.
User fills the necessary
5 information to the form and
press “add”.
System will validate data and
6
save data to the database.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 21


Project: Building a smart health care system

The use case for admin creating food is described in Table 2.4.
Table 2.4 Use-case description for Creating Food

Use Case ID UC-04


Actor Admin
Brief description This use case is for creating food in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “Food” in
1
navigation bar.
Flow of events 2 System shows food page.
User clicks to button “Create
3
Food”.
4 System shows a food form.
User fills the necessary
5 information to the form and
press “add”.
System will validate data and
6
save data to the database.

The use case for admin editing disease is described in Table 2.5.
Table 2.5 Use-case Description for Editing Disease

Use Case ID UC-05


Actor Admin
Brief description This use case is for editing disease in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “More button” in
Flow of events
1 the last column of each row of
each disease

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 22


Project: Building a smart health care system

2 System shows sub menu.


3 User clicks to button “Edit”.
4 System shows a disease form.
User fills the necessary
5 information into the form and
press “save”.
System will validate data and
6
save data to the database.

The use case for admin editing symptom is described in Table 2.6.
Table 2.6 Use-case Description for Editing Symptom

Use Case ID UC-06


Actor Admin
Brief description This use case is for editing symptom in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “More button” in
1 the last column of each row of
each symptom
Flow of events
2 System shows sub menu.
3 User clicks to button “Edit”.
System shows a symptom
4
form.
User fills the necessary
5 information to the form and
press “save”.
System will validate data and
6
save data to the database.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 23


Project: Building a smart health care system

The use case for admin editing food is described in Table 2.7.
Table 2.7 Use-case Description for Editing Food

Use Case ID UC-07


Actor Admin
Brief description This use case is for editing food in the system.
Pre-conditions Admin who has account to access to the application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “More button” in
1 the last column of each row of
Flow of events each food
2 System shows sub menu.
3 User clicks to button “Edit”.
4 System shows a food form.
User fills the necessary
5 information to the form and
press “save”.
System will validate data and
6
save data to the database.

The use case for admin deleting disease is described in Table 2.8.
Table 2.8 Use-case Description for Deleting Disease

Use Case ID UC-08


Actor Admin
Brief description This use case is for deleting disease in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “More button” in
Flow of events
1 the last column of each row of
each disease

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 24


Project: Building a smart health care system

2 System shows sub menu.


3 User clicks to button “Delete”.
System will delete the record
4
of disease

The use case for admin deleting food is described in Table 2.9.
Table 2.9 Use-case Description for Deleting Food

Use Case ID UC-09


Actor Admin
Brief description This use case is for deleting food in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Actor Input System Response
User clicks to “More button” in
1 the last column of each row of
Flow of events
each food
2 System shows sub menu.
3 User clicks to button “Delete”.
System will delete the record
4
of food

The use case for admin deleting symptom is described in Table 2.10.
Table 2.10 Use-case Description for Deleting Symptom

Use Case ID UC-10


Actor Admin
Brief description This use case is for deleting symptom in the system.
Pre-conditions Admin who has account to access to application.
Post-conditions Admin logged in successfully.
Flow of events Actor Input System Response

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 25


Project: Building a smart health care system

User clicks to “More button” in


1 the last column of each row of
each symptom
2 System shows sub menu.
3 User clicks to button “Delete”.
System will delete the record
4
of symptom

The Table 2.11 and 2.12 describe the use case for user viewing detail disease, and asking
for food.
Table 2.11 Use-case Description for Viewing Detail Disease

Use Case ID UC-11


Actor User
Brief description This use case is for viewing detail disease in the system.
Pre-conditions User who accesses to application.
Post-conditions
Actor Input System Response
User clicks to “Disease
1
Dictionary” in navigation bar.
Flow of events System navigates dictionary
2
screen.
User clicks to button “Next” in
3
the last of row of each disease.
System will navigate to detail
4
of each disease
User can click to each part of
5 disease like Symptom,
Prevention, Test, …

Table 2.12 Use-case Description for Asking for Food

Use Case ID UC-12

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 26


Project: Building a smart health care system

Actor User
Brief description This use case is for asking for food in the system.
Pre-conditions User who accesses to application.
Post-conditions
Actor Input System Response
User clicks to “Food for
1
Patient” in navigation bar.
System navigates food patient
Flow of events 2
screen.
User pick some disease which
3 added to get some foods for
those diseases.
System will show foods that
4 server render from Kmean
cluster Python

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 27


Project: Building a smart health care system

2.3. System design


Class Diagram

Figure 2.8 Class Diagram


About the system design, the first thing always needs to be shown is Class Diagram of
the system which is shown in Figure 2.8.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 28


Project: Building a smart health care system

Sequence Diagram
After the Class Diagram, the sequence diagram is shown above to describe how each
use-case work, what my system will do, and what the user/ admin does from Figure 2.9 to
2.13.

Figure 2.9 Sequence diagram for Admin Login

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 29


Project: Building a smart health care system

Figure 2.12 Sequence diagram for Admin Managing Disease

Figure 2.11 Sequence diagram for User Managing Disease

Figure 2.10 Sequence diagram for Admin managing Food

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 30


Project: Building a smart health care system

Figure 2.12 Sequence diagram for User viewing the detail Disease

Figure 2.13 Sequence diagram for User Asking for food

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 31


Project: Building a smart health care system

Database Design
From table 2.13 to 2.17 is the description for each table that is shown in Class Diagram.
The detail of table Account is shown in table 2.13.
Table 2.13 Description of table: Account
No. Name Type Length Allow Null Key
1 id int False PK
2 email text 255 False
3 password text 255 False
4 code text True
5 createdAt timestamp False
6 updatedAt timestamp False
7 isDelete boolean False

The detail of table Role is shown in table 2.14.


Table 2.14 Description of table: Role
No. Name Type Length Allow Null Key
1 id int False PK
2 email text 255 False
3 createdAt timestamp False
4 updatedAt timestamp False
5 isDelete boolean False

The detail of table Profile is shown in table 2.15.


Table 2.15 Description of table: Profile
No. Name Type Length Allow Null Key
1 id int False PK
2 accountId int 255 False FK
3 password text 255 False
4 code text 255 True
5 createdAt timestamp False
6 updatedAt timestamp False

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 32


Project: Building a smart health care system

7 isDelete boolean False

The detail of table Disease is shown in table 2.16.


Table 2.16 Description of table: Disease
No. Name Type Length Allow Null Key
1 id int False PK
2 name text False
3 definition text False
4 symptoms text False
5 causes text False
6 risk text False
7 complications text False
8 tests text False
9 preparing text False
10 prevention text False
11 treatment text False
12 createdAt timestamp False
13 updatedAt timestamp False
14 isDelete boolean False

The detail of table Food is shown in table 2.17.


Table 2.17 Description of table: Food
No. Name Type Length Allow Null Key
1 id int False PK
2 name text 255 False
3 image text True
4 createdAt timestamp False
5 updatedAt timestamp False
6 isDelete boolean False

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 33


Project: Building a smart health care system

The detail of table Symptom is shown in table 2.18.


Table 2.18 Description of table: Symptom
No. Name Type Length Allow Null Key
1 id int False PK
2 name text 255 False
3 createdAt timestamp False
4 updatedAt timestamp False
5 isDelete boolean False

2.4. Conclusions
This chapter presented the requirements specification so the system could meet the
user’s demands. Following the requirements, the use case diagrams are used to gather the
requirements of a system including internal and external influences. These requirements
are mostly design requirements. The action sequences as well as the interactions between
user and user, user and system. Thereby, the overview and the activity streams of the system
are fully presented.
In addition, it also describes the structure of the system, as well as the action sequences
for each function. By that, it facilitates the testing phase, the tester can go back to the
sequence diagrams to follow the action sequences and create the function tests and the input
data as well. Furthermore, it shows the database and some UI application designs to help
the reader have clearer views of the system. Therefore, we can consider and evaluate the
complexity of this system.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 34


Project: Building a smart health care system

Chapter 3: IMPLEMENTATION AND EVALUATION


3.1. Development environment
Web service
The web service is a RESTful API. It is built by .Net Entity Framework, based on
representational state transfer (REST) technology. I use MS SQL to store data.
Software Development Tools
We use the following tools: Visual Studio Code, Visual Studio, Microsoft SQL, and
Postman.
3.2. K-Means Cluster Recommendation
There are several health deteriorating factors for patients who suffer from multiple life-
threatening diseases, food choice is one of them, and it is generally an essential element of
healthy living. For instance, a person might be suffering from high blood pressure, liver
disease, diabetes, high blood pressure, and high cholesterol at the same time and for each
of these health conditions particular food types are considered "safe foods" while some are
"forbidden". To ensure that a patient's health and well-being are managed, it is important
to isolate the "safe food" from all possible food options.
Target user:
This function is targeted to patients who are suffering from multiple killer diseases and
nutritionists who help these patients in finding the right food choices given the complexity
of their health conditions.
Data preparation:
For each disease:
 Convert pandas file to a list.
 Remove NaN value, which stands for "not a number".
 Join food separated by space with '-'. E.g., whole grain should be considered as a
word as follows: whole-grain, otherwise whole will be a word of its own as well as
grain.
 Merge an individual list of food options for various diseases into a single array.
 Finally, Use lemmatize method to remove occurrences of 's' at the end of the string.
This is because different blogs and websites use different styles for food entries
recommended for the diseases under consideration.
Convert food items into vectors using CountVectorizer() (AKA One-Hot
Encoding):
Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 35
Project: Building a smart health care system

CountVectorizer() is preferred here because it counts the word frequencies and as such
rends itself more appropriate for the given problem. Intuitively, it is assumed that the food
which occurs more frequently from each disease food choice to the other is the "safe food".
KMEANS Clustering:
 Using the ELBOW method to identify the true clusters, the result is shown in Figure
3.1

Figure 3.1 Plot for Loss and K of KMeans++ Method

After using the Elbow Method to see the effect of the number of clusters K, I decided
to choose the K=3 because the change after that is smaller than others.
 One can observe "3 clusters", though it is not a clear point.
 Let's choose 3 clusters, where it can be assumed that the first cluster is the "safe
food".
 To particularly observe the "safe food", let's view the first cluster only.
Furthermore, in this feature, I use KMeans++ to recommend the food for the patient.
According to Wikipedia, The k-means problem is to find cluster centers that minimize
the intra-class variance, i.e. the sum of squared distances from each data point being
clustered to its cluster center (the center that is closest to it). Although finding an exact
solution to the k-means problem for arbitrary input is NP-hard, the standard approach to
finding an approximate solution (often called Lloyd's algorithm or the k-means algorithm) is
used widely and frequently finds reasonable solutions quickly.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 36


Project: Building a smart health care system

However, the k-means algorithm has at least two major theoretic shortcomings:
The result of KMeans Cluster is shown in Figure 3.2.

Figure 3.2 Illustration for Kmeans cluster


The red points are the centroid that is recomputed by KMeans algorithm.
First, it has been shown that the worst-case running time of the algorithm is super-
polynomial in the input size.
Second, the approximation found can be arbitrarily bad with respect to the objective
function compared to optimal clustering.
The result of KMeans Cluster is shown in Figure 3.3.

Figure 3.3 Illustration for KMeans++ cluster


The red points are random centroid which KMeans++ generates.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 37


Project: Building a smart health care system

The k-means++ algorithm addresses the second of these obstacles by specifying a


procedure to initialize the cluster centers before proceeding with the standard k-means
optimization iterations. With the initialization of k-means ++, the algorithm is guaranteed
to find a solution that O(log k) is competitive to the optimal k-means solution [9].
And the way how KMeans ++ works is shown in figure 3.3, K-Means++ is a smart
centroid initialization technique and the rest of the algorithm is the same as that of K-Means.
The steps to follow for centroid initialization are:
 Pick the first centroid point (C_1) randomly.
 Compute the distance of all points in the dataset from the selected centroid. The
distance of x_i point from the farthest centroid can be computed by:

d_i: Distance of x_i point from the farthest centroid.


m: number of centroids already picked.

 Make the point x_i as the new centroid that is having maximum probability
proportional to d_i.
 Repeat the above two steps until you find k-centroids [10].

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 38


Project: Building a smart health care system

3.3. Demo main feature


Admin Page:
Login:
The login page is shown in Figure 3.4.

Figure 3.4 Login Admin Screen

The website uses username and password to log in. After successful login, it will direct
the admin to the home page which is shown in Figure 3.5.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 39


Project: Building a smart health care system

Figure 3.5 Disease Management Screen


This page only accesses the admin. Here, displayed in order from left to right: the navbar
and the main screen. Admin can manage the disease, food, and symptom here.
The form for admin add new disease is shown in Figure 3.6.

Figure 3.6 Admin Add Form

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 40


Project: Building a smart health care system

The Figure 3.7 show the form for admin editing the disease.

Figure 3.7 Admin Edit Form


The same UI is applied for Symptom and Food Screen.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 41


Project: Building a smart health care system

User Mobile:
App mobile doesn’t need an account for login, it allows all users to access it. This has
some screen for the user to read news, get information about covid in the world, detail
countries. The main sceen and dictionary screen is shown in Figure 3.8, and 3.9.

Figure 3.8 Home screen Figure 3.9 Dictionary Disease Screen

Furthermore, users can access the app for getting information about diseases, they can
see lots of things in this from symptoms, causes, definition, … which are shown by below
figures.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 42


Project: Building a smart health care system

The Figure 3.10 and 3.11 show the information about the COVID-19 from overview to
detail.

Figure 3.10 Covid Info Screen Figure 3.11 Detail Country Info Screen

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 43


Project: Building a smart health care system

The Figure 3.12 shows the detail disease screen, while the Figure 3.13 show the screen for
patient ask food.

Figure 3.13 Detail Disease Screen Figure 3.12 Food for Patient Screen

3.4. Evaluation
Advantages
Basically, “Smart Health Care System” meets the needs of people who care about health,
they want to research diseases, their symptoms, causes… they want to know how to prevent
them, how to test that “Do they got this disease?”
In terms of UX/UI, our system provides simple and familiar UIs for users to interact
and get information through a mobile app and a website for admin.
The user will have more health knowledge when accessing my apps. In addition to this,
my app can suggest some food for the user who has some diseases in the list which suggest
on screen.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 44


Project: Building a smart health care system

Disadvantages
In addition to the advantages mentioned above, my system still has some disadvantages:
 The method of predicting suggested food is not yet optimal.
 Some functions are not yet fully developed such as predicting disease via symptoms,

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 45


Project: Building a smart health care system

CONCLUSION

1. Achievement
Smart Health Care System is a simple application to help people who want to gain more
knowledge or information about diseases, to help them to protect themselves from diseases.
It also can show them how to check if they got the disease, or how to prevent the disease.
In addition to this, in the dangerous pandemic nowadays, it can show the user the
information about COVID-19 throughout the world, or the details per country. It shows the
cases, the death cases, vaccine doses had been vaccinated,…
Finally, it gets a small AI system which uses KMeans++ cluster to recommend food for
the patient who doesn’t know which food is good for him/ her. An example of a machine
learning system is a virtual personal nutritionist. The goal of a machine is to work with the
data from the medical records and generate recommendations for the patients. In this article,
we will discuss how one can use K-means++ clustering to perform such a recommendation
algorithm.
After building this application, I could understand how to work with some frameworks
and libraries such as Entity, ReactJS, ReactNative, and Python. I learned the structure of
the frameworks and how to apply them to my project. In addition, it also helps me to update
technology trends and my future career.
I also improved my skills a lot, including research skills, technical skills, presentation
skills, English, and many other soft skills.
About the project, I have already followed the plan which was created in the first week
of graduation project duration and implemented all functions in that plan. Besides, I also
added some more features that are intended is to enhance user experience.
2. Future work
With some disadvantages I have already mentioned in the evaluation part, the future
work of this project is as follows:
 Integrate the “Like” function for User pick some diseases that they are concerned
about most.
 Build an AI system to diagnose disease for the patient diagnostic some disease via
symptom and paint,...
 Integrate the meeting function to have the patient meet with the doctor to ask about
their health.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 46


Project: Building a smart health care system

REFERENCES

[1] ReactJS, URL: https://www.tutorialspoint.com/reactjs/reactjs_overview.htm, access


on Jan 6th,2022.
[2]ReactNative,URL:https://www.tutorialspoint.com/react_native/react_native_overvi
ew.htm, access on Jan 6th,2022.
[3] REST API, URL: https://www.liquidweb.com/kb/what-is-rest-api-an-overview/,
access on Jan 6th,2022.
[4]SQLServer,
URL:https://www.tutorialspoint.com/ms_sql_server/ms_sql_server_overview.htm, access
on Jan 6th,2022.
[5] Recommender System, URL: https://viblo.asia/p/gioi-thieu-ve-he-thong-goi-y-
recommender-systems-hoac-recommendation-systems-maGK78yOZj2, access on Jan
6th,2022.
[6] Recommender System, URL: https://en.wikipedia.org/wiki/Recommender_system,
access on Jan 6th,2022.
[7]Collaborative filtering, URL:
https://machinelearningcoban.com/2017/05/24/collaborativefiltering/, access on Jan
6th,2022
[8]Entity Framework: URL:https://www.geeksforgeeks.org/what-is-entity-framework-
in-net-framework , access on Jan 13th,2022.

[9] Kmeans Cluster, URL: https://en.wikipedia.org/wiki/K-means%2B%2B, access on


Feb 25th, 2022.
[10] KMeans Cluster: URL: https://towardsdatascience.com/understanding-k-means-k-
means-and-k-medoids-clustering-algorithms-ad9c9fbf47ca, access on Feb 25th, 2022.

Student: Hoang Duc Thanh Instructor: Ph.D. Pham Cong Thang 47

You might also like