fix: patient gender list filtering
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
patientswithfilteredPatientsin 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 |
|---|---|
![]() |
![]() |
| Filter not working | Filter updates correctly |
How to Set Up and Validate Locally
- Start frontend:
bun dev
-
Navigate to patient list page
-
Apply filters:
- Select Male / Female / Other
- 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

