Kulcare Docs
UhiTesting

Manual Test Plan: UHI ↔ Clinical Appointment Sync

Setup

  1. Ensure Rails, Sidekiq, and frontend are running
  2. Raj Kumar has schedules at City Hospital Branch (role 01900006-...-002, facility 01900002-...-002)
  3. Log in as Simmi (ABHA: johndoe@sbx)

Test 1: Book → Clinical Appointment Created

StepActionExpected
1.1Search "raj" on UHI search page3 provider entries (Branch, Main, MedCare)
1.2Click "View Slots" on City Hospital BranchSlot grid shows available times
1.3Select any future slotProceeds to booking page
1.4Accept all terms and confirmPIN displayed, state CONFIRMED
1.5Check uhi.bookingsstate = 'CONFIRMED', clinical_appointment_id set
1.6Check clinical.appointmentsstatus = 'booked', same practitioner/facility as slot
1.7Check clinical.patientsPatient user_id linked to Simmi
1.8Visit patient appointments pageNew appointment visible with correct date/time
StepActionExpected
2.1After Test 1, search same facility on same dateBooked slot NOT in results
2.2Search a different facility (City Hospital Main) on same dateSame time slot IS available (different facility)

Test 3: Cancel ← Clinical Appointment Cancelled

StepActionExpected
3.1Open the confirmed booking from Test 1Booking detail page shows CONFIRMED
3.2Click "Cancel Appointment" → confirmModal hides, toast shows "Cancellation requested"
3.3Wait 5 seconds, refresh the pageBooking shows CANCELLED
3.4Check uhi.bookingsstate = 'CANCELLED'
3.5Check clinical.appointmentsstatus = 'cancelled' (same appointment from Test 1)
3.6Search slots for same facility/datePreviously booked slot IS available again

Test 4: on_confirm Audit

StepActionExpected
4.1After Test 1, check uhi.requestsOnly 1 on_confirm + 1 on_confirm_audit
4.2No Sidekiq retriesNo OnConfirmJob error or exhausted retries in logs

Test 5: on_cancel Audit

StepActionExpected
5.1After Test 3, check uhi.requestsOnly 1 on_cancel + 1 on_cancel_audit
5.2No Sidekiq retriesNo OnCancelJob error in logs

Test 6: IST Timestamps

StepActionExpected
6.1Check on_search responseSlot timestamps are IST format without Z (e.g., T09:00:00)
6.2Check on_init responseContext timestamp in IST
6.3Check on_confirm responseAuthorization valid_from/valid_to in IST
6.4Check patient appointments pageTime displays as IST (not UTC)

Test 7: Location Block

StepActionExpected
7.1Check on_init responseorder.location block present with facility details
7.2Check on_confirm responseorder.location block present
7.3Check on_cancel responseorder.location block present

Test 8: Duplicate Slot Prevention

StepActionExpected
8.1On slot selection, click date A → B → AOnly one set of slots per date, no duplicates
8.2On a date with 0 slots"No slots on this date" shown inline, date tabs remain visible
8.3On a date with 0 slotsPolling stops immediately (not 30s timeout)

Test 9: Reverse Sync — CMS Status → UHI

StepActionExpected
9.1Open CMS app, find the clinical appointment from Test 1Appointment shows status "Booked"
9.2Change status to "Arrived" (or "In Progress") in CMSafter_update fires notify_eua!
9.3Check uhi.requestsNew on_update request sent to gateway
9.4Check UHI appointment detail pageStatus reflects the CMS change
9.5Change status to "Completed" in CMSnotify_eua! sends COMPLETED state
9.6Change status to "No Show" in CMSnotify_eua! sends NO_SHOW state
9.7Change status to "Cancelled" in CMSnotify_eua! sends CANCELLED state

On this page