Изменения в основном report

This commit is contained in:
brusnitsyn
2026-05-06 22:32:11 +09:00
parent c5da85763c
commit 723ccee8d3
56 changed files with 1911 additions and 3814 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Infrastructure\Reports\Sources;
use App\Data\UnifiedPatientData;
use App\Models\MedicalHistory;
use App\Models\User;
use App\Services\DateRange;
use App\Services\PatientService;
@@ -27,10 +28,15 @@ class MisPatientSource
bool $forSnapshots = false
): Collection {
return $this->getPatients($user, $status, $dateRange, $branchId, $includeCurrent, $fillableAuto, $forSnapshots)
->map(fn ($patient) => UnifiedPatientData::fromMisMedicalHistory(
$patient,
(bool) ($patient->is_recipient_today ?? false),
))
->map(fn ($patient) => $patient instanceof MedicalHistory
? UnifiedPatientData::fromMedicalHistory(
$patient,
(bool) ($patient->is_recipient_today ?? false),
)
: UnifiedPatientData::fromMisMedicalHistory(
$patient,
(bool) ($patient->is_recipient_today ?? false),
))
->sortByDesc(fn (UnifiedPatientData $patient) => $patient->admittedAt ?? '')
->values();
}