0% found this document useful (0 votes)
34 views67 pages

Plag Check Report 2025 04 29T05 - 36 - 34

The document presents a project report on an IoT-Based Health Monitoring System, detailing its development through five Agile sprints. Each sprint focused on specific functionalities such as user authentication, health metrics management, appointment booking, and user interface design. The project aims to enhance patient-provider interactions and ensure a scalable, user-centric healthcare solution.

Uploaded by

trishank434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views67 pages

Plag Check Report 2025 04 29T05 - 36 - 34

The document presents a project report on an IoT-Based Health Monitoring System, detailing its development through five Agile sprints. Each sprint focused on specific functionalities such as user authentication, health metrics management, appointment booking, and user interface design. The project aims to enhance patient-provider interactions and ensure a scalable, user-centric healthcare solution.

Uploaded by

trishank434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

QuillBot

Scanned on: 05:36 April 29, 2025 UTC

9.2% 24 10727

Overall similarity score Results found Total words in text

Word count
Identical 559
Minor Changes 280
Paraphrased 152
Omitted 0

Powered by
QuillBot Scanned on: 05:36 April 29, 2025 UTC

Results
The results include any sources we have found in your submitted document that includes the
following: identical text, minor changed text, paraphrased text.

IoT_SAMPLE PROJECT REPORT (2) | PDF | Learning | Artificial… IDENTICAL


https://www.scribd.com/document/851667862/IoT-SAMPLE-PROJECT-REPO…
4%

Text that is exactly the


Sample Project Report (1) | PDF | Learning | Educational Tec… same.

https://www.scribd.com/document/853559872/Sample-Project-Report-1
3%

PERSONALIZED MOVIE RECOMMENDATION SYSTEM MINOR P…


https://www.slideshare.net/slideshow/personalized-movie-recommendatio…
2% MINOR CHANGES

Text that is nearly


Pet Care Application | PDF
https://www.slideshare.net/slideshow/pet-care-application/258391225
1% identical, yet a
different form of the
word is used. (i.e 'slow'
becomes 'slowly')
Barriers to mental health treatment in primary care practic…
https://pmc.ncbi.nlm.nih.gov/articles/PMC10521856/ 1%
PARAPHRASED

Microsoft Word - plagiarism-declaration-CSE-side1.doc


Text that has similar
https://www.roe.ac.uk/~wkmr/Galaxy_Redshift_webpages/OwnWorkDeclar… 1% meaning, yet different
OwnWorkDeclaration.pdf words are used to
convey the same
message.

Table of Contents for SEPM projects | PDF


https://www.scribd.com/document/853561397/Table-of-Contents-for-SEP… 1% Unsure about your report?

The results have been found after


comparing your submitted text to
All information will be kept confidential in accordance with … online sources, open databases
https://www2.ph.ed.ac.uk/~muheim/teaching/sh-projects/plagiarism-decl… and the Copyleaks internal
1%
database. If you have any
plagiarism-declaration.pdf questions or concerns, please feel
free to contact us
[email protected]

Click here to learn more about


different types of plagiarism

Powered by
.

QuillBot Scanned on: 05:36 April 29, 2025 UTC

own-work-decl-ip-pt1.txt
https://www.inf.ed.ac.uk/teaching/courses/ip/own-work-decl-ip-pt1.txt 1%
own-work-decl-ip-pt1.txt

University of Edinburgh – Own Work Declaration


https://edwebcontent.ed.ac.uk/sites/default/files/imports/fileManager/Ow… 1%
Own%20%20Work%20%20Declaration.docx

Modal · Bootstrap v5.0


https://getbootstrap.com/docs/5.0/components/modal/
1%

FINAL T | PDF | Cognitive Science | Computing


https://www.scribd.com/document/850541964/FINAL-T 1%

luisa frei - Independent Researcher


https://independent.academia.edu/luisafrei 1%

Declaration of Originality Form


https://www.gla.ac.uk/media/Media_106239_smxx.docx 1%
Media_106239_smxx.docx

120427431.pdf?sequence=3&isAllowed=y
https://dspace.cuni.cz/bitstream/handle/20.500.11956/178369/12042743… 1%
120427431.pdf

pierre twagirimana - Independent Researcher


https://independent.academia.edu/pierretwagirimana 1%

Powered by
.

QuillBot Scanned on: 05:36 April 29, 2025 UTC

1.3.4.14.pdf
https://mkce.ac.in/aqar/1.3.4.14.pdf 1%
1.3.4.14.pdf

Analysis Of Welspun Corp Ltd. Essay - 9873 Words | Bartleby


https://www.bartleby.com/essay/Analysis-Of-Welspun-Corp-Ltd-FKARQRXY…
1%

Microsoft Word - declaration_of_originality.doc


https://www.gla.ac.uk/ibls/US/cover%20sheets/declaration_of_originality.pdf 1%
declaration_of_originality.pdf

MedicPoint | LinkedIn
https://iq.linkedin.com/company/medicpointiraq
1%

Imogen Marsh - Independent Researcher


https://independent.academia.edu/ImogenMarsh
1%

Scrum Team Management Plan - AI Prompt


https://docsbot.ai/prompts/business/scrum-team-management-plan-1 1%

content
https://odr.chalmers.se/server/api/core/bitstreams/764ca6d4-5fab-4c43-a… 1%

School of Computing, SRMIST | LinkedIn


https://in.linkedin.com/company/school-of-computing-srmist 1%

Powered by
QuillBot Scanned on: 05:36 April 29, 2025 UTC

Scanned Text
Your text is highlighted according to the plagiarism types that where
found, as shown above.

IDENTICAL MINOR CHANGES PARAPHRASED

IoT-Based Health Monitoring System


A PROJECT REPORT
Submitted by

Subramanya Trishank Reddy M[RA2211056010002]


Rishyunth Raju S R V[RA2211056010044]
Under the Guidance of

Dr. D Prabakar
Assistant Professor
Department of Data Science and Business Systems
in partial fulfillment of the requirementsfor the degree
of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE ENGINEERING

DEPARTMENT OF
DATA SCIENCE AND BUSSINESS SYSTEMS
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY
KATTANKULATHUR- 603 203
MAY 2025

Department of Computational Intelligence


SRM Institute of Science & Technology
Own Work* Declaration Form
This sheet must be filled in (each box ticked to show that the condition has been met). It must be
signed and dated along with your student registration number and included with all assignments
you submit – work will not be marked unless this is done.
To be completed by the student for all assessments
Degree/ Course

Student Name

Registration Number
:

Title of Work

I / We hereby certify that this assessment compiles with the University’s Rules and Regulations
relating to Academic misconduct and plagiarism**, as listed in the University Website,
Regulations, and the Education Committee guidelines.
I / We confirm that all the work contained in this assessment is my / our own except where
indicated, and that I / We have met the following conditions:

Clearly referenced / listed all sources as appropriate

Referenced and put in inverted commas all quoted text (from books, web, etc)

Given the sources of all pictures, data etc. that are not my own

Not made any use of the report(s) or essay(s) of any other student(s) either past or present

Acknowledged in appropriate places any help that I have received from others (e.g.
fellow students, technicians, statisticians, external sources)

Compiled with any other plagiarism criteria specified in the Course handbook /
University website

I understand that any false claim for this work will be penalized in accordance with the
University policies and regulations.
DECLARATION:
I am aware of and understand the University’s policy on Academic misconduct and plagiarism and I certify
that this assessment is my / our own work, except where indicated by referring, and that I have followed
the good academic practices noted above.

If you are working in a group, please write your registration numbers and sign with the date for
every student in your group.

ii

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY


KATTANKULATHUR – 603 203
<Font Style Times New Roman — Size - 18>

BONAFIDE CERTIFICATE
<Font Style Times New Roman — Size - 16>
<Font Style Times New Roman — Size - 14>
Certified that 18CSP107L - Minor Project [18CSP108L- Internship] report titled
“PROJECT TITLE ” is the bonafide work of “STUDENT1 NAME [REG NUM],
STUDENT2 NAME [REG NUM]” who carried out the project work[internship] under my
supervision. Certified further, that to the best of my knowledge the work reported herein
does not form any other project report or dissertation on the basis of which a degree or award
was conferred on an earlier occasion on this or any other candidate.

<<Signature >>
SIGNATURE
<<Signature >>
SIGNATURE

<<Name >>

DR. R. ANNIE UTHRA

SUPERVISOR
[Designation]
[Department]

PROFESSOR &HEAD
DEPARTMENT OF
COMPUTATIONAL INTELLIGENCE

iii

ACKNOWLEDGEMENTS
We express our humble gratitude to Dr. C. Muthamizhchelvan, Vice-Chancellor, SRM
Institute of Science and Technology, for the facilities extended for the project work and his
continued support.
We extend our sincere thanks to Dr. Leenus Jesu Martin M, Dean-CET, SRM Institute of
Science and Technology, for his invaluable support.
We wish to thank Dr. Revathi Venkataraman, Professor and Chairperson, School of
Computing, SRM Institute of Science and Technology, for her support throughout the project
work.
We encompass our sincere thanks to, Dr. M. Pushpalatha, Professor and Associate
Chairperson - CS, School of Computing and Dr. Lakshmi, Professor and Associate Chairperson
-AI, School of Computing, SRM Institute of Science and Technology, for their invaluable
support.
We are incredibly grateful to our Head of the Department, <<Name , Designation &
Department>>, SRM Institute of Science and Technology, for her suggestions and
encouragement at all the stages of the project work.
We want to convey our thanks to our Project Coordinators, Panel Head, and Panel Members
Department of Computational Intelligence, SRM Institute of Science and Technology, for their
inputs during the project reviews and support.
We register our immeasurable thanks to our Faculty Advisor, ..................., Department of
<<Dept. Name>>, SRM Institute of Science and Technology, for leading and helping us to
complete our course.
Our inexpressible respect and thanks to our guide, ....................., Department of <<Dept.
Name>>, SRM Institute of Science and Technology, for providing us with an opportunity to
pursue our project under his / her mentorship. He / She provided us with the freedom and
support to explore the research topics of our interest. His / Her passion for solving problems
and making a difference in the world has always been inspiring.
We sincerely thank all the staff members of <<Dept. Name>>, School of Computing, S.R.M
Institute of Science and Technology, for their help during our project. Finally, we would like to
thank our parents, family members, and friends for their unconditional love, constant support
and encouragement

Authors

iv

ABSTRACT
The IoT-Based Health Monitoring System project is designed to bridge the gap between
patients and healthcare providers through a digital platform that simplifies appointment
scheduling, health data monitoring, and profile management. This document details the
project's development journey, structured across five organized sprints under Agile
methodology, ensuring rapid delivery, adaptability, and quality assurance. Sprint 1 focused on
building the core authentication system, enabling secure registration and login functionalities
for both doctors and patients, with proper database integration. Sprint 2 developed user
dashboards tailored to each role, providing intuitive navigation and access to key services.
Sprint 3 introduced the management of health metrics, including the collection and storage of
real-time biometric data from devices such as the ESP32 sensor, enhancing the platform's
ability to support remote health monitoring. Sprint 4 implemented the appointment booking
functionality, allowing patients to request consultations and doctors to manage their schedules
effectively. Finally, Sprint 5 concentrated on improving the overall user interface design,
ensuring a responsive and professional look, while comprehensive functional testing was
performed to validate the system’s stability and performance. Each sprint documented sprint
goals, user stories, system architecture, UI prototypes, functional specifications, testing
strategies, daily call progress, and retrospective evaluations. The structured approach adopted
throughout the project ensured not only the successful delivery of all committed features but
also laid a strong foundation for future scalability, positioning IoT-Based Health Monitoring
System as a reliable and user-centric healthcare solution.

TABLE OF CONTENTS

ABSTRACT

iv

TABLE OF CONTENTS

LIST OF FIGURES

vi

LIST OF TABLES

vii

ABBREVIATIONS

viii

CHAPTER NO.

TITLE

PAGE NO.

1 INTRODUCTION

1.1 Introduction to Project

1.2 Motivation

1.3 Sustainable Development Goal of the Project

1.4 Product Vision Statement

1.5 Product Goal

1.6 Product Backlog (Key User Stories with Desired Outcomes)

7
1.7 Product Release Plan

2 SPRINT PLANNING AND EXECUTION


2.1 Sprint 1

9
10

2.1.1 Sprint Goal with User Stories of Sprint 1

11

2.1.2 Functional Document

12

2.1.3 Architecture Document

13

2.1.4 UI Design

14

2.1.5 Functional Test Cases

15

2.1.6 Daily Call Progress

16

2.1.7 Committed vs Completed User Stories

17

2.1.8 Sprint Retrospective

18

vi

2.2 Sprint 2

19
2.2.1 Sprint Goal with User Stories of Sprint 2

20

2.2.2 Functional Document

21

2.2.3 Architecture Document

22

2.2.4 UI Design

23

2.2.5 Functional Test Cases


24

2.2.6 Daily Call Progress

25

2.2.7 Committed vs Completed User Stories

26

2.2.8 Sprint Retrospective

27

2.3 Sprint 3

19
2.3.1 Sprint Goal with User Stories of Sprint 2

20

2.3.2 Functional Document

21

2.3.3 Architecture Document

22

2.3.4 UI Design

23

2.3.5 Functional Test Cases

24

2.3.6 Daily Call Progress

25

2.3.7 Committed vs Completed User Stories

26

2.3.8 Sprint Retrospective

27

2.4 Sprint 4

19
2.4.1 Sprint Goal with User Stories of Sprint 2

20

2.4.2 Functional Document

21

2.4.3 Architecture Document

22

2.4.4 UI Design
23

2.4.5 Functional Test Cases

24

2.4.6 Daily Call Progress

25

2.4.7 Committed vs Completed User Stories

26

vii

2.4.8 Sprint Retrospective

27

3. RESULTS AND DISCUSSIONS

28

3.1 Project Outcomes (Justification of outcomes and how they align

29

with the goals)


3.2 Committed vs Completed User Stories

30

CONCLUSIONS & FUTURE ENHANCEMENT

31

APPENDIX

32

A. PATENT DISCLOSURE FORM

33

B. SAMPLE CODING

34

C. PLAGIARISM REPORT

35

viii

LIST OF FIGURES
Figure
No.

Title

Page
No.
Figure 1.1

MS Planner Board of IoT-Based Health Monitoring


System

Figure 1.2 Release Plan of IoT-Based Health Monitoring System

Figure 2.1 User Story for Doctor Registration

11

Figure 2.2 User Story for Patient Registration

12

Figure 2.3 User Story for Login to Dashboard

13

Figure 2.4 System Architecture Diagram (Sprint 1)

14

Figure 2.5 UI Design for Landing Page

15

Figure 2.6 UI Design for Choose Role

15

Figure 2.7 UI Design for Doctor Login Page

16

Figure 2.8 UI Design for Doctor Signup Page

16

Figure 2.9 UI Design for Patient Login Page

17

Figure
2.10

UI Design for Patient Registration Page

17

Figure
2.11

Detailed Functional Test Cases (Sprint 1)

18

Figure
2.12

Bar Graph: Committed vs Completed User Stories


(Sprint 1)
18

Figure 3.1 User Story: View Real-Time Charts (Patient)

20

Figure 3.2 User Story: Doctor Viewing Patient Data

21

Figure 3.3 User Story: Secure Messaging (Doctor/Patient)

22

Figure 3.4 System Architecture Diagram (Sprint 2)

23

ix

Figure
No.

Page
No.

Title

Figure 3.5 UI Design for Doctor Dashboard

24

Figure 3.6 UI Design for Patient Dashboard

24

Figure 3.7 UI Design for View Patient Data

25

Figure 3.8 Detailed Functional Test Cases (Sprint 2)

26

Bar Graph: Committed vs Completed User Stories


(Sprint 2)

27

Figure 4.1 User Story: Integrate ESP32 with Glucose Sensor

29

Figure 4.2 User Story: Add MAX30102 Pulse Oximeter

29

Figure 4.3 User Story: View Synchronized Vitals

30

Figure 4.4 System Architecture Diagram (Sprint 3)

31
Figure 4.5 UI Design for Booking Appointment

32

Figure 4.6 Detailed Functional Test Cases (Sprint 3)

32

Figure 3.9

Figure 4.7

Bar Graph: Committed vs Completed User Stories


(Sprint 3)

33

Figure 5.1 User Story: Deploy on XAMPP Server

34

Figure 5.2 User Story: Enhanced Patient Dashboard UI

34

Figure 5.3 Schema Design (Sprint 4)

35

Figure 5.4 UI Design for View Trends

36

Figure 5.5 Detailed Functional Test Cases (Sprint 4)

36

Figure 5.6

Bar Graph: Committed vs Completed User Stories


(Sprint 4)

37

Figure 6.1

Bar Graph: Committed vs Completed User Stories


(Overall)

39

LIST OF TABLES
Table No. Title

Page No.

Table 1.1 Abbreviations Table

Table 1.2 User Stories of IoT-Based Health Monitoring System 9


Table 2.1 Detailed User Stories of Sprint 1

11
Table 2.2 Access Level Authorization Matrix (Sprint 1)

13

Table 2.3 Standup Meetings (Sprint 1)

18

Table 2.8 Sprint Retrospective (Sprint 1)

19

Table 3.1 Detailed User Stories of Sprint 2

20

Table 3.2 Access Level Authorization Matrix (Sprint 2)

22

Table 3.3 Standup Meetings (Sprint 2)

26

Table 3.4 Sprint Retrospective (Sprint 2)

27

Table 4.1 Detailed User Stories of Sprint 3

29

Table 4.2 Demography Table (Sprint 3)

30

Table 4.3 Standup Meetings (Sprint 3)

32

Table 4.4 Sprint Retrospective (Sprint 3)

33

Table 5.1 Detailed User Stories of Sprint 4

34

Table 5.2 Demography Table (Sprint 4)

35

Table 5.3 Standup Meetings (Sprint 4)

36

Table 5.4 Sprint Retrospective (Sprint 4)

37

xi

ABBREVIATIONS
Abbreviation Full Form
UI
User Interface

API

Application Programming Interface

DB

Database

ESP32

Espressif Systems Microcontroller (IoT Device)

PHP

Hypertext Preprocessor

HTML

HyperText Markup Language

CSS

Cascading Style Sheets

SQL

Structured Query Language

CRUD

Create, Read, Update, Delete

MVC

Model-View-Controller

HTTP

Hypertext Transfer Protocol

XAMPP

Cross-platform Apache, MariaDB, PHP, and Perl

QA

Quality Assurance

UX

User Experience

SRS

Software Requirements Specification

Table 1.1 Abbreviationa Table

xii

CHAPTER 1
INTRODUCTION
1.1 Introduction to IoT-Based Health Monitoring System
The manner in which we access healthcare is transforming at a rate of knots, driven by digital
technologies. There is now increased emphasis on remote care, real-time feedback, and
individualized support between patients and physicians. In this new paradigm, the IoT-Based
Health Monitoring System emerges as an effective tool — building a smart, networked
platform where patients can be continuously monitored without having to visit a hospital each
time.
At the center of this system are IoT technologies such as the ESP32 microcontroller and
biomedical sensors such as the MAX30102. They work together to gather critical health
information — such as heart rate, oxygen saturation (SpO2), and body temperature — and
transmit it securely to healthcare professionals in real time.
We've designed a web application with PHP handling backend computations and MySQL used
to store the data. From there, the patient can sign up, sign in, schedule visits, review medical
records, and receive input from physicians remotely, all within their homes. Meanwhile,
doctors receive real-time data about their patients, are able to see medical trends, and intervene
instantly whenever necessary. This way, patients are no longer restricted to time-bound checkups — early
intervention and detection become relatively easier, particularly when it comes to
chronic diseases.
We made the system simple to use, scalable, and secure so that anyone of any age and technical
skill can take advantage of it. And due to its modular design, it's poised for future enhancements
such as adding new sensors or even AI-based health forecasts.
Ultimately, the IoT-Based Health Monitoring System is not merely about technology — it's
about creating a healthcare experience that's seamless, reliable, and accessible, in the process
creating a healthier and more connected world.

1.2 Motivation
Today’s healthcare environment is confronted with significant challenges — from the burden
of aging populations and long-term diseases to the unpredictability of worldwide pandemics.
Conventional models, which rely heavily on in-person consultations and manual monitoring of
health, can’t always keep pace. In rural communities, individuals often simply struggle to travel
to a clinic, while urban hospitals grapple with swaths of people and lengthy wait times. And
without ongoing monitoring, many health issues aren’t detected until it’s too late.
That is where the impetus for our IoT-Based Health Monitoring System derives from.
Healthcare ought to be less difficult to attain, more swift to deliver, and even proactive — as
opposed to reactionary once something does fail.
By merging IoT devices with a smart digital platform, our system enables one to monitor
significant health markers such as heart rate, SpO2 levels, and body temperature remotely and
in real time. Patients can take charge of monitoring their own health at home, while physicians
receive precise, current information to intervene early when necessary.
This not only enhances patient outcomes — it minimizes avoidable hospital stays and alleviates
the burden on healthcare systems as a whole.
Most of all, it empowers individuals. Rather than waiting until something really feels wrong,
individuals can be in control of their own health, detect warning signs early on, and create
healthier lives. And since the system operates from a distance, it breaks down geographical
barriers, making quality healthcare more accessible to all — regardless of where they reside.
At its heart, this project is propelled by a vision of a world in which technology bridges the gap
between doctors and patients — building a smarter, healthier, and more connected world.

1.3 Sustainable Development Goal (SDG) of the Project


Our IoT-Based Health Monitoring System has a direct linkage with the United Nations’
Sustainable Development Goal 3: Good Health and Well-Being.
By monitoring key vital signs such as heart rate, temperature, oxygen saturation, and blood
pressure around the clock, our system allows for the detection of emerging health problems
early on — before they become severe. This immediate monitoring allows doctors to react
sooner, emergencies to be avoided, and patients to become empowered by managing their own
health trends.
For those patients who reside in remote or underserved areas, the system is particularly

dominant. Rather than go a long way for check-ups, they are able to remain in touch with
medical professionals from their own homes, conserving time, money, and effort. This further
decongests hospitals, making them available for more critical or emergency cases.
In addition, the system is customized. Physicians are able to view the information for each
patient over time, providing individualized advice or treatment regimens that can adapt if
necessary. This customization results in improved health outcomes and fewer disparities in
access to healthcare.
Overall, our project works towards SDG 3 in the sense that it makes health care more
preventive, efficient, and inclusive. It’s bringing us closer to a world in which everyone – no
matter their location, earnings, or age – can have full control of their health and enjoy healthier
lives.

1.4 Product Vision Statement


1.4.1 Audience
Primary Audience:
Our system is primarily intended for patients requiring constant, real-time monitoring of their
health — particularly individuals with chronic conditions, the elderly, and those residing in
remote locations where frequent hospital visits are not always feasible.
Secondary Audience:
It also benefits healthcare professionals such as physicians, nurses, and medical personnel who
require immediate, accurate access to patient health information in order to make quicker, more
informed decisions regarding care.

1.4.2 Needs
Primary Needs:
Real-Time Health Monitoring:
Patients and doctors need a way to continuously track key vital signs like heart rate, oxygen
levels, body temperature, and blood pressure, around the clock.
Early Detection of Health Issues:
Immediate notification should inform patients and health professionals when something
abnormal is found so that quick action may be taken before complications arise.Remote
Healthcare Management:
Patients — particularly those who are distant from hospitals — ought to receive quality health
care from their homes, reducing the frequency of hospital visits.
3

Secondary Needs:
Easy Access to Data:
Doctors and patients must be able to access prior medical history easily, aiding in the
identification of patterns and improved long-term health choices.
Seamless Integration with Hospital Systems:
The platform must integrate well with healthcare systems such as hospital records and
electronic health records (EHRs) without requiring significant tweaking.
Simple, User-Friendly Design:
The system should be simple for all to use whether a tech-savvy physician or an older patient
so health tracking is easy and hassle-free.

1.4.3 Products
Core Product:
An Intelligent IoT-based health monitoring system that collects vital health information from
wearable devices such as smartwatches or sensors and sends it immediately to a secure platform
where doctors and patients can monitor it in real time.

Additional Features:
Health Data Insights:
The system

nalyses data collected to provide useful trends and insights, aiding improved

treatment decisions and lifestyle changes.


Emergency Alerts:
In case readings stray perilously off course, instant alerts will be sent to healthcare
professionals and emergency contacts.
Remote Monitoring Dashboard:
Physicians can monitor numerous patients simultaneously through a special dashboard,
enabling them to offer proactive care without requiring face-to-face consultations each time.
Patient Health History:
A concise, coherent timeline of the patient’s health information facilitates easier observation of
changes across time and early detection of problems.

4
1.4

Product Goal

The primary aim of the IoT-Based Health Monitoring System is to develop an intelligent,
secure, and simple healthcare platform that leverages the capabilities of IoT technology with
advanced healthcare management. Our aim is to develop a system that enhances the experience
for patients and healthcare providers alike, rendering healthcare more convenient, proactive,
and efficient.
One of the fundamental concepts behind the platform is ongoing health monitoring. Critical
signs such as heart rate, oxygen saturation (SpO2), body temperature, and other critical
indicators are monitored in real-time. This allows physicians to detect health problems early
and provide timely, customized treatments — possibly even before patients are aware that
anything’s amiss.Security is also high priority. The system employs role-based access control,
so that sensitive health data can only be seen by registered users (patients or physicians) to
safeguard privacy and maintain conformance with healthcare regulations.
In addition to health tracking, the platform simplifies day-to-day healthcare activities. Patients
can schedule, reschedule, or cancel appointments using an automated scheduling system
without having to endure long wait times or complex processes. Physicians also gain, with less
administrative burden and more time to devote to care.
One major way healthcare becomes simpler is by simple and intuitive data visualization.
Doctors and patients can see over time how health trends are progressing using intuitive
dashboards — simpler to monitor progress, detect warning signs early on, and make more
informed treatment decisions.
Another significant objective is ensuring that all patient information, such as electronic health
records (EHRs), is kept safely and is available quickly when necessary. This enhances care
continuity — patients and physicians are able to view the history to see the complete scenario
prior to progressing.
The platform’s power comes in the form of real-time integration of IoT sensors. Health sensors
at home and wearable devices all provide real-time data straight to the platform, providing
doctors with current information on which to base their diagnosis and advice — rather than
working off out-of-date checkup reports.

1.5

S.No

Product Backlog(Key User Stories with Desired Outcomes)

User Stories of IoT-Based Health Monitoring

Desired Outcome

System
#US 1

#US 2

As a patient, I want to securely register and log in so

Data privacy and secure

that my medical information remains private.

authentication

As a doctor, I want to view patient health metrics

Remote monitoring

remotely so that I can monitor conditions proactively.


#US 3
As a patient, I want to record and upload my biometric

IoT integration

readings using IoT devices.


#US 4

As a patient, I want to book appointments online at my

Appointment system

convenience.
#US 5

As a doctor, I want to manage appointment slots and

Doctor schedule management

confirm bookings.
#US 6

As an admin, I want to manage user accounts,

Full administrative control

appointments, and system logs.


#US 7

As a patient, I want reminders for upcoming


appointments.

Table 1.2 UserStories

Improved patient engagement

Figure 1.1 MS Planner Board of IoT-Based Health Monitoring System

1.7 Product Release Plan

Figure 1.2 Release plan of IoT-Based Health Monitoring System

CHAPTER 2
SPRINT PLANNING AND EXECUTION
2.1 Sprint 1
2.1.1 Sprint Goal
Develop a secure Login, Registration, Update Profile, and Logout system for both doctors
and patients in MedConnect.

Table 2.1 Detailed User Stories of sprint 1


ID As a...
US1 Patient
US2 Doctor
US3 Patient
US4 Doctor
User
(Doctor/Patient)
User
US6
(Doctor/Patient)
US5

I want to...
So that...
I can access my dashboard
Register an account
securely
Register an account I can monitor patient information
Login to my
Access my health data safely
account
Login to my
View patient list safely
account

Priority

Update my profile

Keep my information accurate

Medium

Logout securely

Protect my account

High

High
High
High
High

Planner Board representation of user stories are mentioned below figures 2.1,2.2 and 2.3

Figure 2.1 user story for user registration(Doctor)

Figure 2.2 user story for user registration(patient)

10

Figure 2.3 User story for login to dashboard

11

2.1.2 Functional Document


2.1.2.1. Introduction
MedConnect project is a health monitoring system aimed at building a secure and effective
interaction between patients and physicians.Sprint 1 is concerned with establishing the central
authentication system that allows users (physicians and patients) to securely register, login,
profile update, and logout.This platform is important in handling health records, real-time
monitoring, and individualized care in future sprints.
2.1.2.2. Product Goal
The main objective of Sprint 1 is to develop a secure profile management and authentication
system that supports:
• Safe and frictionless user registration (patient/doctor registration).
• Authenticate user for various roles.
• Simple profile updates to keep up-to-date contact information.
• Implement secure logout functionality to safeguard user sessions and sensitive information.
2.1.2.3. Demography (Users, Location)
Users:

Target Users:
o

no Patients looking to track their health and interact with physicians.

no Physicians handling patient data and health metrics.

User Characteristics:
o

Patients: Non-tech users requiring easy and straightforward login/registration


functionality.

Doctors: Professionals who need fast, secure access to patient dashboards.

Location:

Target Location:
o

Initially India and comparable emerging economies where affordable,


accessible digital healthcare platforms are necessary.

Subsequently scalable to global audiences with minimal changes.

2.1.2.4. Business Processes


The most important business processes are:
User Registration:

12

Patients and doctors register separately by furnishing corresponding personal details.

Profile Management:

Users can change their email, phone number, and password.

The data is updated in the database securely after authentication.

User Logout:

Users can log out, ending the session and maintaining data security.

2.1.2.5. Features
User Registration:

Patients and doctors register separately by furnishing corresponding personal details.

User Authentication:

Session management maintains secure and persistent login sessions.

Profile Management:

It allows users to change their email, phone number, and Name.

Data is safely updated in the database after validation.

User Logout:

Users can log out, ending the session and making data secure.

2.1.2.6. Authorization Matrix

Table 2.2 Access level Authorization Matrix

Role

Access Level

Administrator Full access to user data management (future sprint)


Doctor

Access to personal dashboard, patient data (future), and profile updates

Patient

Access to own dashboard, own health data (future), and profile updates

Guest

Only access to Login and Registration pages

13

2.1.2.7. Assumptions

Valid and honest registration information will be entered by the users.

Passwords will be stored safely (encrypted storage implementation scheduled in


subsequent sprint).

Phone numbers and email IDs will be usernames as well as unique identifiers.

Secure login sessions will be maintained using standard PHP session management.

Users have good internet connectivity during login/registration activities.

MySQL server is well configured and accessible for backend storage of data.

Adherence to general data protection laws such as GDPR will be taken into account in
the entire project (subsequent sprints).

2.1.3 Architecture Document


2.1.3.1 Application
Sprint 1 of the Project platform has a modular service-based architecture to maintain
authentication, user management, and session handling in separate entities for ease of
maintenance and scalability.
Though complete microservices are to be implemented in later sprints, Sprint 1 employs a
service-oriented modular architecture with an emphasis on:
Key Modules:
Authentication Service:
Handles secure login of users (username & password authentication), creation of sessions, and
invalidation of sessions (logout).
Registration Service:
Manages new sign-ups of doctors and patients, securely storing data in the MySQL database.
Profile Management Service:
Permits users to change profile data such as email address, phone number, and password upon
successful login.
Session Management Service:
Validates active sessions, avoids unauthorized access, and implements logout feature.

14

2.1.3.2 System Architecture-

Figure 2.4 System Architecture Diagram


2.1.3.3.
Data Exchange Contract:
Operation

Frequency

User Registration Real-time (API call at form submission)


User Login

Real-time (session validation at each login)

Profile Update

Real-time (instant database update)

User Logout

Real-time (session termination at logout click)

Data Sets:
Data Type
User

Fields
Data fullname,

Use Cases
email,

phone,

username, Registration, Login, Profile

(Doctor/Patient)

password, age/department
Session Data

user_id, session_token, timestamp

15

Update
Session

Management

(Login, Logout)

Mode of Exchanges:
Mode

Description

API (RESTful

Used for real-time communication between frontend forms and backend server

HTTP Calls)

APIs (Registration, Login, Update Profile, Logout).

Session

PHP Sessions (or Java Server Sessions) manage login states in real-time

Management

during user activity.

Database Queries

MySQL is accessed using JDBC (Java) or MySQLi/PDO (PHP) for data


insertion, retrieval, update, and deletion.

2.1.4 UI DESIGN

Figure 2.5 UI Design for Landing page

16

Figure 2.6 UI Design for Choose Role

Figure 2.7 UI design for Doctor login page

17

Figure 2.8 UI design for Doctor Signup page

Figure 2.9 UI design for Patient login page

18

Figure 2.10 UI design for Patient Registration page

2.1.5 Functional Test Cases

Figure 2.11 Detailed Functional Test Case(Sprint1)

19

2.1.6 Daily Call Progress


Date

Day

Focus Areas

12.02.2025

Wednesday

DB Setup, Registration Form UI

21.02.2025

Monday

Patient Registration API

3.03.2025

Monday

Doctor Registration, Login Auth

4.03.2024

Tuesday

Profile Update, Session Mgmt

5.03.2025

Wednesday

Testing, Bug Fixes

Table 2.3 Standup meetings(Sprint 1)

2.1.7 Committed Vs Completed User Stories

Figure 2.12 Bar graph for Committed Vs Completed User Stories(Sprint 1)

20

2.1.8 Sprint Retrospective


Liked
- Smooth
collaboration
between frontend
and backend teams.

Learned

Lacked

- Early stakeholder

- Detailed docs for

feedback improved

PHP session

- Automated testing tools


clarity of

management and

(e.g., PHPUnit) to catch

patient/doctor role

MySQLi security best

regressions faster.

flows.

practices.

- Daily stand-ups

- Modular code

kept everyone

structure eased

aligned on

debugging (e.g.,

blockers.

separating auth logic).

- Quick resolution

- Validating user

- Backup server for

of database

inputs early reduced

testing during

connection issues.

backend errors.

outages.

Longed For

- Time for peer code

- Dedicated UX review

reviews due to tight

sessions for

deadlines.

login/registration forms.

Table 2.8 Sprint Retrospective (Sprint 1)


21

streamline deployments,
making updates faster,
smoother, and more
reliable.

2.2 SPRINT 2
2.2.1 Sprint Goal
Implement patient health dashboard with real-time IoT data visualization and doctor-patient
interaction features.
Table 3.1 Detailed User Stories of sprint 2
User
Story ID

As a...

I want to...

View

my

So that...

glucose/pulse

US-07

Patient

US-08

Patient

US-09

Doctor

US-10

Doctor

US-11

Both

Send/receive secure messages

US-12

Admin

Manage user roles/permissions

readings in real-time charts

See

emergency

alerts

can
Priority

monitor

my

health trends

for

abnormal readings

I can take immediate


action

Filter patients by department

I can focus on my
specialty cases

View patient health history in

I can diagnose more

graphs

effectively

22

We can communicate
without delays

I can control system


access

High

Critical

High

High

Medium

Medium

Figure 3.1 User Story for View my glucose/pulse readings in real-time charts

23

Figure 3.2 User Story for Doctor:view patient

24

Figure 3.3 User Story (Doctor/Patient) send/Receive

25

2.2.2 Functional Document


2.2.2.1 Introduction
This sprint adds MedConnect with essential patient monitoring and collaboration features on
top of Sprint 1's authentication system. Top areas of focus are IoT data visualization, emergency
notifications, and secure messaging.
2.2.2.2 Product Goal

Provide real-time glucose/pulse monitoring with actionable insights

Enable doctor-patient communication within the platform

Offer department-specific patient management for doctors

2.2.2.3 Demography
User Type

Needs

Technical Proficiency

Patients

Real-time health tracking, emergency alerts

Low-medium

Doctors

Patient filtering, trend analysis

Medium-high

Admins

Role/permission management

High

2.2.2.4 Business Processes


1. Data Visualization Pipeline:
o

IoT Device → HTTP API → Database → Chart.js Dashboard

2. Alert Workflow:
o

Threshold breach → SMS/Email → Patient/Doctor Dashboard

3. Messaging Protocol:
o

WebSocket Connection → Encryption → Message Store

2.2.2.5 Features
Feature 1: Real-Time Health Dashboard

Description: Live charts displaying glucose/pulse trends with 5-minute refresh

User Story:

26

"As a patient, I want to see my glucose levels on interactive charts so I can track daily
patterns."

Technical Specs:
o

Chart.js with time-series formatting

WebSocket connection to ESP32 devices

Feature 2: Emergency Alert System


Description: Red-colored alerts for abnormal values (Red: Glucose > 180mg/dL)

User Story:

"As a doctor, I want to get immediate alerts when my patient's values go over thresholds so I
can take action in time."
Feature 3: Doctor Patient Filter

Description: Dropdown to filter patients by department (Cardiology/Neurology)

SQL Query Example: SELECT * FROM patients WHERE department = 'Cardiology';

2.2.2.6 Authorization Matrix


Role

Dashboard

Alerts

Messaging

Admin Panel

Patient

Full

Receive Only

Send/Receive

Denied

Doctor

Full

Send/Receive

Send/Receive

Denied
Admin

Read-Only

Denied

Denied

Full

Table 3.2 Access level Authorization Matrix(Sprint 2)

27

2.2.3 Architecture Document


2.2.3.1 Application
Microservices Expansion:
1. Dashboard Service (Node.js + Express)
o

Handles Chart.js data feeds via WebSocket

Endpoint: /api/v1/patient/:id/telemetry

2. Alert Engine (Python Flask)


o

Threshold evaluation every 5 minutes

Integrates Twilio SMS API (/alerts/trigger)

3. Messaging Service (Socket.io)


o

End-to-end encryption using AES-256

Message persistence in MySql

Figure 3.4 System Architecture Diagram(Sprint 2)

28

2.2.4 UI Design

Figure 3.5 UI Design for Doctor Dashboard

Figure 3.6 UI Design for Patient Dashboard

29

Figure 3.7 UI Design for to view Patient Data

2.2.5 Functional Test Cases

Figure 3.8 Detailed Functional Test Case(Sprint 2)

30

2.2.6 Daily Call Progress


Date

Day

8.03.2025

Saturday

9.03.2025

Sunday

11.03.2025

Tuesday

12.03.2025

Wednesday

Focus Areas

• WebSocket server setup (Node.js)


• Dashboard UI framework (React-Chart.js)

• Real-time glucose chart implementation


• Sql schema design for messages

• Department filter (SQL queries)

• Message read receipts


• Stress testing
Table 3.3 Standup meetings(Sprint 2)

2.2.7 COMMITTED Vs COMPLETED USER STORIES

Figure 3.9 Bar graph for Committed Vs Completed User Stories(Sprint 2)

31

2.2.8 Sprint Retrospective


Liked

Learned

- Seamless

- MongoDB reduced

WebSocket

message storage

- Only 68% edge-

integration (1.2s

time by 300% vs

case test coverage

avg latency)

MySQL

- Effective crossteam debugging


during DB
outage

Lacked

- Chart.js requires

- HIPAA review

Safari-specific -

delayed role

webkit prefixes

management

- Stakeholders

- Load testing

praised

revealed need for

dashboard

WebSocket

UI/UX

heartbeats

- No fallback for
IoT device
disconnections

Longed For

- Real-time performance
monitoring
(Prometheus/Grafana)

- Dedicated UX reviewer
for dashboard charts

- Legal team involvement


in early sprint planning

Table 3.4 Sprint Retrospective(Sprint 2)

32

2.3 Sprint 3
2.3.1 Sprint Goal with User Stories of Sprint 3
IoT Sensor Data Integration Connect ESP32 + Sensors, Show Real-Time Glucose/Pulse
Table 4.1 Detailed User Stories of sprint 3

ID

Role

User Story

Technical Acceptance
Criteria
Priority

US13

System

Integrate ESP32 with


glucose sensor

Readings update every 5min

Critical

US14

System

Add MAX30102 pulse


oximeter

SpO2 values within ±2% of


clinical reference

High

US15

Patient

View synchronized vitals

Combined glucose/pulse chart


with <1s refresh

High

US16

Engineer

Handle sensor failures

"Device Offline" alert after


10min timeout

Medium

33

Figure 4.1 user story System: Integrate ESP32 with Glucose Sensor

34

Figure 4.2 user story to Add MAX30102 Pulse Oximeter

35

Figure 4.3 user story to Patient: View Synchronized Vitals

36

2.3.2 Functional Document


2.3.2.1 Introduction
Enhances MedConnect's monitoring capabilities by:

Creating medical-grade sensor connectivity

Providing data accuracy and fault tolerance

Providing real-time multi-vital visualization

2.3.2.2 Product Goal


Obtain glucose and SpO2 accuracy compared to clinical devices

Keep <1s dashboard update latency

Enable 10-minute offline buffering

2.3.2.3 Demography
User Type

Needs

Technical Impact

Patients

Accurate real-time vitals

High-frequency data polling

Doctors

Trustworthy sensor data

Clinical validation requirements

Engineers

Device management

Fault recovery protocols

Table 4. 2 Demography(Sprint 3)

37

2.3.3 Architecture Document


2.3.3.1 System Architecture

Figure 4.4 System Architecture Diagram(Sprint 3)

38

2.3.4 UI Design

Figure 4.5 UI Design for To Book Appointment

39
2.3.5 Functional Test Cases

Figure 4.6 Detailed Functional Test Case(Sprint 3)

2.3.6 Daily Call Progress


Date

Day

18.03.2025

Tuesday

19.03.2025

Wednesday

20.03.2025

Thursday

Focus Areas

• WebSocket server setup (Node.js)


• Dashboard UI framework (React-Chart.js)

• Real-time glucose chart


• SQL schema for sensor data

• MAX30102 pulse oximeter integration


• Data validation service

Table 4.3 Standup meetings(Sprint 3)

40

2.3.7 Committed Vs Completed User Stories

Figure 4.7 Bar graph for Committed Vs Completed User Stories(Sprint 3)

2.3.8 Sprint Retrospective


Liked

Learned

Lacked

Longed For

Smooth ESP32-

MAX30102 requires

Clinical validation

Dedicated IoT

WiFi handoff

weekly recalibration

delays

QA specialist

Accurate glucose
SD cards corrupt after

readings (±2%)

100+ cycles

Collaborative
debugging sessions

Insufficient
Bluetooth
debugging tools

WebSocket reduces

No fallback for

latency by 60% vs

sensor conflicts

HTTP

Table 4.4 Sprint Retrospective(Sprint 3)

41

Hardware CI/CD
pipeline

Automated
calibration
system

2.4 Sprint 4
2.4.1 Sprint Goal with User Stories of Sprint 3
Finalize system polish, resolve critical bugs, and deploy MedConnect to
production
Table 5.1 Detailed User Stories of sprint 4
ID

US17

US18

US19

Role

System

Patient

Admin

User Story

Technical Acceptance Criteria

Deploy on XAMPP

All features work identically to dev

server
environment

Enhanced dashboard
UI

Monitor system
health

Priority

Critical

Load time <2s on 3G networks

High

Uptime >99.5% first 30 days

Medium

42

Figure 5.1 user story for System to Deploy on XAMPP Server

43

Figure 5.2 user story for Patient Enhanced Dashboard UI

44

2.4.2 Functional Document (Sprint 4)


2.4.2.1 Introduction
Completes MedConnect's production readiness by:

Defining hospital-grade deployment standards

Maximizing system performance for clinical environments

Enabling regulatory compliance and accessibility

2.4.2.2 Product Goal


Maintain 99.5% uptime in first month of production

Decrease dashboard load time to <2s on 3G networks

Pass all WCAG 2.1 AA accessibility tests

Have HIPAA-compliant audit trails

2.4.2.3 Demography
User Type

Needs
Technical Impact

Patients

Reliable 24/7 access

Load-balanced servers

Doctors

Fast report generation

PDF rendering optimizations

Administrators

System monitoring

Prometheus+Grafana integration

Engineers

Maintenance access

Automated backup systems

Table 5. 2 Demography(Sprint 4)

45

2.4.3 Architecture Document

Figure 5.3 Schema Design(Sprint 4)

2.4.4 UI Design

Figure 5.4 UI Design for view Trends

46

2.4.5 Functional Test Cases (Sprint 4)

Figure 5.5 Detailed Functional Test Case(Sprint 4)

2.4.6 Daily Call Progress


Date

Focus

Technical Outcome

15.04.25

Deployment Setup

Ansible playbooks validated

16.04.25

Load Testing

10 concurrent users

Table 5.3 Standup meetings(Sprint 4)


47

2.4.7 Committed vs Completed

Figure 5.6 Bar graph for Committed Vs Completed User Stories(Sprint 4)

2.4.8 Sprint Retrospective


Liked

Learned

Lacked

Longed For

Zero-downtime

Galera clustering

Detailed rollback

Kubernetes

deployments

needs 3+ nodes

playbooks

migration

1.8s 3G load

PDF generation

Audit log

Serverless PDF

performance

spikes CPU

compression

rendering

Table 5.4 Sprint Retrospective(Sprint 4)

48

CHAPTER 3
RESULTS AND DISCUSSION
3.1 Project Outcomes
The IoT-Based Health Monitoring System was successfully designed, developed, and
implemented, achieving its intended purpose of real-time monitoring of health through IoT
integration. A secure user authentication system was in place, with independent registration
and login features for doctors and patients and features like profile updates and secure logout
for data protection.
Patients were given an interactive dashboard that showed synchronized vital signs in dynamic
charts so they could track their health trends effectively. Doctors could also view patient history
graphs and filter patients by department to improve diagnosis and management. An emergency
alert system was included to notify users of abnormal readings immediately, providing
immediate action during critical moments.
The system was deployed on a local XAMPP server without any loss of functionality or
integrity with the development environment. Frontend performance optimization was done so
that dashboard pages were loaded in less than two seconds, even on slower 3G network
connections, hence enhancing accessibility and user experience. Server uptime monitoring was
also included, which ensured more than 99.5% availability in the initial phase of deployment.
The IoT-Based Health Monitoring System architecture was developed in a scalable way so that
it could be easily expanded later on with more sensors, extra features, and perhaps cloud
migration. Generally speaking, the project was successful in its objectives of providing a
secure, effective, and responsive system for real-time health monitoring.

49

3.2 Committed Vs Completed User stories


(SAMPLE)

Completed User stories


99
98
97
96

95
94
93
92
91
90
89
Sprint1

Sprint2

Sprint3

Sprint5

Series 1

Figure 6.1 Bar graph for Committed Vs Completed User Stories(Sprint 1-4)

50

CHAPTER 4
CONCLUSION & FUTURE ENHANCEMENTS
The IoT-Based Health Monitoring System development has successfully demonstrated the
capabilities of integrating IoT technology with healthcare services to provide uninterrupted,
real-time health monitoring and data management. By integrating a glucose sensor and a
MAX30102 pulse oximeter seamlessly with an ESP32 microcontroller, the system was able to
monitor critical health parameters such as blood glucose levels and pulse rates at periodic
intervals. Patients were given an easy-to-use dashboard through which they could track their
health status in real time, while physicians were given access to detailed patient profiles, health
trend history, and department-based filtering for improved patient management.
Security and usability were given importance during the development of the system. Secure
user registration, login authentication, profile modification, and logout features were
incorporated to make sure that patient and physician data was secure. In addition, the testing
on a local XAMPP environment enabled a consistent testing environment where all modules
were able to function smoothly, thus preserving the consistency across the development and
deployment phases. The system also effectively integrated emergency alert systems so that
users could be notified in time in the event of anomalous health readings, thereby averting
serious medical emergencies.
Although the system was successful in meeting its primary goals, a number of exciting avenues
for future development have been suggested. One of the initial enhancements would include
moving the platform from a local server environment to a cloud-based platform, providing
increased accessibility, higher scalability, real-time worldwide access, and enhanced disaster
recovery measures. Secondly, by including AI-driven predictive analytics, the system would
be able to track trends in patient data and predict emerging health risks prior to their worsening,
allowing for early interventions and tailored healthcare planning.
The other significant upgrade is the creation of a standalone mobile app for the Android and
iOS platforms. The app would give patients and physicians an easier method of using the
system's features, including real-time monitoring of health, secure messaging, and scheduling
of appointments. Most importantly, the mobile app would deliver instant alerts through push
notifications whenever critical health thresholds are crossed, ensuring faster response times and

51

potentially saving lives during emergencies. The inclusion of such mobile capabilities would
significantly increase the system's accessibility, user engagement, and responsiveness.
In addition, extending the system's hardware integration to encompass more biomedical
sensors, like temperature sensors, blood pressure sensors, and ECG sensors, would provide a
broader view of the patient's well-being. Real-time synchronization of several health
parameters could provide more precise diagnostics and more comprehensive medical insights.
The system could also include data visualization improvements, like enhanced health trend
analysis and forecasting charts, to help both doctors and patients make more informed
decisions.
In summary, the IoT-Based Health Monitoring System has set a solid and scalable foundation
for future healthcare technology innovation. With the integration of cloud services, mobile
apps, smart sensor integration, and AI-powered health analytics, the platform can potentially
grow into a completely intelligent health monitoring ecosystem that promotes preventive care,
enhances patient outcomes, and facilitates timely medical interventions.

52

APPENDIX
A. PATENT DISCLOSURE FORM

53

B. SAMPLE CODING
Source Code
Patient Dashboard.php
<?php
session_start();
if (!isset($_SESSION['patient_id'])) {
header("Location: patient-login.html");
exit();
}

require_once __DIR__ . '/includes/db_connection.php';

try {
// Fetch patient profile
$stmt = $conn->prepare("SELECT * FROM patients WHERE id = :id");
$stmt->bindParam(':id', $_SESSION['patient_id']);
$stmt->execute();
$patient = $stmt->fetch(PDO::FETCH_ASSOC);

if (!$patient) {
session_destroy();
header("Location: patient-login.html?error=patient_not_found");
exit();
}

// Handle profile update


if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_profile']))
{
$fullname = $_POST['fullname'];
$email = $_POST['email'];

54

$phone = $_POST['phone'];
$age = $_POST['age'];

$updateStmt = $conn->prepare("UPDATE patients SET fullname = :fullname, email =


:email, phone = :phone, age = :age WHERE id = :id");
$updateStmt->bindParam(':fullname', $fullname);
$updateStmt->bindParam(':email', $email);
$updateStmt->bindParam(':phone', $phone);
$updateStmt->bindParam(':age', $age);
$updateStmt->bindParam(':id', $_SESSION['patient_id']);
$updateStmt->execute();

// Refresh patient data


$stmt->execute();
$patient = $stmt->fetch(PDO::FETCH_ASSOC);
}

// Fetch latest health metrics


$stmt = $conn->prepare("
SELECT heart_rate, spo2, temperature, blood_pressure_sys, blood_pressure_dia,
recorded_at
FROM health_metrics
WHERE patient_id = :patient_id
ORDER BY recorded_at DESC
LIMIT 1
");
$stmt->bindParam(':patient_id', $_SESSION['patient_id']);
$stmt->execute();
$metrics = $stmt->fetch(PDO::FETCH_ASSOC);

// Fetch health metrics history (last 10 records)

55

$history_stmt = $conn->prepare("
SELECT heart_rate, spo2, temperature, blood_pressure_sys, blood_pressure_dia,
recorded_at
FROM health_metrics
WHERE patient_id = :patient_id
ORDER BY recorded_at DESC
LIMIT 10
");
$history_stmt->bindParam(':patient_id', $_SESSION['patient_id']);
$history_stmt->execute();
$metrics_history = $history_stmt->fetchAll(PDO::FETCH_ASSOC);

// Prepare data for Chart.js


$chart_labels = [];
$heart_rate_data = [];
$spo2_data = [];
$temperature_data = [];
$blood_pressure_sys_data = [];
$blood_pressure_dia_data = [];

foreach (array_reverse($metrics_history) as $record) {


$chart_labels[] = date("M j, H:i", strtotime($record['recorded_at']));
$heart_rate_data[] = $record['heart_rate'];
$spo2_data[] = $record['spo2'];
$temperature_data[] = $record['temperature'];
$blood_pressure_sys_data[] = $record['blood_pressure_sys'];
$blood_pressure_dia_data[] = $record['blood_pressure_dia'];
}

// Fetch doctor list

56

$doctors = $conn->query("SELECT id, fullname, department FROM doctors")>fetchAll(PDO::FETCH_ASSOC);

// Fetch patient appointments


$appt_stmt = $conn->prepare("
SELECT a.*, d.fullname AS doctor_name
FROM appointments a
JOIN doctors d ON a.doctor_id = d.id
WHERE a.patient_id = :patient_id
ORDER BY a.appointment_date DESC, a.appointment_time DESC
");
$appt_stmt->bindParam(':patient_id', $_SESSION['patient_id']);
$appt_stmt->execute();
$appointments = $appt_stmt->fetchAll(PDO::FETCH_ASSOC);

// Fetch prescriptions from patient_prescriptions


$presc_stmt = $conn->prepare("
SELECT pp.*, d.fullname AS doctor_name
FROM patient_prescriptions pp
JOIN doctors d ON pp.doctor_id = d.id
WHERE pp.patient_id = :patient_id
ORDER BY pp.created_at DESC
");
$presc_stmt->bindParam(':patient_id', $_SESSION['patient_id']);
$presc_stmt->execute();
$prescriptions = $presc_stmt->fetchAll(PDO::FETCH_ASSOC);

} catch (PDOException $e) {


die("Database error: " . $e->getMessage());
}
?>

57

<!DOCTYPE html>
<html>
<head>
<title>Patient Dashboard</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-
icons.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-light">
<div class="container py-5">
<!-- Updated Header with Profile Dropdown -->
<div class="d-flex justify-content-between align-items-center mb-4">
<h2>Welcome, <?= htmlspecialchars($patient['fullname']) ?></h2>
<div>
<button class="btn btn-primary me-2" data-bs-toggle="modal" data-bstarget="#updateProfileModal">
<i class="bi bi-pencil-square"></i> Edit Profile
</button>

<!-- Profile Dropdown -->


<div class="dropdown d-inline-block">
<button class="btn btn-outline-secondary dropdown-toggle" type="button"
id="profileDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person-circle"></i> <?= htmlspecialchars(explode(' ',
$patient['fullname'])[0]) ?>
</button>
<ul class="dropdown-menu dropdown-menu-end" arialabelledby="profileDropdown">
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bstarget="#viewProfileModal">

58

<i class="bi bi-eye"></i> View Profile


</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="logout.php">
<i class="bi bi-box-arrow-right"></i> Logout
</a></li>
</ul>
</div>
</div>
</div>

<!-- Health Metrics Display (unchanged) -->


<h4 class="mb-3">

Latest Health Metrics</h4>

<div class="row">
<div class="col-md-4 mb-3">
<div class="card text-white bg-danger">
<div class="card-body">
<h5 class="card-title">Heart Rate</h5>
<p class="card-text fs-4">

<?= $metrics['heart_rate'] ?? 'N/A' ?> BPM</p>

</div>
</div>
</div>
<div class="col-md-4 mb-3">
<div class="card text-white bg-info">
<div class="card-body">
<h5 class="card-title">SpO2 Level</h5>
<p class="card-text fs-4">

<?= $metrics['spo2'] ?? 'N/A' ?> %</p>

</div>
</div>
</div>

59

<div class="col-md-4 mb-3">


<div class="card text-white bg-warning">
<div class="card-body">
<h5 class="card-title">Temperature</h5>
<p class="card-text fs-4">

<?= $metrics['temperature'] ?? 'N/A' ?> °C</p>

</div>
</div>
</div>
<div class="col-md-4 mb-3">
<div class="card text-white bg-secondary">
<div class="card-body">
<h5 class="card-title">Blood Pressure</h5>
<p class="card-text fs-4">
<?= isset($metrics['blood_pressure_sys'], $metrics['blood_pressure_dia'])
? "{$metrics['blood_pressure_sys']}/{$metrics['blood_pressure_dia']}
mmHg"
: 'N/A' ?>
</p>
</div>
</div>
</div>
<div class="col-md-8 mb-3">
<div class="card border-primary">
<div class="card-body">
<h5 class="card-title">Last Updated</h5>
<p class="card-text">

<?= $metrics['recorded_at'] ?? 'No data available'

?></p>
</div>
</div>
</div>
</div>

60

<!-- Rest of the content remains unchanged -->


<div class="mb-4">
<a href="add-health.html" class="btn btn-outline-success me-2">
<i class="bi bi-plus-circle"></i> Add Health Data
</a>
</div>

<!-- Health Metrics History Graph -->


<div class="card mb-5">
<div class="card-header bg-primary text-white">
<h5 class="mb-0">

Health Metrics History (Last 10 Records)</h5>

</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<canvas id="healthMetricsChart" height="300"></canvas>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<canvas id="heartRateChart" height="200"></canvas>
</div>
<div class="col-md-6">
<canvas id="spo2Chart" height="200"></canvas>
</div>
</div>
</div>
</div>

61

<!-- Appointment Booking Form -->


<hr class="my-5">
<h4>

Book an Appointment</h4>

<form action="book_appointment.php" method="POST" class="row g-3">


<div class="col-md-6">
<label for="doctor_id" class="form-label">Select Doctor</label>
<select class="form-select" id="doctor_id" name="doctor_id" required>
<option value="">Choose a doctor</option>
<?php foreach ($doctors as $doc): ?>
<option value="<?= $doc['id'] ?>"><?= $doc['fullname'] ?> (<?=
$doc['department'] ?>)</option>
<?php endforeach; ?>
</select>
</div>

<div class="col-md-3">
<label for="appointment_date" class="form-label">Date</label>
<input type="date" class="form-control" name="appointment_date" required>
</div>

<div class="col-md-3">
<label for="appointment_time" class="form-label">Time</label>
<input type="time" class="form-control" name="appointment_time" required>
</div>

<div class="col-12">
<label for="notes" class="form-label">Notes (Optional)</label>
<textarea class="form-control" name="notes" rows="2"></textarea>
</div>

<div class="col-12">
62

<button type="submit" class="btn btn-primary">


<i class="bi bi-calendar-plus"></i> Book Appointment
</button>
</div>
</form>

<!-- Appointments Table -->


<hr class="my-5">
<h4>

Your Appointments</h4>

<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Doctor</th>
<th>Date</th>
<th>Time</th>
<th>Status</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php if ($appointments): foreach ($appointments as $appt): ?>
<tr>
<td><?= htmlspecialchars($appt['doctor_name']) ?></td>
<td><?= $appt['appointment_date'] ?></td>
<td><?= $appt['appointment_time'] ?></td>
<td>
<span class="badge bg-<?=
$appt['status'] === 'completed' ? 'success' :
($appt['status'] === 'cancelled' ? 'danger' : 'warning') ?>">

63

<?= ucfirst($appt['status']) ?>


</span>
</td>
<td><?= htmlspecialchars($appt['notes']) ?></td>
</tr>
<?php endforeach; else: ?>
<tr><td colspan="5" class="text-center">No appointments found.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>

<!-- Prescriptions Table -->


<hr class="my-5">
<h4>

Prescriptions</h4>

<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead class="table-light">
<tr>
<th>Doctor</th>
<th>Medication</th>
<th>Dosage</th>
<th>Instructions</th>
<th>Prescription Notes</th>
<th>Date Issued</th>
</tr>
</thead>
<tbody>
<?php if ($prescriptions): foreach ($prescriptions as $presc): ?>
<tr>

64

<td><?= htmlspecialchars($presc['doctor_name']) ?></td>


<td><?= htmlspecialchars($presc['medication'] ?? 'N/A') ?></td>
<td><?= htmlspecialchars($presc['dosage'] ?? 'N/A') ?></td>
<td><?= nl2br(htmlspecialchars($presc['instructions'] ?? 'N/A')) ?></td>
<td><?= nl2br(htmlspecialchars($presc['prescription'])) ?></td>
<td><?= date("d M Y, h:i A", strtotime($presc['created_at'])) ?></td>
</tr>
<?php endforeach; else: ?>
<tr><td colspan="6" class="text-center">No prescriptions found.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>

<!-- View Profile Modal (NEW) -->


<div class="modal fade" id="viewProfileModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Your Profile</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" arialabel="Close"></button>
</div>
<div class="modal-body">
<div class="text-center mb-4">
<div class="rounded-circle bg-primary d-inline-flex align-items-center justifycontent-center" style="width:
80px; height: 80px;">
<i class="bi bi-person-fill text-white" style="font-size: 2.5rem;"></i>
</div>
<h4 class="mt-3"><?= htmlspecialchars($patient['fullname']) ?></h4>

65

<p class="text-muted">Patient ID: <?= htmlspecialchars($patient['id']) ?></p>


</div>

<div class="row mb-3">


<div class="col-md-6">
<h6>Email</h6>
<p><?= htmlspecialchars($patient['email']) ?></p>
</div>
<div class="col-md-6">
<h6>Phone</h6>
<p><?= htmlspecialchars($patient['phone']) ?></p>
</div>
</div>

<div class="row">
<div class="col-md-6">
<h6>Age</h6>
<p><?= htmlspecialchars($patient['age']) ?></p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Close</button>
<button class="btn btn-primary" data-bs-toggle="modal" data-bstarget="#updateProfileModal" data-bs-
dismiss="modal">
<i class="bi bi-pencil-square"></i> Edit Profile
</button>
</div>
</div>
</div>

66

</div>

<!-- Edit Profile Modal (Existing) -->


<div class="modal fade" id="updateProfileModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<form method="POST" class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Update Profile</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" arialabel="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" name="update_profile" value="1" />
<div class="mb-3">
<label class="form-label">Full Name</label>
<input type="text" name="fullname" class="form-control" value="<?=
htmlspecialchars($patient['fullname']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Email</label>
<input type="email" name="email" class="form-control" value="<?=
htmlspecialchars($patient['email']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Phone</label>
<input type="text" name="phone" class="form-control" value="<?=
htmlspecialchars($patient['phone']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Age</label>
<input type="number" name="age" class="form-control" value="<?=
htmlspecialchars($patient['age']) ?>" required>

67

</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Health Metrics Chart
document.addEventListener('DOMContentLoaded', function() {
const ctx = document.getElementById('healthMetricsChart').getContext('2d');
const healthChart = new Chart(ctx, {
type: 'line',
data: {
labels: <?= json_encode($chart_labels) ?>,
datasets: [
{
label: 'Heart Rate (BPM)',
data: <?= json_encode($heart_rate_data) ?>,
borderColor: 'rgb(220, 53, 69)',
backgroundColor: 'rgba(220, 53, 69, 0.1)',
tension: 0.1,
yAxisID: 'y'
},
{

68

label: 'SpO2 (%)',


data: <?= json_encode($spo2_data) ?>,
borderColor: 'rgb(13, 110, 253)',
backgroundColor: 'rgba(13, 110, 253, 0.1)',
tension: 0.1,
yAxisID: 'y1'
},
{
label: 'Temperature (°C)',
data: <?= json_encode($temperature_data) ?>,
borderColor: 'rgb(255, 193, 7)',
backgroundColor: 'rgba(255, 193, 7, 0.1)',
tension: 0.1,
yAxisID: 'y2'
}
]
},
options: {
responsive: true,
interaction: {
mode: 'index',
intersect: false,
},
scales: {
y: {
type: 'linear',
display: true,
position: 'left',
title: {
display: true,

69

text: 'Heart Rate (BPM)'


}
},
y1: {
type: 'linear',
display: true,
position: 'right',
grid: {
drawOnChartArea: false,
},
title: {
display: true,
text: 'SpO2 (%)'
},
min: 90,
max: 100
},
y2: {
type: 'linear',
display: false,
position: 'right',
grid: {
drawOnChartArea: false,
},
title: {
display: true,
text: 'Temperature (°C)'
}
}
}

70

}
});

// Heart Rate Chart


const hrCtx = document.getElementById('heartRateChart').getContext('2d');
const hrChart = new Chart(hrCtx, {
type: 'line',
data: {
labels: <?= json_encode($chart_labels) ?>,
datasets: [{
label: 'Heart Rate (BPM)',
data: <?= json_encode($heart_rate_data) ?>,
borderColor: 'rgb(220, 53, 69)',
backgroundColor: 'rgba(220, 53, 69, 0.1)',
tension: 0.1,
fill: true
}]
},
options: {
responsive: true,
plugins: {
title: {
display: true,
text: 'Heart Rate Trend'
}
}
}
});

// SpO2 Chart

71

const spo2Ctx = document.getElementById('spo2Chart').getContext('2d');


const spo2Chart = new Chart(spo2Ctx, {
type: 'line',
data: {
labels: <?= json_encode($chart_labels) ?>,
datasets: [{
label: 'SpO2 (%)',
data: <?= json_encode($spo2_data) ?>,
borderColor: 'rgb(13, 110, 253)',
backgroundColor: 'rgba(13, 110, 253, 0.1)',
tension: 0.1,
fill: true
}]
},
options: {
responsive: true,
plugins: {
title: {
display: true,
text: 'Oxygen Saturation Trend'
}
},
scales: {
y: {
min: 90,
max: 100
}
}
}
});

72

});
</script>
</body>
</html>

Doctor Dashboard.php
<?php
session_start();
if (!isset($_SESSION['doctor_id'])) {
header("Location: doctor-login.html");
exit();
}

require_once __DIR__ . '/includes/db_connection.php';

try {
// Fetch doctor info
$stmt = $conn->prepare("SELECT * FROM doctors WHERE id = :id");
$stmt->bindParam(':id', $_SESSION['doctor_id']);
$stmt->execute();
$doctor = $stmt->fetch(PDO::FETCH_ASSOC);

if (!$doctor) {
session_destroy();
header("Location: doctor-login.html?error=not_found");
exit();
}

// Handle form submissions


if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['update_profile'])) {

73

$fullname = $_POST['fullname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$department = $_POST['department'];

$updateStmt = $conn->prepare("UPDATE doctors SET fullname = :fullname, email =


:email, phone = :phone, department = :department WHERE id = :id");
$updateStmt->bindParam(':fullname', $fullname);
$updateStmt->bindParam(':email', $email);
$updateStmt->bindParam(':phone', $phone);
$updateStmt->bindParam(':department', $department);
$updateStmt->bindParam(':id', $_SESSION['doctor_id']);
$updateStmt->execute();

// Refresh doctor data


$stmt->execute();
$doctor = $stmt->fetch(PDO::FETCH_ASSOC);
} elseif (isset($_POST['add_prescription'])) {
$patient_id = $_POST['patient_id'];
$appointment_id = $_POST['appointment_id'];
$prescription = $_POST['prescription'];
$medication = $_POST['medication'] ?? '';
$dosage = $_POST['dosage'] ?? '';
$instructions = $_POST['instructions'] ?? '';

$insertStmt = $conn->prepare("INSERT INTO patient_prescriptions


(doctor_id, patient_id, appointment_id, prescription, medication, dosage,
instructions)
VALUES (:doctor_id, :patient_id, :appointment_id, :prescription, :medication,
:dosage, :instructions)");
$insertStmt->bindParam(':doctor_id', $_SESSION['doctor_id']);

74

$insertStmt->bindParam(':patient_id', $patient_id);
$insertStmt->bindParam(':appointment_id', $appointment_id);
$insertStmt->bindParam(':prescription', $prescription);
$insertStmt->bindParam(':medication', $medication);
$insertStmt->bindParam(':dosage', $dosage);
$insertStmt->bindParam(':instructions', $instructions);
$insertStmt->execute();
} elseif (isset($_POST['update_status'])) {
$appointment_id = $_POST['appointment_id'];
$status = $_POST['status'];
$notes = $_POST['notes'] ?? '';

$updateStmt = $conn->prepare("UPDATE appointments SET status = :status, notes =


:notes WHERE id = :id AND doctor_id = :doctor_id");
$updateStmt->bindParam(':status', $status);
$updateStmt->bindParam(':notes', $notes);
$updateStmt->bindParam(':id', $appointment_id);
$updateStmt->bindParam(':doctor_id', $_SESSION['doctor_id']);
$updateStmt->execute();
}
}

// Count of patients
$stmt = $conn->prepare("SELECT COUNT(DISTINCT p.id) AS total FROM patients p
INNER JOIN appointments a ON a.patient_id = p.id WHERE a.doctor_id = :doc_id");
$stmt->bindParam(':doc_id', $_SESSION['doctor_id']);
$stmt->execute();
$patientCount = $stmt->fetch(PDO::FETCH_ASSOC)['total'];

// Fetch patients with latest health metrics


$stmt = $conn->prepare("

75

SELECT p.id, p.fullname, p.age, p.email, p.phone,


hm.heart_rate, hm.spo2, hm.temperature,
hm.blood_pressure_sys, hm.blood_pressure_dia, hm.recorded_at
FROM patients p
INNER JOIN appointments a ON a.patient_id = p.id
LEFT JOIN (
SELECT hm.*
FROM health_metrics hm
INNER JOIN (
SELECT patient_id, MAX(recorded_at) as max_time
FROM health_metrics
GROUP BY patient_id
) latest ON hm.patient_id = latest.patient_id AND hm.recorded_at = latest.max_time
) hm ON p.id = hm.patient_id
WHERE a.doctor_id = :doc_id
GROUP BY p.id
ORDER BY p.fullname
");
$stmt->bindParam(':doc_id', $_SESSION['doctor_id']);
$stmt->execute();
$patients = $stmt->fetchAll(PDO::FETCH_ASSOC);

// Fetch health history for each patient


foreach ($patients as &$patient) {
$stmt = $conn->prepare("
SELECT heart_rate, spo2, temperature, blood_pressure_sys, blood_pressure_dia,
recorded_at
FROM health_metrics
WHERE patient_id = :patient_id
AND recorded_at >= DATE_SUB(NOW(), INTERVAL 10 DAY)
ORDER BY recorded_at DESC

76

");
$stmt->bindParam(':patient_id', $patient['id']);
$stmt->execute();
$patient['health_history'] = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
unset($patient); // Break the reference

// Fetch all appointments with prescriptions


$stmt = $conn->prepare("
SELECT a.*, p.fullname AS patient_name,
(SELECT GROUP_CONCAT(pp.prescription SEPARATOR '|||')
FROM patient_prescriptions pp
WHERE pp.appointment_id = a.id
ORDER BY pp.created_at DESC) AS prescriptions
FROM appointments a
INNER JOIN patients p ON a.patient_id = p.id
WHERE a.doctor_id = :doc_id
ORDER BY a.appointment_date DESC, a.appointment_time DESC
");
$stmt->bindParam(':doc_id', $_SESSION['doctor_id']);
$stmt->execute();
$appointments = $stmt->fetchAll(PDO::FETCH_ASSOC);

} catch (PDOException $e) {


die("Database error: " . $e->getMessage());
}
?>

<!DOCTYPE html>
<html lang="en">

77

<head>
<meta charset="UTF-8">
<title>Doctor Dashboard - MedConnect</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-
icons.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.prescription-list { max-height: 150px; overflow-y: auto; }
.badge-completed { background-color: #28a745; }
.badge-pending { background-color: #ffc107; color: #212529; }
.badge-cancelled { background-color: #dc3545; }
.badge-accepted { background-color: #17a2b8; }
.prescription-card { border-left: 4px solid #0d6efd; margin-bottom: 10px; }
.status-dropdown { min-width: 120px; }
.profile-icon {
width: 36px; height: 36px; border-radius: 50%;
background-color: #0d6efd; color: white;
display: flex; align-items: center; justify-content: center;
font-weight: bold;
}
.health-metric-card { transition: transform 0.2s; }
.health-metric-card:hover { transform: translateY(-3px); }
.trend-btn { padding: 2px 8px; font-size: 0.8rem; }
.chart-container { height: 300px; }
</style>
</head>
<body class="bg-light">
<div class="container py-5">
<!-- Updated Header with Profile Dropdown -->

78

<div class="d-flex justify-content-between align-items-center mb-4">


<h2>Welcome, Dr. <?= htmlspecialchars($doctor['fullname']) ?> <small class="textmuted">(<?=
htmlspecialchars($doctor['department']) ?>)</small></h2>
<div>
<button class="btn btn-primary me-2" data-bs-toggle="modal" data-bstarget="#updateProfileModal">
<i class="bi bi-pencil-square"></i> Edit Profile
</button>

<div class="dropdown d-inline-block">


<button class="btn btn-outline-secondary dropdown-toggle d-flex align-items-center"
type="button" id="profileDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<div class="profile-icon me-2">
<?= strtoupper(substr($doctor['fullname'], 0, 1)) ?>
</div>
<?= htmlspecialchars(explode(' ', $doctor['fullname'])[0]) ?>
</button>
<ul class="dropdown-menu dropdown-menu-end" arialabelledby="profileDropdown">
<li><h6 class="dropdown-header">Dr. <?= htmlspecialchars($doctor['fullname'])
?></h6></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bstarget="#viewProfileModal">
<i class="bi bi-person-lines-fill"></i> View Profile
</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="logout.php">
<i class="bi bi-box-arrow-right"></i> Logout
</a></li>
</ul>
</div>

79

</div>
</div>

<!-- Stats Cards -->


<div class="row mb-4">
<div class="col-md-4">
<div class="card text-white bg-primary health-metric-card">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="card-title"><?= $patientCount ?></h5>
<p class="card-text">Patients Assigned</p>
</div>
<i class="bi bi-people-fill" style="font-size: 2rem;"></i>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card text-white bg-success health-metric-card">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="card-title"><?= count(array_filter($appointments, fn($a) => $a['status']
=== 'completed')) ?></h5>
<p class="card-text">Completed Appointments</p>
</div>
<i class="bi bi-check-circle-fill" style="font-size: 2rem;"></i>
</div>
</div>
</div>

80

</div>
<div class="col-md-4">
<div class="card text-white bg-warning health-metric-card">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="card-title"><?= count(array_filter($appointments, fn($a) => $a['status']
=== 'pending')) ?></h5>
<p class="card-text">Pending Appointments</p>
</div>
<i class="bi bi-clock-history" style="font-size: 2rem;"></i>
</div>
</div>
</div>
</div>
</div>

<!-- Patients Section -->


<div class="card mb-5">
<div class="card-header bg-primary text-white d-flex justify-content-between alignitems-center">
<h5 class="mb-0"><i class="bi bi-people-fill"></i> Your Patients & Health Data</h5>
<span class="badge bg-light text-dark"><?= count($patients) ?> Patients</span>
</div>
<div class="card-body">
<?php if (empty($patients)): ?>
<div class="alert alert-info">No patients found yet.</div>
<?php else: ?>
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead>

81

<tr>
<th>Patient</th>
<th>Contact</th>
<th>Health Metrics</th>
<th>Last Updated</th>
</tr>
</thead>
<tbody>
<?php foreach ($patients as $p): ?>
<tr>
<td>
<div class="d-flex align-items-center">
<div class="profile-icon me-3">
<?= strtoupper(substr($p['fullname'], 0, 1)) ?>
</div>
<div>
<strong><?= htmlspecialchars($p['fullname']) ?></strong>
<div class="text-muted small">Age: <?= htmlspecialchars($p['age'])
?></div>
</div>
</div>
</td>
<td>
<div><?= htmlspecialchars($p['email']) ?></div>
<div class="text-muted small"><?= htmlspecialchars($p['phone']) ?></div>
</td>
<td>
<div class="d-flex flex-wrap gap-2">
<?php if ($p['heart_rate']): ?>
<span class="badge bg-danger">HR: <?= $p['heart_rate'] ?? 'N/A' ?>
BPM</span>

82

<?php endif; ?>


<?php if ($p['spo2']): ?>
<span class="badge bg-info">SpO2: <?= $p['spo2'] ?? 'N/A' ?>%</span>
<?php endif; ?>
<?php if ($p['temperature']): ?>
<span class="badge bg-warning">Temp: <?= $p['temperature'] ?? 'N/A'
?>°C</span>
<?php endif; ?>
<?php if (isset($p['blood_pressure_sys'], $p['blood_pressure_dia'])): ?>
<span class="badge bg-secondary">BP: <?=
"{$p['blood_pressure_sys']}/{$p['blood_pressure_dia']}" ?></span>
<?php endif; ?>
</div>
</td>
<td>
<?= $p['recorded_at'] ? date("M j, Y H:i", strtotime($p['recorded_at'])) : 'N/A'
?>
<?php if (!empty($p['health_history'])): ?>
<button class="btn btn-sm btn-outline-primary trend-btn ms-2"
data-bs-toggle="modal"
data-bs-target="#healthTrendsModal"
data-patient-id="<?= $p['id'] ?>"
data-patient-name="<?= htmlspecialchars($p['fullname']) ?>">
<i class="bi bi-graph-up"></i> Trends
</button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

83

</div>
<?php endif; ?>
</div>
</div>

<!-- Appointments Section -->


<div class="card">
<div class="card-header bg-primary text-white d-flex justify-content-between alignitems-center">
<h5 class="mb-0"><i class="bi bi-calendar-check"></i> Patient Appointments</h5>
<span class="badge bg-light text-dark"><?= count($appointments) ?>
Appointments</span>
</div>
<div class="card-body">
<?php if (empty($appointments)): ?>
<div class="alert alert-info">No appointments scheduled yet.</div>
<?php else: ?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Patient</th>
<th>Date/Time</th>
<th>Status</th>
<th>Notes</th>
<th>Prescriptions</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($appointments as $appt): ?>

84

<tr>
<td>
<div class="d-flex align-items-center">
<div class="profile-icon me-3" style="background-color: #6c757d;">
<?= strtoupper(substr($appt['patient_name'], 0, 1)) ?>
</div>
<div>
<strong><?= htmlspecialchars($appt['patient_name']) ?></strong>
</div>
</div>
</td>
<td>
<?= date("M j, Y", strtotime($appt['appointment_date'])) ?>
<div class="text-muted small"><?= date("H:i",
strtotime($appt['appointment_time'])) ?></div>
</td>
<td>
<form method="POST" class="d-inline">
<input type="hidden" name="update_status" value="1">
<input type="hidden" name="appointment_id" value="<?= $appt['id'] ?>">
<select name="status" class="form-select status-dropdown"
onchange="this.form.submit()">
<option value="pending" <?= $appt['status'] === 'pending' ? 'selected' : ''
?>>Pending</option>
<option value="accepted" <?= $appt['status'] === 'accepted' ? 'selected' : ''
?>>Accepted</option>
<option value="completed" <?= $appt['status'] === 'completed' ? 'selected' : ''
?>>Completed</option>
<option value="cancelled" <?= $appt['status'] === 'cancelled' ? 'selected' : ''
?>>Cancelled</option>
</select>
</form>

85

</td>
<td>
<form method="POST">
<input type="hidden" name="update_status" value="1">
<input type="hidden" name="appointment_id" value="<?= $appt['id'] ?>">
<div class="input-group">
<input type="text" name="notes" class="form-control form-control-sm"
value="<?= htmlspecialchars($appt['notes'] ?? '') ?>" placeholder="Notes">
<button type="submit" class="btn btn-sm btn-outline-secondary">
<i class="bi bi-save"></i>
</button>
</div>
</form>
</td>
<td>
<?php if (!empty($appt['prescriptions'])): ?>
<div class="prescription-list">
<?php foreach (explode('|||', $appt['prescriptions']) as $prescription): ?>
<div class="prescription-card p-2 mb-2 bg-light small">
<?= nl2br(htmlspecialchars($prescription)) ?>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<span class="text-muted small">None</span>
<?php endif; ?>
</td>
<td>
<button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal"
data-bs-target="#addPrescriptionModal"
data-patient-id="<?= $appt['patient_id'] ?>"

86

data-patient-name="<?= htmlspecialchars($appt['patient_name']) ?>"


data-appointment-id="<?= $appt['id'] ?>">
<i class="bi bi-prescription"></i> Add Rx
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>

<!-- View Profile Modal -->


<div class="modal fade" id="viewProfileModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Doctor Profile</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="text-center mb-4">
<div class="profile-icon mx-auto" style="width: 100px; height: 100px; font-size:
3rem;">
<?= strtoupper(substr($doctor['fullname'], 0, 1)) ?>
</div>
<h3 class="mt-3">Dr. <?= htmlspecialchars($doctor['fullname']) ?></h3>

87
<p class="text-muted"><i class="bi bi-building"></i> <?=
htmlspecialchars($doctor['department']) ?> Department</p>
</div>

<div class="row mb-3">


<div class="col-md-6 mb-3">
<div class="card">
<div class="card-body">
<h6><i class="bi bi-envelope"></i> Email</h6>
<p><?= htmlspecialchars($doctor['email']) ?></p>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="card">
<div class="card-body">
<h6><i class="bi bi-telephone"></i> Phone</h6>
<p><?= htmlspecialchars($doctor['phone']) ?></p>
</div>
</div>
</div>
</div>

<div class="card">
<div class="card-body">
<h6><i class="bi bi-person-badge"></i> Doctor ID</h6>
<p><?= htmlspecialchars($doctor['id']) ?></p>
</div>
</div>
</div>
<div class="modal-footer">

88

<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Close</button>


<button class="btn btn-primary" data-bs-toggle="modal" data-bstarget="#updateProfileModal" data-bs-
dismiss="modal">
<i class="bi bi-pencil-square"></i> Edit Profile
</button>
</div>
</div>
</div>
</div>

<!-- Edit Profile Modal -->


<div class="modal fade" id="updateProfileModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<form method="POST" class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Update Profile</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" name="update_profile" value="1" />
<div class="mb-3">
<label class="form-label">Full Name</label>
<input type="text" name="fullname" class="form-control" value="<?=
htmlspecialchars($doctor['fullname']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Email</label>
<input type="email" name="email" class="form-control" value="<?=
htmlspecialchars($doctor['email']) ?>" required>
</div>
89

<div class="mb-3">
<label class="form-label">Phone</label>
<input type="text" name="phone" class="form-control" value="<?=
htmlspecialchars($doctor['phone']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Department</label>
<input type="text" name="department" class="form-control" value="<?=
htmlspecialchars($doctor['department']) ?>" required>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>

<!-- Add Prescription Modal -->


<div class="modal fade" id="addPrescriptionModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-lg">
<form method="POST" class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Prescription for <span id="patientName"></span></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" name="add_prescription" value="1" />
<input type="hidden" id="patientId" name="patient_id" value="" />

90

<input type="hidden" id="appointmentId" name="appointment_id" value="" />

<div class="row mb-3">


<div class="col-md-6">
<label class="form-label">Medication</label>
<input type="text" name="medication" class="form-control" placeholder="Enter
medication name">
</div>
<div class="col-md-6">
<label class="form-label">Dosage</label>
<input type="text" name="dosage" class="form-control" placeholder="e.g., 500mg,
1 tablet">
</div>
</div>

<div class="mb-3">
<label class="form-label">Instructions</label>
<textarea class="form-control" name="instructions" rows="2"
placeholder="Usage instructions (e.g., Take twice daily after
meals)"></textarea>
</div>

<div class="mb-3">
<label class="form-label">Full Prescription Details</label>
<textarea class="form-control" name="prescription" rows="5" required
placeholder="Enter complete prescription details including duration, refills,
etc."></textarea>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">
<i class="bi bi-prescription"></i> Save Prescription

91

</button>
<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>

<!-- Health Trends Modal -->


<div class="modal fade" id="healthTrendsModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Health Trends for <span
id="trendPatientName"></span></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="noDataMessage" class="alert alert-info d-none">
No health data available for this patient.
</div>
<div id="chartsContainer">
<div class="row">
<div class="col-md-6">
<div class="card mb-4">
<div class="card-header bg-danger text-white">
<h6 class="mb-0">Heart Rate (BPM)</h6>
</div>
<div class="card-body">
<div class="chart-container">

92

<canvas id="heartRateChart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card mb-4">
<div class="card-header bg-info text-white">
<h6 class="mb-0">SpO2 (%)</h6>
</div>
<div class="card-body">
<div class="chart-container">
<canvas id="spo2Chart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card mb-4">
<div class="card-header bg-warning text-dark">
<h6 class="mb-0">Temperature (°C)</h6>
</div>
<div class="card-body">
<div class="chart-container">
<canvas id="tempChart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-md-6">

93

<div class="card mb-4">


<div class="card-header bg-secondary text-white">
<h6 class="mb-0">Blood Pressure (mmHg)</h6>
</div>
<div class="card-body">
<div class="chart-container">
<canvas id="bpChart"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead class="table-light">
<tr>
<th>Date/Time</th>
<th>Heart Rate</th>
<th>SpO2</th>
<th>Temperature</th>
<th>Blood Pressure</th>
</tr>
</thead>
<tbody id="healthMetricsTableBody">
<!-- Data inserted by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>

94

<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bsdismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Set patient info when prescription modal is shown
document.getElementById('addPrescriptionModal').addEventListener('show.bs.modal',
function (event) {
const button = event.relatedTarget;
document.getElementById('patientId').value = button.getAttribute('data-patient-id');
document.getElementById('patientName').textContent = button.getAttribute('data-patientname');
document.getElementById('appointmentId').value = button.getAttribute('dataappointment-id');
});

// Add hover effects to health metric cards


document.querySelectorAll('.health-metric-card').forEach(card => {
card.addEventListener('mouseenter', () => {
card.style.boxShadow = '0 4px 8px rgba(0,0,0,0.1)';
});
card.addEventListener('mouseleave', () => {
card.style.boxShadow = '';
});
});

95

// Health Trends Modal Handler


document.getElementById('healthTrendsModal').addEventListener('show.bs.modal',
function(event) {
const button = event.relatedTarget;
const patientId = button.getAttribute('data-patient-id');
const patientName = button.getAttribute('data-patient-name');

document.getElementById('trendPatientName').textContent = patientName;

// Find the patient data


const patients = <?= json_encode($patients) ?>;
const patient = patients.find(p => parseInt(p.id) === parseInt(patientId));

if (!patient || !patient.health_history || patient.health_history.length === 0) {


document.getElementById('noDataMessage').classList.remove('d-none');
document.getElementById('chartsContainer').classList.add('d-none');
document.getElementById('healthMetricsTableBody').innerHTML =
'<tr><td colspan="5" class="text-center">No health data available</td></tr>';
return;
} else {
document.getElementById('noDataMessage').classList.add('d-none');
document.getElementById('chartsContainer').classList.remove('d-none');
}

const healthHistory = patient.health_history;

// Prepare data
const labels = healthHistory.map(entry => new Date(entry.recorded_at).toLocaleString());
const heartRates = healthHistory.map(entry => entry.heart_rate || null);
const spo2s = healthHistory.map(entry => entry.spo2 || null);
const temps = healthHistory.map(entry => entry.temperature || null);

96

const bpSys = healthHistory.map(entry => entry.blood_pressure_sys || null);


const bpDia = healthHistory.map(entry => entry.blood_pressure_dia || null);

// Update table
const tableBody = document.getElementById('healthMetricsTableBody');
tableBody.innerHTML = '';
healthHistory.forEach(entry => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${new Date(entry.recorded_at).toLocaleString()}</td>
<td>${entry.heart_rate || 'N/A'}</td>
<td>${entry.spo2 || 'N/A'}</td>
<td>${entry.temperature || 'N/A'}</td>
<td>${entry.blood_pressure_sys && entry.blood_pressure_dia
? `${entry.blood_pressure_sys}/${entry.blood_pressure_dia}`
: 'N/A'}</td>
`;
tableBody.appendChild(row);
});

// Initialize/Update charts
createChart('heartRateChart', 'Heart Rate', labels, heartRates, '#dc3545');
createChart('spo2Chart', 'SpO2', labels, spo2s, '#17a2b8');
createChart('tempChart', 'Temperature', labels, temps, '#ffc107');
createBPChart('bpChart', labels, bpSys, bpDia);
});

function createChart(canvasId, label, labels, data, color) {


const ctx = document.getElementById(canvasId).getContext('2d');
if (window[canvasId + 'Chart']) window[canvasId + 'Chart'].destroy();

97

window[canvasId + 'Chart'] = new Chart(ctx, {


type: 'line',
data: {
labels: labels,
datasets: [{
label: label,
data: data,
borderColor: color,
backgroundColor: color + '33',
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: { beginAtZero: false }
}
}
});
}

function createBPChart(canvasId, labels, sysData, diaData) {


const ctx = document.getElementById(canvasId).getContext('2d');
if (window.bpChart) window.bpChart.destroy();
window.bpChart = new Chart(ctx, {
type: 'line',
data: {

98

labels: labels,
datasets: [
{
label: 'Systolic',
data: sysData,
borderColor: '#6c757d',
backgroundColor: '#6c757d33',
tension: 0.3
},
{
label: 'Diastolic',
data: diaData,
borderColor: '#495057',
backgroundColor: '#49505733',
tension: 0.3
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: { beginAtZero: false }
}
}
});
}
</script>
</body>
</html>

99

100

C. PLAGIARISM REPORT

101

You might also like