WORK / SYS-01: DENTAL CLINIC MANAGEMENT SYSTEM
PRODUCTION SYSTEM HEALTHCARE SYSTEMS 2024 — 2026

Dental Clinic Management System

Enterprise clinical operating system engineered with 16 decoupled domains, custom regex routing, Server-Sent Events (SSE) live queue synchronization, multi-surface odontograms, and automated SMS dispatch.

ROLE
Lead Full-Stack Systems Architect & Developer
PRIMARY STACK
Custom PHP · MySQL · SSE · PWA
VERIFIED STATUS
Production on Hostinger
DOMAINS
16 Decoupled Domains
01 / OPERATIONAL FRICTION

The Clinical Problem

High-volume outpatient clinics and multi-chair dental practices suffered from severe operational choke points. Paper charts frequently went missing between reception and consultation rooms. Triage status desynchronization led to patients being called before clinical charts were prepared. Dual-booking errors and lack of automated SMS reminders produced costly appointment no-shows.

Furthermore, simultaneous updates from doctors recording examination notes and receptionists managing waiting room intake caused concurrency conflicts on shared databases without strict isolation discipline.

02 / SYSTEM ARCHITECTURE

16-Domain Decoupled Architecture

Rather than relying on heavy third-party PHP frameworks that introduce unnecessary memory overhead and complex dependency chains, Dental Clinic Management System was engineered from first principles with a strict Domain-Driven Design (DDD) layering:

ARCHITECTURAL LAYERS
1. INGRESS & ROUTING (Router.php)
Custom regex route dispatcher with zero-allocation pattern matching, middleware pipelines, and role-based policy enforcement.
2. DOMAIN CONTROLLERS & DTOS
Strict boundary inputs mapped directly to typed Data Transfer Objects (DTOs) with fail-fast validation.
3. DOMAIN SERVICES (16 Autonomous Domains)
Appointments, Auth, Billing, Calendar, DigitalIndexCard, Doctor, DoctorCommandCenter, Households, Packages, Patients, Queue, Reports, Settings, Sms, Users, Workspace.
4. REPOSITORIES & REALTIME TRANSPORT
MySQL InnoDB transactional queries, Server-Sent Events daemon (queue_sse.php), and SMS gateway adapters.
Dental Clinic Management System 16-Domain Decoupled Architecture Diagram
03 / ENGINEERING DEEP-DIVE

Production Real-Time Queue & SSE Protocol

Building real-time waiting room monitors in restrictive shared hosting environments (such as LiteSpeed and Apache) presented significant protocol hurdles:

CHALLENGE 1: LITESPEED / REVERSE PROXY BUFFER FLUSHING

Reverse proxies by default aggregate small HTTP stream chunks, buffering events until several kilobytes accumulate before flushing. This completely broke real-time queue notifications.

THE SOLUTION: PROXY WARMUP PADDING & EXPLICIT HEADERS
// Disable proxy compression and chunk aggregation
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache, no-transform');
header('X-Accel-Buffering: no');
header('Connection: keep-alive');

// 2KB whitespace padding forces proxy buffers to flush immediately
echo ":" . str_repeat(" ", 2048) . "\n\n";
if (ob_get_level() > 0) {
    ob_end_flush();
}
flush();
CHALLENGE 2: TRANSACTION ISOLATION & DIRTY CHAIR READS

Default MySQL REPEATABLE READ isolation caused continuous polling connections in the SSE loop to return identical cached snapshots even after a doctor had called a new patient in another room.

THE SOLUTION: READ COMMITTED SESSION ISOLATION
// Set session transaction isolation level to READ COMMITTED
// Prevents phantom dirty reads while ensuring instant visibility of commits
$pdo->exec("SET TRANSACTION ISOLATION LEVEL READ COMMITTED;");
CHALLENGE 3: WI-FI RECONNECTION CONTINUITY

When reception Wi-Fi briefly drops, EventSource automatically reconnects. Dental Clinic Management System implements the Last-Event-ID specification, tracking monotonically increasing sequence integers so clients never drop missed queue calls upon reconnection.

04 / CLINICAL WORKFLOWS

Doctor Command Center & Specialized Capabilities

Dental Clinic Management System Doctor Command Center Live Queue & Digital Index Card
Doctor Command Center
Unified single-screen workstation combining patient vitals, timeline history, prescription writing, SOAP clinical documentation, and diagnostic image attachments.
Interactive Dental Odontogram
A multi-surface canvas-driven odontogram allowing dentists to chart restorations, extractions, cavities, and periodontal conditions on individual tooth surfaces with historical procedure ledgers.
SMS Gateway Integration
Decoupled SMS domain supporting Twilio and Semaphore with automated appointment reminders, custom SMS templates, and a real-time SSE SMS inbox.
Household Relationship Graphing
Relational linking of pediatric patients to parents and guardians, enabling unified household billing balances, shared contact profiles, and emergency contact dispatch.
05 / OPERATIONAL EVIDENCE

Production Impact & Verification

Dental Clinic Management System was deployed directly to live production on Hostinger infrastructure with full relational database migrations (clinic_dbv1 through clinic_dbv6).

The platform successfully eliminated paper medical chart losses, cut patient waiting room confusion through synchronized audio/visual queue displays, and established an immutable audit trail for clinical governance.

SPECIFICATION SUMMARY
Architecture: Custom PHP DDD
Database: MySQL (InnoDB)
Real-Time: Server-Sent Events
Isolation: READ COMMITTED
Offline: PWA / Service Worker
Deployment: Hostinger Live
NEXT SYSTEM BRIEF

BIR E-invoice

Commerce integration, Philippine 12% VAT tax calculation engine, and pessimistic invoice sequence locking.

VIEW BIR E-INVOICE →