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

CS304 Assignment 1 Solution

solution
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)
43 views

CS304 Assignment 1 Solution

solution
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/ 8

CS304 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.

You have to perform the following tasks in this assignment:


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

Solution:
1) Extract the main objects (entities) of above system:
From the scenario the entities of the above system are:
• Donor
• Patient
• Blood
• Inventory
• Hospital
• Admin
• Blood Request
• Donation

2) Find the necessary attributes and functions that need to be associated with
each object.
Donor:
Attributes are:
• donorID (for uniquely identifier)
• donorName (name of the donor)
• donorAge (donor age)
• donorGender (donor gender)
• bloodType (blood group of donor)
• contactInfo (contact informtion of donor such as email, phone number etc.)
• medicalHistory (medical history of the donor)
• lastDonationDate (date of last donation of the donor)
• eligibilityStatus (donor is eligible or not for donation)

Functions are:
• register(): Register as a donor.
• updateProfile(): Update donor details.
• viewDonationHistory(): View past donations.
• checkEligibility(): Check donor’s eligibility to donate.
• donateBlood(): Record blood donation.
• receiveReminder(): Recieve reminders for future donation

Patient:
Attributes are:
• patientID (unique identifier)
• namePatient (name of the patient)
• bloodType (blood group of the patient)
• medicalHistory (medical history of the patient)
• requestedBloodType (requested blood group which is need of the patient)
• requestedQuantity (quantity of the requested blood group)
• requestStatus (status of the request is fullfilled, pending or cancelled)
• contactInfo (contact information of the patient)

Functions are:
• register(): Register as a patient.
• requestBlood(): Place a blood request.
• trackRequestStatus(): Track status of the blood request.

Blood:
Attributes are:
• bloodID (unique identifier)
• bloodType (blood group)
• quantity (how much required)
• expiryDate (date of expiry)
• donorID (for knowing who is donating blood)

Functions are:
• checkExpiry(): Check if the blood has expired.
• updateInventory(): Update the blood quantity and expiry.

Inventory:
Attributes are:
• inventoryID (unique identifier)
• bloodType (blood group)
• availableQuantity (no of bottles)
• expiryDate (date of expiry)
• location (storage location of blood)
Function are:
• addBlood(): Add blood to inventory.
• updateInventory(): Update blood details (quantity, expiry, etc.).
• checkAvailability(): Check if requested blood type is available.

Hospital:
Attributes are:
• hospitalID (unique identifier)
• hospitalName (name of the hospital)
• contactInfo (contact information like email , phone number etc)
• hospitalLocation (hospital location where is placed)
Functions are:
• viewDonorDetails(): View information of available donors.
• requestBlood(): Place a blood request.
• trackRequestStatus(): Track status of a blood request.

Admin:
Attributes are:
• adminID (unique identifier)
• adminName (name of admin)
• contactInfo (contact information of admin)
• role (role of the admin)
Functions are:
• manageDonorRegistrations(): Approve or reject donor registrations.
• manageBloodInventory(): Manage the inventory
• checkBloodExpiry(): Track blood expiry and ensure timely usage or discard.
• sendDonationReminders(): Send reminders to donors for future donations.
• approveRequest(): Approve or reject blood requests from hospitals.
BloodRequest:
Attributes are:
• requestID (unique identifier)
• patientID (links to the patient requesting blood)
• requestedBloodType (requested blood group)
• requestedQuantity (requested quantity of the blood)
• requestStatus ( Pending, Fulfilled, Denied)
• hospitalID (links to the hospital requesting blood)

Functions are:

• createRequest(): Create a new blood request.


• updateRequestStatus(): Update the status of the request (Pending, Fulfilled, Denied).
• trackRequestStatus(): Track the current status of the request.

Donation:
Attributes are:
• donationID (unique identifier)
• donorID (linked to the donor who made the donation)
• bloodType (blood group)
• donationDate (date of the donation)
• volumeDonated (integer)

Functions are:
• recordDonation(): Record a new donation.
• updateDonationStatus(): Update donation status (successful, failed, etc.).

3) Identify the relationships among identified objects.


• Donor → Donation: A donor can make multiple donations, so one-to-many relationship
between Donor and Donation.
• Patient → BloodRequest: A patient can place multiple blood requests, so one-to-many
relationship between Patient and Blood Request.
• Hospital → BloodRequest: A hospital can place multiple blood requests, so one-to-
many relationship between Hospital and Blood Request.
• Inventory → Blood: The inventory stores multiple units of blood, so one-to-many
relationship between Inventory and Blood.
• Admin → Donor: Admin manages donor registrations, so one-to-many relationship
between Admin and Donor.
• Admin → BloodRequest: Admin approves/rejects blood requests, so one-to-many
relationship between Admin and Blood Request.
• Admin → Inventory: Admin manages inventory, so one-to-many relationship between
Admin and Inventory.
• BloodRequest → Blood: A blood request is fulfilled by a specific blood type, so many-
to-one relationship between Blood Request and Blood.

4) Construct a final comprehensive Class diagram showing all objects and


their relationships along with their attributes and functions.

Donor Donation
donorID donationID

donorName donorID

donorGender bloodType

bloodType bloodType

contactInfo donationDate

medicalHistory volumeDonated

lastDonationDate

eligibilityStatus
Patient BloodReqest
patientID requestID

namePatient patientID

bloodType requestedBloodType

medicalHistory requestedQuantity

requestedBloodType requestStatus

requestedQuantity hospitalID

requestStatus
contactInfo
Hospital
hospitalID
hospitalName
contactInfo
hospitalLocation

Inventory
inventoryID
bloodType
availableQuantity
expiryDate
location

Blood
bloodID
bloodType
quantity
expiryDate
donorID
Admin
adminID
adminName
contactInfo
role

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