Добавил ограничение по отказникам

This commit is contained in:
brusnitsyn
2026-06-17 17:38:48 +09:00
parent fe59410187
commit 839a534bb2
6 changed files with 105 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ class SnapshotPatientSource
?array $recipientReportIds = null
): Collection {
$snapshots = MedicalHistorySnapshot::query()
->withoutDenials()
->whereIn('rf_report_id', $reportIds)
->where('patient_type', $type)
->get()
@@ -45,6 +46,7 @@ class SnapshotPatientSource
if ($markRecipients) {
$recipientReportIds ??= $reportIds;
$recipientIds = MedicalHistorySnapshot::query()
->withoutDenials()
->whereIn('rf_report_id', $recipientReportIds)
->where('patient_type', 'recipient')
->get()
@@ -91,6 +93,7 @@ class SnapshotPatientSource
?array $recipientReportIds = null
): Collection {
$snapshots = MedicalHistorySnapshot::query()
->withoutDenials()
->whereIn('rf_report_id', $reportIds)
->where('patient_type', 'current')
->get();
@@ -107,6 +110,7 @@ class SnapshotPatientSource
$recipientReportIds ??= $reportIds;
$recipientIds = MedicalHistorySnapshot::query()
->withoutDenials()
->whereIn('rf_report_id', $recipientReportIds)
->where('patient_type', 'recipient')
->get()
@@ -151,7 +155,7 @@ class SnapshotPatientSource
private function getCountFromSnapshots(string $type, array $reportIds): int
{
$query = MedicalHistorySnapshot::whereIn('rf_report_id', $reportIds);
$query = MedicalHistorySnapshot::withoutDenials()->whereIn('rf_report_id', $reportIds);
if ($type === 'outcome') {
$query->whereIn('patient_type', ['discharged', 'deceased']);