= Entity-Relationship Model v.01 = == Diagram == [[Image(ERModel_v01.png, 2000px)]] == Data requirements == === Entities === '''`Donor`''' The `Donor` entity represents individuals registered in the system who can participate in blood donation activities. It is modeled separately because donors can have multiple appointments and donations over time, while their personal identity remains the same regardless of the number of donation activities they participate in. '''Candidate keys:''' * `donor_id` – Primary key. It uniquely identifies each donor and is selected as the system's internal identifier. * `embg` – Alternative candidate key, since every citizen has a unique EMBG. `donor_id` is chosen as the primary key because `embg` is sensitive personal data that should not be repeated as a key in other tables, and a foreign donor may not have one. '''Attributes:''' * `donor_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `embg` – Text (CHAR(13)), required, unique, exactly 13 numeric digits. * `full_name` – Composite attribute consisting of: * `first_name` – Text (VARCHAR), required, non-empty first name. * `last_name` – Text (VARCHAR), required, non-empty last name. * `date_of_birth` – Date (DATE), required, valid date that cannot be in the future. * `age` – Numeric (INTEGER), derived from `date_of_birth` and the current date. * `gender` – Text (VARCHAR), required, one of: `M`, `F`. * `phone` – Text (VARCHAR), multivalued, stores one or more valid telephone numbers. * `email` – Text (VARCHAR), optional, must follow a valid email address format. * `address` – Composite attribute consisting of: * `street` – Text (VARCHAR), required, street and street number. * `city` – Text (VARCHAR), required, city of residence. * `deferred_until` – Date (DATE), optional, indicates the date until which the donor is temporarily deferred. * `deferral_reason` – Text (TEXT), optional, describes the reason for donor deferral. It should be provided when a deferral is recorded. ---- '''`BloodGroup`''' The `BloodGroup` entity represents the different blood groups recognized by the system, based on the ABO and Rh classifications. It is modeled as a separate entity because blood group information is shared by donors, patients, and collected blood units. Centralizing this information also allows the system to define compatibility rules between different blood groups and component types. '''Candidate keys:''' * `bg_id` – Primary key. It uniquely identifies each blood group. * (`abo_type`, `rh_factor`) – Alternative composite candidate key, since each combination appears only once. `bg_id` is chosen as the primary key because a single short key is simpler to use in the many relationships connected to blood groups than a pair of attributes. '''Attributes:''' * `bg_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `abo_type` – Text (VARCHAR), required, restricted to `A`, `B`, `AB`, or `O`. * `rh_factor` – Text (VARCHAR), required, restricted to positive or negative Rh factor (`+` or `-`). ---- '''`TransfusionCenter`''' The `TransfusionCenter` entity represents the facilities responsible for organizing blood donation campaigns and providing blood transfusion services. It is modeled independently because the system can manage multiple transfusion centers, each operating with its own campaigns, appointments, and employees. '''Candidate keys:''' * `center_id` – Primary key. It uniquely identifies each transfusion center. '''Attributes:''' * `center_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `name` – Text (VARCHAR), required, non-empty name of the transfusion center. * `phone` – Text (VARCHAR), required, valid telephone number, preferably including the international country code. * `address` – Composite attribute consisting of: * `street` – Text (VARCHAR), required, street and street number. * `city` – Text (VARCHAR), required, city in which the center is located. ---- '''`Campaign`''' The `Campaign` entity represents organized blood donation campaigns conducted by transfusion centers. It is modeled as a separate entity because a transfusion center can organize multiple campaigns, and each campaign can have multiple appointments associated with it. This separation allows campaigns and their associated appointments to be managed independently. '''Candidate keys:''' * `campaign_id` – Primary key. It uniquely identifies each campaign and is selected because it is independent of the campaign's name, location, and date. '''Attributes:''' * `campaign_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `name` – Text (VARCHAR), required, non-empty campaign name. * `location` – Text (VARCHAR), required, describes the campaign location. * `campaign_date` – Date (DATE), required, valid calendar date. ---- '''`Appointment`''' The `Appointment` entity represents a scheduled visit by a donor to a transfusion center for a potential blood donation. It is modeled separately from `Donation` because scheduling an appointment does not necessarily mean that a donation will take place. This distinction allows the system to manage scheduled visits independently of completed donation procedures. '''Candidate keys:''' * `appointment_id` – Primary key. It uniquely identifies each appointment. '''Attributes:''' * `appointment_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `date_time` – Date and time (TIMESTAMP), required, valid date and time for the scheduled appointment. ---- '''`Employee`''' The `Employee` entity represents personnel employed by a transfusion center. It serves as a general entity for the different professional roles within the center. It is specialized into `Doctor`, `Nurse`, and `LabTechnician` because these roles share common employee characteristics but have different professional responsibilities and additional role-specific attributes. The specialization is disjoint, as indicated by the `d` notation in the ER diagram, and total, because every employee has exactly one of these roles. '''Candidate keys:''' * `employee_id` – Primary key. It uniquely identifies each employee. * `embg` – Alternative candidate key, since every citizen has a unique EMBG. `employee_id` is chosen as the primary key because `embg` is sensitive personal data that should not be repeated as a key in other tables. '''Attributes:''' * `employee_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `embg` – Text (CHAR(13)), required, unique, exactly 13 numeric digits. * `full_name` – Composite attribute consisting of: * `first_name` – Text (VARCHAR), required, non-empty first name. * `last_name` – Text (VARCHAR), required, non-empty last name. * `phone` – Text (VARCHAR), required, valid telephone number. * `hire_date` – Date (DATE), required, valid employment date. ---- '''`Doctor`''' The `Doctor` entity represents employees who have the professional role of a doctor within a transfusion center. It is modeled as a specialization of `Employee` because doctors inherit the common employee characteristics while having additional information specific to their medical qualifications and professional responsibilities. '''Candidate keys:''' * `employee_id` – Primary key, inherited from `Employee`. * `license_no` – Alternative candidate key, provided that professional license numbers are unique. The inherited `employee_id` is selected as the primary key to maintain the identification of the doctor in relation to the general `Employee` entity. '''Attributes:''' * `employee_id` – Numeric (BIGINT), required, inherited from `Employee` and references the corresponding employee. * `license_no` – Text (VARCHAR), required, unique professional license number. * `specialty` – Text (VARCHAR), required, medical specialty of the doctor. ---- '''`Nurse`''' The `Nurse` entity represents employees responsible for nursing activities within a transfusion center, particularly during blood donation procedures. It is modeled as a specialization of `Employee` because nurses share the common employee characteristics but have additional information related to their specific professional role. '''Candidate keys:''' * `employee_id` – Primary key, inherited from `Employee`. '''Attributes:''' * `employee_id` – Numeric (BIGINT), required, inherited from `Employee` and references the corresponding employee. * `shift` – Text (VARCHAR), required, the nurse's assigned work shift, one of: `morning`, `afternoon`, `night`. ---- '''`LabTechnician`''' The `LabTechnician` entity represents employees responsible for laboratory activities, including testing blood units and handling discarded components. It is modeled as a specialization of `Employee` because laboratory technicians share common employee characteristics but have additional professional qualifications and responsibilities specific to laboratory work. '''Candidate keys:''' * `employee_id` – Primary key, inherited from `Employee`. '''Attributes:''' * `employee_id` – Numeric (BIGINT), required, inherited from `Employee` and references the corresponding employee. * `certification` – Text (VARCHAR), required, certification or professional qualification held by the laboratory technician. ---- '''`Donation`''' The `Donation` entity represents an individual blood donation performed by a donor. It is modeled independently because each donation is a separate medical and operational event, even when the same donor participates multiple times. This allows each donation to be associated with its corresponding examination, blood collection procedure, and resulting blood unit. '''Candidate keys:''' * `donation_id` – Primary key. It uniquely identifies each donation. '''Attributes:''' * `donation_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `donated_at` – Date and time (TIMESTAMP), required, records when the donation took place; cannot be in the future. * `body_temperature` – Numeric (DECIMAL), required, body temperature measured in degrees Celsius; must be between 34.0 and 42.0. * `weight_kg` – Numeric (DECIMAL), required, donor's measured weight in kilograms; must be between 30 and 250. * `blood_pressure` – Text (VARCHAR), required, records blood pressure in a standardized systolic/diastolic format, for example 120/80 mmHg. The systolic value must be between 60 and 250, the diastolic value between 30 and 150, and the diastolic value must be lower than the systolic. * `hemoglobin` – Numeric (DECIMAL), required, hemoglobin measurement in g/dL; must be between 5.0 and 25.0. * `pulse` – Numeric (INTEGER), required, pulse measured in beats per minute; must be between 30 and 220. ---- '''`BloodUnit`''' The `BloodUnit` entity represents a collected unit of whole blood obtained from a donation. It is modeled separately from `Donation` because the collected blood unit becomes an individual object that can be identified, tested, stored, and subsequently separated into different blood components. This distinction allows the system to track the blood unit throughout its lifecycle. '''Candidate keys:''' * `unit_id` – Primary key. It uniquely identifies each blood unit. * `barcode` – Alternative candidate key, since every bag carries a unique barcode. `unit_id` is chosen as the primary key because it is a short internal number, while the barcode is a longer text whose format depends on the labeling equipment. '''Attributes:''' * `unit_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `barcode` – Text (VARCHAR), required, unique barcode used to identify and track the blood unit. It may contain numeric and alphanumeric characters. * `volume_ml` – Numeric (DECIMAL), required, volume of collected blood in milliliters; must be greater than zero and at most 600. ---- '''`TestType`''' The `TestType` entity represents the different laboratory tests that can be performed on collected blood units. It is modeled separately from the actual testing operations because the definition of a test is independent of the individual blood units on which that test is performed. This allows the same test types to be reused for multiple blood units. '''Candidate keys:''' * `test_type_id` – Primary key. It uniquely identifies each test type. '''Attributes:''' * `test_type_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `name` – Text (VARCHAR), required, non-empty name of the test. * `is_mandatory` – Boolean, required, indicates whether the test is mandatory. Allowed values are `TRUE` or `FALSE`. ---- '''`Component`''' The `Component` entity represents an individual blood component obtained by separating a collected blood unit. It is modeled separately from `BloodUnit` because a single blood unit can produce multiple components, each of which can have its own storage conditions, expiration date, allocation, and transfusion history. It is modeled as a weak entity of `BloodUnit`, because a component cannot exist without the unit it was separated from and is identified only within that unit. '''Candidate keys:''' * (`unit_id`, `component_no`) – Primary key, formed by the identifier of the owning blood unit together with the partial key `component_no`. '''Attributes:''' * `component_no` – Numeric (INTEGER), required, partial key, unique within its blood unit, starting from 1. * `produced_at` – Date and time (TIMESTAMP), required, records when the component was produced. * `volume_ml` – Numeric (DECIMAL), required, component volume in milliliters; must be greater than zero. * `expiry_date` – Date (DATE), derived attribute, calculated using the production date and the shelf life associated with the component type. ---- '''`ComponentType`''' The `ComponentType` entity represents the different categories of blood components managed by the system. It is modeled separately from `Component` because multiple individual components can belong to the same type and share the same storage requirements, temperature limits, and shelf life. '''Candidate keys:''' * `ct_id` – Primary key. It uniquely identifies each component type. '''Attributes:''' * `ct_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `name` – Text (VARCHAR), required, non-empty name of the component type. * `shelf_life_days` – Numeric (INTEGER), required, shelf life expressed in days; must be greater than zero. * `storage_temp` – Composite attribute consisting of: * `min_temp` – Numeric (DECIMAL), required, minimum permitted storage temperature in degrees Celsius. * `max_temp` – Numeric (DECIMAL), required, maximum permitted storage temperature in degrees Celsius; must be greater than `min_temp`. ---- '''`Hospital`''' The `Hospital` entity represents healthcare institutions that request blood components for their patients. It is modeled separately because a hospital can submit multiple blood requests and treat multiple patients, while remaining an independent institution within the system. '''Candidate keys:''' * `hospital_id` – Primary key. It uniquely identifies each hospital. '''Attributes:''' * `hospital_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `name` – Text (VARCHAR), required, non-empty hospital name. * `phone` – Text (VARCHAR), required, valid telephone number. * `address` – Composite attribute consisting of: * `street` – Text (VARCHAR), required, street and street number. * `city` – Text (VARCHAR), required, city in which the hospital is located. ---- '''`BloodRequest`''' The `BloodRequest` entity represents a request submitted by a hospital for blood components needed by its patients. It is modeled separately because each request is an individual process that must be tracked independently, from its submission and allocation of available components to its eventual fulfillment. '''Candidate keys:''' * `request_id` – Primary key. It uniquely identifies each blood request. '''Attributes:''' * `request_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `created_at` – Date and time (TIMESTAMP), required, records when the request was created. * `urgency` – Text (VARCHAR), required, one of: `routine`, `urgent`, `emergency`. ---- '''`Patient`''' The `Patient` entity represents individuals who require blood transfusions. It is modeled as a separate entity because a patient can have multiple blood requests and receive multiple transfusions over time. Keeping patient information independent of individual requests and transfusions allows the system to maintain a consistent record of each patient throughout their treatment. '''Candidate keys:''' * `patient_id` – Primary key. It uniquely identifies each patient. `embg` is not a candidate key, because it may be missing when a patient is admitted in an emergency. It is unique only when it is entered. '''Attributes:''' * `patient_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `embg` – Text (CHAR(13)), optional, exactly 13 numeric digits when entered, unique. * `full_name` – Composite attribute consisting of: * `first_name` – Text (VARCHAR), required, non-empty first name. * `last_name` – Text (VARCHAR), required, non-empty last name. * `date_of_birth` – Date (DATE), required, valid date that cannot be in the future. ---- '''`Transfusion`''' The `Transfusion` entity represents an actual blood transfusion administered to a patient. It is modeled separately from `BloodRequest` because submitting a request and performing a transfusion are two different processes. A request may be fulfilled later, and a patient can receive multiple transfusions over time. This entity also allows the system to maintain an individual record of each transfusion procedure. '''Candidate keys:''' * `transfusion_id` – Primary key. It uniquely identifies each transfusion. '''Attributes:''' * `transfusion_id` – Numeric (BIGINT), required, automatically generated, positive and unique. * `transfused_at` – Date and time (TIMESTAMP), required, records when the transfusion took place. * `reaction` – Text (VARCHAR), required, the reaction observed during or after the transfusion, one of: `none`, `mild`, `moderate`, `severe`. The default value is `none`. ---- === Relationships === '''`has_group`''' The `has_group` relationship connects `Donor` and `BloodGroup`. It associates each donor with their blood group. It is modeled as a one-to-many relationship because multiple donors can share the same blood group, while each donor has at most one recorded blood group. '''Cardinality:''' `BloodGroup` (1) : `Donor` (N). '''Relationship attributes:''' None. ---- '''`works_at`''' The `works_at` relationship connects `Employee` and `TransfusionCenter`. It represents the employment relationship between personnel and their respective transfusion centers. It is modeled as a one-to-many relationship because one transfusion center can employ multiple employees, while each employee is associated with one center. '''Cardinality:''' `TransfusionCenter` (1) : `Employee` (N). '''Relationship attributes:''' None. ---- '''`organizes`''' The `organizes` relationship connects `Campaign` and `TransfusionCenter`. It represents the responsibility of a transfusion center for organizing blood donation campaigns. It is modeled as a one-to-many relationship because one transfusion center can organize multiple campaigns, while each campaign is organized by one transfusion center. '''Cardinality:''' `TransfusionCenter` (1) : `Campaign` (N). '''Relationship attributes:''' None. ---- '''`books`''' The `books` relationship connects `Donor` and `Appointment`. It represents the association between a donor and their scheduled appointments. It is modeled as a one-to-many relationship because one donor can book multiple appointments over time, while each appointment is booked by one donor. '''Cardinality:''' `Donor` (1) : `Appointment` (N). '''Relationship attributes:''' None. ---- '''`for_campaign`''' The `for_campaign` relationship connects `Campaign` and `Appointment`. It associates appointments with the campaigns for which donors have registered. It is modeled as a one-to-many relationship because one campaign can have multiple appointments, while each appointment belongs to at most one campaign. '''Cardinality:''' `Campaign` (1) : `Appointment` (N). '''Relationship attributes:''' None. ---- '''`at_center`''' The `at_center` relationship connects `Appointment` and `TransfusionCenter`. It identifies the transfusion center at which an appointment is scheduled to take place. It is modeled as a one-to-many relationship because one transfusion center can host multiple appointments, while each appointment takes place at one center. '''Cardinality:''' `TransfusionCenter` (1) : `Appointment` (N). '''Relationship attributes:''' None. ---- '''`gives`''' The `gives` relationship connects `Donor` and `Donation`. It represents the association between a donor and the blood donations they make. It is modeled as a one-to-many relationship because one donor can make multiple donations over time, while each donation is associated with one donor. '''Cardinality:''' `Donor` (1) : `Donation` (N). '''Relationship attributes:''' None. ---- '''`from_appointment`''' The `from_appointment` relationship connects `Appointment` and `Donation`. It records which appointment resulted in a particular blood donation. It is modeled as a one-to-one relationship because an appointment can result in at most one donation, and a donation can come from at most one appointment. '''Cardinality:''' `Appointment` (1) : `Donation` (1). '''Relationship attributes:''' None. ---- '''`examined_by`''' The `examined_by` relationship connects `Donation` and `Doctor`. It identifies the doctor responsible for examining the donor during the donation procedure. It is modeled as a one-to-many relationship because one doctor can examine multiple donations, while each donation is examined by one doctor. '''Cardinality:''' `Doctor` (1) : `Donation` (N). '''Relationship attributes:''' None. ---- '''`performed_by`''' The `performed_by` relationship connects `Donation` and `Nurse`. It identifies the nurse responsible for performing the blood collection procedure. It is modeled as a one-to-many relationship because one nurse can perform multiple donations, while each donation is performed by one nurse. '''Cardinality:''' `Nurse` (1) : `Donation` (N). '''Relationship attributes:''' None. ---- '''`produces`''' The `produces` relationship connects `Donation` and `BloodUnit`. It represents the production of a collected blood unit as the result of a donation. It is modeled as a one-to-one relationship because each donation produces at most one blood unit, and each blood unit originates from one donation. '''Cardinality:''' `Donation` (1) : `BloodUnit` (1). '''Relationship attributes:''' None. ---- '''`tested`''' The `tested` relationship connects `TestType`, `LabTechnician`, and `BloodUnit`. It represents a laboratory testing operation performed on a blood unit by a laboratory technician using a particular test type. It is modeled as a ternary relationship because all three entities are needed to describe a testing operation. This makes it possible to associate each test result with the corresponding blood unit, test type, and responsible technician. '''Cardinality:''' `TestType` (M) : `BloodUnit` (N) : `LabTechnician` (1). A specific test on a specific blood unit is performed by one laboratory technician. '''Relationship attributes:''' * `result` – Text (VARCHAR), required, the outcome of the performed test, one of: `positive`, `negative`. * `tested_at` – Date and time (TIMESTAMP), required, records when the test was performed. ---- '''`confirmed_group`''' The `confirmed_group` relationship connects `BloodUnit` and `BloodGroup`. It records the blood group confirmed for a collected blood unit after the appropriate testing and verification procedures. It is modeled as a one-to-many relationship because multiple blood units can have the same confirmed blood group, while each blood unit is assigned one blood group. '''Cardinality:''' `BloodGroup` (1) : `BloodUnit` (N). '''Relationship attributes:''' None. ---- '''`separated_into`''' The `separated_into` relationship connects `BloodUnit` and `Component`. It represents the process of separating a collected blood unit into individual blood components. It is the identifying relationship of the weak entity `Component`, which is identified by its blood unit together with its own `component_no`. It is modeled as a one-to-many relationship because one blood unit can produce multiple components, while each component originates from one blood unit. '''Cardinality:''' `BloodUnit` (1) : `Component` (N). '''Relationship attributes:''' None. ---- '''`of_type`''' The `of_type` relationship connects `Component` and `ComponentType`. It classifies each individual blood component according to its corresponding component type. It is modeled as a one-to-many relationship because multiple components can belong to the same component type, while each component has one defined type. '''Cardinality:''' `ComponentType` (1) : `Component` (N). '''Relationship attributes:''' None. ---- '''`discards`''' The `discards` relationship connects `LabTechnician` and `Component`. It records which laboratory technician is responsible for discarding a blood component. It is modeled as a one-to-many relationship because one laboratory technician can discard multiple components, while each discarded component is associated with one technician. '''Cardinality:''' `LabTechnician` (1) : `Component` (N). '''Relationship attributes:''' * `discarded_at` – Date and time (TIMESTAMP), required, records when the component was discarded. * `reason` – Text (TEXT), required, describes the reason for discarding the component. ---- '''`compatible_with`''' The `compatible_with` relationship connects `BloodGroup` with itself and `ComponentType`. It represents blood group compatibility rules based on the donor's blood group, the recipient's blood group, and the type of blood component. The `BloodGroup` entity participates twice in this relationship, with the distinct roles of `donor` and `recipient`. It is modeled as a ternary recursive relationship because compatibility depends on the combination of these three elements rather than on blood groups alone. '''Cardinality:''' `BloodGroup` as `donor` (M) : `BloodGroup` as `recipient` (N) : `ComponentType` (P). '''Relationship attributes:''' None. ---- '''`sends`''' The `sends` relationship connects `Hospital` and `BloodRequest`. It represents the submission of blood requests by hospitals to the transfusion center. It is modeled as a one-to-many relationship because one hospital can submit multiple blood requests, while each blood request is submitted by one hospital. '''Cardinality:''' `Hospital` (1) : `BloodRequest` (N). '''Relationship attributes:''' None. ---- '''`for_patient`''' The `for_patient` relationship connects `BloodRequest` and `Patient`. It identifies the patient for whom a particular blood request is submitted. It is modeled as a one-to-many relationship because one patient can have multiple blood requests over time, while each request is intended for at most one patient. '''Cardinality:''' `Patient` (1) : `BloodRequest` (N). '''Relationship attributes:''' None. ---- '''`requests`''' The `requests` relationship connects `BloodRequest`, `BloodGroup`, and `ComponentType`. It represents the specific blood components requested by a hospital, taking into account the required blood group and component type. It is modeled as a ternary relationship because the requested quantity depends on the combination of a particular blood request, blood group, and component type. This allows a single request to include multiple component types and blood groups, each with its own requested quantity. '''Cardinality:''' `BloodRequest` (M) : `ComponentType` (N) : `BloodGroup` (P). '''Relationship attributes:''' * `quantity` – Numeric (INTEGER), required, represents the number of units requested for the specified blood group and component type; must be a positive integer. ---- '''`treated_at`''' The `treated_at` relationship connects `Hospital` and `Patient`. It identifies the hospital at which a patient receives medical treatment. It is modeled as a one-to-many relationship because one hospital can treat multiple patients, while each patient is associated with one hospital in the current model. '''Cardinality:''' `Hospital` (1) : `Patient` (N). '''Relationship attributes:''' None. ---- '''`patient_group`''' The `patient_group` relationship connects `Patient` and `BloodGroup`. It associates each patient with their recorded blood group. It is modeled as a one-to-many relationship because multiple patients can share the same blood group, while each patient has at most one recorded blood group. '''Cardinality:''' `BloodGroup` (1) : `Patient` (N). '''Relationship attributes:''' None. ---- '''`allocated_to`''' The `allocated_to` relationship connects `BloodRequest` and `Component`. It records the allocation of available blood components to a particular hospital blood request. It is modeled as a one-to-many relationship because one blood request can have multiple allocated components, while each component is associated with at most one blood request. '''Cardinality:''' `BloodRequest` (1) : `Component` (N). '''Relationship attributes:''' * `allocated_at` – Date and time (TIMESTAMP), required, records when the component was allocated to the request. ---- '''`crossmatched`''' The `crossmatched` relationship connects `Component` and `Patient`. It represents the compatibility testing performed between a blood component and a patient before transfusion. It is modeled as a many-to-many relationship because a component may be crossmatched against multiple patients, while a patient may undergo crossmatching with multiple components. '''Cardinality:''' `Component` (M) : `Patient` (N). '''Relationship attributes:''' * `result` – Text (VARCHAR), required, stores the crossmatching result, one of: `compatible`, `incompatible`. * `tested_at` – Date and time (TIMESTAMP), required, records when the crossmatching test was performed. ---- '''`receives`''' The `receives` relationship connects `Patient` and `Transfusion`. It represents the administration of a blood transfusion to a patient. It is modeled as a one-to-many relationship because one patient can receive multiple transfusions over time, while each transfusion belongs to one patient. '''Cardinality:''' `Patient` (1) : `Transfusion` (N). '''Relationship attributes:''' None. ---- '''`uses`''' The `uses` relationship connects `Component` and `Transfusion`. It identifies the blood component used during a particular transfusion. It is modeled as a one-to-one relationship because each transfusion uses exactly one component, and a component can be used in at most one transfusion. '''Cardinality:''' `Component` (1) : `Transfusion` (1). '''Relationship attributes:''' None. ---- == Entity-Relationship Model History == * [attachment:ERModel_v01.png v01] – Initial version of the model.