diff --git a/app/Services/DutyReportService.php b/app/Services/DutyReportService.php index a821f0c..0a584ff 100644 --- a/app/Services/DutyReportService.php +++ b/app/Services/DutyReportService.php @@ -127,6 +127,7 @@ class DutyReportService return MedicalHistory::query() ->whereHas('migrations', function ($q) use ($departmentId, $dateRange, $startYear) { $q->where('department_id', $departmentId) + // ->whereNotIn('diagnosis_code', ['Z00.8', 'Z76.1', 'Z76.2', 'Z76.3']) // Исключаем осмотры и наблюдения ->where('ingoing_date', '<=', $dateRange->endSql()) ->where(function ($sub) use ($dateRange, $startYear) { // Миграции без out_date (еще лежат) diff --git a/app/Services/MedicalHistoryService.php b/app/Services/MedicalHistoryService.php index 446fb3b..24c606b 100644 --- a/app/Services/MedicalHistoryService.php +++ b/app/Services/MedicalHistoryService.php @@ -14,6 +14,7 @@ class MedicalHistoryService $startYear = $dateRange->startDate->copy()->startOfYear()->format('Y-m-d'); $periodMigrationFilter = function ($q) use ($departmentId, $dateRange, $startYear) { $q->where('department_id', $departmentId) + // ->whereNotIn('diagnosis_code', ['Z76.1', 'Z76.2', 'Z76.3']) // Исключаем осмотры и наблюдения ->where('ingoing_date', '<=', $dateRange->endSql()) ->where(function ($sub) use ($dateRange, $startYear) { // Миграции без out_date (еще лежат) diff --git a/app/Services/NurseReportService.php b/app/Services/NurseReportService.php index 9409781..3fe4f6b 100644 --- a/app/Services/NurseReportService.php +++ b/app/Services/NurseReportService.php @@ -96,6 +96,7 @@ class NurseReportService $query = UnifiedMedicalHistory::query() ->whereHas('migrations', function ($q) use ($departmentId, $dateRange, $startYear) { $q->where('department_id', $departmentId) + // ->whereNotIn('diagnosis_code', ['Z00.8', 'Z76.1', 'Z76.2', 'Z76.3']) // Исключаем осмотры и наблюдения ->where('ingoing_date', '<=', $dateRange->endSql()) ->where(function ($sub) use ($dateRange, $startYear) { $sub->whereNull('out_date') @@ -110,6 +111,7 @@ class NurseReportService }) ->with(['migrations' => function ($q) use ($departmentId, $dateRange, $startYear) { $q->where('department_id', $departmentId) + // ->whereNotIn('diagnosis_code', ['Z00.8', 'Z76.1', 'Z76.2', 'Z76.3']) // Исключаем осмотры и наблюдения ->where('ingoing_date', '<=', $dateRange->endSql()) ->where(function ($sub) use ($dateRange, $startYear) { $sub->whereNull('out_date')