feat(patients): inline tag popover + advanced filters on the records list
Port the remaining pieces of tauri /files list into /admin/patients:
- inline tag assignment: the برچسبها cell (table + card) opens a popover to
assign/remove tenant tags without leaving the list. Uses existing endpoints
(GET /api/v1/tenant-tags + PATCH /api/v1/patient/{uuid} { tags:[uuid] }).
New component assets/admin/components/PatientTagsCell.tsx.
- advanced filter modal (PatientsFilterModal): admission date range, insurance,
service status (pending/completed), has-debt, gender, tags — wired to the
list query with an active-filter badge on the button.
Backend: GET /api/v1/patients gains tags/gender/insurance_id/admitted_from/
admitted_to/service_status/has_debt filters via a shared applyFilters() on
PatientRecordRepository (findByEntity + countByEntity stay consistent). Debt
and service status derive from unpaid sessions (payment_method='pending'),
documented in docs/api/patient.md.
Tests: tests/Patient/PatientListFilterTest.php (5) + PatientsListPage tag-popover
and filter-apply tests. Pre-existing LoginPage.test failures are unrelated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -25,7 +25,15 @@ Returns a paginated list of patient records belonging to the authenticated entit
|
||||
|-------|------|---------|-------------|
|
||||
| `page` | int | 1 | Page number |
|
||||
| `limit` | int | 20 | Items per page (10–50) |
|
||||
| `search` | string | — | Search by patient name or phone |
|
||||
| `search` | string | — | Search by patient name, phone or national code |
|
||||
| `tags` | string | — | Comma-separated tenant-tag uuids; matches records having any of them |
|
||||
| `gender` | string | — | Patient `UserProfile.gender` (e.g. `male`/`female`) |
|
||||
| `insurance_id` | int | — | Patient's basic insurance id (`UserProfile.basic_insurance_id`) |
|
||||
| `admitted_from` / `admitted_to` | int | — | Record creation (تاریخ پذیرش) unix-seconds range |
|
||||
| `service_status` | string | — | `pending` (has an unpaid session) or `completed` (has sessions, none unpaid) |
|
||||
| `has_debt` | bool | — | `1` → only records with an unpaid session (`payment_method='pending'`) |
|
||||
|
||||
> «بدهی» و «وضعیت سرویس» بر پایهی وجود مراجعهی پرداختنشده تعریف شدهاند (مدل بدهی مستقل ندارد). فیلترها روی هم AND میشوند و در count هم اعمال میگردند.
|
||||
|
||||
**Response 200:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user