Обновлен стартовый экран
Переписаны запросы для статистики, отчетов Добавлена интеграция отчета сестры
This commit is contained in:
@@ -33,6 +33,7 @@ class MedicalHistory extends MaterializedViewModel
|
||||
public function latestMigration()
|
||||
{
|
||||
return $this->hasOne(MigrationPatient::class, 'medical_history_id', 'id')
|
||||
->whereNotNull('out_date')
|
||||
->latest('ingoing_date');
|
||||
}
|
||||
|
||||
@@ -41,6 +42,17 @@ class MedicalHistory extends MaterializedViewModel
|
||||
return $this->hasMany(Reanimation::class, 'medical_history_id', 'id');
|
||||
}
|
||||
|
||||
public function observables()
|
||||
{
|
||||
return $this->hasMany(ObservableMedicalHistory::class, 'original_id', 'id');
|
||||
}
|
||||
|
||||
public function observable()
|
||||
{
|
||||
return $this->hasOne(ObservableMedicalHistory::class, 'original_id', 'id')
|
||||
->latest('observable_in');
|
||||
}
|
||||
|
||||
public function operationsInDepartment($query, $departmentId)
|
||||
{
|
||||
return $this->operations()->where('department_id', $departmentId);
|
||||
|
||||
Reference in New Issue
Block a user