Выдача пацинетов на сутки
This commit is contained in:
@@ -49,8 +49,9 @@ class DutyReportExport
|
|||||||
|
|
||||||
private function urgencyGroup(Collection $patients, string $flag): array
|
private function urgencyGroup(Collection $patients, string $flag): array
|
||||||
{
|
{
|
||||||
|
// Поступившие именно в этот отчётный период (сутки), а не все, кто вообще сейчас в отделении
|
||||||
$filtered = $patients
|
$filtered = $patients
|
||||||
->where('period_flags.current_at_end', true)
|
->where('period_flags.recipient', true)
|
||||||
->where("period_flags.{$flag}", true)
|
->where("period_flags.{$flag}", true)
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
@@ -62,8 +63,12 @@ class DutyReportExport
|
|||||||
|
|
||||||
private function operationsGroup(Collection $patients, array $urgentStatuses): array
|
private function operationsGroup(Collection $patients, array $urgentStatuses): array
|
||||||
{
|
{
|
||||||
|
// latest_migration.operations уже ограничены периодом (start_date в рамках суток),
|
||||||
|
// в отличие от верхнеуровневого operations, у которого нижняя граница не задана
|
||||||
$filtered = $patients->filter(function (array $p) use ($urgentStatuses) {
|
$filtered = $patients->filter(function (array $p) use ($urgentStatuses) {
|
||||||
return collect($p['operations'] ?? [])->whereIn('urgent_status', $urgentStatuses)->isNotEmpty();
|
return collect(data_get($p, 'latest_migration.operations', []))
|
||||||
|
->whereIn('urgent_status', $urgentStatuses)
|
||||||
|
->isNotEmpty();
|
||||||
})->values();
|
})->values();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user