feat(treatment): filter treatment cases by patient record

The list could be narrowed by status, search and open-date, but not by patient
— so a patient's own file had no way to ask which courses belong to them.
`?record=` adds that bound.

patientRecord is joined once and shared with the search branch; joining it twice
under the same alias is a DQL error, and search already needed it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-08-07 16:05:35 +03:30
co-authored by Claude Opus 5
parent fbaf98a1f5
commit 250e0b0813
5 changed files with 418 additions and 6 deletions
@@ -59,6 +59,8 @@ class TreatmentCaseController extends BaseController
$q !== '' ? $q : null,
$this->dayBoundary($request->query->get('from'), '00:00:00'),
$this->dayBoundary($request->query->get('to'), '23:59:59'),
// نمای «پروندهٔ بیمار» همین فهرست است با یک کران بیشتر.
is_string($record = $request->query->get('record')) && $record !== '' ? $record : null,
),
));
}