Back to all insights
Product Architecture15 September 2024•8 min read

Building ClinicOS: Architecting Real-Time Queue Systems & Healthcare Telemetry

A
Aditya Patil
Founder & CEO, Team Axiogen

The Problem with Traditional Clinic Management

Most outpatient clinics in India struggle with chaotic waiting rooms, lost physical paper prescriptions, and frustrated patients waiting 2+ hours past their appointment slot.

Legacy desktop software from the 2010s operates as closed silos: front-desk receptionists cannot synchronize in real time with the consulting doctor's chamber, and patients have zero visibility into their actual queue position.

When Team Axiogen designed ClinicOS, our objective was clear: eliminate waiting room friction with a unified, real-time operating system that connects reception, doctor chamber, waiting TV displays, and patient smartphones seamlessly.

Multi-Tenant Real-Time Architecture

ClinicOS uses a distributed pub/sub architecture built on top of high-concurrency event channels. When a receptionist checks in a patient, the queue state updates in sub-50 milliseconds across both the doctor's iPad chamber interface and the clinic waiting room smart TV.

To guarantee zero-lag token calling, we engineered an active voice announcement engine that synthesizes token numbers in English, Hindi, and Marathi directly through the TV's browser runtime.

typescript
// Real-time queue event dispatch in ClinicOS
export async function advancePatientToken(clinicId: string, tokenId: string) {
  const updatedQueue = await db.transaction(async (tx) => {
    await tx.tokens.update({ where: { id: tokenId }, data: { status: 'IN_CHAMBER' } });
    return tx.tokens.findMany({ where: { clinicId, status: 'WAITING' }, orderBy: { tokenNumber: 'asc' } });
  });

  // Broadcast to smart TV displays and trigger patient WhatsApp webhook
  await broadcastChannel.publish(`clinic:${clinicId}:queue`, { current: tokenId, queue: updatedQueue });
  await dispatchWhatsAppNotification(tokenId, 'YOUR_TURN_NEXT');
}

WhatsApp Webhook Pipelines & Patient Telemetry

Instead of requiring patients to download yet another bloated mobile application, ClinicOS interfaces directly with WhatsApp.

As patients approach their turn, automated webhook workers dispatch personalized updates informing them of the estimated doctor consult time, clinic address map coordinates, and digital prescriptions once the consultation concludes.

Ready to architect high-performance software?

Partner directly with Team Axiogen founders and architects. We ship production systems on tight sprint cadences.

Start a project