feat: introduce patient dashboard with live visit tracking and onboarding experience

Overview

This MR introduces the new Patient Dashboard experience for eHRS Medical Camp workflow.

From now on, every registered patient will have access to a dedicated Patient Dashboard where they can track their complete medical camp journey in realtime.

The dashboard provides:

  • live visit progress tracking
  • vitals visibility
  • consultation status
  • doctor consultation history
  • onboarding experience for unregistered patients
  • reassignment consultation flow handling

What does this MR do and why?

This change adds a complete patient-side dashboard experience to improve visibility and engagement during the medical camp workflow.

Motivation

Previously, only volunteers, coordinators, and admins had dashboard access. Patients did not have visibility into:

  • their current visit status
  • vitals progress
  • consultation progress
  • reassigned consultations
  • consulted doctors

This resulted in poor transparency and patient uncertainty during camp flow.

Solution Implemented

A dedicated Patient Dashboard was introduced which:

  • activates automatically after volunteer registration
  • shows live workflow stages
  • displays realtime vitals and consultation updates
  • handles reassignment consultation scenarios properly
  • provides onboarding/waiting UI for unregistered patients

Approach Taken

The implementation uses:

  • realtime patient status synchronization
  • consultation history-based rendering
  • conditional consultation flow UI
  • periodic refetching and focus refresh for consistency

Additional logic was added to properly differentiate:

  • normal consultation flow
  • reassigned consultation flow
  • completed consultation history rendering

Changes Made

Patient Dashboard

  • Added dedicated Patient Dashboard flow
  • Added patient-specific dashboard route and rendering
  • Enabled dashboard access for all patients

Unregistered Patient Experience

  • Added centered onboarding/welcome overlay
  • Added background blur effect
  • Added registration waiting state
  • Dashboard activates automatically after volunteer registration

Visit Journey Tracking

Added realtime patient workflow tracker:

  • Registration
  • Specialization Selected
  • Vitals Check-up
  • Doctor Consultation
  • Medicines Prescribed
  • Medicines Verified
  • Counselling Done

Vitals & Measurements

Added realtime vitals display:

  • Blood Pressure
  • Pulse Rate
  • Heart Rate
  • Blood Sugar (RBS)
  • Height
  • Weight
  • Temperature

Consultation Flow Improvements

Implemented:

  • normal consultation flow
  • reassigned consultation flow
  • reassigned waiting specialization state
  • multi-doctor consultation history rendering
  • green completed consultation state

Technical Changes

Modified:

  • PatientDashboard.tsx
  • PatientDashboardPage.tsx
  • translations.json
  • PatientDashboard.test.tsx

Added:

  • consultation history rendering logic
  • reassignment state handling
  • realtime refetch support
  • regression tests

Technical Details

Consultation Rendering Logic

Consultation card rendering now depends on:

  • consultation history count
  • reassignment state
  • active consultation status
  • queue/specialization waiting state
  • consultation completion state

Reassignment Flow

Implemented strict conditional rendering for:

  • reassigned waiting state
  • reassigned active doctor state
  • completed multi-doctor history state

State Synchronization

Added:

  • periodic consultation history refetch
  • focus refresh synchronization
  • improved realtime rendering consistency

Completed Consultation History

After completion:

  • reassignment labels are removed
  • all consulted doctors are displayed cleanly
  • completed state uses success/green UI

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ️ Refactor (no functional changes)
  • Performance improvement
  • 🧪 Test update
  • 🔧 Configuration change
  • 🚨 Security fix

Related Issues / References

  • Added patient-side dashboard experience
  • Added reassignment consultation handling
  • Added onboarding flow for unregistered patients

Screenshots or Screen Recordings

Before After
No patient dashboard available Added complete Patient Dashboard with realtime tracking

Screencast_from_2026-05-21_14-21-34

How to Set Up and Validate Locally

  1. Pull this branch:
    git checkout feat/patient-dashboard

Merge request reports

Loading