Skip to content

Resolve "Fix the complete councelling route by removing unnecessary data in request body"

Closes #22 (closed)

Description

This MR simplifies the counseling page workflow and integrates the Patient Status Tracker for better navigation control.

Problem

1)Complex Counseling Page: The original page had a 5-step process with unused form fields, slowing down volunteers.

2)Broken Navigation: The Patient Status Tracker's "Counseling Done" step was trying to navigate to a path that didn't support URL parameters correctly, causing 404s or broken state.

Solution

1)Simplified Counseling Page:

  • Reduced to a 2-step flow: Search → Complete.
  • Removed unused fields (dietary/lifestyle advice, notes).
  • Added support for ?book_no=123 query parameter to auto-search patients.

2)Integrated Status Tracker:

  • Added PatientStatusTrackerto the Counseling Page.
  • Fixed the tracker's navigation logic to use query parameters (?book_no=...) instead of path parameters for the counseling step, ensuring consistent deep linking.

Changes

Modified Files

  • src/pages/volunteer/CounselingPage.tsx
    • Integrated PatientStatusTracker
    • Added URL query parameter support for auto-searching
    • Simplified UI to remove unused form fields
  • src/components/PatientStatusTracker.tsx
    • Fixed navigation logic to use query parameters for counselling_done step
  • tests/unit/components/CounselingPage.test.tsx
    • Updated tests to cover new functionality (URL params, tracker presence)

Key Features

Deep Linking: Can now navigate to /volunteer/counseling?book_no=123 and it automatically loads the patient.

Seamless Navigation: Clicking "Counseling Done" in the tracker now correctly directs to the counseling page with the patient pre-loaded.

Streamlined Workflow: Volunteers can mark counseling as done in one click.

Edited by Lakshy Yarlagadda

Merge request reports

Loading