Java Microproject
Java Microproject
The main aim of developing this JAVA based Patient Management System project is to
provide better services to hospitals for both the doctors as well as patients. This Java based
progrom will store all patients and it view patients bill. It can be used in any Hospital, Clinic,
Polyclinic or Pathology labs for maintaining patient details and their test results. This article
contains Hospital Management System source code in java, database files and documentation.
The Patient Record Management System is an offline application for patient record
management. It has been developed on java. It is a virtual showcase for managing patient data,
their names, roll no, year, course of patients etc. The Patient Record Management System will
reduce the amount of time spent by the employees of the hospitals/clinics and also provides a
convenient and efficient means of reaching to patients using cutting-edge-technologies. The main
goal is targeting towards smooth internal communication and functioning for the patients along
with other useful information
You can also check the patient list or you can admit new patient same as Doctors List for
that you have to go to the main menu and select patient than 2 option will occur 1. Add New
Entry or 2. Existing Patients List and by pressing 2 you can check the patient details
Concepts Used:
1. Package used:
The java.util.Scanner class is a simple text scanner which can parse primitive types and strings
using regular expressions. Following are the important points about Scanner −
o A Scanner breaks its input into tokens using a delimiter pattern, which by default
matches whitespace.
o A scanning operation may block waiting for input.
o A Scanner is not safe for multithreaded use without external synchronization.
• Java try block is used to enclose the code that might throw an exception. It must be used
within the method.
• Java catch block is used to handle the Exception. It must be used after the try block only.
Java Code :
Patient.java
import java.util.*;
public Patient( String name, int pno, String disease, String year, String section )
{
m_name = name;
m_patientno = pno;
m_patientdisease = disease;
m_year=year;
m_section = section;
}
public String toString()
{
return "Name: " + m_name + ", Pno: " + m_patientno + ", Disease: " + m_patientdisease +
", year: " + m_year+ ", Section: " + m_section;
}
int menuChoice = 4;
do {
System.out.println("\t:::::>>>>>Patient Record Management<<<<<:::::");
System.out.println("\t");
System.out.println("Records Menu>>>");
System.out.println("\t\t1. Add Patient");
System.out.println("\t\t2. View Patient");
System.out.println("\t\t3. Search Patient");
System.out.println("\t\t4. Exit");
try {
System.out.println("Enter choice: ");
menuChoice = Integer.parseInt(input.nextLine());
} catch (NumberFormatException e) {
continue;
}
if (menuChoice==1)
{
System.out.println("Full name:");
String name = input.nextLine();
System.out.println("Disease(level):");
String disease = input.nextLine();
System.out.println("year:");
String year= input.nextLine();
System.out.println("Section(Class):");
String section = input.nextLine();
} else if (menuChoice==2) {
System.out.println("Patients List:");
for (Patient patient : patients)
{
System.out.println(patient);
}
}else if (menuChoice==3) {
System.out.println("Patients Are As Following:");
for (Patient patient : patients)
{
System.out.println(patient);
}
}
} while (menuChoice<4);
}
}
All these problems are solved by this project. This system helps in maintaining the
information of pupil of the organization. It can be easily accessed by the manager and kept safe
for a long period of time without any changes.