Kulcare Docs
Test plans

Doctor App - Add Patient & Appointment Booking Test Plan

Document Version: 1.0 Test Date: 2026-06-11 Focus Areas: Add Patient Flow + Appointment Booking Flow Environment: Staging


1. TEST FLOW OVERVIEW

Flow 1: Add Patient (Standalone)

Patients Page (/cms/patients)
       ↓
Add Patient Modal
       ↓
┌──────────────────────────────────────┐
│ FederatedPatientPicker               │
│ ┌────────────┐ ┌────────────┐       │
│ │ In Clinic  │ │In Kulcare  │       │
│ │ (existing) │ │(network)  │       │
│ └────────────┘ └────────────┘       │
│ ┌────────────────────────────────┐  │
│ │ + Add a new patient (CTA)      │  │
│ └────────────────────────────────┘  │
└──────────────────────────────────────┘
       ↓
┌──────────────────────────────────────┐
│ Patient Form                         │
│ - First Name (required)             │
│ - Last Name (required)              │
│ - Country Code + Phone (required)   │
│ - Email (optional)                  │
│ - Gender (required)                 │
│ - Date of Birth (required)          │
└──────────────────────────────────────┘
       ↓
   POST /clinical/patients
       ↓
   Patient Created

Flow 2: Appointment Booking (2-Step Modal)

Queue Page (/cms/queue) → Add Appointment Modal
       ↓
┌──────────────────────────────────────┐
│ STEP 1: Doctor & Time                │
│ ┌────────────────────────────────┐  │
│ │ Select Doctor (required)        │  │
│ │ Appointment Type:               │  │
│ │   ○ WALKIN (queue)             │  │
│ │   ○ ONCALL (scheduled)         │  │
│ │   ○ TELEMEDICINE               │  │
│ │ Select Date (required)          │  │
│ │ Select Time Slot (if ONCALL)   │  │
│ └────────────────────────────────┘  │
│              [Continue →]           │
└──────────────────────────────────────┘
       ↓
┌──────────────────────────────────────┐
│ STEP 2: Patient Information          │
│ ┌────────────────────────────────┐  │
│ │ FederatedPatientPicker         │  │
│ │ (same as Add Patient flow)    │  │
│ └────────────────────────────────┘  │
│ ┌────────────────────────────────┐  │
│ │ Patient Form Fields            │  │
│ │ (auto-filled from picker)    │  │
│ └────────────────────────────────┘  │
│              [Add Appointment]      │
└──────────────────────────────────────┘
       ↓
   POST /clinical/appointments
       ↓
   Appointment Created → Appears in Queue

2. TEST DATA REQUIREMENTS

Pre-Test Setup

TypeDataPurpose
Patient AExisting clinic patient (in_clinic)Test "In this clinic" bucket
Patient BKulcare network patient (in_kulcare)Test "Elsewhere on Kulcare" bucket
Patient CNew patient (not in system)Test "Add new patient" flow
Doctor 1Active doctor with availabilityTest appointment booking
Doctor 2Active doctorTest doctor selection
Doctor 3Doctor with no availabilityTest "No slots" scenario

Test Phones (Use distinct numbers)

  • Patient A: 9999999001 (existing in clinic)
  • Patient B: 9999999002 (in Kulcare network)
  • Patient C: 9999999003 (new patient)

3. PHASE 1: ADD PATIENT FLOW

URL

https://practice-stg-new.kulcare.com/cms/patients

Component: FederatedPatientPicker.tsx API: GET /clinical/patients/federated_search

Happy Path Tests

#Test CaseStepsExpectedPriority
AP-01Search by phone (in clinic)Enter existing patient phone → Wait 400msShows "In this clinic" bucket with patientP0
AP-02Search by phone (in Kulcare)Enter network patient phone → Wait 400msShows "Elsewhere on Kulcare" bucketP0
AP-03Search by phone (no match)Enter unknown phone → Wait 400msBoth buckets empty, "Add new patient" shownP1
AP-04Search by name (2+ chars)Enter patient name → Wait 400msShows matching patientsP1
AP-05Search by name (3+ chars for API)Enter 2 chars → No searchInput threshold checkP2
AP-06Auto-detect phone vs nameEnter digits → Search by phoneAuto-mode detection worksP2
AP-07Auto-detect name vs phoneEnter letters → Search by nameAuto-mode detection worksP2

Selection Tests

#Test CaseStepsExpectedPriority
AP-08Select in-clinic patientClick patient in "In this clinic"Toast: "already exists", modal closesP0
AP-09Select in-Kulcare patientClick patient in "Elsewhere on Kulcare"Form auto-fills with patient dataP0
AP-10Import patient edits formImport Kulcare patient → Edit nameEdited name used in submissionP1
AP-11Create new after no matchClick "+ Add a new patient"Form clears, ready for new entryP1
AP-12Create new with partial matchHas matches → Click "+ Add a new patient"Form clears anywayP2

Edge Cases

#Test CaseStepsExpectedPriority
AP-13Phone < 4 digitsEnter 3 digits → WaitNo search triggeredP2
AP-14Phone without country codeNo countryCode prop passedWarning: "Pass countryCode prop"P2
AP-15Search loading stateEnter valid phone → Show loading"Searching Kulcare network…" spinnerP1
AP-16Search error stateForce API errorError message with retry hintP1
AP-17Empty search inputClear search fieldNo buckets shownP2

3.2 Create New Patient Form

Component: AddPatientModal.tsx API: POST /clinical/patients

Happy Path Tests

#Test CaseStepsExpectedPriority
CP-01Create with all fieldsFill all fields → SubmitPatient created, modal closesP0
CP-02Create with required onlyFill required fields → SubmitPatient createdP0
CP-03Create from Kulcare importImport from Kulcare → Adjust → SubmitPatient created with identity linkP1
CP-04View in patient listCreate → Go to listNew patient appearsP0

Validation Tests

#Test CaseStepsExpectedPriority
CP-05Empty first nameLeave first name blank → SubmitError: "First name is required"P0
CP-06First name < 2 charsEnter "A" → SubmitError: "First name must be at least 2 characters"P0
CP-07Empty last nameLeave last name blank → SubmitError: "Last name is required"P0
CP-08Empty phone numberLeave phone blank → SubmitError: "Phone number is required"P0
CP-09Phone < 10 digitsEnter 9 digits → SubmitError: "Phone number must be at least 10 digits"P0
CP-10Invalid phone (letters)Enter letters in phone → SubmitError: "Phone number must be at least 10 digits"P0
CP-11Empty genderLeave gender blank → SubmitError: "Gender is required"P0
CP-12Empty DOBLeave DOB blank → SubmitError: "Date of birth is required"P0
CP-13Future DOBSelect future date → SubmitError: "Date of birth cannot be in the future"P0
CP-14Invalid email formatEnter "test@invalid" → SubmitError: "Invalid email address"P1
CP-15Empty country codeClear country code → SubmitError: "Country code is required"P1

Edge Cases

#Test CaseStepsExpectedPriority
CP-16Whitespace-only first nameEnter " " → SubmitError: "First name is required" (trim validation)P1
CP-17Duplicate phoneCreate with existing phoneShould allow (same person) or warnP1
CP-18Form reset on closeFill form → Close modal → ReopenForm emptyP1
CP-19Form reset on successFill form → Submit → ReopenForm emptyP1
CP-20Submit while loadingClick Submit twice quicklyOnly one patient createdP2
CP-21Network error on submitSubmit with no networkError toast, form preservedP1

3.3 Patient List & Management

URL: https://practice-stg-new.kulcare.com/cms/patients API: GET /clinical/patients

Happy Path Tests

#Test CaseStepsExpectedPriority
PL-01View patient listGo to patients pageShows all clinic patientsP0
PL-02Search patientsEnter name/phone → SearchShows matching patientsP1
PL-03View patient detailsClick on patientShows patient profileP0
PL-04Edit patientEdit details → SaveChanges savedP1
PL-05Delete patientDelete → ConfirmPatient removedP1
PL-06PaginationNavigate pagesShows correct patientsP2

4. PHASE 2: APPOINTMENT BOOKING FLOW

URL

https://practice-stg-new.kulcare.com/cms/queue

4.1 Step 1: Doctor & Time Selection

Component: AppointmentSetup.tsx API: GET /clinical/facilities/{id}/practitioners/{id}/slots

Happy Path Tests

#Test CaseStepsExpectedPriority
AB-01Select doctorChoose from dropdownDoctor selectedP0
AB-02Select WALKIN typeSelect WALKIN radioTime slot NOT requiredP0
AB-03Select ONCALL typeSelect ONCALL radioTime slot requiredP0
AB-04Select TELEMEDICINE typeSelect TELEMEDICINE radioTime slot requiredP1
AB-05Select datePick date from calendarDate selected, slots loadP0
AB-06View available slotsSelect doctor + dateShows available time slotsP0
AB-07Select time slotClick on available slotSlot selectedP0
AB-08Continue to step 2Select doctor + (slot if ONCALL) → ContinueAdvances to step 2P0

Validation Tests

#Test CaseStepsExpectedPriority
AB-09Continue without doctorClick Continue without doctorError: "Doctor selection is required"P0
AB-10Continue without slot (ONCALL)ONCALL selected, no slot → ContinueError: "Time slot is required"P0
AB-11Continue without slot (WALKIN)WALKIN selected, no slot → ContinueProceeds to step 2P0
AB-12Continue without slot (TELEMEDICINE)TELEMEDICINE selected, no slot → ContinueError: "Time slot is required"P1

Edge Cases

#Test CaseStepsExpectedPriority
AB-13No slots availableSelect date with no availability"No slots available" messageP1
AB-14Select past dateTry to select past datePast dates disabled in calendarP1
AB-15Change doctor clears slotSelect slot → Change doctorSlot clearedP1
AB-16Change date clears slotSelect slot → Change dateSlot clearedP1
AB-17Booked slot shownSelect booked slotSlot should show as unavailableP1
AB-18Loading slotsSelect doctor + dateLoading spinnerP1
AB-19Slot time in correct timezoneSelect slotTime shown in clinic timezoneP1
AB-20Doctors list loadingPage loadLoading spinner in dropdownP2

4.2 Step 2: Patient Information

Component: PatientInformation.tsx Flow: Same as Add Patient Flow (Federated Search + Form)

Happy Path Tests

#Test CaseStepsExpectedPriority
PS-01Search existing patientEnter phone → Select from in_clinicForm auto-fillsP0
PS-02Import Kulcare patientEnter phone → Select from in_kulcareForm auto-fillsP0
PS-03Create new patientFill form → SubmitNew patient + appointment createdP0
PS-04Edit auto-filled patientAuto-fill → Edit name → SubmitUpdated name usedP1

Validation Tests

#Test CaseStepsExpectedPriority
PS-05Submit without patientClick Submit without patientError: "First name is required"P0
PS-06Submit with incomplete patientLeave phone blank → SubmitError: "Phone number is required"P0
PS-07Submit with invalid phoneEnter 9 digits → SubmitError: "Phone number must be 10 digits"P0

Edge Cases

#Test CaseStepsExpectedPriority
PS-08Go back to step 1Click BackReturns to step 1, data preservedP2
PS-09Form reset on closeFill form → Close → ReopenForm resetsP1
PS-10Couple session toggleEnable couple sessionSpouse details form appearsP2

4.3 Appointment Submission

API: POST /clinical/appointments

Happy Path Tests

#Test CaseStepsExpectedPriority
AS-01Book WALKIN appointmentWALKIN + patient → SubmitAppointment created in queueP0
AS-02Book ONCALL appointmentONCALL + slot + patient → SubmitAppointment createdP0
AS-03Book TELEMEDICINE appointmentTELEMEDICINE + slot + patient → SubmitAppointment createdP1
AS-04View in queueAfter bookingPatient appears in queueP0
AS-05View appointment detailsClick on appointmentShows full detailsP0

Edge Cases

#Test CaseStepsExpectedPriority
AS-06Double-click preventionDouble-click SubmitOnly one appointment createdP1
AS-07Network error on submitSubmit with no networkError toast, form preservedP1
AS-08Slot no longer availableSelect slot → Wait long → SubmitError: "Slot no longer available"P1
AS-09Booking for different doctorSelect Doctor B → BookAppointment for Doctor BP1
AS-10Submit with couple sessionEnable couple + fill spouse → SubmitBoth appointments createdP2

4.4 Queue Management

URL: https://practice-stg-new.kulcare.com/cms/queue API: GET /clinical/facilities/{id}/queue

Happy Path Tests

#Test CaseStepsExpectedPriority
QM-01View today's queueGo to queue pageShows today's appointmentsP0
QM-02Filter by status (Waiting)Filter: WaitingShows waiting onlyP1
QM-03Filter by status (In Progress)Filter: In ProgressShows in-progress onlyP1
QM-04Filter by status (Completed)Filter: CompletedShows completed onlyP1
QM-05Filter by doctorSelect doctor filterShows that doctor's patientsP1
QM-06Search in queueEnter patient nameShows matchingP1
QM-07Navigate date (prev)Click previous dayShows that day's queueP1
QM-08Navigate date (next)Click next dayShows that day's queueP1
QM-09Navigate date (today)Click TodayShows today's queueP1
QM-10Queue statisticsView queue headerShows total, waiting, in-progress countsP1

Appointment Actions

#Test CaseStepsExpectedPriority
QM-11Start encounterClick "Start" on appointmentEncounter startedP0
QM-12Complete appointmentMark as completedStatus updatedP0
QM-13Mark as no-showMark as no-showStatus updatedP1
QM-14Cancel appointmentCancel → ConfirmAppointment cancelledP0
QM-15View appointment detailsClick on appointmentShows full detailsP0

Edge Cases

#Test CaseStepsExpectedPriority
QM-16Empty queueNo appointments todayEmpty state messageP2
QM-17Refresh queueClick refreshQueue updatedP2
QM-18Cancel past appointmentTry to cancel pastError or warningP2

5. INTEGRATION TEST CASES

Cross-Flow Integration

#Test CaseStepsExpectedPriority
INT-01Add Patient → Book AppointmentAdd patient → Book appointmentPatient exists, booking succeedsP0
INT-02Search → Import → BookSearch Kulcare → Import → BookPatient imported, booking succeedsP0
INT-03Patient created → Appears in searchCreate patient → SearchPatient found in in_clinicP0
INT-04Booking updates queueBook appointmentQueue updates in real-timeP1
INT-05Status change reflects in listComplete appointmentStatus updated in listP0

6. TEST EXECUTION CHECKLIST

Pre-Flight Checklist

  • Test accounts: 2 doctors, 2 staff
  • Test data: Patient A (in clinic), Patient B (in Kulcare), Patient C (new)
  • Test data: Doctor 1 (with availability), Doctor 2, Doctor 3 (no availability)
  • Staging environment accessible
  • API tools ready (Postman/curl)

Phase 1: Add Patient Flow

  • AP-01 to AP-07: Federated Search (Happy Path)
  • AP-08 to AP-12: Selection Tests
  • AP-13 to AP-17: Edge Cases
  • CP-01 to CP-04: Create Patient (Happy Path)
  • CP-05 to CP-15: Validation Tests
  • CP-16 to CP-21: Edge Cases
  • PL-01 to PL-06: Patient List

Phase 2: Appointment Booking Flow

  • AB-01 to AB-08: Step 1 (Happy Path)
  • AB-09 to AB-12: Step 1 (Validation)
  • AB-13 to AB-20: Step 1 (Edge Cases)
  • PS-01 to PS-04: Step 2 (Happy Path)
  • PS-05 to PS-07: Step 2 (Validation)
  • PS-08 to PS-10: Step 2 (Edge Cases)
  • AS-01 to AS-05: Submission (Happy Path)
  • AS-06 to AS-10: Submission (Edge Cases)
  • QM-01 to QM-10: Queue Management
  • QM-11 to QM-15: Appointment Actions
  • QM-16 to QM-18: Queue Edge Cases

Integration Tests

  • INT-01 to INT-05: Cross-Flow Integration

7. API REFERENCE

GET /clinical/patients/federated_search
Params:
  - phone: string (min 4 digits)
  - country_code: string (required with phone)
  - name: string (min 3 chars)
Response:
{
  in_clinic: PatientApi[],
  in_kulcare: InKulcareIdentityPatient[],
  no_match: []
}

Create Patient

POST /clinical/patients
Body:
{
  first_name: string,
  last_name: string,
  phone_number: string,
  phone_country_code: string,
  email?: string,
  gender: "male" | "female" | "other" | "unknown",
  birth_date: string (YYYY-MM-DD)
}

Create Appointment

POST /clinical/appointments
Body (existing patient):
{
  patient_id: string,
  facility_id: string,
  practitioner_id?: string,
  start_time: ISO8601,
  end_time?: ISO8601,
  appointment_type: "walk_in" | "fixed" | "telemedicine",
  note?: string,
  payment_option?: "BEFORE" | "AFTER" | "NO"
}

Body (new patient):
{
  facility_id: string,
  patient_params: {
    first_name: string,
    last_name: string,
    phone_number: string,
    country_code: string,
    email?: string,
    gender: string,
    dob?: string
  },
  practitioner_id?: string,
  start_time: ISO8601,
  end_time?: ISO8601,
  appointment_type: "walk_in" | "fixed" | "telemedicine",
  note?: string,
  payment_option?: "BEFORE" | "AFTER" | "NO"
}

Get Time Slots

GET /clinical/facilities/{facility_id}/practitioners/{practitioner_id}/slots
Params:
  - date: YYYY-MM-DD
  - appointment_type: "fixed" | "telemedicine"
Response:
{
  slots: [{ start_at: ISO8601, end_at: ISO8601, status: "available" | "booked" }],
  timezone: "Asia/Kolkata"
}

8. BUG REPORTING TEMPLATE

### Bug #[N]: [Short Description]

| Field | Value |
|-------|-------|
| **Severity** | 🟡 High / 🟠 Medium / 🟢 Low |
| **Test Case** | [TC-ID] |
| **Area** | Add Patient / Appointment Booking |
| **Component** | [Component name] |
| **API** | [API endpoint] |
| **Status** | Open |

**Description**:
[Detailed description of the bug]

**Steps to Reproduce**:
1. [Step 1]
2. [Step 2]
3. [Step 3]

**Expected Behavior**:
[What should happen]

**Actual Behavior**:
[What actually happens]

**Evidence**:
[Screenshots / API responses / Console logs]

Document Status: Ready for Testing Total Test Cases: 100+ Estimated Time: 3-4 hours

On this page