0% found this document useful (0 votes)
13 views

CS304-Assignment No 01

Uploaded by

UMMAD MANSOOR
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

CS304-Assignment No 01

Uploaded by

UMMAD MANSOOR
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment No.

01 (Graded) Total Marks: 20


Semester: Fall 2024
Due Date: 08 November, 2024
CS304- Object Oriented Programming

Student Name: Ummad Mansoor


Student ID: BC190203170

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.

You have to perform the following tasks in this assignment:


1. Extract the main objects (entities) of above system.
2. Find the necessary attributes and functions that need to be associated with each object.
3. Identify the relationships among identified objects.
4. Construct a final comprehensive Class diagram showing all objects and their relationships along with
their attributes and functions.
Answer)

To design the Blood Bank Management System, we first need to break down the requirements and identify
the key entities, attributes, relationships, and functions that should be associated with each entity. This
process involves identifying the main objects in the system, as well as their attributes, functions, and how
they interact with each other. Let’s walk through the process.

1. Main Objects (Entities)

Based on the description of the system, we can identify the following key entities:

 Donor
 Patient
 Blood Bank (Inventory)
 Hospital
 Admin
 Blood Donation
 Blood Request
 Blood Type

2. Attributes and Functions for Each Object

Donor

Attributes:

 donorID (unique identifier)


 name (full name)
 contactDetails (email, phone number)
 dob (date of birth)
 address
 bloodType (A, B, AB, O, etc.)
 donationHistory (list of donations made)
 lastDonationDate (date of last donation)
 eligibilityStatus (whether the donor is eligible for donation)
 weight (used for eligibility check)
 medicalHistory (any relevant medical conditions)

Functions:

 registerDonor() (register new donor)


 updateProfile() (update contact, medical history, etc.)
 viewDonationHistory() (view past donations)
 checkEligibility() (check eligibility to donate)
 donateBlood() (record donation)

Patient

Attributes:

 patientID (unique identifier)


 name (full name)
 contactDetails (email, phone number)
 bloodType (required blood type)
 medicalHistory (relevant medical conditions)
 bloodRequestStatus (status of current request)
 hospitalName (where they are being treated)
 requiredQuantity (amount of blood needed)

Functions:

 registerPatient() (register as a patient)


 requestBlood() (submit blood request)
 trackRequestStatus() (check current status of request)

Blood Bank (Inventory)

Attributes:

 inventoryID (unique identifier)


 bloodType (A, B, AB, O, etc.)
 quantity (current available quantity)
 expirationDate (expiration date of the blood)
 lastUpdated (last update timestamp)

Functions:

 checkAvailability() (check if a specific blood type is available)


 updateInventory() (update the quantity of a blood type)
 monitorExpiry() (monitor blood stock expiry)

Hospital

Attributes:

 hospitalID (unique identifier)


 hospitalName
 contactDetails (email, phone number)
 location
 requestHistory (list of all blood requests made)

Functions:

 viewAvailableBlood() (view available blood types in the bank)


 requestBlood() (make a request for blood)
 selectDonor() (choose a donor based on blood type)

Admin

Attributes:

 adminID (unique identifier)


 name (full name)
 contactDetails (email, phone number)
 role (admin or other roles)

Functions:

 manageDonors() (approve, register, or remove donors)


 manageInventory() (add, update, remove blood types from inventory)
 viewRequests() (view all blood requests)
 approveRequest() (approve or reject a blood request)
 sendReminders() (send reminders to donors for future donations)
 monitorEligibility() (ensure donors are eligible for future donations)

Blood Donation

Attributes:

 donationID (unique identifier)


 donorID (reference to donor)
 bloodType (blood type donated)
 donationDate (date of donation)
 quantity (amount of blood donated)
Functions:

 recordDonation() (store details of the donation)


 updateDonationStatus() (update status of donation if needed)

Blood Request

Attributes:

 requestID (unique identifier)


 patientID (reference to patient)
 hospitalID (reference to hospital)
 bloodTypeRequired (blood type required)
 quantityRequired (quantity required)
 requestStatus (approved, pending, completed)
 requestedDate (date of request)

Functions:

 createRequest() (submit a new blood request)


 updateRequestStatus() (change status of request)

Blood Type

Attributes:

 bloodTypeID (unique identifier)


 bloodType (A, B, AB, O, etc.)

Functions:

 getBloodTypeDetails() (retrieve details about blood types)

3. Relationships among Objects

The relationships between the objects are as follows:

 Donor → Blood Donation: A donor can donate multiple times, so there is a one-to-many
relationship between Donor and Blood Donation.
 Blood Donation → Blood Bank: Each blood donation adds blood to the inventory, creating a one-
to-many relationship from Blood Donation to Blood Bank (since multiple donations of the same
blood type can be stored in the inventory).
 Hospital → Blood Request: A hospital can place multiple blood requests, so there is a one-to-many
relationship between Hospital and Blood Request.
 Patient → Blood Request: A patient can have a single or multiple blood requests, so there is a one-
to-many relationship between Patient and Blood Request.
 Admin → Donor, Inventory, Blood Request: Admin has control over managing donors, inventory,
and requests, so the Admin has a one-to-many relationship with these objects.
 Blood Request → Blood Bank: A blood request is fulfilled by blood in the inventory, establishing a
many-to-one relationship between Blood Request and Blood Bank.
 Patient → Blood Type: A patient requires a specific blood type, creating a many-to-one relationship
between Patient and Blood Type.
 Hospital → Donor: Hospitals may interact with donors directly, selecting donors as needed for
blood requirements.

You might also like