0% found this document useful (0 votes)
26 views5 pages

Assigment cs304

assigmnt cs304

Uploaded by

shahzadkarim180
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)
26 views5 pages

Assigment cs304

assigmnt cs304

Uploaded by

shahzadkarim180
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/ 5

Assignment

Solution:
1. Extract Main Objects (Entities)
Based on the scenario, the main entities for this system would include:

1. Donor

2. Patient

3. Blood Inventory

4. Hospital

5. Admin

6. Blood Request

2. Necessary Attributes and Functions for Each


Object
Here are some attributes and functions for each entity.

Entity: Donor

 Attributes:

o donor_id: Unique identifier for each donor.

o name: Donor's full name.

o age: Age of the donor.

o blood_type: Blood type of the donor (e.g., A+, B-, etc.).

o contact_info: Contact information (phone/email).

o last_donation_date: Date of last blood donation.

o eligibility_status: Boolean indicating whether the donor is eligible


for donation (based on criteria like last donation date, health
status).

 Functions:

o register(): Registers a new donor.


o update_profile(): Updates donor information.

o view_donation_records(): Views past donation records.

o check_eligibility(): Checks if the donor is eligible for donation.

o send_donation_reminder(): Sends reminders to eligible donors.

Entity: Patient

 Attributes:

o patient_id: Unique identifier for each patient.

o name: Patient's full name.

o blood_type_needed: Blood type required by the patient.

o medical_history: Medical history of the patient (relevant to blood


transfusion).

o contact_info: Contact information.

 Functions:

o register_request(): Registers a new blood request.

o track_request_status(): Tracks the status of their blood request.

Entity: Blood Inventory

 Attributes:

o inventory_id: Unique identifier for each blood unit in inventory.

o blood_type: Blood type of the stored blood.

o quantity: Amount of blood available per blood type.

o expiration_date: Expiration date for the stored blood.

 Functions:

o check_availability(blood_type): Checks the availability of a


specified blood type.

o update_quantity(blood_type, quantity): Updates quantity of a


particular blood type.

o monitor_expiry(): Checks for blood units that are about to expire


and manages them accordingly.
Entity: Hospital

 Attributes:

o hospital_id: Unique identifier for each hospital.

o name: Name of the hospital.

o contact_info: Contact information of the hospital.

 Functions:

o view_donor_details(blood_type): Allows hospitals to view donors


based on blood type.

o select_donor(donor_id): Selects a donor based on their details for


potential blood donation.

Entity: Admin

 Attributes:

o admin_id: Unique identifier for the admin.

o name: Admin's full name.

o contact_info: Contact information for the admin.

 Functions:

o manage_donor_registration(donor): Handles the registration of


new donors.

o manage_blood_inventory(): Manages and updates the blood


inventory.

o process_blood_request(request): Processes requests for blood


from hospitals.

o monitor_blood_expiry(): Regularly checks inventory for blood


expiry.

o check_donor_eligibility(donor_id): Checks if a donor is eligible for


donation.

o send_reminders_to_donors(): Sends donation reminders to


donors.

Entity: Blood Request


 Attributes:

o request_id: Unique identifier for each blood request.

o patient_id: The ID of the patient making the request.

o blood_type: Blood type needed for the request.

o quantity: Quantity of blood required.

o status: Current status of the request (e.g., "Pending",


"Approved", "Fulfilled").

 Functions:

o update_status(new_status): Updates the status of the blood


request.

o check_inventory(): Checks if required blood is available in the


inventory.

3. Relationship
Compositi
Related Relationsh on /
Entity Description
Entity ip Type Aggregati
on
Blood
One-to- A donor donates multiple blood units
Donor Inventor Aggregation
Many that are added to the inventory.
y
A patient can make multiple blood
Blood One-to- Compositio requests, and each request is
Patient
Request Many n dependent on the patient (request
ceases if patient is removed).
Blood Blood Blood requests use multiple units from
Many-to-
Reques Inventor Aggregation the inventory, and each unit may fulfill
Many
t y multiple requests over time.
Hospit Blood One-to- Hospitals can place multiple blood
Aggregation
al Request Many requests for their patients.
Admins manage the registration and
One-to-
Admin Donor Aggregation eligibility of multiple donors but do not
Many
"own" the donor records.
Admin Blood One-to- Aggregation Admins monitor and update the blood
Inventor One / One- inventory but do not own the
y to-Many inventory data.
Admins are responsible for processing
Blood One-to-
Admin Aggregation multiple blood requests but do not
Request Many
own the requests themselves.

4. Class Diagram
Note: Zoom in the Image for a Clear View

You might also like