Skip to content

Repository files navigation

HDIMS - Hospital & Drug Inventory Management System

Database Management System Course Project

A comprehensive hospital management platform demonstrating relational database design, CRUD operations, and modern full-stack web development.


Project Overview

This is a college group project for the Database Management Systems (DBMS) course. The HDIMS application provides a complete inventory and patient management system for a hospital, showcasing practical implementation of database design principles including normalization, relationships, and data integrity.

Objective: Design and implement a relational database schema for hospital operations, then build an interactive management platform to demonstrate full CRUD functionality across multiple entities.


Features Implemented

Core Modules

  • ✅ Patient Management - Register, search, edit, delete patient records
  • ✅ Appointment System - Schedule consultations, track status
  • ✅ Room & Bed Management - Monitor availability, track admissions/discharges
  • ✅ Doctor & Staff Directory - Employee records with department assignment
  • ✅ Medicine Inventory - Stock tracking, expiry monitoring, low-stock alerts
  • ✅ Billing System - Invoice generation, payment status tracking
  • ✅ Supplier Management - Vendor records, purchase order tracking
  • ✅ Prescription Records - Clinical documentation with medicine linkage
  • ✅ Department Structure - Hospital organizational hierarchy

Management Features (All Tables)

  • Search - Full-text search across columns
  • Sorting - Click headers for ascending/descending sort
  • CRUD Operations:
    • Create - Add new records via form
    • Read - Display and search existing records
    • Update - Edit record data in-place
    • Delete - Remove records with confirmation
  • Pagination - Configurable rows per page (5, 10, 20)
  • Dashboard - Real-time KPI cards and operational metrics

Database Schema

Entity-Relationship Model

DEPARTMENT
  ├─ dept_id (PK)
  └─ dept_name

PATIENT
  ├─ patient_id (PK)
  ├─ first_name, last_name
  ├─ phone, email, address
  └─ blood_group

ROOM
  ├─ room_id (PK)
  ├─ room_type
  ├─ capacity
  └─ occupied_count

ROOM_ALLOCATION
  ├─ allocation_id (PK)
  ├─ patient_id (FK → PATIENT)
  ├─ room_id (FK → ROOM)
  ├─ admission_date
  └─ discharge_date

EMPLOYEE
  ├─ emp_id (PK)
  ├─ name, role
  ├─ joining_date, salary
  └─ dept_id (FK → DEPARTMENT)

DOCTOR
  ├─ doctor_id (FK → EMPLOYEE)
  ├─ specialization
  └─ consultation_fee

APPOINTMENT
  ├─ appointment_id (PK)
  ├─ patient_id (FK → PATIENT)
  ├─ doctor_id (FK → DOCTOR)
  ├─ appointment_date, appointment_time
  └─ status

MEDICINE
  ├─ medicine_id (PK)
  ├─ medicine_name, manufacturer
  ├─ price
  ├─ stock_quantity
  └─ expiry_date

SUPPLIER
  ├─ supplier_id (PK)
  ├─ supplier_name
  ├─ phone
  └─ address

MEDICINE_PURCHASE
  ├─ purchase_id (PK)
  ├─ supplier_id (FK → SUPPLIER)
  ├─ medicine_id (FK → MEDICINE)
  ├─ quantity
  └─ purchase_date

BILL
  ├─ bill_id (PK)
  ├─ patient_id (FK → PATIENT)
  ├─ doctor_id (FK → DOCTOR)
  ├─ amount, bill_date
  └─ payment_status

PRESCRIPTION
  ├─ prescription_id (PK)
  ├─ patient_id (FK → PATIENT)
  ├─ doctor_id (FK → DOCTOR)
  ├─ medicine_id (FK → MEDICINE)
  ├─ dosage, duration
  └─ prescription_date

Key Relationships

  • One-to-Many: Department → Employee, Patient → Appointment, Room → Room_Allocation
  • Many-to-Many: Medicine ↔ Purchase (via Medicine_Purchase), Patient ↔ Doctor (via Appointment)
  • Foreign Keys: Enforce referential integrity across all child tables
  • Normalization: 3NF applied to eliminate redundancy and anomalies

Tech Stack

Layer Technology
Frontend Next.js 14+, React, TypeScript
Styling Tailwind CSS, Shadcn UI Components
Icons Phosphor Icons
State Management React Hooks (Client-side)
Build Tool Node.js + npm

Project Structure

hdims/
├── app/
│   ├── dashboard/          # KPI overview & insights
│   ├── patients/           # Patient CRUD
│   ├── appointments/       # Appointment scheduling
│   ├── rooms/              # Room & bed management
│   ├── doctors-staff/      # Employee directory
│   ├── departments/        # Department list
│   ├── medicine-inventory/ # Stock management
│   ├── suppliers-purchases/# Vendor & PO tracking
│   ├── billing/            # Invoice management
│   ├── reports/            # Prescription records
│   ├── search-records/     # Cross-entity search
│   └── layout.tsx
├── components/
│   ├── page-shell.tsx      # Reusable page layout
│   ├── records-table.tsx   # CRUD-enabled table component
│   ├── app-sidebar.tsx     # Navigation
│   └── ui/                 # Shadcn UI library
├── lib/
│   ├── hdims-dummy-data.ts # Sample dataset (10+ records per table)
│   └── utils.ts
└── public/

Installation & Setup

Requirements

  • Node.js 18.17 or higher
  • npm or yarn

Steps

  1. Clone/Extract Project

    cd hdims
  2. Install Dependencies

    npm install
  3. Run Development Server

    npm run dev
  4. Open in Browser

    • Navigate to http://localhost:3000
    • Automatically redirects to /dashboard

How to Use

Navigation

  • Sidebar: Click any module (Patients, Appointments, etc.) to view/manage that entity
  • Dashboard: High-level overview with 4 KPI cards and today's appointment queue

CRUD Operations

Create Record:

  1. Click "Add Record" button
  2. Fill form fields (required fields marked)
  3. ID auto-generated for tables
  4. Click "Save"

Read Records:

  • View all records with key attributes
  • Default: 10 rows per page

Update Record:

  1. Click "Edit" on any row
  2. Modify fields in side panel
  3. Click "Save"

Delete Record:

  1. Click "Delete" button
  2. Confirm deletion prompt
  3. Record removed from list

Search & Sort:

  • Search Bar: Type to filter across all columns (real-time)
  • Column Headers: Click to sort ascending/descending/off

Pagination:

  • Change rows per page (5, 10, 20)
  • Use Prev/Next buttons
  • View current page number

Sample Data

Pre-loaded dummy data includes:

  • 5 Patients with contact & medical details
  • 4 Rooms with capacity tracking
  • 5 Employees (doctors & nurses) with departments
  • 4 Medicines with stock & expiry dates
  • 3 Suppliers with contact info
  • 12 Appointments with status flow
  • 3 Bills with payment tracking
  • Plus complete relationships for Prescriptions, Purchases, Room Allocations

About

HDIMS - Hospital and Drug Inventory Management System, is a Database Management project built for the course of DBMS. Built using NextJS, Shadcn, OracleDB, SQL.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages