CS304 Assignment 1
CS304 Assignment 1
Assignment 1
Scenario:
A blood bank plays a vital role in saving people’s lives. A blood bank management
system is a system which manages the donation and storage of blood, and inventory
operations etc. It manages the collection, storage and distribution of blood to hospitals.
Donors are individuals who donate blood. They can register, update their profiles, and
view their donation records. On the other hand, patients in need of blood can register
request and track status of their request. They have specific blood type requirements
and medical history.
The Inventory tracks available blood types and quantities, including inventory ID and
expiration dates, with methods for checking availability and updating records.
Similarly, hospitals can view donor details, and select required donor on biases of
donor’s information. The admin must handle donor registrations, manage blood
inventory, and facilitate blood requests from hospitals. It should also monitor blood
expiry, check donor eligibility and ensures that blood is available for critical patients.
Admin also send reminders to donors for future donations.
Solution:
Entities:
Donor
Patient
Inventory
Hospital
Admin
Attributes & Functions:
Donor ID
Name
Age
Blood Type
Last donation date
Contact info
Eligibility status
Functions:
Register ()
updateProfile ()
viewDonationRecords ()
checkEligibility ()
receiveDonationReminder ()
Patient:
Attributes:
patientID
name
bloodTypeRequired
medicalHistory
contactInfo
requestStatus
Functions:
registerRequest()
viewRequestStatus()
Inventory:
Attributes:
inventoryID
bloodType
quantity
expirationDate
Functions:
checkAvailability()
updateInventory()
removeExpiredBlood()
Blood Request
Attributes:
requestID
patientID
hospitalID
bloodType
priorityLevel
requestStatus
Functions:
submitRequest()
updateRequest()
cancelRequest()
Hospital:
Attributes:
hospitalID
name
location
contactInfo
Functions:
viewDonorDetails()
selectDonor()
Admin
Attributes:
adminID
name
contactInfo
Functions:
registerDonor()
manageInventory()
processBloodRequests()
monitorBloodExpiry()
sendDonationReminders()
3. Relationships Among Identified Objects:
Donor - Patient: Indirect relationship through Inventory; donors supply blood, which is then
requested by patients.
Admin - Donor: Admin manages donor registrations and sends reminders.
Admin - Inventory: Admin monitors and manages the inventory, ensuring blood is available
and up-to-date.
Admin - Hospital: Admin facilitates blood requests from hospitals.
Patient - Inventory: Patients make blood requests, which depend on inventory availability.
Hospital - Donor: Hospitals can view donor information and select donors based on blood
type requirements.
Blood Request - Patient: Patients create and manage their blood requests.
Blood Request - Inventory: Requests are matched to the blood types available in inventory.