Изменения в основном report
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user