Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 Hospital - Smart AI-Powered Multi-Tenant SaaS ERP Platform

Project Vision

A next-generation, white-labelable, multi-branch Enterprise Resource Planning (ERP) platform for healthcare providers. Driven by a centralized subscription billing core (hospital.com), offering native B2C (Direct Hospital) and B2B (Company Whitelabel Reseller/Odoo-style) engagement models with AI-automated operational flows and future Web3 infrastructure.

Technical Architecture

  • Central Gateway (hospital.com): Public marketing landing page, pricing matrix (Monthly/Annual tiers), user registration gateway, and secure payment processing.
  • Frontend: ReactJS (v19+), TypeScript (Strict Mode), Pure Custom HTML5 & CSS3 (Zero third-party UI libraries/frameworks). Layout clones Microsoft Teams/Store utilizing multi-tiered custom sidebars.
  • Backend: Python 3.12+, Django REST Framework (DRF), Custom AI/ML Micro-engines.
  • Databases: PostgreSQL (Core ERP, Ledger, Tenant subscriptions, relational transactional records, doctor schedules, staff biometric indices), MongoDB (Semi-structured Clinical Diagnostic Logs, AI Conversational Trails, digital signatures, dynamic Rx logs, custom template schemas), JSON (Local metadata arrays, configurations, dictionary schemes).

🗺️ System Architecture & Feature Roadmap

Phase 1: Foundation & Fluent UI Layout Shell

  1. App Shell Layout (frontend/src/components/Layout/):
    • Flat, high-fidelity implementation of the Microsoft Teams style workspace grid.
    • Contains Navbar.tsx (Top navigation bar & centralized alert panel), Sidebar.tsx (Role-based dynamic menu container), and Footer.tsx (System versioning & copyright footer) using raw CSS modules.
  2. Global Components Hub (frontend/src/components/):
    • Strict reuse policy for custom elements. Contains optimized, component-isolated folders like Switch, Input, Button, Combobox, Select.
    • Centralized Icons/ registry with clean barrel exports (index.ts) for single-line destructuring imports. Looks for legacy graphics before initiating automated creation.

Phase 2: Central SaaS Engine & Access Gateway (frontend/src/pages/)

  1. Public Platform Site (frontend/src/pages/landing/ | backend/apps/saas_engine/):
    • Product presentation website displaying hospital management specifications, core feature matrices, contact lines, and subscription toggles (Monthly vs Annual pricing switch).
  2. Access Gates & Verification (frontend/src/pages/auth/ | backend/apps/saas_engine/):
    • Secure multi-role portal login interface, registration screens, forgot/reset password, and Multi-Factor Authentication (MFA) or OTP forms.
    • Multi-Tenant Onboarding: Auto-provisions secure tenant subdomains upon successful gateway transactions for Personal (Direct single/multi-branch hospital admin) or Company (Odoo-style white-label SaaS reseller) accounts.
    • Server-Side Security Lockout: Automatically locks profiles for 24 hours after 3+ consecutive failed password attempts. Triggers client-side browser tab blacklisting with a hardcoded restriction window forcing a blank white screen.
  3. System Management Hub (frontend/src/pages/settings/ & frontend/src/pages/about/):
    • /settings maps global multi-tenant parameters, notification rules, and whitelabel customization frameworks.
    • /about routes dedicated individual profile updates, password modifications, avatar uploads, and personal account security configurations.
    • Lifecycle Background Workers: Active Django cron layer executing the 60-day automated account grace expiration check and the 5-day pre-expiry upscaling renewal notification window.
  4. Central Workspace Controller (frontend/src/pages/dashboard/):
    • Strategic dynamic layout routing authenticated users to their respective business modules based on strict role privilege clearances via conditional rendering, keeping routing lightweight and unified.

Phase 3: Core Healthcare Business Modules (frontend/src/modules/)

  1. Central Administration Module (frontend/src/modules/admin/ | backend/apps/admin/):
    • Admin main dashboards, analytical reporting grids, dynamic user creation/modification modals (create_new.tsx), and role/permission matrix access controls (roles.tsx).
  2. Live Workflow Automation (frontend/src/modules/queue_manage/ | backend/apps/queue_manage/):
    • Unified WebSocket synchronization engine tracking digital token boards, live waiting room counters, fluid/sample collection channels, billing counter workflows, and diagnostic report delivery desks.
  3. Staff Operations Hub (frontend/src/modules/hr/ | backend/apps/hr/):
    • Comprehensive employee profiles, rosters, biometric/IoT attendance engine logs, and leave balance allocation approval matrices.
    • Internal IT Helpdesk: Software support ticketing system (tickets.tsx, ticket_detail.tsx) for platform developers to log bugs, track system requests, and manage issue lifecycles.
  4. Clinical Ward Streams (frontend/src/modules/ipd_opd/ | backend/apps/ipd_opd/):
    • In-Patient (IPD): Grid representations for Emergency beds, Wards, ICUs, and Cabins showing real-time allocation, billing transfers, and discharge tracking.
    • Out-Patient (OPD): Doctor serial management, clinical tickets, and real-time consultation tracking channels.
  5. Scheduling & Consultations Registry (frontend/src/modules/appointment/ | backend/apps/appointment/):
    • Appointment Engine: Digital scheduling grids, tele-consultation channels, and follow-up log managers.
    • Feedback Tracker: Omnichannel automated patient satisfaction feedback loops, survey logs, and reviews data ingestion.
  6. Laboratories Diagnostic Desk (frontend/src/modules/pathology/ | backend/apps/pathology/):
    • Lab tracking pipelines, telemetry parsing, report generators, prescription validation checks, and secure image/DICOM attachments. Generates dynamic automated report charts streamed into MongoDB.
  7. Advanced Digital Prescription Module (frontend/src/modules/prescription/ | backend/apps/prescription/):
    • Advanced AI & Alerts: Real-time backend Drug-Drug Interaction alerts popup. Antibiotic Stewardship flags prompting mandatory "Reason/Indication" data capture. Native Web Speech API integration for hands-free voice command symptom input.
    • Custom Writing Interface: Split-screen layout tracking inputs (Symptoms, Vitals, History) on the left against a live interactive A4 printable Rx Preview on the right. Features custom MongoDB template protocols ("Fever Protocol", "Hypertension Follow-up") for 1-click loading.
    • Vanilla Draggables & Calendars: Drag-and-drop rows powered purely via native HTML5 Drag and Drop API with dynamic auto-serial calculation. Custom scheduler parsing natural language inputs ("7 days", "1 month") cross-checking a DoctorSchedule table to auto-reroute holidays to the closest next available chamber opening.

Phase 4: Logistics, Commercials & Dedicated Role Interfaces (frontend/src/modules/)

  1. Financial Auditing Desk (frontend/src/modules/billing/ | backend/apps/billing/):
    • Counter-Based Decentralized Billing: Isolated invoicing terminals tracked by specific accounting codes (e.g., Entry: 102/103, OPD: 203/205, Canteen: 702/801, Pathology: 301/302). Immediate pay closes local transactions; due balances securely defer to the tenant patient's central admission ledger.
    • Dedicated collection ledgers, insurance adjustments, corporate corporate discounts, and customizable invoice prefix formatting rules.
  2. Pharmaceutical Sales Terminal (frontend/src/modules/pharmacy/ | backend/apps/pharmacy/):
    • Point-of-Sale drug dispatching grids, medicine batch controls, stock expiration monitoring matrices, donor cross-matching data, and temperature warning alert rules for the blood bank.
  3. Doctor Portfolio Workspace (frontend/src/modules/doctor/ | backend/apps/doctor/):
    • Personal appointment calendars, live patient loglines, active treatment pipelines, and patient clinical history trackers.
  4. Nurse Clinical Station (frontend/src/modules/nurse/ | backend/apps/nurse/):
    • Real-time vitals monitors, IV drip countdown metrics, medicine push schedules, and automated nursing round alarms.
  5. Receptionist Front Desk Terminal (frontend/src/modules/receptionist/ | backend/apps/receptionist/):
    • Walk-in registration gates, quick serial issuance terminals, centralized directory lookups, and slot booking wizards.
  6. Accountant Governance Ledger (frontend/src/modules/accountant/ | backend/apps/accountant/):
    • Centralized trial balancing ledgers, custom tax rules matrices, refund token emitters, and transactional auditing trackers.
  7. Pharmacist Dispensary Portal (frontend/src/modules/pharmacist/ | backend/apps/pharmacist/):
    • Verified digital prescription queue checkers, retail medication counter tools, and local batch storage request forms.
  8. Pathologist Laboratory Terminal (frontend/src/modules/pathologist/ | backend/apps/pathologist/):
    • Diagnostic machine telemetry log parsers, biometric authentication signature keys, and lab verification checklists.
  9. Patient Consumer Space (frontend/src/modules/patient/ | backend/apps/patient/):
    • Self-service portal tracking historical prescription timeline downloads, test results graphs, financial transaction statements, and appointment booking logs.