Skip to content

fix: patient gender list filtering

Damanagari Sathwika requested to merge fix/vitals-gender into fix/develop

Overview

This MR fixes the issue where patient filtering by gender was not working correctly in the UI due to incorrect data rendering.


What does this MR do and why?

Previously, the UI was rendering the full patients list instead of the filtered list, causing:

  • Gender filter (male/female/other) not working
  • UI not updating correctly when filters were applied

This MR ensures that the UI uses the correct filtered data source for rendering.


Changes Made

  • Replaced patients with filteredPatients in rendering logic
  • Ensured UI updates dynamically based on selected filters
  • Fixed mismatch between backend data and frontend display
  • Improved consistency in patient list rendering

Technical Details

  • Root Cause: UI was using unfiltered dataset (patients)
  • Fix: Updated rendering to use filteredPatients
  • Ensured proper state-based filtering logic

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Related Issues / References

  • Fixes gender filter not working in patient list
  • Aligns UI with backend gender data

Screenshots or Screen Recordings

Before After
image image
Filter not working Filter updates correctly

How to Set Up and Validate Locally

  1. Start frontend:
bun dev
  1. Navigate to patient list page

  2. Apply filters:

  • Select Male / Female / Other
  1. Verify:
  • Only filtered patients are shown
  • UI updates instantly

Testing Done

  • Manual testing completed

Test Cases Covered:

Scenario Expected Result Status
Select Male filter Only male patients shown
Select Female filter Only female patients shown
Remove filter Full list shown

Code Quality Checklist

  • No unused variables
  • Clean state handling
  • No console logs
  • Follows project conventions

Documentation

  • No documentation changes required

Additional Notes

This fix ensures frontend filtering behavior is consistent with backend data and improves overall user experience.

Edited by Damanagari Sathwika

Merge request reports

Loading