Self Health Care System
Self Health Care System
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
Algorithm
SelfHealthCareSystem
2. User
1. Store user attributes like name, date of birth, email, phone number, address,
and password.
3. Hospital
4. Tablet
5. Appointment
User Login
3. If found, set the user as current user and mark as logged in; otherwise, prompt for retry.
User Registration
1. Collect user details (username, password, date of birth, email, phone number, address).
2. Create a new User object and add it to the registered users array.
Order Tablets
4. Collect user details (name, age, address, phone number) and ask for prescription
confirmation.
Book Appointment
View Appointments
import java.time.LocalDate;
public User(String username, LocalDate dateOfBirth, String email, String phoneNumber, String
city, String password) {
this.username = username;
this.dateOfBirth = dateOfBirth;
this.email = email;
this.phoneNumber = phoneNumber;
this.city = city;
this.password = password;
return username;
return password;
this.name = name;
this.address = address;
this.phoneNumber = phoneNumber;
return name;
return address;
return phoneNumber;
@Override
}
}
this.name = name;
this.price = price;
this.quantity = quantity;
return name;
return price;
return quantity;
this.quantity = quantity;
@Override
return name + " - Price: " + price + ", Available: " + quantity;
}
public Appointment(String patientName, int age, String phoneNumber, String date, String time,
String hospitalName) {
this.patientName = patientName;
this.age = age;
this.phoneNumber = phoneNumber;
this.date = date;
this.time = time;
this.hospitalName = hospitalName;
@Override
return "Appointment{" +
'}';
}
}
Output;
=====================================
=====================================
Main Menu:
1. Login
2. Register
3. Exit
Choose an option:2
Main Menu:
1. Login
2. Register
3. Exit
1.
Main Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. Logout
6. Exit
Choose an option:1
Available Hospitals:
User Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. ESIC Claim
6. Logout
7. Exit
Choose an option: 2
Available Tablets:
Enter Age: 21
Order confirmed! Prescription details have been shown to the delivery member.
User Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. ESIC Claim
6. Logout
7. Exit
Choose an option: 3
Booking an Appointment:
Enter Age: 21
Available Hospitals:
1. Hospital 1 - Address 1
2. Hospital 2 - Address 2
3. Hospital 3 - Address 3
Select a hospital (1-3): 1
User Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. ESIC Claim
6. Logout
7. Exit
Choose an option: 4
Your Appointments:
1.Patient Name: George, Age: 21, Phone: 9876543210, Date: 25/10/2024, Time: 10:00,
Hospital: Hospital 1
User Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. ESIC Claim
6. Logout
7. Exit
Choose an option: 5
User Menu:
2. Order Tablets
3. Book an Appointment
4. View Appointments
5. ESIC Claim
6. Logout
7. Exit
Choose an option: 7
Result; thus the java application to implement to implement the User, Hospital,
Tablet, Appointment, and the self healthcare system was implemented and executed
successfully
--------------------------------------------------------------------------------------------------------------------------------------