Skip to content

fix(ot-roster): replace static patient list with live server-side search#1353

Merged
av-dev2 merged 1 commit into
Aakvatech-Limited:version-15-betafrom
av-dev2:feat_changes
Jun 11, 2026
Merged

fix(ot-roster): replace static patient list with live server-side search#1353
av-dev2 merged 1 commit into
Aakvatech-Limited:version-15-betafrom
av-dev2:feat_changes

Conversation

@av-dev2

@av-dev2 av-dev2 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator
  • Add search_patients() whitelisted API in roster.py that searches active patients using TRIM(patient_name) LIKE to handle leading/ trailing whitespace in patient names stored in the DB
  • Search matches both patient_name (trimmed) and patient ID (name)
  • Returns up to 30 results per query (server-side pagination)
  • Replace the static patientList createResource (which tried to load 17k+ patients in one request) with a debounced live-search function in OTRosterCell.vue using frappe-ui call()
  • Wire @update:query event on FormControl autocomplete to trigger the server-side search with 300ms debounce
  • Add :loading prop to show spinner while results are fetching
  • Labels are trimmed on the client side to handle display whitespace
  • Rebuild frontend assets

Fixes: patients not appearing in OT schedule dialog dropdown even when searched by first/middle/last name, caused by API page limit and whitespace in stored patient names.

- Add search_patients() whitelisted API in roster.py that searches
  active patients using TRIM(patient_name) LIKE to handle leading/
  trailing whitespace in patient names stored in the DB
- Search matches both patient_name (trimmed) and patient ID (name)
- Returns up to 30 results per query (server-side pagination)
- Replace the static patientList createResource (which tried to load
  17k+ patients in one request) with a debounced live-search function
  in OTRosterCell.vue using frappe-ui call()
- Wire @update:query event on FormControl autocomplete to trigger the
  server-side search with 300ms debounce
- Add :loading prop to show spinner while results are fetching
- Labels are trimmed on the client side to handle display whitespace
- Rebuild frontend assets

Fixes: patients not appearing in OT schedule dialog dropdown even when
searched by first/middle/last name, caused by API page limit and
whitespace in stored patient names.
@av-dev2 av-dev2 added the backport-to-version-15 Production branch label Jun 11, 2026
@av-dev2 av-dev2 merged commit 86738f8 into Aakvatech-Limited:version-15-beta Jun 11, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for version-15:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-version-15 Production branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant