Hello

ALi.
Virtual Hospital SA-ME — Telehealth & Clinic Portal
Architecture Deep DiveTelehealth & Hospital ERP • 05 Feb 2025 • 8–10 Weeks

Telehealth & Hospital ERP

Virtual Hospital SA-ME — Telehealth & Clinic Portal

Real-Time Slot Engine, Encrypted WebRTC Video & ERPNext Healthcare Sync

Virtual Hospital SA-ME — Telehealth & Clinic Portal - Real-Time Slot Engine, Encrypted WebRTC Video & ERPNext Healthcare Sync
Next.js 15✦React 19✦ERPNext v15✦Frappe Framework✦Python✦Stripe API✦WebRTC Video✦TypeScript✦Tailwind CSS✦REST APIs✦MariaDB✦Doctor Scheduling & Rotations✦Teleconsultation & Video Calling✦Omnichannel Appointment Booking✦Real-Time Slot Engine✦Stripe Payment Gateway✦ERPNext Healthcare Integration✦Patient Medical Records (EMR)✦Production Deployed✦DevDoz Engineering✦
Next.js 15✦React 19✦ERPNext v15✦Frappe Framework✦Python✦Stripe API✦WebRTC Video✦TypeScript✦Tailwind CSS✦REST APIs✦MariaDB✦Doctor Scheduling & Rotations✦Teleconsultation & Video Calling✦Omnichannel Appointment Booking✦Real-Time Slot Engine✦Stripe Payment Gateway✦ERPNext Healthcare Integration✦Patient Medical Records (EMR)✦Production Deployed✦DevDoz Engineering✦
Next.js 15✦React 19✦ERPNext v15✦Frappe Framework✦Python✦Stripe API✦WebRTC Video✦TypeScript✦Tailwind CSS✦REST APIs✦MariaDB✦Doctor Scheduling & Rotations✦Teleconsultation & Video Calling✦Omnichannel Appointment Booking✦Real-Time Slot Engine✦Stripe Payment Gateway✦ERPNext Healthcare Integration✦Patient Medical Records (EMR)✦Production Deployed✦DevDoz Engineering✦
Next.js 15✦React 19✦ERPNext v15✦Frappe Framework✦Python✦Stripe API✦WebRTC Video✦TypeScript✦Tailwind CSS✦REST APIs✦MariaDB✦Doctor Scheduling & Rotations✦Teleconsultation & Video Calling✦Omnichannel Appointment Booking✦Real-Time Slot Engine✦Stripe Payment Gateway✦ERPNext Healthcare Integration✦Patient Medical Records (EMR)✦Production Deployed✦DevDoz Engineering✦

Key Metrics & Impact

+60%
Operational Efficiency

Measurable improvement in scheduling efficiency, administrative processing, and patient triage handling by migrating to an open-source ERP framework.

0
Double-Bookings

Real-time slot engine dynamically disabling booked appointment periods to eliminate scheduling conflicts across remote clinicians.

Automated
Cross-Border Billing

Dynamic doctor consultation fees and automated payment management handling insurance, billing, and patient payments seamlessly across borders.

System Overview

Development Date05 Feb 2025
Duration8–10 Weeks
Engineering Team3 Engineers
Modules Deployed
Doctor Scheduling & RotationsTeleconsultation & Video CallingOmnichannel Appointment BookingReal-Time Slot EngineStripe Payment GatewayERPNext Healthcare IntegrationPatient Medical Records (EMR)
Technologies Used
Next.js 15React 19ERPNext v15Frappe FrameworkPythonStripe APIWebRTC VideoTypeScriptTailwind CSSREST APIsMariaDB

Executive Summary

Virtual Hospital SA-ME (Saudi Arabia & Middle East) required a comprehensive, state-of-the-art virtual healthcare ecosystem to modernize clinical delivery and expand patient outreach across the GCC region. Healthcare systems in the Middle East — particularly across Saudi Arabia's vast geography — face the profound challenge of reaching remote populations without relying entirely on slow, capital-intensive brick-and-mortar expansion. Built in 2025 by a specialized 3-engineer team over an 8–10 week delivery cycle, the platform bridges a modern, responsive Next.js web application with an enterprise ERPNext v15 healthcare backoffice. Patients can seamlessly discover medical practitioners, inspect specialties, and schedule appointments either virtually (via integrated secure video calls) or physically for on-site clinic visits. The platform incorporates a real-time availability engine that dynamically disables already-booked time periods, a Stripe payment gateway calculating dynamic doctor consultation fees, and automated healthcare workflows managed end-to-end within ERPNext.

The Project Challenge

Operating healthcare services across Saudi Arabia and the broader Middle East demands high accessibility for remote patients alongside seamless management of physical clinic capacity. The core challenge was delivering scalable digital infrastructure capable of coordinating real-time virtual care, managing doctor rotations, and processing payments across borders — all without the delays of physical clinic expansion. Prior to this initiative, the hospital faced critical operational bottlenecks: fragmented practitioner calendars with high risk of appointment overlaps, no integrated teleconsultation infrastructure, and entirely manual invoicing reconciliation for remote patients. The hospital needed a unified digital front door that adhered to regional healthcare standards, empowered patients with immediate self-service booking, and synchronized effortlessly with ERPNext v15 for clinical and administrative management.

Main Objectives

  • Engineer an intuitive, high-performance Next.js 15 patient web portal supporting both virtual and physical appointment bookings
  • Integrate with ERPNext v15 via custom Frappe REST APIs for doctor directory lookups, specialty categorizations, and rotation management
  • Implement a real-time doctor availability engine that automatically disables time slots once booked to eliminate double-booking
  • Build secure, encrypted video calling infrastructure enabling doctors to conduct remote teleconsultations directly in the browser
  • Integrate Stripe payment gateway to automatically charge doctor consultation fees upon booking confirmation
  • Automate downstream hospital operations in ERPNext Healthcare, including patient file generation, consultation notes, and sales ledger reconciliation

System Architecture

The solution is built natively on ERPNext and the Frappe Framework, utilizing Python for backend logic — treating virtual hospital logistics similarly to enterprise resource planning: managing resources, schedules, and staff rosters at scale. This open-source, highly adaptable enterprise stack allowed rapid customization and integration without expensive proprietary licensing: • Patient Portal & Frontend (Next.js 15, React 19, TypeScript, Tailwind CSS): High-speed, accessible appointment booking flow featuring doctor search, specialty filtering, interactive calendar date pickers, and dynamic availability time-slot buttons. • Doctor Scheduling & Rotation Calendar: A real-time rotation calendar engine built on Frappe REST APIs ensuring remote clinicians and specialists are allocated efficiently without scheduling conflicts. High-performance endpoints query doctor rotation schedules and existing appointment entries, dynamically validating and locking slots during booking. • Teleconsultation Engine: Embedded secure WebRTC video calling pipeline integrated directly into the platform, allowing high-definition, encrypted two-way teleconsultation sessions for instant or scheduled live check-ins between patients and doctors. • Automated Payment Management: Stripe Checkout integration modeled after standard Healthcare ERP financial workflows, dynamically calculating consultation fees based on doctor tier/specialty, with secure webhook handlers handling insurance, billing, and automated patient payments at time of booking or post-consultation. • Healthcare Operations Core (ERPNext v15 / Frappe / Python): Centralized management of Patient Records, Practitioner Rotations, Clinical Appointments, and automated Sales Invoices directly within the ERPNext Healthcare module.

Role-Based Controls & Security

A multi-layered access architecture isolates public patient interactions from clinical operations and hospital administration. Public patients access search, booking, payment, and video call rooms without exposure to internal hospital databases. Medical doctors authenticate into ERPNext desk interfaces to view their daily consultation agendas, initiate video sessions, and log clinical diagnosis notes. Hospital administrators and billing teams maintain full control over doctor master files, fee structures, schedule rotations, and Stripe financial reconciliations.

Automated Workflows

End-to-end automation streamlines patient flow and backoffice tasks: selecting a date queries real-time availability and automatically disables taken time slots; confirming an appointment redirects to Stripe where payment completion triggers webhooks that immediately confirm the appointment in ERPNext; the system auto-generates patient consultation records and financial invoices in the general ledger; and doctors and patients receive automated reminders with secure video room links for virtual appointments.

UX Redesign & Styling System

Crafted with a clean, medical-grade dark and emerald green aesthetic designed for the Saudi Arabian and Middle Eastern healthcare market. Features clear visual cues distinguishing virtual teleconsultations from physical hospital visits, intuitive active vs. disabled slot indicators, responsive mobile layouts, and modern typography tailored for high trust and effortless navigation.

Business Impact & Outcomes

  • •Achieved a 60% operational improvement in scheduling efficiency, administrative processing, and patient triage handling by migrating workflows to an open-source ERPNext ERP framework
  • •100% elimination of double-bookings through real-time API availability validation and dynamic slot disabling across a distributed roster of remote clinicians
  • •Unified virtual teleconsultation and physical clinic visits into a single seamless patient booking experience for the Saudi Arabia & Middle East region
  • •Automated 100% of remote consultation fee collections and cross-border accounting invoice reconciliations via Stripe & ERPNext
  • •Significantly expanded clinical reach to remote populations across Saudi Arabia's vast geography without capital-intensive physical clinic expansion
  • •Delivered and deployed the full virtual care ecosystem in 8–10 weeks with a 3-engineer engineering team

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

Let’s work together

alihusnainmughal215@gmail.comalihusnainmughal215@gmail.com+92 307 4681469+92 307 4681469

©2026 Muhammad Ali Husnain. All rights reserved.

Affiliated with DevDozDevDoz