Профиль хирургии

This commit is contained in:
brusnitsyn
2026-03-25 17:37:32 +09:00
parent 52a80ccd3b
commit f566ab96df
75 changed files with 3841 additions and 1009 deletions

View File

@@ -102,7 +102,9 @@ class MisMedicalHistory extends Model
public function scopeOperationOnBranch($query, $branchId, $startDate, $endDate)
{
return $this->surgicalOperations()->where('rf_StationarBranchID', $branchId)
->whereBetween('Date', [$startDate, $endDate]);
->where('Date', '>=', $startDate)
->where('Date', '<=', $endDate);
// ->whereBetween('Date', [$startDate, $endDate]);
}
public function scopeCurrentlyHospitalized($query)
@@ -143,6 +145,13 @@ class MisMedicalHistory extends Model
return $this->hasMany(MisMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
}
public function outcomeMigration()
{
return $this->migrations()
->whereDate('DateOut', '<>', '2222-01-01')
->orderBy('DateOut', 'desc');
}
/*
* Движение по StationarBranch
*/
@@ -166,7 +175,9 @@ class MisMedicalHistory extends Model
->where('sb.rf_DepartmentID', $departmentId);
if ($startDate && $endDate) {
$q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
$q->where('mp.DateIngoing', '>=', $startDate)
->where('mp.DateIngoing', '<=', $endDate);
// $q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
}
});
}