0% found this document useful (0 votes)
3 views22 pages

24BCY70135 Hospital Management Case Study

The document outlines a case study for a Hospital Management System implemented in C++, designed to manage patient information and streamline hospital operations. It includes objectives, system requirements, a proposed solution, system design, code explanation, and sample outputs demonstrating the program's functionalities. The project highlights basic CRUD operations and offers recommendations for future enhancements such as file handling and GUI integration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views22 pages

24BCY70135 Hospital Management Case Study

The document outlines a case study for a Hospital Management System implemented in C++, designed to manage patient information and streamline hospital operations. It includes objectives, system requirements, a proposed solution, system design, code explanation, and sample outputs demonstrating the program's functionalities. The project highlights basic CRUD operations and offers recommendations for future enhancements such as file handling and GUI integration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Title: Hospital Management System

using C++
Prepared by: Soumyadeep Sarkar
UID: 24BCY70135
Section&Group: 117-B
Subject: BASIC DATA STRUCTURES
USING C++
Subject Code: 24CSH-103
Table of Contents
1. Introduction
2. Objectives
3. Problem Statement
4. System Requirements
5. Proposed Solution
6. System Design
7. Code Explanation
8. Program Code
9. Output
10. Conclusion
11. Recommendations
12. References
Introduction
The healthcare sector is increasingly
dependent on efficient data management
systems. A Hospital Management System is a
software solution designed to manage and
streamline hospital operations like patient
information, staff records, appointments, and
medical records. This case study showcases a
simple implementation of such a system
using C++.

Objectives
- To build a basic Hospital Management System in
C++.
- To demonstrate the use of simple C++ constructs
such as loops, arrays, conditionals, and switch-
case.
- To allow basic functionalities like adding,
displaying, and modifying patient information.
Problem Statement
Manual handling of hospital records can be time-
consuming and error-prone. This project aims to
automate the basic functionalities of patient
management, thereby improving efficiency and
accuracy.

System Requirements
Software Requirements:
 C++ Compiler (e.g., GCC, Turbo C++)
 Text Editor or IDE (e.g., Code::Blocks, Dev C+
+)

Hardware Requirements:
 Minimum 1GB RAM
 Minimum 1 GHz Processor
 Keyboard and Monitor

Proposed Solution
The proposed solution is a C++ program that can
store, display, and manage patient information. It
is a console-based program and uses arrays to
store data in memory without using file handling.
The interface is menu-driven and uses only `cin`
and `cout` for I/O.

System Design
Algorithm:
1. Start the program.
2. Declare arrays to store ID, name, age, gender,
and disease.
3. Initialize a variable `patientCount` to 0.
4. Display a menu with the following options:
- Add Patient
- Show Patients
- Edit Patient
- Delete Patient
- Exit
5. Use `cin` to get user's choice.
6. Use a `switch` statement to handle each case:
- Case 1 (Add Patient):
- Check if `patientCount` is less than maximum
allowed.
- Ask user to enter ID, Name, Age, Gender, and
Disease.
- Store the details in corresponding arrays.
- Increment `patientCount`.
- Case 2 (Show Patients):
- Loop through arrays up to `patientCount`.
- Display patient details.
- Case 3 (Edit Patient):
- Ask for patient ID to edit.
- Search for the ID in the array.
- If found, ask for new details and update
arrays.
- Case 4 (Delete Patient):
- Ask for patient ID to delete.
- Search and remove the patient by shifting all
later entries up.
- Decrease `patientCount` by 1.
- Case 5 (Exit):
- Display exit message.
- Break loop and terminate program.
- Default: Display "Invalid choice".
7. Loop the menu until the user chooses Exit.
8. End the program.

Code Explanation
- The program uses arrays to store patient ID,
name, age, gender, and disease.
- `cin` and `cout` handle user input/output.
- A switch statement is used for menu navigation.
- New functions added: editPatient, deletePatient.

Full Program Code


#include <iostream>
using namespace std;

const int MAX = 100;


int idList[MAX];
string nameList[MAX];
int ageList[MAX];
string genderList[MAX];
string diseaseList[MAX];
int patientCount = 0;

void addPatient() {
if (patientCount < MAX) {
cout << "Enter Patient ID: ";
cin >> idList[patientCount];
cout << "Enter Name (use underscores for
spaces): ";
cin >> nameList[patientCount];
cout << "Enter Age: ";
cin >> ageList[patientCount];
cout << "Enter Gender: ";
cin >> genderList[patientCount];
cout << "Enter Disease (use underscores): ";
cin >> diseaseList[patientCount];
patientCount++;
cout << "Patient added successfully.\n";
} else {
cout << "Patient limit reached.\n";
}
}

void showPatients() {
if (patientCount == 0) {
cout << "No patient records available.\n";
return;
}
cout << "\n--- Patient List ---\n";
for (int i = 0; i < patientCount; i++) {
cout << "ID: " << idList[i]
<< ", Name: " << nameList[i]
<< ", Age: " << ageList[i]
<< ", Gender: " << genderList[i]
<< ", Disease: " << diseaseList[i] << "\n";
}
}

void editPatient() {
int id;
cout << "Enter ID to edit: ";
cin >> id;
for (int i = 0; i < patientCount; i++) {
if (idList[i] == id) {
cout << "Enter new Name: ";
cin >> nameList[i];
cout << "Enter new Age: ";
cin >> ageList[i];
cout << "Enter new Gender: ";
cin >> genderList[i];
cout << "Enter new Disease: ";
cin >> diseaseList[i];
cout << "Record updated.\n";
return;
}
}
cout << "Patient ID not found.\n";
}

void deletePatient() {
int id;
cout << "Enter ID to delete: ";
cin >> id;
for (int i = 0; i < patientCount; i++) {
if (idList[i] == id) {
for (int j = i; j < patientCount - 1; j++) {
idList[j] = idList[j + 1];
nameList[j] = nameList[j + 1];
ageList[j] = ageList[j + 1];
genderList[j] = genderList[j + 1];
diseaseList[j] = diseaseList[j + 1];
}
patientCount--;
cout << "Record deleted.\n";
return;
}
}
cout << "Patient ID not found.\n";
}
int main() {
int choice;
do {
cout << "\nHospital Management System\n";
cout << "1. Add Patient\n";
cout << "2. Show Patients\n";
cout << "3. Edit Patient\n";
cout << "4. Delete Patient\n";
cout << "5. Exit\n";
cout << "Enter choice: ";
cin >> choice;

switch (choice) {
case 1: addPatient(); break;
case 2: showPatients(); break;
case 3: editPatient(); break;
case 4: deletePatient(); break;
case 5: cout << "Goodbye!\n"; break;
default: cout << "Invalid choice.\n";
}
} while (choice != 5);
return 0;
}

Output:
Hospital Management System
1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 1
Enter Patient ID: 01
Enter Name (use underscores for spaces):
Soumyadeep
Enter Age: 20
Enter Gender: Male
Enter Disease (use underscores):
Acute_Depression
Patient added successfully.

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 1
Enter Patient ID: 02
Enter Name (use underscores for spaces): Mohit
Enter Age: 34
Enter Gender: Male
Enter Disease (use underscores): Diabetes
Patient added successfully.

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 1
Enter Patient ID: 03
Enter Name (use underscores for spaces): Anny
Enter Age: 13
Enter Gender: Female
Enter Disease (use underscores):
Blood_Cancer_Stage_Three
Patient added successfully.
Hospital Management System
1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 1
Enter Patient ID: 04
Enter Name (use underscores for spaces): Raghav
Enter Age: 18
Enter Gender: Male
Enter Disease (use underscores): Malaria
Patient added successfully.

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 1
Enter Patient ID: 05
Enter Name (use underscores for spaces): Roxy
Enter Age: 60
Enter Gender: Female
Enter Disease (use underscores):
Dementia_Stage_Severe
Patient added successfully.

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 2

--- Patient List ---


ID: 1, Name: Soumyadeep, Age: 20, Gender: Male,
Disease: Acute_Depression
ID: 2, Name: Mohit, Age: 34, Gender: Male, Disease:
Diabetes
ID: 3, Name: Anny, Age: 13, Gender: Female,
Disease: Blood_Cancer_Stage_Three
ID: 4, Name: Raghav, Age: 18, Gender: Male,
Disease: Malaria
ID: 5, Name: Roxy, Age: 60, Gender: Female,
Disease: Dementis_Stage_Severe

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 4
Enter ID to delete: 3
Record deleted.

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 2

--- Patient List ---


ID: 1, Name: Soumyadeep, Age: 20, Gender: Male,
Disease: Acute_Depression
ID: 2, Name: Mohit, Age: 34, Gender: Male, Disease:
Diabetes
ID: 4, Name: Raghav, Age: 18, Gender: Male,
Disease: Malaria
ID: 5, Name: Roxy, Age: 60, Gender: Female,
Disease: Dementis_Stage_Severe

Hospital Management System


1. Add Patient
2. Show Patients
3. Edit Patient
4. Delete Patient
5. Exit
Enter choice: 5
Goodbye!

Conclusion
This project successfully demonstrates a simple hospital
management system using only basic C++ features. It
includes CRUD (Create, Read, Update, Delete)
operations for patient data, making it a foundational
system that could be extended further with databases
or GUI.

Recommendations
- Use file handling to store patient records permanently.
- Add more modules like doctor scheduling, billing, and
medicine inventory.
- Introduce GUI using frameworks like Qt or console UI
libraries.

References
1. C++ Documentation - http://www.cplusplus.com
2. Programming Tutorials -
https://www.geeksforgeeks.org
3. C++ For Beginners -
https://www.w3schools.com/cpp

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy