COMPUTER PROJECT
Blood Bank Management System
Prepared by: Sumaima Hameed &
Suha Muhammed
Grade: 12th A
Batch: 2023-2024
Bonafide certificate
1
Blood bank management system
SUBMITTED TO
Al Janoub International School, Khamis Mushyat
Affiliated to CBSE Delhi
Affiliation No. 5730023
SUBMITTED BY
Sumiama Hameed & Suha Muhammed
SUPERVISED BY
Sanooja Jabbar.T
Subject teacher (C.S)
January 2024
This is to certify that the Computer Science Project titled “BLOOD BANK
MANAGEMENT SYSTEM” has been successfully completed by M.s
SUMAIMA HAMEED & M.s SUHA MUHAMMED of class 12, Al Janoub
International School, under the guidance Mrs. Sanooja Jabbar.T in partial
fulfillment of Practical Examinations held for AISSCE 2024 by Central Board
of Secondary Education
All the information provided is accurate and the project has fulfilled all the
conditions to the best of our knowledge.
External Examiner: Subject teacher:
Principal:
Declaration by author
2
This is to declare that this report has been written by
us. No part of the report is plagiarized from other
sources. All information included from other sources
has been duly acknowledged. Primary information
from other sources has been used to achieve the
broad aims of this project work.
Signature of Author’s:
Name of Author’s: Sumaima Hameed & Suha
Muhammed
Table of contents
3
1.BONAFIDE CERTIFICATE
2.DECLARATION BY AUTHOR
3.ACKNOWLEDGMENT
4.INTRODUCTION
5.MODULES USED
6.SOURCE CODE
7.OUTPUT
8.HARDWARE AND SOFTWARE REQUIREMENTS
9.CONCLUSION
10.BIBLIOGRAPHY
ACKNOWLEDGEMENT
4
We would like to thank God for being able to complete this
project with success to the best of my abilities. We would
like to express our gratitude to our Computer Science
teacher Mrs. Sanooja Jabbar. T and Head mistress Dr.
Anupama Sherry for their valuable guidance and
suggestions which have served as an important
contribution to our work. We thank the Honorable Principal
of Al Janoub International School, Mr. Mehasoom Arrakal
for providing us the opportunity and resources needed for
completing this project. We would like to thank our parents
for their immense support and our friends who have
motivated us to complete this project.
5
INTRODUCTION
A Blood bank is a centre where blood gathered because of blood
donation is stored and preserved for later use in blood transfusion.
The term ‘blood bank’ typically refers to a department of a hospital
usually Whitin a Clinical Pathology Laboratory where the storage of
blood product occurs and where pre-transfusion and Blood
Compatibility Testing is performed. Before the blood is supplied to the
patients, the blood will undergo several tests to ensure that the person
receiving the blood is not infected by any disease. The main benefit of
this system is to get the information of the available blood group in a
very short period of time.
❖ OBJECTIVE-
The objective of the blood bank MS is to manage the details of donor,
blood group, blood bank, stock it manages and all the information
about the Donor details, the records of the different blood group etc.
The main objective of this program is to automate the complete
operations of the blood bank. They need to maintain numerous
records. And also searching should be very fast so they can find the
required details instantly.
❖SCOPE-
This program is built in such a way that it should suit all types of blood
banks in future. So, every effort is taken to implement this project in
this blood bank. On successful implementation in this blood bank, we
can target other blood banks in the city.
THIS PROGRAM IS CAPABLE OF PERFOMING THE
FOLLOWING TASKS:
• The program takes in the donor details
• It keeps a record of donor’s age, blood group, Id and name.
• The purpose of this program is to provide help to the people who
need blood by giving them all the details of the blood group available
or regarding the donor with the same blood.
6
• The program will be central registry for collecting information
regarding all haemophilia patients and other congenital bleeding
disorders.
• This program will record, maintain and manage information
regarding blood related stock details.
• It keeps a track of the blood group, Date pf receiving the blood etc.
• The program displays the following information Donor, Id, Donor
Name, Donor age, Platelet count, and RBC count
❖OVERVIEW-
The main aim of developing this program is to provide blood to the
people who need blood. The number of people who need blood are
increasing in large numbers day by day. By using this program, users
can search the blood group available in the city. In order to help
people who, need blood, this program can be used effectively for
getting the details.
7
Modules
There are a total of six modules used in this program for blood
bank management system:
1. Insert donor details
2. Display all donor details
3. Search blood group
4. Request Blood
5. Delete a record
6. Add new user
7. Exit
Insert donor details:
In this module the user is asked to enter the Donor Id, name, age,
group, platelet count and RBC count so as to identify the donor in
the given list easily.
Display all donor details:
This module displays all the doner details in the blood bank
system. This includes Donor id, name, age, blood group, platelet
count, RBC count, Received date and Status.
Search blood group:
This module searches and displays the details of the donor and
the received date when the blood group is entered. This helps to
search for the details without any confusion and mishaps.
Request Blood:
This module updates the blood details after the blood has been
requested. The status immediately changes to ‘N’ from ‘Y’ after
the blood has been requested.
8
Delete a record:
In this module the user is asked to enter the required information
related to the donor, like donor Id so that the system can Identify
that particular donor and delete it.
Add new user:
In this module a new user can be added, and all the details can
be inserted in. This comes in handy when you want to organize all
the details and helps to easily Identify the donor as each donor is
given a unique donor Id.
9
Source code
import os
import pickle
from datetime import date
def main_menu():
print('Blood Bank Management System'.center(89,'*'))
print('1.Insert donor details')
print('2.Display all donor details')
print('3.Serach blood group')
print('4.Request blood')
print('5.Delete a record')
print('6.Add new user')
print('7.Exit')
print('--------------------------------------------------')
choice=int(input('enter your choice[1-7]:'))
if choice==1:
insertDonorRec()
elif choice==2:
readDonorRec()
elif choice==3:
r=input('enter a blood group to search(a+,a-,b+,b-,ab+,ab-,O-
,O+:')
r=r.lower()
checkBlood(r)
searchBlood(r)
elif choice==4:
10
r=int(input('Request Blood from DONOR with ID:'))
requestBlood(r)
elif choice==5:
r=int(input('enter a donor id to delete:'))
deleteDonorRec(r)
elif choice==6:
addUser()
elif choice==7:
print('Goodbye')
exit()
else:
print('INVALID CHOICE')
main_menu()
#Checking the login details
def login():
print('Enter login details.......')
user=input('Enter the username:')
pwd=input('Enter the password:')
f=open('user.dat','rb')
rec=[]
flag=False
while True:
try:
rec=pickle.load(f)
if rec['username']== user and rec['password']== pwd:
print('successfully logged in..')
11
flag=True
return True
except EOFError:
f.close()
break
if flag==False:
print('Username and Password Miss Match../n Try Again..')
login()
#f.close()
#Accepting data for Dictionary
def insertDonorRec():
donor_id=int(input('Enter Donor ID: '))
donor_name=input('Enter Donor name: ')
donor_age=int(input('Enter Donor age: '))
donor_group=input('Enter blood group(a+,a-,b+,b-,ab+,ab-,O-,O+):')
checkBlood(donor_group)
donor_group=donor_group.lower()
donor_platelet=int(input('enter platelet count: '))
donor_rbc=input('enter donor rbc count: ')
today=date.today()
status='Y'
#Creating the dictionary
rec={'ID':donor_id,'Name':donor_name,'Age':donor_age,'Group':donor
12
_group,'Platelet':donor_platelet,'rbc':donor_rbc,'Received
date':today,'Status':status}
#Writing the Dictionary into binary file
f=open('blood.dat','ab')
pickle.dump(rec,f)
f.close()
#Reading the records
def readDonorRec():
f=open('blood.dat','rb')
print('******Complete Details of all Donors******')
print('--------------------------------------------------------------------')
print('ID\t Name\t\t Age\t BloodGrp\t Platelet\t RBC\t Rcvd Date\t
Status')
print('--------------------------------------------------------------------')
while True:
try:
rec=pickle.load(f)
print(rec['ID'],'\t',rec['Name'],'\t\t',rec['Age'],'\t',rec['Group'],'\t\t',rec['Plate
let'],'\t\t',rec['rbc'],'\t',rec['Received date'],'\t',rec['Status'])
except EOFError:
break
print("----------------------------------------------------------")
f.close()
#Searching a record based on blood group avalible
def searchBlood(r):
13
f=open('blood.dat','rb')
flag=False
print('******Details of Donor with blood group',r.upper(),'******')
while True:
try:
rec=pickle.load(f)
if rec['Group']==r and rec['Status']=='Y':
print('Donor ID:',rec['ID'])
print('Donor Name:',rec['Name'])
print('Donor Age:',rec['Age'])
print('Donor Blood Group:',rec['Group'])
print('Platelet Count:',rec['Platelet'])
print('RBC Count:',rec['rbc'])
print('Blood Received date:',rec['Received date'])
print('Status:',rec['Status'])
print('******************************************')
flag=True
except EOFError:
break
if flag==False:
print('Blood Not Avalible')
f.close()
#Modification for a donor id
def requestBlood(r):
14
f=open('blood.dat','rb+')
reclst=[]
while True:
try:
pos=f.tell()
rec=pickle.load(f)
if rec['ID']==r:
if rec['Status']=='Y':
rec['Status']='N'
f.seek(pos)
pickle.dump(rec,f)
print('Blood Details Updated......\n')
else:
print('Blood not avalible.............\n')
break
print('*********Details of Donor*********')
print('Donor ID:',rec['ID'])
print('Donor Name:',rec['Name'])
print('Donor Age:',rec['Age'])
print('Donor Blood Group:',rec['Group'])
print('Status:',rec['Status'])
break
except EOFError:
break
#Deleating a record based on Rollno
15
def deleteDonorRec(r):
f=open('blood.dat','rb')
reclst=[]
while True:
try:
rec=pickle.load(f)
reclst.append(rec)
except EOFError:
break
f.close()
f=open('blood.dat','rb+')
for x in reclst:
if x['ID']==r:
print('*********Removed The Details of Donor with
ID:','r','*********')
print('Donor ID:',x['ID'])
print('Donor Name:',x['Name'])
print('Donor Age:',x['Age'])
print('Donor Blood Group:',x['Group'])
print('Status:',x['Status'])
pickle.dump(x,f)
f.close()
#Add new user
def addUser():
ruser={}
16
user_name=input('Enter Username:')
user_pwd=input('Enter Password:')
user_pwd1=input('Confirm Password')
if user_pwd==user_pwd1:
ruser={'username':user_name,'password':user_pwd}
f=open('user.dat','ab+')
pickle.dump(ruser,f)
#rec=pickle.load(f)
#print(rec)
f.close()
print('User Added Successfully........')
else:
print("Password Miss match........")
def checkBlood(r):
l1=['a+','a-','b+','b-','ab+','ab-','o-','o+']
if r not in l1:
print('Entered Blood group is invalid.........')
main_menu()
####################STARTING OF MAIN PROGRAM#########
#############################
print('Blood Bank Management System'.center(89,'*'))
#addUser()
login()
main_menu()
output
17
18
19
Hardware and software requirements
I. Operating System: Windows 10
II. Processor: 11th Gen Intel® Core™ i7-1165G7@
III. Ram: 16.0 GB
IV. Windows OS
V. Python
20
CONCLUSION
This is a working module created for the storage and
access of data in institution where blood transfusion is
necessary. We have made it easy and user friendly for all
age groups above 16 to use as needed.
We have developed this Blood Bank Management system
using Dictionary in Python.
It can be further developed using MySQL for changes in
the primary key used for identification of an individual.
It can also enter online platforms using Django. This
system has a lot of potential and can be improved by
adding more features.
Therefore, I conclude that I have accomplished in
designing a system that can successfully,
• Check all the necessary parameters before allowing a
user to operate the system.
• Receive and store the details entered by the user.
• Act as a central registry and manage the data it
contains.
• File and operate to ensure there are no mix-up of
data.
• Display thr information of everyone without any
mishaps.
21
Bibliography
• Computer Science with Python-Class XII By: Sumita Arora
• Computer Science with Python-Class XI By:Sumita Arora
• Google.com
• Wikipedia.com
22
23