diff --git a/app/Models/MedicalHistory.php b/app/Models/MedicalHistory.php index 041d458..28938ed 100644 --- a/app/Models/MedicalHistory.php +++ b/app/Models/MedicalHistory.php @@ -33,7 +33,7 @@ class MedicalHistory extends MaterializedViewModel public function latestMigration() { return $this->hasOne(MigrationPatient::class, 'medical_history_id', 'id') - ->whereNotNull('out_date') + ->whereNot('stationar_branch_id', 0) // не выписка ->latest('ingoing_date'); }