Skip to content

About

🩸 Blood Bank & Emergency Donor Neural Network β€” 2,130 real Indian blood banks Β· emergency matching in seconds Β· live donor paging Β· zero-waste rebalancing Β· demand forecasting

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩸 JeevanDhara β€” Blood Bank & Emergency Donor Neural Network

Every drop. Every second. Every life. A real-time intelligence layer over India's blood ecosystem β€” built on 2,130 real, licensed blood banks across 35 states & UTs from the Government of India's open data portal.

Author: Praveen Sudireddy


πŸ’‘ The Problem

India needs 13–15 million units of blood every year but collects only ~11 million β€” a structural shortfall of 1–4 million units (15–25%). Meanwhile:

  • ~10% of collected blood expires unused β€” RBC units live just 42 days
  • 74 districts have zero blood banks; 660M people live in "blood deserts" with marginal access
  • In an emergency, families make dozens of phone calls to find a compatible unit β€” minutes that cost lives
  • Rare groups (Oβˆ’, ABβˆ’) are chronically dry, yet donors willing to help are never paged

JeevanDhara attacks all four failures with one neural network.

⚑ What It Does

Engine Magic
🚨 Emergency Matching Scores every bank on stock coverage (0.40) Β· proximity (0.25) Β· freshness (0.20) Β· 24Γ—7 readiness (0.15), then builds a multi-bank fulfillment plan with live ETAs β€” exact group first, Oβˆ’ universal reserve routed automatically
πŸ“Ÿ Donor Paging When shelves run dry (Rh-negative groups), pages the nearest eligible, committed, compatible donors β€” NBTC rules enforced: 90-day interval, 18–65 yrs, β‰₯50 kg, Hb β‰₯12.5
🧬 Compatibility Graph The 8-node, 27-edge red-cell transfusion graph (Oβˆ’ universal donor β†’ AB+ universal recipient) with rarity indices and pool mathematics
πŸ—Ί Network Map All 2,130 real banks plotted live β€” names, districts, coordinates, contact numbers, stock health
🩸 Inventory Intelligence Days-of-supply per group & state, expiry-risk windows, and a rebalancing advisor that rescues near-expiry units by routing them to hungry banks
πŸ“ˆ Demand Forecast 12-month seasonal model β€” monsoon dengue/malaria surge (+15–18%), winter surgery & trauma rise (+8%) β€” with an AI camp planner telling you where and when to hold drives
🀝 Donor Hub Live eligibility checker with every rule explained, next-eligible-date calculation, and "lives touchable" impact maths

πŸ–₯ The Dashboard

Hand-crafted, zero-dependency frontend β€” glassmorphism over a night-shift palette, animated ECG pulse, glowing bank constellation, count-up stats, and staged emergency scans.

Command Center Emergency Match
Command Center β€” live network pulse & real-world facts Emergency Match β€” multi-bank plan, ETAs, donor paging
Network Map Inventory & Waste
Network Map β€” 2,130 real banks, stock-health coloured Inventory β€” group health, expiry risk, rebalancing
Demand Forecast Donor Hub
Forecast β€” seasonal demand vs supply, camp planner Donor Hub β€” eligibility, compatibility matrix, rarity

🎬 Demo Video

docs/demo_video.mp4 β€” a 3-minute narrated walkthrough: the crisis in numbers, the real-data foundation, a live ABβˆ’ emergency in Mysuru (scan β†’ multi-bank plan β†’ donor paging), zero-waste rebalancing, seasonal forecasting with the camp planner, and the donor hub.

πŸš€ Quickstart

pip install -r requirements.txt

# seed the database (deterministic, ~10s first run)
python3 app/db.py

# launch
python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8000

Open http://localhost:8000 β€” the dashboard loads instantly.

Run the test suite (40 tests):

python3 -m pytest tests/ -v

Interactive API docs are auto-generated at /docs (Swagger) and /redoc.

πŸ— Architecture

jeevandhara/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ blood_banks.json        # 2,130 real banks (source of truth)
β”‚   β”œβ”€β”€ raw_bloodbanks.geojson  # raw government fetch (provenance)
β”‚   └── jeevandhara.db          # SQLite: banks Β· inventory Β· lots Β· donors Β· requests
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ db.py                   # schema + deterministic seed (rng 2026)
β”‚   β”œβ”€β”€ main.py                 # FastAPI Β· 15 API endpoints Β· static dashboard
β”‚   └── engines/
β”‚       β”œβ”€β”€ compatibility.py    # 27-edge transfusion graph
β”‚       β”œβ”€β”€ emergency.py        # ⭐ hero: scoring + planning + paging
β”‚       β”œβ”€β”€ inventory.py        # stock health + rebalancing
β”‚       β”œβ”€β”€ forecast.py         # seasonal demand + camp planner
β”‚       β”œβ”€β”€ donors.py           # eligibility rules + network stats
β”‚       └── facts.py            # citable real-world numbers
β”œβ”€β”€ web/                        # index.html Β· style.css Β· app.js (zero deps)
β”œβ”€β”€ tests/                      # 40 pytest cases (engines + API)
└── docs/                       # screenshots

API Endpoints

Method Endpoint Purpose
POST /api/emergency/find 🚨 the hero β€” full fulfillment plan
GET /api/inventory/health network stock health
GET /api/inventory/rebalance near-expiry rescue plan
GET /api/forecast 12-month projection + camps
POST /api/donors/eligibility rule-by-rule donor check
GET /api/map/banks all banks with geo + stock
GET /api/banks Β· /api/states Β· /api/cities directory with renamed-city aliases (Mysuruβ†’Mysore…)
GET /api/compatibility matrix Β· rarity Β· donors-for
GET /api/overview Β· /api/facts Β· /api/donors/stats Β· /api/emergency/requests dashboard feeds

πŸ“Š Data Source & Integrity

  • Blood Bank Directory β€” National Health Portal (NIHFW), via data.gov.in / ArcGIS Living Atlas India β€” NDSAP open licence (Government Open Data License – India)
  • 2,130 unique licensed banks with real names, districts, lat/lng, categories, contacts
  • Inventory, lots and donors are deterministic simulations (fixed seed 2026) layered on the real network topology β€” every number reproducible
  • Narrative statistics (shortfall, wastage, blood deserts) from NBTC/NACO, WHO, e-RaktKosh, and peer-reviewed literature, surfaced in-app with sources

⚠️ Disclaimer

JeevanDhara is a planning & demonstration system. In a real emergency, always contact your nearest blood bank or hospital directly. Inventory figures shown are simulated for the real bank network.

πŸ“„ License

MIT Β© Praveen Sudireddy Β· Data under Government Open Data License – India (NDSAP)

About

🩸 Blood Bank & Emergency Donor Neural Network β€” 2,130 real Indian blood banks Β· emergency matching in seconds Β· live donor paging Β· zero-waste rebalancing Β· demand forecasting

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages