Smart Hospital Platform Documentation

End-to-End Operating Manual & System Specs

Complete guide covering SaaS platform administration (hospital.ssteckservices.com), hospital tenant clinical management (Vamana Speciality Care), doctor rosters, receptionist workflows, patient booking, AI report analysis, and API/MCP specifications.

Table of Contents
Architecture

1. Platform Architecture Overview

Smart Hospital Management is engineered as an enterprise-grade multi-tenant digital healthcare platform. The system operates on a modular monolith foundation designed for ultra-lean single-server execution (consuming only ~115 MB RAM in production) while enabling individual domains to be partitioned cleanly by tenantId.

Platform SaaS Layer
hospital.ssteckservices.com

SuperAdmin suite, global tenant directory, subscription billing, and platform monitoring.

Anchor Tenant #1
www.vamanahospital.com

Vamana Speciality Care (Tirunelveli): Full hospital public website, doctor rosters, online booking, EMR, and CRM.

Key Architectural Pillars:

  • Next.js 14 App Router: Server components, edge middleware host detection, and optimized static rendering across 28 routes.
  • Three.js Anatomy Engine: High-performance 3D spine visualization with automatic reduced-motion accessibility fallbacks.
  • Deterministic Slot Generator: Dynamic schedule math computing doctor capacity, working shifts, and double-booking locks.
  • Zero-External-S3 Disk Vault: Encrypted local disk file storage using signed, time-expiring streaming URLs.
SaaS SuperAdmin

2. SaaS SuperAdmin Manual

The SaaS SuperAdmin controls cross-tenant operations from hospital.ssteckservices.com.

Tenant Provisioning Workflow:

  1. Create a new hospital tenant record with unique slug (e.g. vamana).
  2. Specify primary brand domain (e.g. www.vamanahospital.com) and secondary aliases (vamanahospital.com).
  3. Set hospital brand identity tokens (Primary Blue #0A3D62 and Secondary Orange #F97316).
  4. Initialize default administrative user (admin@vamanahospital.com).

Domain Routing & DNS Verification:

The platform resolves tenants via incoming HTTP Host headers. When a client visits www.vamanahospital.com, the Next.js edge middleware resolves Tenant #1 and injects x-tenant-id: vamana-tenant-001.

Hospital Operations

3. Hospital / Tenant Admin Manual (/admin)

Hospital administrators manage daily clinical operations, doctors, schedules, CRM leads, and SEO directly via /admin.

Appointment Queue Management (/admin/appointments):

  • Status Transitions: Progress patients through CONFIRMEDARRIVEDCOMPLETED.
  • Walk-in Appointments: Click "Add Walk-in Appointment" to instantly reserve an emergency or walk-in slot with deterministic conflict prevention.
  • Filtering: Filter by doctor (Dr. D. Balamurugan vs Dr. P. Seetha), date range, or appointment status.

Patient EMR Records (/admin/patients):

  • Unique Medical Record Number (MRN) assigned to every patient (e.g. MRN-VSC-10001).
  • Access historical consultations, symptoms, documented allergies, and private medical attachments.

CRM Lead Pipeline (/admin/crm):

  • Kanban view across 5 stages: NEW, CONTACTED, QUALIFIED, APPOINTMENT_BOOKED, CONVERTED.
  • Tracks inquiry sources: Website form, direct phone calls (7200767066), Google Maps, or walk-ins.

Domain Redirect Manager (/admin/settings/domains):

Manage 301/302 redirects (e.g. vamanahospital.com/*https://www.vamanahospital.com) without touching Nginx configuration files.

Clinical Staff

4. Doctor & Clinical Staff Guide

Specialist doctors (Dr. D. Balamurugan and Dr. P. Seetha) have dedicated roster schedules configured:

Consultation Shifts (Monday – Saturday):
Morning Shift: 9:30 AM – 1:00 PM (15-minute slot intervals)
Evening Shift: 8:00 PM – 10:00 PM (15-minute slot intervals)
Sunday: Hospital Clinical Holiday (No online booking available)

Surgeons can view patient history, review past MRI/X-ray summaries, and schedule recommended follow-up visits.

Front Desk

5. Receptionist & Front Desk Workflow

  1. Patient Arrival: Search appointment by phone number or Booking Reference (e.g. VSC-20260903-101) on /admin/appointments.
  2. Check In: Click Arrived button to notify the doctor.
  3. Walk-in Consultation: Click "Add Walk-in", enter patient name & mobile, select attending doctor, and print/convey the reference number.
  4. Fee Collection: Collect consultation fee at reception desk (₹500 for Ortho/Spine, ₹400 for General Surgery).
Patient Experience

6. Patient Online Booking Guide

Patients visit /appointments or click "Book an Appointment":

Step 1Select Department
Step 2Choose Doctor
Step 3Pick Date & Slot
Step 4Instant Ref No.

Instant confirmation details and SMS/WhatsApp notifications are triggered automatically with hospital address and driving instructions.

AI & MCP Server

7. Clinical AI & MCP Server Integration

The platform includes an OpenAI-compatible AI gateway and a Model Context Protocol (MCP) server running on port 5001.

Mandatory Clinical Safety Guardrail:All AI report analysis features are strictly assistive. Every AI output displays: "AI-generated assistance. This does not replace professional medical evaluation or diagnosis."

MCP Tool Tiers:

READ Tools (Public)

search_doctors, get_doctor_profile, get_departments, check_appointment_slots, get_blog_posts

WRITE Tools

create_appointment (Patient appointment booking with atomic slot reservation)

ADMIN Tools (Token Guarded)

get_patient_profile, create_blog_draft, analyze_report (Protected by RBAC)

DevOps & API

8. REST API & Production Runbook

REST API Endpoints (/api/v1):

GET /api/v1/health # Liveness and memory telemetry
GET /api/v1/doctors # List specialist doctors
GET /api/v1/departments # List hospital departments
GET /api/v1/appointments/availability # Query slots (?doctorId=...&date=YYYY-MM-DD)
POST /api/v1/appointments # Atomic appointment booking
GET /api/v1/crm/leads # CRM lead inquiries

Disaster Recovery & Backup:

Daily database dumps are automatically generated at 2:00 AM by /opt/smart-hospital/scripts/backup-database.sh, compressed with gzip, and stored in /var/backups/smart-hospital with automatic 7-day retention.

Call NowBook Appointment