Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Mini project report

on
HealthTrack: Digital Hospital Management Suite
Submitted in partial fulfilment of the requirements for the award of
degree of
Bachelor of Technology in
Computer Science & Engineering

UE21CS352B – OOAD Project

Submitted by:

VISHAL PES2UG21CS123
SUJAN PES2UG21CS145
Divya D PES2UG21CS165
Druthi L Gowda PES2UG21CS168
Under the guidance of

Dr. Saranya Rubini S


Associate Professor Designation
PES University

AUG - DEC 2023

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


FACULTY OF ENGINEERING
PES UNIVERSITY
(Established under Karnataka Act No. 16 of 2013) Electronic City, Hosur Road, Bengaluru – 560
100, Karnataka, India

2
PES UNIVERSITY
(Established under Karnataka Act No. 16 of 2013)
Electronic City, Hosur Road, Bengaluru – 560 100, Karnataka, India

CERTIFICATE

This is to certify that the mini project entitled

HealthTrack : Digital Health Management Suite

is a bonafide work carried out by

Bhoomika M.S PES2UG21CS123


Chinthana M.J PES2UG21CS145
Divya D PES2UG21CS165
Druthi L Gowda PES2UG21CS168

In partial fulfilment for the completion of sixth semester OOADJ Project (UE21CS352B) in the
Program of Study - Bachelor of Technology in Computer Science and Engineering under rules
and regulations of PES University, Bengaluru during the period JAN. 2024 – MAY. 2024. It is
certified that all corrections / suggestions indicated for internal assessment have been
incorporated in the report. The project has been approved as it satisfies the 6th semester
academic requirements in respect of project work.

Signature
Dr. Saranya Rubini S
Associate Professor

3
TABLE OF CONTENTS

1. Problem Statement

2. Models

2.1 Use case Diagram

2.2 Class Diagram

3. Architecture Pattern

4. Design Principles

5. Design Patterns

6. GitHub Repositories

7. Code Base Structure

8. Individual Contributions

9. Output Screenshots

4
PROBLEM STATEMENT :

The project Digital Hospital Management Suite includes registration of patients, storing their
details into the system, and also computerised billing in the pharmacy, and labs. The software
has the facility to give a unique id for every patient and stores the details of every patient
automatically. TheDigital Hospital Management Suite can be accessed by different users using a
username and password. It is accessible by an administrator, receptionist, doctor and a
pharmacist. Only the admin can register users into the database. The data can be retrieved easily.
The interface is very user-friendly. The data is well protected for personal use and makes the data
processing very fast.

The Digital Hospital Management Suite is powerful, flexible, and easy to use and is designed
and developed to deliver real conceivable benefits to hospitals.

Digital Hospital Management Suite is designed for multispeciality hospitals, to cover a wide
range of hospital administration and management processes. It is an integrated end-to-end
Digital Hospital Management Suite that provides relevant information across the hospital to
support effective decision making for patient care, hospital administration in a seamless flow.

Digital Hospital Management Suite enables you to develop your organisation and improve its
effectiveness and quality of work.

5
MODELS:
USE CASE DIAGRAM:

6
CLASS DIAGRAM:

7
ARCHITECTURE PATTERN:
The architecture pattern chosen for our project is Model-View-Controller(MVC). This pattern separates
the system into three interconnected components:

Model:
The model component represents the data and business logic of theDigital Hospital Management Suite. It
consists of entities such as Doctor, Patient, Appointment, and Medicine, which define the structure of the
data and contain methods for data manipulation. Each entity encapsulates properties and behaviors
relevant to its domain, ensuring data integrity and consistency throughout the application.

View:
The view component encompasses the user interface (UI) elements of theDigital Hospital Management
Suite, responsible for presenting information to users in a human-readable format. Views are implemented
using technologies like JSP (JavaServer Pages), Thymeleaf, or HTML templates, which render data
dynamically to create interactive and visually appealing interfaces. Views display information retrieved
from the model and allow users to interact with the system's functionalities.

Controller:
The controller component acts as an intermediary between the model and the view in theDigital Hospital
Management Suite. Controllers receive user input from the UI, process it, and determine the appropriate
response or view to be rendered based on the input and application logic. Controllers are implemented as
classes annotated with @Controller or @RestController, handling incoming HTTP requests and invoking
methods on the service layer (model) to perform business logic operations. By separating concerns,
controllers enable modular development and facilitate the maintenance and testing of the application's
functionality.

8
DESIGN PRINCIPLES:

1. Single Responsibility Principle (SRP):

Each class and method is designed to have a single responsibility. For example, service classes
are responsible for handling business logic related to their respective entities.

2. Open/Closed Principle (OCP):

The codebase is designed to be open for extension but closed for modification. For example,
new functionalities can be added by creating new classes or extending existing ones without
modifying the core implementation.

3. Liskov Substitution Principle (LSP):

Subtypes (e.g., service implementations, DAO implementations) can be substituted for their
base types (e.g., service interfaces, DAO interfaces) without affecting the system's behavior.
This enables polymorphism and facilitates easier code maintenance and scalability.

4. Interface Segregation Principle (ISP):

Service interfaces are designed with specific methods relevant to their corresponding entities.
This ensures that clients only depend on methods they use, reducing the risk of interface
pollution and making the system more cohesive.

9
DESIGN PATTERNS :

Factory Method Pattern : This pattern is implemented with the use of Spring's @Service
annotation acts as a form of factory method pattern. This annotation instructs the Spring
framework to manage the creation and lifecycle of service beans. By leveraging dependency
injection and inversion of control, Spring dynamically instantiates and injects service instances
into other components, promoting loose coupling and flexibility in the application's architecture.

DAO (Data Access Object) Pattern: The DAO pattern is utilised in the codebase to separate
the data access logic from the business logic. Each service class interacts with the underlying
database through its corresponding DAO interface (e.g., DoctorDao, PatientDao) and
implementation (e.g., DoctorDaoImpl, PatientDaoImpl). This abstraction allows for
interchangeable data access implementations and promotes code reusability, scalability, and
maintainability.

Builder Pattern : This pattern implemented using builder classes, the creation of complex
objects, such as entities and DTOs, often involves setting multiple attributes. This aligns with the
builder pattern's concept of constructing objects step by step, where each method call
configures a specific aspect of the object. While the builder pattern is not directly instantiated in
the codebase, the process of constructing objects in a systematic manner follows its principles,
enhancing readability and maintainability.

Service Layer Pattern: The service layer pattern is employed in the codebase by defining
service interfaces (e.g., DoctorService, PatientService) and their corresponding implementations
(e.g., DoctorServiceImpl, PatientServiceImpl). Each service class encapsulates the business
logic related to its respective domain entity, such as adding, deleting, updating, or retrieving
data. This modular approach promotes separation of concerns and facilitates easier
maintenance and testing of the application.

GITHUB REPOSITORY :
https://github.com/Chinthanamj/OOAD_Mini_Project

10
CODE BASE STRUCTURE :

11
INDIVIDUAL CONTRIBUTION :

Vishal : Pharmacist

○ Add medicines to the inventory.


○ Add distributors for medication procurement.
○ Add medicine companies for sourcing pharmaceutical products
○ Manage medication procurement, storage, and distribution.
○ Verify prescription accuracy and provide counselling.
○ Maintain accurate records and adhere to regulations.

12
○ Maintain patient records and medical history.

OUTPUT SCREENSHOTS :

● Register Page

● AdminRegister

● PatientRegister

13
● PharmacistRegister

● DoctorRegister

● ReceptionistRegister

14
● AdminDashboard

15
● AddMedicine

● AddMedicineCompany

● AddMedicineDistributor

16
● AddAppointment

● MakeBill

17
● BillReceipt

DATABASE SCREENSHOTS:

18
19
20
INTERFACE FOR FACTORY DESIGN

IMPLEMENTATION OF FACTORY DESIGN


PATTERN..
package com.hospitalmanagement.factory;

import com.hospitalmanagement.resource.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ResourceFactoryImpl implements ResourceFactory {

@Autowired
private MedicineResource medicineResource;

21
@Autowired
private MedicineDistributorResource medicineDistributorResource;

@Autowired
private MedicineCompanyResource medicineCompanyResource;

@Autowired
private AppointmentResource appointmentResource;

@Autowired
private DoctorResource doctorResource;

@Autowired
private PatientResource patientResource;

@Autowired
private ReceptionistResource receptionistResource;

@Autowired
private PharmacistResource pharmacistResource;

@Override
public MedicineResource createMedicineResource() {
return medicineResource;
}

@Override
public MedicineDistributorResource createMedicineDistributorResource() {
return medicineDistributorResource;
}

@Override
public MedicineCompanyResource createMedicineCompanyResource() {
return medicineCompanyResource;
}

@Override
public AppointmentResource createAppointmentResource() {
return appointmentResource;
}

@Override
public DoctorResource createDoctorResource() {
return doctorResource;
}

22
@Override
public PatientResource createPatientResource() {
return patientResource;
}

@Override
public ReceptionistResource createReceptionistResource() {
return receptionistResource;
}

@Override
public PharmacistResource createPharmacistResource() {
return pharmacistResource;
}
}

MODIFY CONTROLLER FOR FACTORY


package com.hospitalmanagement.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.hospitalmanagement.constants.DatabaseConstants.AdminView;
import com.hospitalmanagement.factory.ResourceFactory;
import com.hospitalmanagement.model.Pharmacist;

@Controller
public class PharmacistController {

private static Logger LOG = LogManager.getLogger(PharmacistController.class);

@Autowired
23
private ResourceFactory resourceFactory;

@GetMapping("/pharmacistlogin")
public String goToPharmacistLoginPage() {
LOG.info("Redirecting to Pharmacist Login Page.");
return "pharmacistlogin";
}

@GetMapping("/pharmacistregister")
public String goToPharmacistRegisterPage() {
LOG.info("Redirecting to Pharmacist Register Page.");
return "pharmacistregister";
}

@PostMapping("/pharmacistregister")
public ModelAndView registerPharmacist(@ModelAttribute Pharmacist pharmacist, Model
model) {
ModelAndView mv = new ModelAndView();
if(resourceFactory.createPharmacistResource().addPharmacist(pharmacist)) {
mv.addObject("status", pharmacist.getFirstname()+" Successfully Registered as
PHARMACIST");
mv.setViewName("pharmacistlogin");
} else {
mv.addObject("status", pharmacist.getFirstname()+" Failed to Register as
PHARMACIST");
mv.setViewName("pharmacistregister");
}
return mv;
}

@PostMapping("/pharmacistlogin")
public ModelAndView loginAdmin(HttpServletRequest request, @RequestParam String
username, @RequestParam String password ) {
ModelAndView mv = new ModelAndView();
Pharmacist pharmacist =
resourceFactory.createPharmacistResource().loginPharmacist(username, password);
if(pharmacist != null) {
HttpSession session = request.getSession();
session.setAttribute("active-user", pharmacist);
session.setAttribute("user-login","pharmacist");
mv.addObject("status", username+" Successfully Logged in as PHARMACIST");
mv.setViewName("index");
} else {
mv.addObject("status"," Failed to Login as PHARMACIST");
mv.setViewName("pharmacistregister");
}

24
return mv;
}

@GetMapping("/searchpharmacistbyId")
public ModelAndView searchPharmacistByid(@RequestParam int pharmacistId) {
LOG.info("Searching medicine by id");
Pharmacist pharmacist =
resourceFactory.createPharmacistResource().getPharmacistById(pharmacistId);
List<Pharmacist> pharmacists = new ArrayList<>();
pharmacists.add(pharmacist);
ModelAndView mv = new ModelAndView();
mv.addObject("view", AdminView.PHARMACIST.value());
mv.setViewName("admindashboard");
mv.addObject("pharmacists", pharmacists);
mv.addObject("appointmentResource", resourceFactory.createAppointmentResource());
mv.addObject("medicineResource", resourceFactory.createMedicineResource());
mv.addObject("companyResource", resourceFactory.createMedicineCompanyResource());
mv.addObject("distributorResource",
resourceFactory.createMedicineDistributorResource());
mv.addObject("patientResource", resourceFactory.createPatientResource());
mv.addObject("doctorResource", resourceFactory.createDoctorResource());
mv.addObject("receptionistResource", resourceFactory.createReceptionistResource());
mv.addObject("pharmacistResource", resourceFactory.createPharmacistResource());
return mv;
}

@GetMapping("/searchpharmacistbyName")
public ModelAndView searchPharmacistByname(@RequestParam String pharmacistName) {
LOG.info("Searching Medicine by name");
List<Pharmacist> pharmacists =
resourceFactory.createPharmacistResource().getPharmacistsByName(pharmacistName);
ModelAndView mv = new ModelAndView();
mv.addObject("view", AdminView.PHARMACIST.value());
mv.setViewName("admindashboard");
mv.addObject("pharmacists", pharmacists);
mv.addObject("appointmentResource", resourceFactory.createAppointmentResource());
mv.addObject("medicineResource", resourceFactory.createMedicineResource());
mv.addObject("companyResource", resourceFactory.createMedicineCompanyResource());
mv.addObject("distributorResource",
resourceFactory.createMedicineDistributorResource());
mv.addObject("patientResource", resourceFactory.createPatientResource());
mv.addObject("doctorResource", resourceFactory.createDoctorResource());
mv.addObject("receptionistResource", resourceFactory.createReceptionistResource());
mv.addObject("pharmacistResource", resourceFactory.createPharmacistResource());
return mv;
}

25
}

26

You might also like