Files
onboard/app/Services/SnapshotService.php
2026-05-06 22:32:11 +09:00

64 lines
1.7 KiB
PHP

<?php
namespace App\Services;
use App\Infrastructure\Reports\Sources\SnapshotPatientSource;
use Illuminate\Support\Collection;
class SnapshotService
{
public function __construct(
mixed $unifiedPatientService = null,
mixed $patientService = null,
mixed $dateRangeService = null,
?SnapshotPatientSource $snapshotPatientSource = null,
) {
$this->snapshotPatientSource = $snapshotPatientSource ?? app(SnapshotPatientSource::class);
}
protected SnapshotPatientSource $snapshotPatientSource;
/**
* Получить статистику из снапшотов
*/
public function getStatisticsFromSnapshots(array $reportIds): array
{
return $this->snapshotPatientSource->getStatisticsFromSnapshots($reportIds);
}
/**
* Получить пациентов из снапшотов по типу
*/
public function getPatientsFromSnapshots(
string $type,
array $reportIds,
?int $branchId = null,
bool $onlyIds = false,
bool $markRecipients = false,
?array $recipientReportIds = null
): Collection {
return $this->snapshotPatientSource->getPatientsFromSnapshots(
$type,
$reportIds,
$onlyIds,
$markRecipients,
$recipientReportIds
);
}
public function getPatientsFromOneDayCurrentSnapshots(
string $type,
array $reportIds,
bool $onlyIds = false,
?array $recipientReportIds = null
): Collection {
return $this->snapshotPatientSource->getPatientsFromOneDayCurrentSnapshots(
$type,
$reportIds,
$onlyIds,
$recipientReportIds
);
}
}