
Key Metrics
Project Overview
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.
Business Context & Challenges
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.
Key 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 Access & 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 & Logic
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.
UI/UX & Design 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
- 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
Key Outcome
"Delivered a 60% operational improvement in scheduling and triage, completely eliminated double-bookings with live API availability locking, automated cross-border billing, and expanded medical care accessibility across the GCC."