FINAL DSA MINI PROJECT - PDF - 20241027 - 225622 - 0000
FINAL DSA MINI PROJECT - PDF - 20241027 - 225622 - 0000
IT1306
DATA STRUCTURE and ALGORITHMS
Blood Bank Manegement System
Submitted by:-
Name of Students:- 1.
23007041- Rahul Yawle
2. 23007048:- Shraddhey Dukare
3. 23007059:- Tushar Rathod
Objective :-
• Manage information related to blood donors, recipients, and blood inventory.
• Ensure the availability of safe and adequate blood.
• Automate blood collection, storage, and distribution.
• Track blood donations, blood groups, and stock levels.
• Provide real-time information to users about blood availability.
Skill Used:- c
1. Global Arrays:
The system uses two global arrays to store data about donors and recipients:
Donor Array:
Purpose: Holds up to 100 Donor structures, each containing information such as ID,
name, blood group, and age.
Recipient Array:
2. Data Management:
The system maintains two integer variables, num_donors and num_recipients, to track
the current number of entries in the respective arrays. These variables ensure that
data is added only when there is space available in the arrays.
3. Array Operations:
New entries are added at the next available index, which is managed by incrementing
num_donors or num_recipients after each successful addition.
Displaying Data:
4. Capacity Limitations:
The arrays are statically sized, which means the maximum number of donors and
recipients is limited to 100 each. This constraint can impact scalability and flexibility in
real-world applications.
5. Data Retrieval:
Blood group compatibility checks utilize the donor array to verify if a suitable donor
exists before adding a recipient, ensuring that the system enforces safety protocols.
Theory:
Blood Bank Management System:-
A Blood Bank Management System is an essential tool designed to streamline the processes
involved in collecting, storing, processing, and distributing blood and its components. Below
is a theoretical overview of the system:
1. Introduction:
Blood banks are institutions responsible for the storage and supply of blood. A Blood
Bank Management System ensures efficient management of donor data, blood inventory,
and transfusion records. The system aims to reduce human error, minimize wastage, and
make the process transparent and fast.
2. Objectives:
• Manage information related to blood donors, recipients, and blood inventory.
• Ensure the availability of safe and adequate blood.
• Automate blood collection, storage, and distribution.
• Track blood donations, blood groups, and stock levels.
• Provide real-time information to users about blood availability.
2.Inventory Management:
Track blood units based on type (A+, A-, O+, O-, etc.).
Monitor the expiry date of blood units.
Record component separation (e.g., plasma, platelets, red blood cells). Alert
for low stock levels or nearing expiry units.
5. System Flow
• Donor Registration: A new donor's details are entered into the system.
• Blood Donation: Blood is collected and added to the inventory.
• Processing: Blood components are separated and stored.
• Inventory Management: The system monitors storage conditions and alerts for nearing expiry.
• Recipient Request: Patients request blood, and the system matches available units.
• Transfusion: Blood is issued to the patient, and records are updated.
• Reports Generation: Regular reports are generated for decision-making and compliance.
7. Challenges
• Ensuring data integrity and security.
• Integration with other healthcare systems.
• Training staff to use the system efficiently.
• Managing blood supply in emergencies and pandemics.
8. Conclusion
A Blood Bank Management System is critical for improving the efficiency of blood collection and
distribution processes. It helps in saving lives by ensuring that the right blood type is available at the
right time. With advancements in technology, these systems are becoming more sophisticated and
accessible, ensuring that both donors and recipients benefit from streamlined operations.
Source Code :-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_DONORS 100
#define MAX_RECIPIENTS 100
// Structure definitions
typedef struct { int
donor_id; char
name[50]; char
blood_group[5]; int
age;
} Donor;
do {
printf("\nBlood Bank Management System\n");
printf("1. Add Donor\n"); printf("2. Add
Recipient\n"); printf("3. Display Donors\n");
printf("4. Display Recipients\n"); printf("5. Exit\
n"); printf("Enter your choice: ");
scanf("%d", &choice);
switch(choice)
{ case 1:
add_donor(); break;
case 2:
add_recipient();
break; case 3:
display_donors();
break; case 4:
display_recipients();
break; case 5:
printf("Exiting the program...\n");
break; default:
printf("Invalid choice. Please enter a valid choice.\n");
}
} while(choice != 5);
return 0;
}
void add_donor() {
if(num_donors < MAX_DONORS) { Donor
new_donor; printf("Enter Donor ID: ");
scanf("%d", &new_donor.donor_id);
printf("Enter Name: "); scanf(" %[^\n]s",
new_donor.name); printf("Enter Blood
Group: "); scanf(" %[^\n]s",
new_donor.blood_group); printf("Enter
Age: "); scanf("%d", &new_donor.age);
donors[num_donors++] = new_donor;
void add_recipient() {
if(num_recipients < MAX_RECIPIENTS)
{ Recipient new_recipient; printf("Enter
Recipient ID: "); scanf("%d",
&new_recipient.recipient_id); printf("Enter
Name: "); scanf(" %[^\n]s",
new_recipient.name); printf("Enter Blood
Group: "); scanf(" %[^\n]s",
new_recipient.blood_group); printf("Enter
Age: ");
scanf("%d", &new_recipient.age);
if(valid_match)
{ recipients[num_recipients++] =
new_recipient; printf("Recipient added
successfully!\n");
} else {
printf("Error: No matching donor found for recipient's
blood group.\n");
}
} else {
printf("Maximum recipients limit reached.\n");
}
}
void display_donors()
{ if(num_donors == 0) {
printf("No donors available.\n");
} else { printf("List of Donors:\n"); for(int i = 0; i <
num_donors; ++i) { printf("Donor ID: %d, Name: %s,
Blood Group: %s, Age:
%d\n",
donors[i].donor_id, donors[i].name,
donors[i].blood_group, donors[i].age);
}
}
}
void display_recipients()
{ if(num_recipients == 0) {
printf("No recipients available.\n");
} else { printf("List of Recipients:\n"); for(int i = 0; i <
num_recipients; ++i) { printf("Recipient ID: %d, Name:
%s, Blood Group: %s, Age:
%d\n",
recipients[i].recipient_id, recipients[i].name,
recipients[i].blood_group, recipients[i].age);
}
}
}