








































Looking for expert guidance for ICT Projects and Assignments? Join our Individual/Group/Online Classes in English, Sinhala, or Tamil. We offer: PHP & Python Projects and Automation Comprehensive Tutorials, Notes, and Exam Papers Digital Marketing & E-Commerce Website Development Database Design, Graphics, Articles, Blogs, and Content Writing Programming & Tech Solutions AI Applications and Office Consultations/Training 📞 WhatsApp us at +94 777337279 📧 Email: ITClassSL@gmail.com
User Registration & Login
Role-based Access Control (Admin, Staff, Donor, Recipient, Hospital, Lab)
Profile Management
Register new users (donors, recipients, staff, hospitals)
Login/logout
Edit/update profile
Change password / forgot password
Verify identity (OTP/email/SMS)
Blood Stock Management
Blood Group Categorization
Location-wise Availability
Add new blood units (with type, RH factor, expiry)
Remove expired/damaged units
View available units by group and location
Track inventory level alerts (low/high)
Barcode generation for units
Donor Scheduling
Donation History
Eligibility Checking
Book donation appointment (calendar integration)
Send reminders to donors
Maintain donation records
Check donor eligibility (health, last donation date)
Generate donation certificate
Blood Request by Patients/Hospitals
Emergency Requests
Approval Workflow
Submit blood request form (group, quantity, urgency)
Approve/reject requests by admin/staff
Notify nearest available donor
Track status (pending, approved, fulfilled)
Auto-match available inventory
Partner Hospital Management
Test Reports for Blood
Blood Cross-Matching
Add/edit hospital/lab details
Upload/track test results (HIV, Hepatitis, etc.)
Match donor-recipient compatibility (AI-based or manually)
Issue certificate of blood safety
Donor Eligibility Prediction
Blood Demand Forecasting
Smart Matching System
Donation Recommendation System
Chatbot for FAQs and Support
Predict future demand of blood types (location-wise)
Suggest donation dates based on health history
Match donor-recipient based on compatibility, distance
Suggest nearest center or donor using geolocation
Chatbot to handle user queries (e.g., "Can I donate?", "Where to donate?", etc.)
Inventory Reports
Donation Reports
Request Reports
AI-Generated Forecast Charts
View and download PDF/Excel reports
Visual dashboards (charts for blood types, usage, donor activity)
Predictive graphs (stock forecasting)
Geo heatmaps for high-demand areas
Email Notifications
SMS Alerts
In-App Notifications
Alert donors for upcoming donation date
Notify hospitals on approval/rejection
Emergency broadcast for rare group need
Birthday & donation anniversary wishes
System Settings
Blood Storage Rules (expiry, min stock)
User Roles & Permissions
Configure donation intervals, expiry period, alert thresholds
Add/edit roles (custom roles for staff, partners)
System backup & restore
User Activity Tracking
Login Logs
Data Integrity Checker
Track who changed what and when
Prevent duplicate entries
Log login attempts and failures
Regular health checks for database
Component | Language/Tech |
---|---|
Frontend UI | PHP (HTML/CSS/JS, Bootstrap) |
Backend Logic | PHP |
Database | MySQL |
AI Models | Python (Flask/FastAPI API to PHP) |
Charts | Chart.js / Google Charts |
Chatbot | Python + RASA or OpenAI API |
Notifications | PHP mailer / Twilio / Firebase |
AI Task | Algorithm Suggestions |
---|---|
Donor Eligibility | Logistic Regression / Random Forest |
Blood Demand Forecast | Time-Series (ARIMA, Prophet) |
Smart Matching | KNN / Decision Tree |
Chatbot | RASA / Langchain or GPT-4 (local or API) |
Image Upload of Reports | OCR + ML Classification |
Here is a detailed Work Flow / Data Flow for Each User and Module in your AI-Based Blood Bank Management System using PHP, MySQL, and Python.
Admin
Staff
Donor
Recipient (Patient)
Hospital / Lab
AI Service (Python-based background tasks / APIs)
System management
Inventory monitoring
Approvals
Reporting
Login → Dashboard Overview (stock, requests, alerts)
Manage Users → Add/Remove/Update Donors, Staff, Hospitals
Manage Inventory → Add/Update/Delete blood stock
Approve Blood Requests → View incoming → Approve/Reject
Check Reports & Forecasts → View AI charts, donor reports
System Settings → Configure alert levels, roles, expiry rules
Coordinate blood donations & requests
Enter health check data
Maintain stock
Login → View dashboard (donors, requests, pending actions)
Manage Appointments → Confirm donor schedules
Check Donor Health → Enter vitals & eligibility
Update Inventory → Add donated units, remove expired
Handle Requests → Forward to admin or fulfill if allowed
Generate Certificates → Print donation or test certificates
Register & donate blood
View history & reminders
Register/Login → Profile setup
Check Eligibility (AI or questionnaire)
Book Donation Appointment
Receive Reminder Notification (email/SMS)
Donate Blood → Confirmed & stock updated by staff
View Donation History → See past donations, certificates
Get AI Recommendation → Best time/place to donate next
Request blood
Track request status
Register/Login
Submit Blood Request → Group, quantity, urgency, location
Wait for Approval (Admin/staff)
View Request Status
Get Notifications → Approval/rejection, pickup info
Request blood for patients
Submit test reports
Login → View dashboard
Submit Request for Blood (for patients)
Enter/Upload Test Reports → HIV, HBV, etc.
Check Compatibility Results → AI or manual
Download Certificates (Safety or rejection)
Prediction, recommendation, automation
Donor inputs age, weight, last donation, health status
PHP sends data to Python API
AI model returns Eligible / Not Eligible
Inventory and request data sent to Python
AI model (Prophet, ARIMA) returns next 30 days’ demand
PHP displays graph using Chart.js
A new request is made
PHP queries donor list and sends to Python
AI ranks matches by blood group, location, availability
PHP notifies top donors
User asks question (chat window)
PHP sends input to Python (RASA/GPT)
Python returns response → displayed to user
User | Module | Input | Process | Output |
---|---|---|---|---|
Admin | User Mgmt | User data | Validate, store | User added |
Admin | Inventory | Blood info | Add/update/delete | Stock updated |
Staff | Donations | Appointment + vitals | Check eligibility | Add to inventory |
Donor | Appointment | Slot selection | Check conflict | Confirmed |
Recipient | Request | Blood group, qty | Match, validate | Status returned |
Hospital | Report | Test results | Store, validate | Safety cert |
AI | Forecasting | Stock + usage logs | ML model | Graph/chart |
AI | Matching | Donor + recipient | Match scoring | Best match |
AI | Chatbot | Question | NLP engine | Answer |
Function | Tool/API |
---|---|
Email/SMS | Twilio, Mailgun, SendGrid |
Map location | Google Maps API |
Chatbot NLP | RASA, Hugging Face Transformers, OpenAI API |
Charts | Chart.js, Google Charts |
Python APIs | Flask or FastAPI |
[Donor] ---> [Web UI] ---> [Donation Mgmt Module] ---> [Inventory]
|
---> [Eligibility Checker (Python)]
[Recipient] --> [Request Module] ---> [Smart Matcher (Python)] ---> [Donor Notification]
[Admin] ---> [Dashboard] <--- [Reports & Forecasts (Python)]
|
---> [Inventory], [Users], [Requests]
[Hospital] ---> [Request Blood] ---> [Approval Module]
[Lab] ---> [Upload Test Report] ---> [Database] ---> [Blood Status]
Here is a complete Database Design / ER Diagram Description for your AI-Based Blood Bank Management System using MySQL, including table names, columns, data types, primary/foreign keys, and relationships.
blood_bank_db
Stores all system users: donors, recipients, staff, admin, hospitals, labs.
Column Name | Data Type | Description |
---|---|---|
user_id | INT AUTO_INCREMENT | Primary Key |
name | VARCHAR(100) | Full name |
VARCHAR(100) | Unique, login email | |
password | VARCHAR(255) | Hashed password |
phone | VARCHAR(20) | Phone number |
gender | ENUM('Male', 'Female', 'Other') | Gender |
dob | DATE | Date of birth |
user_type | ENUM('admin', 'staff', 'donor', 'recipient', 'hospital', 'lab') | Role |
address | TEXT | Physical address |
status | ENUM('active','inactive') | Account status |
created_at | TIMESTAMP DEFAULT CURRENT_TIMESTAMP | Account creation date |
Additional info for donor users.
Column Name | Data Type | Description |
---|---|---|
donor_id | INT AUTO_INCREMENT | Primary Key |
user_id | INT | FK → users(user_id) |
blood_group | ENUM('A+', 'A-', 'B+', 'B-', 'AB+', 'AB-', 'O+', 'O-') | |
weight | FLOAT | In kilograms |
last_donation | DATE | Last donated date |
eligibility | BOOLEAN | 1 = Eligible, 0 = Not |
diseases | TEXT | Known diseases if any |
Info for blood requesters.
Column Name | Data Type | Description |
---|---|---|
recipient_id | INT AUTO_INCREMENT | Primary Key |
user_id | INT | FK → users(user_id) |
blood_group | ENUM(...) | Needed blood group |
hospital_id | INT | FK → hospitals(hospital_id) |
condition | TEXT | Medical condition |
Registered hospitals.
Column Name | Data Type | Description |
---|---|---|
hospital_id | INT AUTO_INCREMENT | Primary Key |
name | VARCHAR(150) | Hospital name |
address | TEXT | Address |
phone | VARCHAR(20) | Contact number |
VARCHAR(100) |
Registered labs for testing.
Column Name | Data Type | Description |
---|---|---|
lab_id | INT AUTO_INCREMENT | Primary Key |
name | VARCHAR(150) | Lab name |
address | TEXT | Address |
phone | VARCHAR(20) | Phone |
Tracks each donation.
Column Name | Data Type | Description |
---|---|---|
donation_id | INT AUTO_INCREMENT | Primary Key |
donor_id | INT | FK → donors(donor_id) |
donation_date | DATE | Date of donation |
center_location | VARCHAR(100) | Donation center name |
blood_qty_ml | INT | Quantity in ml |
tested | BOOLEAN | Tested or not |
Inventory table for available stock.
Column Name | Data Type | Description |
---|---|---|
inventory_id | INT AUTO_INCREMENT | Primary Key |
blood_group | ENUM(...) | Blood group |
quantity_ml | INT | Total quantity in ml |
received_date | DATE | Date received |
expiry_date | DATE | Auto-calculate (e.g., +42 days) |
donor_id | INT | FK → donors(donor_id) |
status | ENUM('available', 'used', 'expired', 'damaged') |
Tracks blood requests.
Column Name | Data Type | Description |
---|---|---|
request_id | INT AUTO_INCREMENT | Primary Key |
recipient_id | INT | FK → recipients(recipient_id) |
blood_group | ENUM(...) | Requested group |
quantity_ml | INT | Amount needed |
request_date | DATE | Request date |
urgency | ENUM('low','normal','high','emergency') | |
status | ENUM('pending','approved','rejected','fulfilled') | |
matched_inventory_id | INT | FK → blood_inventory(inventory_id) |
Stores testing results.
Column Name | Data Type | Description |
---|---|---|
report_id | INT AUTO_INCREMENT | Primary Key |
donation_id | INT | FK → donations(donation_id) |
lab_id | INT | FK → labs(lab_id) |
hiv | BOOLEAN | 0 = Negative, 1 = Positive |
hbv | BOOLEAN | Hepatitis B result |
hcv | BOOLEAN | Hepatitis C |
syphilis | BOOLEAN | Syphilis |
malaria | BOOLEAN | Malaria |
result | ENUM('safe','unsafe') | Final result |
report_date | DATE | Date tested |
Donation scheduling.
Column Name | Data Type | Description |
---|---|---|
appointment_id | INT AUTO_INCREMENT | Primary Key |
donor_id | INT | FK → donors(donor_id) |
appointment_date | DATETIME | Scheduled date/time |
status | ENUM('scheduled','completed','cancelled') |
All messages/alerts.
Column Name | Data Type | Description |
---|---|---|
notification_id | INT AUTO_INCREMENT | Primary Key |
user_id | INT | FK → users(user_id) |
message | TEXT | Notification content |
type | ENUM('email','sms','system') | Type of notification |
read_status | BOOLEAN | 0 = Unread, 1 = Read |
sent_at | TIMESTAMP | Sent timestamp |
Stores outputs from AI.
Column Name | Data Type | Description |
---|---|---|
prediction_id | INT AUTO_INCREMENT | Primary Key |
prediction_type | VARCHAR(50) | e.g., 'eligibility', 'demand' |
input_data | TEXT | JSON of input |
result | TEXT | JSON or string result |
created_at | TIMESTAMP | Generated at |
users
is the base table for all user types.
donors
, recipients
, staff
, etc., extend from users
.
donations
link to donors
; test_reports
link to donations
.
blood_inventory
entries are created after a successful donation and test.
blood_requests
are made by recipients
, fulfilled from blood_inventory
.
AI predictions are stored in ai_predictions
for future analysis.
Would you like:
A drawn ERD (image or PDF)?
A SQL script to auto-generate the tables?
A DB design using dbdiagram.io format?
Let me know your preference, and I’ll prepare it for you!
Here’s a complete Data Flow Diagram (DFD) for your AI-Based Blood Bank Management System using PHP + MySQL + Python (AI), with levels and descriptions.
This shows how external users interact with the system at a high level.
+----------------+
| Donor |
+----------------+
|
v
+--------------------------+
| |
| Blood Bank Management |
| System |
| (PHP + MySQL + Python) |
| |
+--------------------------+
^ ^ ^ ^
| | | |
+--------+ +---+ +--+ +--+--------+
|Recipient| |Admin| |Lab| |Hospital |
+---------+ +-----+ +----+ +-----------+
Breakdown of system processes and data stores:
+-------------+ +-----------------+ +-----------------+
| Donor +----->| 1. Donation +----->| Blood Inventory|
+-------------+ | Management | +--------+--------+
+--------+--------+ |
| v
| +------------+
| |Test Report |
| +------------+
|
v
+-------------+ +------------------+ +--------------------+
| Recipient +----->| 2. Request Mgmt |<---->| Hospital Interface |
+-------------+ +------------------+ +--------------------+
|
v
+--------------------+
| AI Matching Module |
+--------------------+
|
v
+---------------------+
| Notifications / SMS |
+---------------------+
+-------------+ +----------------------+
| Admin +<----->| 3. Inventory Control |
+-------------+ +----------+-----------+
|
v
+--------------------------+
| 4. AI Forecasting Engine |
+--------------------------+
[Donor] → [Donation Request Form]
→ [Donation Module]
→ [Store in Appointments]
→ [Blood Collected]
→ [Send to Lab]
→ [Test Reports]
→ [Update Blood Inventory]
[Recipient/Hospital] → [Request Form]
→ [Request Table]
→ [Admin Review]
→ [Check Inventory]
→ [Fulfill or Notify Admin]
→ [AI Matching Module] → Suggest Donors
→ [Notify Donors via SMS/Email]
[Donations] → [Inventory Table]
[Test Reports] → [Safe Units Only → Mark 'available']
[Admin] → [Add/Remove Units Manually]
→ [Set Min Level Alert]
→ [View Expiry]
Donor Data → Python Model → [Eligible / Not Eligible] → Store in DB
Inventory Trends + Request Logs → ML Forecast Model (Python)
→ Forecast Graph → Display in Admin Panel
Blood Request + Donor List + Location → Python Matching Engine
→ Sorted Donor List → Notify Top Donors
[System Events (Appointments, Approvals, Matches)]
→ [PHP Notification Queue]
→ [SMS/Email APIs (e.g., Twilio)]
Data Store | Source/Flow From |
---|---|
users |
All modules (base for all users) |
donors , recipients |
From user registration |
appointments |
From donor booking |
blood_inventory |
From donation + test success |
blood_requests |
From recipients/hospitals |
test_reports |
From labs |
ai_predictions |
From AI eligibility/demand modules |
notifications |
Triggered by events |
Your DFD Structure covers:
Users → Input (Forms)
PHP Logic → Stores in MySQL
Python AI → Predicts / Recommends
Outputs → Alerts / Charts / Matches
Would you like:
A drawn image (DFD Level 1 or 2) as PNG/PDF?
A flowchart diagram (SVG/Draw.io format)?
A MySQL SQL script of all tables?
Let me know and I’ll generate it for you.