Skip to content

Resolve "feat: Auto-redirect to Assign Doctor after Patient Registration"

🚀 Merge Request: Auto-Redirect to Assign Doctor After Patient Registration

Description

Currently, after a volunteer successfully registers a new patient, the application redirects back to the landing page. To assign a doctor, the volunteer must manually navigate to the Assign Doctor page and search for the newly created patient again. This adds unnecessary steps and slows down the workflow, especially during high-volume registrations.

This MR improves the registration flow by automatically redirecting the volunteer to the Assign Doctor page immediately after a new patient is created.


User Story

As a volunteer, I want to be automatically redirected to the Assign Doctor screen after registering a new patient so that I can immediately assign the patient to a doctor without additional navigation.


Acceptance Criteria

  • Trigger: Redirect occurs only after a successful Create & Register Patient action
  • Feedback: Displays a success notification before redirecting
  • Action: Navigates to /volunteer/assign-doctor/{book_no}
  • State: Assign Doctor page loads with the newly created patient’s Book Number pre-filled or automatically selected

Technical Changes

  • Updated PatientRegistrationPage.tsx
  • Modified createPatientMutation onSuccess handler
  • Added navigation to /volunteer/assign-doctor/${data.book_no}
  • Introduced a short delay (~1000 ms) to allow the success toast to be visible before redirecting

Testing

  • Verified patient creation succeeds
  • Confirmed success toast is displayed
  • Confirmed automatic redirect to Assign Doctor page
  • Confirmed Book Number is pre-filled / auto-selected

Notes

This change improves volunteer efficiency and reduces unnecessary navigation during patient registration workflows.

Closes #38 (closed)

Edited by Kushal Lagichetty

Merge request reports

Loading