Siddhart Java Project KK
Siddhart Java Project KK
D. Y. PATIL POLYTECHNIC
MICRO PROJECT
Academic year: 2024 – 25
1|P a g e
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
Certificate
This is to certify that Mr. /Mrs. Siddhart Ravindra Naiknavre
satisfactorily in Subject Adv. Java Programming (22517) in the academic year 2024 -
Head of
Institute
2|P a g e
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
Certificate
This is to certify that Mr. /Mrs. Kanchan subhash Chaugule
satisfactorily in Subject Adv. Java Programming (22517) in the academic year 2024 -
Certificate
This is to certify that Mr. /Mrs. Ashish Namdev kshirsagar
satisfactorily in Subject Adv. Java Programming (22517) in the academic year 2024 -
Head Of
Institute
5
INDEX:
1 Abstract 02
2 Introduction 03
8 Conclusion 17
10 Annexure II 25
1
Abstract of Hospital Management System:
In this technical world, humans are trying to convert manual processes into
automation to save time and money. The hospital Management system is a
solution for hospitals. To manage many employees who are working with doctors,
nurses, and staff members.
This application is a web platform to handle and manage all the activity and
maintain and centralize a database of information that will be easily available with
just one click on the web.
The main objective to develop a Hospital management system in Java is to
manage the hospital activity online. There will be Three main Actors or Users of
the application 1) doctor 2) Admin 3) Receptionist. This project is only for
college students who want to complete their Semester projects.
2
Introduction:
1. ID
2. Name
3. Specializations
4. Working Time
5. Qualification
3
Simple Java Program for Hospital Management System:
You can see the newly updated list of doctors and by pressing 2 you can see
those details
Doctors List :
In this Hospital Management System Project in Java with Source Code PDF.
You can also check the patient list or you can admit new patients same as the
Doctors List for that you have to go to the main menu and then select a patient
then 2 options will occur
1. Add New Entry or 2. Existing Patients List and by pressing 2 you can check
the patient details. These are the list of my friend and they are not patient they
are absolutely fine(Just for Fun).
4
Patients List:
How to run this Hospital Management System Project in Java with Source Code
PDF. First, create a folder on your desktop with any name then save or download
the code as hospitalmanagement.java. Now open a command prompt by pressing
win+r simultaneously and go to the location of
the hospitalmanagement.java by using the cd command.
CD desktop
CD “folder name”(without quotes)
Now run the below command. The first, command is for compiling the program
and the second one is for running the program.
5
patient.class, and staff.class) will be created.
Now your program is ready to work do whatever you want to perform operations.
We also have some competitive websites solution in C, C++, and Java
Programming languages. Free Download Java Projects and others here.
Below you can find the Hospital Management System Project in Java with
Source Code . This is a very important mini or we can say that medium size of
project for bachelors and masters student.
Source Code:-
import java.io.IOException; import
java.util.List;
import org.apache.log4j.Logger;
6
import in.co.hospital.mgt.sys.bean.UserBean;
import in.co.hospital.mgt.sys.exception.ApplicationException; import
in.co.hospital.mgt.sys.model.PatientModel;
import in.co.hospital.mgt.sys.model.UserModel;
import in.co.hospital.mgt.sys.util.DataUtility; import
in.co.hospital.mgt.sys.util.PropertyReader; import
in.co.hospital.mgt.sys.util.ServletUtility;
/**
* Servlet implementation class PatientListCtl
*/
@WebServlet(name = "PatientListCtl", urlPatterns = { "/ctl/PatientListCtl" })
public class PatientListCtl extends BaseCtl { private
static final long serialVersionUID = 1L;
/**
* Populates bean object from request parameters
*
* @param request
* @return
*/ @Override
protected BaseBean populateBean(HttpServletRequest request) {
log.debug("PatientListCtl populateBean method start"); PatientBean
bean = new PatientBean();
7
bean.setFirstName(DataUtility.getString(request.getParameter("fName")))
;
bean.setEmailId(DataUtility.getString(request.getParameter("emailId")));
log.debug("PatientListCtl populateBean method end");
return bean;
}
/**
* @see HttpServlet#doGet(HttpServletRequest request,
HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
log.debug("PatientListCtl doGet method start"); List
list = null;
int pageNo = 1;
int pageSize = DataUtility.getInt(PropertyReader.getValue("page.size"));
if(uBean.getRoleId()==2) {
bean.setDoctorId(uBean.getId());
}
list = model.search(bean, pageNo, pageSize);
8
if (list == null || list.size() == 0) { ServletUtility.setErrorMessage("No
Record Found", request);
}
ServletUtility.setList(list, request); ServletUtility.setPageNo(pageNo,
request); ServletUtility.setPageSize(pageSize, request);
ServletUtility.forward(getView(), request, response);
9
pageNo = (pageNo == 0) ? 1 : pageNo;
pageSize = (pageSize == 0) ?
DataUtility.getInt(PropertyReader.getValue("page.size")) : pageSize;
if (OP_SEARCH.equalsIgnoreCase(op) || OP_NEXT.equalsIgnoreCase(op) ||
OP_PREVIOUS.equalsIgnoreCase(op))
{
if (OP_SEARCH.equalsIgnoreCase(op)) {
pageNo = 1;
} else if (OP_NEXT.equalsIgnoreCase(op)) {
pageNo++;
} else if (OP_PREVIOUS.equalsIgnoreCase(op) && pageNo > 1) {
pageNo--;
}
} else if (OP_NEW.equalsIgnoreCase(op)) {
ServletUtility.redirect(HMSView.PATIENT_CTL, request, response);
10
return;
} else if (OP_DELETE.equalsIgnoreCase(op)) {
pageNo = 1;
if (ids != null && ids.length > 0) { PatientBean
deletebean = new PatientBean(); for (String id :
ids) { deletebean.setId(DataUtility.getInt(id));
try
{
model.delete(deletebean);
} catch (ApplicationException e) {
ServletUtility.handleException(e, request, response);
e.printStackTrace();
return;
}
}
ServletUtility.setSuccessMessage("Data Deleted Successfully", request);
}
else
{
ServletUtility.setErrorMessage("Select at least one record", request);
}
} else if (OP_RESET.equalsIgnoreCase(op)) {
ServletUtility.redirect(HMSView.PATIENT_LIST_CTL, request,
response);
Return;
}
try {
HttpSession session=request.getSession();
11
UserBean uBean=(UserBean)session.getAttribute("user");
if(uBean.getRoleId()==2) {
bean.setDoctorId(uBean.getId());
}
list = model.search(bean, pageNo, pageSize); if
(list == null || list.size() == 0) {
ServletUtility.setErrorMessage("NO Record Found", request);
}
ServletUtility.setList(list, request); ServletUtility.setPageNo(pageNo,
request); ServletUtility.setPageSize(pageSize, request);
ServletUtility.forward(getView(), request, response);
} catch (ApplicationException e) { ServletUtility.handleException(e,
request, response); e.printStackTrace();
return;
}
@Override
protected String getView() {
// TODO Auto-generated method stub return
HMSView.PATIENT_LIST_VIEW;
}
12
}
Output :
Admin User
Admin is the main actor who will be responsible for managing Doctors and
Receptionists. Below is the task list which will be performed by the admin.
13
Admin can ADD/DELETE/UPDATE a patient.
Admin can ADD/DELETE/UPDATE an appointment.
Doctor User in HMS
A doctor can check the appointment and the patient list.
The doctor can VIEW the appointments.
The doctor can VIEW the patient list.
14
Modules:
1. Patient Registration
2. Doctor Management
3. Appointment Scheduling
4. Ward Management
5. Laboratory Management
6. Pharmacy Management
7. Billing and Payment
Java Classes:
// Patient.java
public class Patient {
private int id;
private String name;
private String contact;
// Getters and setters
}
// Doctor.java
public class Doctor {
private int id;
private String name;
private String specialty;
// Getters and setters
}
// Appointment.java
public class Appointment {
private int id;
private Patient patient;
private Doctor doctor;
private Date date;
private Time time;
// Getters and setters
15
}
// Ward.java
public class Ward {
private int id;
private int capacity;
private List<Patient> patients;
// Getters and setters
}
// Laboratory.java
public class Laboratory {
private int id;
private String testName;
private double cost;
// Getters and setters
}
// Pharmacy.java
public class Pharmacy {
private int id;
private String medicationName;
private int quantity;
// Getters and setters
}
// Billing.java
public class Billing {
private int id;
private Patient patient;
private double amount;
// Getters and setters
}
HospitalManagementSystem.java
import java.util.*;
16
public class HospitalManagementSystem {
private List<Patient> patients;
private List<Doctor> doctors;
private List<Appointment> appointments;
private List<Ward> wards;
private List<Laboratory> laboratories;
private List<Pharmacy> pharmacies;
private List<Billing> billings;
// Constructor
public HospitalManagementSystem() {
patients = new ArrayList<>();
doctors = new ArrayList<>();
appointments = new ArrayList<>();
wards = new ArrayList<>();
laboratories = new ArrayList<>();
pharmacies = new ArrayList<>();
billings = new ArrayList<>();
}
// Patient Registration
public void registerPatient(Patient patient) {
patients.add(patient);
}
// Doctor Management
public void addDoctor(Doctor doctor) {
doctors.add(doctor);
}
// Appointment Scheduling
public void scheduleAppointment(Appointment appointment) {
appointments.add(appointment);
}
// Ward Management
public void addWard(Ward ward) {
17
wards.add(ward);
}
// Laboratory Management
public void addLaboratory(Laboratory laboratory) {
laboratories.add(laboratory);
}
// Pharmacy Management
public void addPharmacy(Pharmacy pharmacy) {
pharmacies.add(pharmacy);
}
// Main method
public static void main(String[] args) {
HospitalManagementSystem hms = new HospitalManagementSystem();
// Create patients, doctors, appointments, wards, laboratories, pharmacies, and billings
// Call respective methods to manage hospital operations
}
}
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/hms",
"username", "password");
} catch (Exception e) {
System.out.println("Error connecting to database: " + e.getMessage());
}
}
18
Conclusion:
19
MICRO PROJECT
Subject: Adv. Java Programming Name Of Faculty:- Prof. Shubhangi Shivankar Mam