Обновлен стартовый экран

Переписаны запросы для статистики, отчетов
Добавлена интеграция отчета сестры
This commit is contained in:
brusnitsyn
2026-05-28 22:10:00 +09:00
parent 90e0d04dfd
commit 739168d427
96 changed files with 6663 additions and 1465 deletions

View File

@@ -39,4 +39,22 @@ class ReportDuty extends Model
{
return $this->belongsTo(ReportStatus::class);
}
public function doctor()
{
return $this->belongsTo(MisLpuDoctor::class, 'rf_lpudoctor_id', 'LPUDoctorID');
}
public function unwantedEvents()
{
return $this->hasMany(DutyUnwantedEvent::class, 'report_duty_id', 'id');
}
public function getLoadedDepartmentAttribute(int $patientsInDepartment)
{
$beds = DutyReportMetricResult::where('rf_report_id', $this->id)
->where('rf_metrika_item_id', 1)->pluck('value')->first() ?? 1;
return round((($patientsInDepartment ?? 0) * 100) / $beds);
}
}