Обновлен стартовый экран
Переписаны запросы для статистики, отчетов Добавлена интеграция отчета сестры
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user