0% found this document useful (0 votes)
9 views35 pages

APP REPORT For Java Pagenumber

The document is a minor project report titled 'Multi Encryption and Decryption Tool' by K. Tarun, K. Javali, and B. Mohit, under the guidance of Dr. Manickam.M, aimed at fulfilling course requirements in Advanced Programming Practice. It focuses on developing a Java-based healthcare application that integrates with MySQL databases to enhance user management and improve healthcare data accessibility. The report outlines the motivation, objectives, challenges, and requirements for creating a user-centric platform that streamlines patient-provider interactions and improves overall health management outcomes.
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)
9 views35 pages

APP REPORT For Java Pagenumber

The document is a minor project report titled 'Multi Encryption and Decryption Tool' by K. Tarun, K. Javali, and B. Mohit, under the guidance of Dr. Manickam.M, aimed at fulfilling course requirements in Advanced Programming Practice. It focuses on developing a Java-based healthcare application that integrates with MySQL databases to enhance user management and improve healthcare data accessibility. The report outlines the motivation, objectives, challenges, and requirements for creating a user-centric platform that streamlines patient-provider interactions and improves overall health management outcomes.
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/ 35

HEALTH AXIS

MINOR PROJECT REPORT

By

K.TARUN (RA2211031010104)
K.JAVALI (RA2211031010100)
B.MOHIT (RA2211031010109)

Under the guidance of

Dr. Manickam.M

In partial fulfilment for the Course

of

21CSC203P –ADVANCED PROGRAMMING PRACTICE

in Networking and Communications

FACULTY OF ENGINEERING AND TECHNOLOGY

SCHOOL OF COMPUTING

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

KATTANKULATHUR

NOVEMBER 2023
SRM INSTITUTE OF SCIENCE ANDTECHNOLOGY

(Under Section 3 of UGC Act, 1956)

BONAFIDE CERTIFICATE

Certified that this minor project report for the course 21CSC203P ADVANCED

PROGRAMMING PRACTICE entitled in "Multi Encryption and Decryption Tool

" is the bonafide work of K.Tarun (RA2211031010104) K.Javali (RA2211031010100)

,and B.Mohit (RA2211031010108) who carried out the work under my supervision.

SIGNATURE SIGNATURE

Dr. Manickam Dr. K Annapurani


Assistant Professor Head of Department
Department of networking and communication Department of networking and communication
SRM Institute of Science and Technology SRM Institute of science and technology
ABSTRACT

Creating Java-based healthcare applications relies on tight integration with MySQL databases for
seamless storage and retrieval of user data, prioritizing user management and ensuring efficient
delivery of healthcare research. This versatile application allows users to access personal content
that is synchronized between a local index and a centralized database, allowing them to seamlessly
navigate their health journey. Featuring an intuitive interface, the app simplifies health checks,
allowing users to easily review results and actively contribute to data collection. The core program
aims to streamline user interaction, collect comprehensive health-related data, and conduct in-depth
qualitative analysis. Through this data-driven approach, it strives to improve the landscape of
customer health management, promote informed decision-making and personal care, ultimately
improving overall health outcomes.
ACKNOWLEDGEMENT

We express our heartfelt thanks to our honorable Vice Chancellor Dr.


C. MUTHAMIZHCHELVAN, for being the beacon in all ourendeavors.

We would like to express my warmth of gratitude to our Registrar


Dr. S. Ponnusamy, for his encouragement.
We express our profound gratitude to our Dean (College of
Engineering and Technology) Dr. T. V.Gopal, for bringing out novelty in all
executions.
We would like to express my heartfelt thanks to Chairperson, School
of Computing Dr. Revathi Venkataraman, for imparting confidence to complete
my courseproject
We are highly thankful to our my Course project Faculty Dr.Manickam.M,Assistant
Professor , Department of Networking and Communications, School of Computing,
for hisassistance, timely suggestion and guidance throughout the duration of this
course project.
We extend my gratitude to our HoDDr.K.AnnapurniPaniyappan ,
Professor,Departmentof DepartmentofNetworking and Communications
,SRMInstituteofScienceandTechnology,and my Departmental colleagues for
theirSupport.

Finally, we thank our parents and friends near and dear ones who
directly and indirectly contributed to the successful completion of our project.
Above all, I thank the almighty for showering his blessings on me to complete
myCourseproject.
TABLE OF CONTENTS

CHAPTER NO CONTENTS PAGE NO

1 INTRODUCTION 1

1.1 Motivation 2

1.2 Objective 3

1.3 Problem Statement 4

1.4 Challenges 5

2 LITERATURE SURVEY 7

3 REQUIREMENT 8
ANALYSIS

4 ARCHITECTURE & 11
DESIGN

5 IMPLEMENTATION 15

6 EXPERIMENT RESULTS 26
& ANALYSIS

7 CONCLUSION 29

8 REFERENCES 30
1. INTRODUCTION

Health systems play an important role in the health of individuals and communities and form the basis
of the global society. As the demand for healthcare continues to grow and evolve, so does the need for
innovative solutions that transcend the limitations of traditional management systems. Promoting
health management is a turning point, and we remain committed to ushering in a new era of efficiency,
accessibility and accuracy of management. review medical records. The driving force behind this shift
is recognition of the many challenges that plague traditional healthcare systems, from complex manual
processes to communication between patients and doctors. The motivation to solve these problems has
led to the development of healthcare management systems that allow not only to store digital medical
records but also to store material for changes in treatment.

Underlying this bold move is a fundamental aim to redefine how medical information is captured,
stored and shared. The health management system strives to support patients by regularly providing
them with a better understanding of how to sign up for medical services, how to update personal
information, and how to provide written information. The system also aims to support doctors,
especially physicians, by providing them with the best tools and quality medical services so that they
can manage the patient effectively. By bridging the gap between patients and doctors, the system
envisions a future where communication is seamless, treatment is timely, and treatment is better. This
introductory chapter lays the groundwork for a detailed exploration of the motivations, goals, problem
statements, and challenges that make up the healthcare management narrative, setting the stage for
change in digital health.

1
1.1 MOTIVATION

Improving health care management is essential to correct the inefficiencies that are common in the
current health care system. Traditional approaches often struggle with manual processes that increase
the likelihood of human error and inefficiency. The healthcare management industry is embracing
this challenge and trying to lead the transformational change by adopting revolutionary technology
solutions for medical information management and access. The main goal is to simplify the
processing of patient data through an intuitive platform, ensuring accuracy, usefulness and quick
access. The ultimate desire is to revolutionize the healthcare paradigm by innovating the digital realm
of medical record management.

In healthcare management, emphasis is placed on improving operational efficiency and reducing


human error. Traditional manually developed systems face obstacles in maintaining optimal accuracy
and orderly processes. In response, healthcare management is seeking to take responsibility for
leveraging technological advances to transform the landscape of medical information management.
The key directive is to streamline patient data processing by providing an accessible, user-friendly
platform that ensures accuracy, relevance and quick access to critical data. This collaborative effort
aims to catalyze a major shift in the healthcare model by innovating the fabric of the digital medical
records management process.

The evolution of healthcare management depends on the inevitable combination of technology and
innovation. Public health systems often struggle with manually designed constraints, fostering an
environment prone to errors and inefficiencies. Recognizing this critical need for change, Healthcare
management plays a leading role in using technology solutions to update the image of medical
information management. Central to this initiative is the development of a user-centered platform
designed to streamline the processing of patient data, ensuring accuracy, relevance and timely access.
The ultimate desire is to change the framework of healthcare by creating a digital framework that
supports the management of medical records.

2
1.2 OBJECTIVE

The main goal of health management involves a multidimensional approach aimed at developing a
comprehensive, user-centric platform that enables seamless interaction between patients and healthcare
providers. Overall, it aims to develop a system that streamlines and improves the patient experience,
provides a better understanding of the registration process for medical services, makes personal content
updates, and simplifies access to drug information. This holistic approach seeks to improve the patient
journey by providing a smoother and more informed experience when interacting with healthcare
services.

At the same time, the system seeks to support healthcare professionals, especially doctors, by providing
reliable tools to optimize patient information, medication management and effective communication
channels. The focus is on empowering health care professionals with the resources they need to
streamline patient care, improve the organization of medical information, and develop more effective
communication channels. By equipping healthcare professionals with these advanced tools and
resources, the system aims to improve their ability to deliver high-quality healthcare while maintaining
high standards of patient care and information management.

By combining these various goals, the system seeks to create significant achievements in medical
information storage and health management. By aligning the functions of the patient center with tools
tailored to the needs of healthcare professionals, this innovative approach aims to redefine the standard
of access, accuracy and impartiality of medical information. Through this collaborative effort to
integrate patient empowerment and healthcare provider support, the system seeks to create a new
management paradigm, moving the healthcare management landscape to unprecedented levels of
efficiency, access and effectiveness.

3
1.3 PROBLEM STATEMENT

The evolution of healthcare management involves an in-depth study of the chronic challenges inherent
in traditional healthcare systems. The underlying problem is the reliance on error-prone and inefficient
manual procedures, leading to compromised standards of patient care. In addition, inherent limitations
in direct communication channels between patients and doctors impede timely delivery of treatment and
often impede optimal health outcomes. Inadequate access and dissemination of critical patient
information leads to vulnerability, resulting in delays in treatment and adverse effects on overall health.
As a result, the emerging system emerges as a powerful antidote to a future where healthcare
management is greatly improved, errors are reduced, and patient-physician communication becomes the
norm.

One of the main obstacles facing traditional healthcare management is the persistence of old manual
processes, which undermine the accuracy and efficiency of patient care processes. The lack of direct
lines of communication between patients and healthcare providers exacerbates this challenge and
prevents the rapid delivery of critical medical interventions. Furthermore, systemic deficiencies in rapid
access to comprehensive patient information continue to result in treatment delays and suboptimal health
care outcomes. In response to these fundamental issues, the system is a beacon of transformative change,
charting a trajectory across the healthcare landscape that leads to efficiencies, reduced errors, and
improved patient-physician communication.

A paradigm shift in healthcare management is defined by a critical breakdown of chronic problems


within the traditional healthcare framework. The prevalence of incorrect manual methodologies and
short patient-doctor communication channels hinder the optimization of healthcare services.
Furthermore, the labyrinthine process surrounding the patient's access to information negatively impacts
health outcomes by affecting timely intervention. In this case, the resulting system represents an
advanced vision of a patient-centered health care system that overcomes accuracy errors, integrates
seamless communication, and is a blueprint for excellent health management.

4
1.4 CHALLENGES

Designing and implementing healthcare management initiatives presents complex challenges that
require thoughtful and strategic solutions. Foremost among these obstacles is the need for strict
security measures. Protecting patient information through strict protocols and providing an
unbreakable communication channel makes for a win-win system. At the same time, the development
team tackles the challenge of creating a user interface that not only meets customer requirements, but
also leads to widespread acceptance among patients and professionals. Integration with existing
healthcare systems is increasingly integrated, requiring integrated solutions that facilitate continuous
change. In addition, adherence to strict administrative procedures and adherence to health regulations
are integral pillars to ensure the ethical and legal use of personal information. Addressing these
challenges is critical to the growth and prosperity of healthcare management.

The complex landscape of healthcare management is beset with many challenges that require careful
deliberation and strategic intervention. Chief among these barriers are mandatory security measures
defined by strong protection of patient data through secure authentication mechanisms and secure
communication channels. At the same time, development efforts tackle the difficult task of creating
a user interface that exceeds customer expectations and leads to widespread adoption among patients
and healthcare providers. The complex web of integration and the comprehensive healthcare system
creates additional demands that require an integrated solution that facilitates a seamless transition
while respecting the established framework. In addition, navigating the maze of compliance with
regulatory rules and administrative protocols emerges as a non-negotiable imperative to ensure ethical
and legal use of personal data. Overcoming these multifaceted challenges is an integral lynchpin,
heralding a transformative health landscape poised for success and sustainability.

The complex mosaic of healthcare governance design and implementation represents a labyrinthine
complex that requires thoughtful deliberation and strategic acumen. Foremost among these challenges
is the need to strengthen security measures, including stricter protection of patient data through
stronger authentication procedures and a secure communication framework. At the same time, the
development trajectory addresses the Herculean challenge of creating a user interface that not only
meets customer needs, but also encourages widespread adoption among patients and healthcare

5
professionals. The complex tapestry of seamless integration with the existing healthcare system
creates additional challenges, requiring an integrated solution that allows for a smooth transition
while respecting established practices. In addition, compliance with strict administrative protocols
and regulatory requirements appears to be an impossible negotiation to ensure fair and lawful use of
personal data. Addressing these complex challenges sets the trajectory for a high-level paradigm of
health governance evolution and implementation.

6
2. LITERATURE SURVEY

TITLE OF PAPER PUBLISHER YEAR APPROACH/ALGORITHM KEY FINDINGS

Hospital Taizhou Hospital did a Hospital


Management practice of HMI which Management
Innovation with Q. Hui, L. Guobo, W. based on the theory of Innovation
patient perceived Yaohui and C. Haixiao 2011 patient (HMI) is a
value process of
improving
medical service
quality
"Design of hospital L. Ren, X. Zhang, J. MVC model and the Oracle resource
beds center Wang, S. Tang and N. database management,
management Gong enabled
2017 interdisciplinary
collaboration
across
departments
service socialization Zheng Jiliang, Zhang Ya Service Management Yunnan
of public hospitals in and Wang Yuntian, (ICSSSM) province are
Yunnan province analyzed, and
the
countermeasures
and suggestions
2016 are put forward
finally
Management of I. Brown and A. Smale Capital Equipment The survey work
Medical Technology Management Plan to identify and
undertaken at a major document actual
equipment items
provides a
convincing
2007 argument for the
funding levels

7
3. REQUIREMENTS

The needs analysis phase in the development of health management is an important stage that requires
examining effective and ineffective work. It involves an in depth examination of the expectations and
needs of different stakeholders, from providers to end users. Understanding the complexity of
healthcare is important to develop a strategy that can be integrated with the various goals of healthcare
management.
3.1 Requirement Analysis

Requirements analysis is the basis of system development and is a complex process that requires caref
ul analysis of the functions and features required for effective management.Respect health. This requir
es consultation with stakeholders, including practitioners, managers and potential clients. It is importan
t to clearly define the specific functions that the system must support (such as accessing patient inform
ation, medication management, and appointment scheduling). In addition, a deep understanding of the
doctor's work and understanding of patients' expectations are important for the treatment process in ord
er to solve the difficult problems that exist in the treatment.

Additionally, requirements analysis goes beyond the direct needs of the system to reveal the potential f
or scalability and adaptability. The healthcare industry is dynamic; It is the scene of constant progress
and changing challenges. It is therefore important to pave the way for the future, to take into account f
uture needs in healthcare and to ensure that healthcare management is still a good and effective solutio
n that can adapt to the development of technology.
3.2 Hardware Requirement

The hardware system of health management is closely related to the operation, performance and securit
y of the system. Code snippets are delivered using systems in Java and Python and require an integrati
on environment that supports these programming languages. In the case of Java, the system relies on th
e Java Virtual Machine (JVM) to interpret and execute Java code, while Python applications require a
Python interpreter and necessary dependencies to be completed.

Beyond language dependencies, hardware features play an important role in ensuring optimum perfor
mance. Graphical user interfaces (GUIs) built with Java Swing and Tkinter in their applications require

8
a display environment that can support these GUI functions. This includes instructions with sufficient
resolution and color depth to accurately render graphic content and provide a consistent user experienc
e. Considering scalability and different use cases, the hardware must be capable of handling user
interactions effectively. This requires sufficient processing power and memory resources to efficiently
manage multiple users accessing and updating medical records simultaneously. Storage capacity is
another important factor to consider when permanently storing patient information. Robust solutions
such as a relational database management system (RDBMS) are essential for efficient data storage and
retrieval.

Additionally, considering the sensitivity of medical information processed by healthcare management,


security should be an important part of medical equipment. This includes the use of security controls, e
ncryption mechanisms, and compliance with industry standards for data protection. Ensuring the confi
dentiality and integrity of patient information is important, and hardware must be geared towards ensur
ing computer security.

Essentially, the hardware requirements of healthcare management define the foundation of the operatio
nal plan that supports the entire design. These requirements go beyond the necessary prerequisites of s
upporting Java and Python applications and delve into the complexity of system dynamics, aiming to c
reate an ecosystem that is not only based on assistance based on current needs, but will also evolve sea
mlessly with the dynamic environment of medical technology. An important aspect of optimization ref
lects the commitment to deliver responsiveness and efficiency, where hardware processing power and
memory resources are optimized to quickly maintain performance on complex tasks and data processin
g. The Scalability method assumes the greatest importance as the healthcare industry is dynamic in
nature and is characterized by constant progress and changing customer needs. Keeping future growth
and influx of more users in mind, the hardware infrastructure has been carefully designed to
accommodate an expanding user base without compromising performance. This visionary approach
ensures that the healthcare management system remains a solution that can adapt to the changing nature
of healthcare providers and overall healthcare systems.

Additionally, the need for security may extend beyond compliance; Demonstrates commitment to prote
cting the integrity and confidentiality of sensitive medical information. The hardware is hardened with
security measures, including access to security controls and encryption systems in accordance with ind

9
ustry standards and regulations. The best approach to data security is necessary to build trust between d
octors and patients, ensuring that health information is accurate and protected from unauthorized acces
s and damage.

HOW OUR SOFTWARE LOOKS LIKE:

10
4. ARCHITECTURE AND DESIGN

4.1 System Architecture:


System architecture of healthcare management refers to the careful consideration of the components and inter
actions that together form the backbone of the entire system. The architecture is envisioned as a modular and
scalable model that seamlessly integrates various modules, each dedicated to a specific function, ensuring co
hesion and efficiency in system operation. The core of the system has a service-
oriented architecture that encourages collaboration and facilitates integration with external systems or future
development.

The power of this model is demonstrated by the ability to control user interaction, data transfer and integratio
n of multiple interfaces, creating a variety of platforms that meet the different needs of doctors and patients.
4.2 Database Design:
Information design of health management is an important thing designed to carefully collect, store and mana
ge health-
related information with maximum efficiency and accuracy. Use the relational database model intelligently t
o link disparate data to provide structure and design. The design follows best practices and balances normaliz
ation to remove duplicates and denormalization to improve queries. Database design optimizes data retrieval
using indexing and contributes to all areas of the system. Additionally, the integrity of the data is important a
nd the design includes strong and valid parameters to ensure the accuracy and consistency of the stored data.
health_records:
record_id (Primary Key)
patient_id (Foreign Key referencing patients)age
gender
blood_group
symptoms
subscription_plan
prescription
users:
user_id (Primary Key)
username
password
appointments:

11
appointment_id (Primary Key)
patient_id (Foreign Key referencing patients)
appointment_date
appointment_time
doctors:
doctor_id (Primary Key)

username
password

medical_tests:
test_id (Primary Key)
test_name description

test_appointments:
appointment_id (Primary Key)
patient_id (Foreign Key referencing patients)
test_id (Foreign Key referencing medical_tests)
appointment_date
appointment_time

4.3 Class Design:

In the Java version, the class creates complex maps containing object- oriented representation of
system entities and functions. Each class encapsulates specific features and behaviors, creates a
model, and maintains a code base. The design supports the principles of reuse, flexibility, and ease
of understanding by following the principles of encapsulation, inheritance, and polymorphism.
Category hierarchies are organized hierarchically with relationships and progression, making it easier

12
to customize code and scalability. This design ensures that the Java version of health management is
not only a functional software application, but also a well-designed and well-designed solution to
improve the future.
4.4 Interaction Flow:

Interactive systems in healthcare management provide a smooth and seamless user experience by gu
iding the user through the system. The process starts with the user interface and continues with vari
ous modules and features, creating a harmonious journey for doctors and patients. From patient regi
stration to document creation, the interactive system is designed to be interactive and efficient, redu
cing technical complexity and improving overall usability. The concept creates a positive and helpf
ul user experience by incorporating feedback loops and error handling mechanisms to provide users
with clear directions and guidance throughout the interaction.

I. The user starts the health management application and triggers the main class to create a JFrame f
or its main interface.
2. Users can choose to log in as a patient or doctor.
3. If the user selects the patient option, they can choose to add a new patient, update an existing pati
ent record, or view a prescription. Contains GUI objects such as dialog boxes, buttons, text boxes, a
nd checkboxes.
4. When adding a new patient, the patient interacts with a powerful GUI to access personal informat
ion, select subscription plans, and submit content. The system processes the messages and stores the
m in PatientDetailsMap and PatientCredentialsMap.
5. If updating an existing patient record, the user interacts with the system via the GUI to confirm, s
elect the patient, change the details, and submit the changes. New information is stored in PatientDe
tailsMap.
6. In the View Medication option, the user interacts to confirm, select a patient, and view the medic
ation in the GUI window; Here they can do other things, like order a blood test or consult a doctor.
7. If the user selects their preferred provider, they will be asked to log in. Once the confirmation is c
ompleted, the doctor can select the patient from the available list and view their details.
8. Doctors can interact with the GUI to prescribe medications, and prescriptions are stored in patent
DetailsMap.
9. The system enables a social system and user interaction where the GUI component promotes effe
ctive communication between the user and health management. The following procedures enable us

13
ers to understand and update their data structures and ensure the security and integrity of their healt
h information.

14
5. IMPLEMENTATION

The Java implementation of the Health Management System is a testament to the power and versati
lity of the Java Swing framework. The main class, Main, orchestrates a graphical user interface (G
UI) through JFrame, setting the stage for an interactive and user- friendly health management
application. Leveraging Java's extensive standard library, the program seamlessly integrates with a
MySQL database to store patient details securely.
The initialization phase involves configuring the JDBC URL, username, and password, ensuring a r
obust connection to the database. The dynamic structure of the code caters to various database conf
igurations, promoting adaptability across diverse environments. The inclusion of the MySQL JDB
C driver solidifies the bridge between the Java application and the underlying database, facilitating
smooth data transactions.
The GUI itself, built using Java Swing components, exhibits a thoughtful layout with buttons and la
bels arranged in a flow that guides users intuitively. The ActionListener interface responds to user i
nteraction and triggers events to perform actions such as adding a patient, updating, and viewing th
e order. Using JOptionPane dialogs increases user engagement by providing information and feedb
ack throughout the application.
Patient-related functions are encapsulated in methods such as addNewPatient(),
changeExistingPatient() and viewPrescription(), demonstrating the modular design of the system.
The integration of radio buttons, text, and buttons in the GUI window demonstrates the richness of
Java Swing components. Additionally, the rules elegantly handle patient authentication to secure
access to patient details.
The doctor interface, accessed via the login dialog, opens a portal where doctors can interact with p
atient details. The doctor seen through JTextAreas and buttons can prescribe the medicine and influ
ence both aspects of the body through good communication with patients.

Using inner classes (such as PatientDetails) adds a layer of encapsulation that encapsulates the pati
ent's properties and methods within well-defined boundaries. Using lambda expressions in key
data generation facilitates the readability and simplicity of your code and adds to the overall elegan
ce.
In conclusion, the Java implementation of healthcare management proves the robustness and versat
ility of the Java programming language. Integration of Java Swing, JDBC, and core Java functions
results in an extended and effective application that puts users in control of their health.

15
CODE:
import javax.swing.*;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;

public class Main {


private static final Map<String, PatientDetails> patientDetailsMap = new HashMap<>();
private static final Map<String, String> patientCredentialsMap = new HashMap<>();
private static final String DOCTOR_USERNAME = "doctor";
private static final String DOCTOR_PASSWORD = "password";
private static final String JDBC_URL = "jdbc:mysql://localhost:3306/medical_system";
private static final String USERNAME = "root";
private static final String PASSWORD = "03091107";

public static void main(String[] args) {


JFrame frame = new JFrame("Medical Subscription System");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setSize(4000, 3000);
frame.setLayout(new BorderLayout());

JPanel centerPanel = new JPanel(new GridBagLayout());


frame.add(centerPanel, BorderLayout.CENTER);

JLabel label = new JLabel("Are you a patient or a doctor?");


label.setFont(new Font("Arial", Font.BOLD, 100));

GridBagConstraints labelConstraints = new GridBagConstraints();


labelConstraints.gridx = 0;
labelConstraints.gridy = 0;
labelConstraints.insets = new Insets(10, 10, 10, 10);
centerPanel.add(label, labelConstraints);

JButton patientButton = new JButton("Patient");


JButton doctorButton = new JButton("Doctor");
patientButton.setFont(new Font("Arial", Font.BOLD, 20));
doctorButton.setFont(new Font("Arial", Font.BOLD, 20));
Dimension buttonSize = new Dimension(200, 80);

patientButton.setPreferredSize(buttonSize);
doctorButton.setPreferredSize(buttonSize);

GridBagConstraints buttonConstraints = new GridBagConstraints();


buttonConstraints.gridx = 0;
buttonConstraints.gridy = 1;

16
buttonConstraints.insets = new Insets(10, 10, 10, 10);
centerPanel.add(patientButton, buttonConstraints);

buttonConstraints.gridy = 2;
centerPanel.add(doctorButton, buttonConstraints);

patientButton.addActionListener(e -> handlePatientAction(frame));


doctorButton.addActionListener(e -> showLoginDialog(frame));

frame.setLocationRelativeTo(null);
frame.setVisible(true);
}

private static void showNearbyHospitalsInMaps(PatientDetails patientDetails) {

double patientLat = 12.824714554411358;


double patientLng = 80.0452120243675;

String uri = "https://www.google.com/maps/search/hospitals/@" +


patientLat + "," + patientLng + ",15z";
try {
Desktop.getDesktop().browse(new URI(uri));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Failed to open the browser.");
}
}

private static void handlePatientAction(JFrame frame) {


String[] options = {"Add New Patient", "Modify Existing Patient", "View Prescription"};
int choice = JOptionPane.showOptionDialog(frame, "Choose an option:", "Patient Interface",
JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);

switch (choice) {
case 0 -> addNewPatient();
case 1 -> modifyExistingPatient();
case 2 -> viewPrescription();
}
}

private static void addNewPatient() {


JFrame patientFrame = new JFrame("Patient Subscription");
patientFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();


patientFrame.setSize(screenSize.width, screenSize.height);
patientFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
patientFrame.setUndecorated(true);

patientFrame.setLayout(new GridBagLayout());

GridBagConstraints gbc = new GridBagConstraints();


gbc.insets = new Insets(5, 5, 5, 5);
gbc.anchor = GridBagConstraints.WEST;

JLabel subscriptionLabel = new JLabel("Choose a subscription plan:");

17
gbc.gridx = 0;
gbc.gridy = 0;
patientFrame.add(subscriptionLabel, gbc);

JRadioButton plan1Button = new JRadioButton("Doctor Consultation");


JRadioButton plan2Button = new JRadioButton("Doctor Consultation + Blood Tests");
ButtonGroup group = new ButtonGroup();
group.add(plan1Button);
group.add(plan2Button);
gbc.gridy++;
patientFrame.add(plan1Button, gbc);
gbc.gridy++;
patientFrame.add(plan2Button, gbc);

addLabelAndTextField(patientFrame, "Name:", gbc);


addLabelAndTextField(patientFrame, "Age:", gbc);
addLabelAndTextField(patientFrame, "Gender:", gbc);
addLabelAndTextField(patientFrame, "Blood Group:", gbc);
addLabelAndTextField(patientFrame, "Symptoms:", gbc);

JButton submitButton = new JButton("Submit");


gbc.gridy++;
gbc.gridx = 0;
gbc.gridwidth = 2;
patientFrame.add(submitButton, gbc);

submitButton.addActionListener(e -> {
String patientName = getTextFieldValue(patientFrame, "Name:");
String patientPassword = JOptionPane.showInputDialog("Create a password for the patient:");
patientCredentialsMap.put(patientName, patientPassword);

PatientDetails patientDetails = new PatientDetails(


getTextFieldValue(patientFrame, "Age:"),
getTextFieldValue(patientFrame, "Gender:"),
getTextFieldValue(patientFrame, "Blood Group:"),
getTextFieldValue(patientFrame, "Symptoms:"),
plan1Button.isSelected() ? "Doctor Consultation" : "Doctor Consultation + Blood Tests"
);
patientDetailsMap.put(patientName, patientDetails);
JOptionPane.showMessageDialog(null, "Details stored successfully!");
patientFrame.dispose();
});

patientFrame.setVisible(true);
}

private static void modifyExistingPatient() {


if (patientDetailsMap.isEmpty()) {
JOptionPane.showMessageDialog(null, "No existing patients to modify.");
} else {
String patientName = authenticatePatient();
if (patientName != null) {
PatientDetails patientDetails = patientDetailsMap.get(patientName);

JFrame modifyFrame = new JFrame("Modify Patient Details");


modifyFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

18
modifyFrame.setSize(400, 400);
modifyFrame.setLayout(new GridBagLayout());

GridBagConstraints gbc = new GridBagConstraints();


gbc.insets = new Insets(5, 5, 5, 5);
gbc.anchor = GridBagConstraints.WEST;

JLabel subscriptionLabel = new JLabel("Choose a subscription plan:");


gbc.gridx = 0;
gbc.gridy = 0;
modifyFrame.add(subscriptionLabel, gbc);

JRadioButton plan1Button = new JRadioButton("Doctor Consultation");


JRadioButton plan2Button = new JRadioButton("Doctor Consultation + Blood Tests");
ButtonGroup group = new ButtonGroup();
group.add(plan1Button);
group.add(plan2Button);
gbc.gridy++;
modifyFrame.add(plan1Button, gbc);
gbc.gridy++;
modifyFrame.add(plan2Button, gbc);

setTextFieldValue(modifyFrame, "Name:", patientName, gbc);


setTextFieldValue(modifyFrame, "Age:", patientDetails.getAge(), gbc);
setTextFieldValue(modifyFrame, "Gender:", patientDetails.getGender(), gbc);
setTextFieldValue(modifyFrame, "Blood Group:", patientDetails.getBloodGroup(), gbc);
setTextFieldValue(modifyFrame, "Symptoms:", patientDetails.getSymptoms(), gbc);

JButton submitButton = new JButton("Submit");


gbc.gridy++;
gbc.gridx = 0;
gbc.gridwidth = 2;
modifyFrame.add(submitButton, gbc);

submitButton.addActionListener(e -> {
PatientDetails updatedDetails = new PatientDetails(
getTextFieldValue(modifyFrame, "Age:"),
getTextFieldValue(modifyFrame, "Gender:"),
getTextFieldValue(modifyFrame, "Blood Group:"),
getTextFieldValue(modifyFrame, "Symptoms:"),
plan1Button.isSelected() ? "Doctor Consultation" : "Doctor Consultation + Blood Tests"
);
patientDetailsMap.put(patientName, updatedDetails);
JOptionPane.showMessageDialog(null, "Details updated successfully!");
modifyFrame.dispose();
});

modifyFrame.setVisible(true);
}
}
}

private static void viewPrescription() {


if (patientDetailsMap.isEmpty()) {
JOptionPane.showMessageDialog(null, "No existing patients to view prescription.");
} else {

19
String patientName = authenticatePatient();
if (patientName != null) {
PatientDetails patientDetails = patientDetailsMap.get(patientName);

JFrame prescriptionFrame = new JFrame("View Prescription");


prescriptionFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
prescriptionFrame.setSize(400, 300);
prescriptionFrame.setLayout(new FlowLayout());
prescriptionFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); // Maximizes the frame to
full screen
JTextArea prescriptionTextArea = new JTextArea(10, 30);
prescriptionTextArea.setEditable(false);
prescriptionTextArea.setText("Prescription for " + patientName + ":\n" +
patientDetails.getPrescription()
);

JButton bloodTestButton = new JButton("Book Blood Test");


JButton callDoctorButton = new JButton("Call Doctor");
JButton callAmbulanceButton = new JButton("Call Ambulance");

JButton nearbyHospitalsButton = new JButton("Nearby Hospitals");


prescriptionFrame.add(nearbyHospitalsButton);

nearbyHospitalsButton.addActionListener(e -> showNearbyHospitalsInMaps(patientDetails));

prescriptionFrame.add(prescriptionTextArea);
prescriptionFrame.add(bloodTestButton);
prescriptionFrame.add(callDoctorButton);
prescriptionFrame.add(callAmbulanceButton);

bloodTestButton.addActionListener(e -> {
String[] timeSlots = {"9:00 AM", "11:00 AM", "2:00 PM", "4:00 PM"};
String selectedSlot = (String) JOptionPane.showInputDialog(
prescriptionFrame,
"Select a time slot for the blood test:",
"Book Blood Test",
JOptionPane.QUESTION_MESSAGE,
null,
timeSlots,
timeSlots.length > 0 ? timeSlots[0] : null
);

if (selectedSlot != null) {
JOptionPane.showMessageDialog(null, "Blood test appointment booked for " +
selectedSlot + "!");
}
});

callDoctorButton.addActionListener(e ->
JOptionPane.showMessageDialog(null, "Call the doctor at: 123-456-7890"));

callAmbulanceButton.addActionListener(e ->
JOptionPane.showMessageDialog(null, "Ambulance on the way!"));

prescriptionFrame.setVisible(true);
}

20
}
}

private static String authenticatePatient() {


String patientName = JOptionPane.showInputDialog("Enter patient name:");
if (patientCredentialsMap.containsKey(patientName)) {
String enteredPassword = JOptionPane.showInputDialog("Enter patient password:");
String correctPassword = patientCredentialsMap.get(patientName);
if (enteredPassword.equals(correctPassword)) {
return patientName;
} else {
JOptionPane.showMessageDialog(null, "Incorrect password. Access denied.");
return null;
}
} else {
JOptionPane.showMessageDialog(null, "Patient not found. Access denied.");
return null;
}
}

private static void showLoginDialog(JFrame frame) {


JTextField usernameField = new JTextField(10);
JPasswordField passwordField = new JPasswordField(10);

JPanel loginPanel = new JPanel();


loginPanel.add(new JLabel("Username:"));
loginPanel.add(usernameField);
loginPanel.add(new JLabel("Password:"));
loginPanel.add(passwordField);

int result = JOptionPane.showConfirmDialog(null, loginPanel, "Doctor Login",


JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {
String username = usernameField.getText();
char[] passwordChars = passwordField.getPassword();
String password = new String(passwordChars);

if (isDoctor(username, password)) {
openDoctorPortal(frame);
} else {
JOptionPane.showMessageDialog(null, "Invalid username or password. Access denied.");
}

usernameField.setText("");
passwordField.setText("");
}
}

private static boolean isDoctor(String username, String password) {


return DOCTOR_USERNAME.equals(username) && DOCTOR_PASSWORD.equals(password);
}

private static void openDoctorPortal(JFrame frame) {


if (patientDetailsMap.isEmpty()) {
JOptionPane.showMessageDialog(null, "No patients available.");

21
} else {
String[] patients = patientDetailsMap.keySet().toArray(new String[0]);
String selectedPatient = (String) JOptionPane.showInputDialog(
frame,
"Select a patient:",
"Doctor Interface",
JOptionPane.QUESTION_MESSAGE,
null,
patients,
patients.length > 0 ? patients[0] : null
);

if (selectedPatient != null) {
displayPatientDetails(selectedPatient);
}
}
}

private static void displayPatientDetails(String selectedPatient) {


PatientDetails patientDetails = patientDetailsMap.get(selectedPatient);

JFrame doctorFrame = new JFrame("Doctor Portal");


doctorFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
doctorFrame.setSize(400, 300);
doctorFrame.setLayout(new FlowLayout());
doctorFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); // Maximizes the frame to full screen
JTextArea patientDetailsTextArea = new JTextArea(10, 30);
patientDetailsTextArea.setEditable(false);
patientDetailsTextArea.setText("Patient Details for " + selectedPatient + ":\n" +
"Age: " + patientDetails.getAge() + "\n" +
"Gender: " + patientDetails.getGender() + "\n" +
"Blood Group: " + patientDetails.getBloodGroup() + "\n" +
"Symptoms: " + patientDetails.getSymptoms() + "\n" +
"Subscription Plan: " + patientDetails.getSubscriptionPlan()
);

JTextArea prescriptionTextArea = new JTextArea(10, 30);


JScrollPane scrollPane = new JScrollPane(prescriptionTextArea);

JButton prescribeButton = new JButton("Prescribe Medication");


doctorFrame.add(patientDetailsTextArea);
doctorFrame.add(new JLabel("Prescription:"));
doctorFrame.add(scrollPane);
doctorFrame.add(prescribeButton);

prescribeButton.addActionListener(e -> {
String prescription = JOptionPane.showInputDialog(
doctorFrame,
"Enter prescription:",
"Prescribe Medication",
JOptionPane.PLAIN_MESSAGE
);
patientDetails.setPrescription(prescription);
JOptionPane.showMessageDialog(null, "Prescription stored successfully!");
});

22
doctorFrame.setVisible(true);
}

private void createPatientsTable() {


try {
Connection connection = DriverManager.getConnection(JDBC_URL, USERNAME,
PASSWORD);
Statement statement = connection.createStatement();

String createTableQuery = "CREATE TABLE IF NOT EXISTS patients ("


+ "id INT AUTO_INCREMENT PRIMARY KEY,"
+ "name VARCHAR(100) NOT NULL,"
+ "age INT,"
+ "gender VARCHAR(10),"
+ "bloodGroup VARCHAR(10),"
+ "symptoms TEXT,"
+ "subscriptionPlan VARCHAR(100),"
+ "prescription TEXT"
+ ")";

statement.executeUpdate(createTableQuery);

statement.close();
connection.close();
} catch (SQLException ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, "Error creating 'patients' table: " + ex.getMessage());
}
}

private static class PatientDetails {


private String age;
private String gender;
private String bloodGroup;
private String symptoms;
private String subscriptionPlan;
private String prescription;

public PatientDetails(String age, String gender, String bloodGroup, String symptoms, String
subscriptionPlan) {
this.age = age;
this.gender = gender;
this.bloodGroup = bloodGroup;
this.symptoms = symptoms;
this.subscriptionPlan = subscriptionPlan;
this.prescription = "";
}

public String getAge() {


return age;
}

public String getGender() {


return gender;
}

23
public String getBloodGroup() {
return bloodGroup;
}

public String getSymptoms() {


return symptoms;
}

public String getSubscriptionPlan() {


return subscriptionPlan;
}

public String getPrescription() {


return prescription;
}

public void setPrescription(String prescription) {


this.prescription = prescription;
}
}

// Helper methods for setting and getting text field values


private static void addLabelAndTextField(JFrame frame, String labelText, GridBagConstraints gbc) {
gbc.gridx = 0;
gbc.gridy++;
frame.add(new JLabel(labelText), gbc);

gbc.gridx = 1;
JTextField textField = new JTextField(20);
textField.setPreferredSize(new Dimension(200, textField.getPreferredSize().height));

frame.add(textField, gbc);
}

private static String getTextFieldValue(JFrame frame, String labelText) {


Component[] components = frame.getContentPane().getComponents();
for (Component component : components) {
if (component instanceof JLabel && ((JLabel) component).getText().equals(labelText)) {
int index = frame.getContentPane().getComponentZOrder(component);
JTextField textField = (JTextField) frame.getContentPane().getComponent(index + 1);
return textField.getText();
}
}
return "";
}

private static void setTextFieldValue(JFrame frame, String labelText, String value, GridBagConstraints
gbc) {
gbc.gridx = 1;
Component[] components = frame.getContentPane().getComponents();
for (Component component : components) {
if (component instanceof JLabel && ((JLabel) component).getText().equals(labelText)) {
int index = frame.getContentPane().getComponentZOrder(component);
JTextField textField = (JTextField) frame.getContentPane().getComponent(index + 1);
textField.setText(value);

24
}
}
}
}

25
6. RESULTS
Main Frame (Main Screen):

This framework serves as the main interface for Medicine's subscription system.
It offers two options via buttons: "Patient" and "Doctor".
Based on the user's choice, it creates various functions related to the patient or doctor.

Patient Interface Framework:

It starts when you select the "Patience" button from the main frame.
It offers options to add new patients, edit details of existing patients or view prescriptions.
This option allows the user to interact with functions related to the patient.

Doctor's Introductory Lecture:

Asked when the Doctor button is selected from the main frame.
The doctor asks for a username and password to confirm.
After successful authentication, it allows you to access the doctor's portal.

Medical Portal Framework:

Access is possible after a successful medical examination.


Displays patient details for further selection and interaction.
Provide the ability to write prescriptions for selected patients.

26
Add a new patient frame:

Occurs when the option to add a new patient is selected from the patient interface.
Users can enter subscription plan, name, age, gender, etc. for new patients. allows you to enter
information such as

Change existing patient frames:

Subscription plans, personal information, etc. allows you to change patient details like

See the recipe frame:

27
It shows the patient's specific prescription, and schedules a blood test, calls a doctor or an
ambulance.
There is also a button to search for nearby hospitals on Google Maps based on the patient's location.
Dialog box (JOptionPane):

Used for login, validation, and error messages throughout the program.
It collects incorrect login or password information, successful transactions, etc. display warnings
such as

Database Interaction:

The code includes methods of interaction with the MySQL database, especially to create a table
('patient') to store patient data.
Each frame or dialog box has a specific purpose in the Medical Subscription System, allowing users
(patients or doctors) to perform various activities such as managing patient details, prescriptions,
appointments, and more.

28
7. CONCLUSION

The provided Java code includes a Swing component for the user interface and a Medical
Subscription System using MySQL for data storage. This integrated system includes a special
framework that facilitates interaction between patients and doctors. The design is structured to
allow patients to manage their subscriptions, change personal information and view prescriptions.
Meanwhile, doctors can access patient details to manage prescriptions.

The program begins with a basic framework that offers a clear choice between patient or physician
practice. Patient actions include adding new records, changing existing details and viewing
prescriptions, while the doctor portal allows you to create and manage prescriptions for specific
patients. This functionality is packaged between multiple frameworks, dialogs, and components
while maintaining a user-friendly interface.

In addition, the system implements a secure login mechanism for doctors, ensuring data
confidentiality. Using code to connect to the MySQL database increases scalability and allows
consistent storage of patient data. Frameworks such as "Add New Patient" and "Modify Existing
Patient" provide intuitive interfaces, improve user access and usability. The Prescription View
framework integrates functions such as blood chart scheduling and navigation to nearby hospitals
via Google Maps.

However, the system shows room for improvement. The code lacks robust error handling and
validation for user input, which can lead to unexpected behavior. In addition, improving database
interoperability for efficient data retrieval and management can strengthen security measures and
encrypt sensitive data.

Overall, this medical subscription system represents a basic framework for patient-physician
interaction. With further improvements in error handling, data security and database optimization,
it has the potential to become a reliable and secure solution for managing medical subscriptions and
patient-doctor interactions.

29
8. REFERENCES

 Brown and A. Smale, "Management of Medical Technology - Case Study of a Major Acute Hospital," 2007
29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Lyon,
France, 2007, pp. 1778-1781, doi: 10.1109/IEMBS.2007.4352656.
 L. Ren, X. Zhang, J. Wang, S. Tang and N. Gong, "Design of hospital beds center management
information system based on HIS," 2017 IEEE International Conference on Bioinformatics and
Biomedicine (BIBM), Kansas City, MO, USA, 2017, pp. 1093-1096, doi: 10.1109/BIBM.2017.8217808.
 Y. Guo et al., "A BIM Integrated Hospital Emergency Management Framework," 2018 IEEE 22nd
International Conference on Computer Supported Cooperative Work in Design ((CSCWD)), Nanjing,
China, 2018, pp. 677-682, doi: 10.1109/CSCWD.2018.8465274.
 Q. Hui, L. Guobo, W. Yaohui and C. Haixiao, "An exploration of Hospital Management Innovation with
patient perceived value: Based on the study in Taizhou Hospital of Zhejiang Province," 2011 International
Conference on Product Innovation Management (ICPIM 2011), Wuhan, China, 2011, pp. 108-111, doi:
10.1109/ICPIM.2011.5983612.

30

You might also like