Исправил приоритет при сохранении метрик
This commit is contained in:
@@ -290,12 +290,22 @@ class DutyReportController extends Controller
|
||||
$deceased = $patients['meta']['counts']['deceased'] ?? 0; // Умершие
|
||||
$discharged = $patients['meta']['counts']['discharged'] ?? 0; // Выписанные
|
||||
$outcome = $deceased + $discharged;
|
||||
|
||||
$baseMetrics = $this->metrikaService->calculateBaseStatistics($reportsDuty);
|
||||
$currentValue = empty($baseMetrics['current']) ?
|
||||
$patients['meta']['counts']['in_department'] ?? 0 :
|
||||
$baseMetrics['current'] ?? 0;
|
||||
$recipientValue = empty($baseMetrics['recipient']) ?
|
||||
$patients['meta']['counts']['recipient'] ?? 0 :
|
||||
$baseMetrics['recipient'] ?? 0;
|
||||
$dischargedValue = empty($baseMetrics['outcome']) ?
|
||||
$patients['meta']['counts']['discharged'] ?? 0 + $deceased :
|
||||
$baseMetrics['outcome'] ?? 0;
|
||||
|
||||
$lethality = !empty($discharged)
|
||||
? round(($deceased / $discharged) * 100, 2)
|
||||
: 0;
|
||||
|
||||
$baseMetrics = $this->metrikaService->calculateBaseStatistics($reportsDuty);
|
||||
|
||||
return [
|
||||
'nurse' => [
|
||||
'current' => !empty($nursePatients)
|
||||
@@ -311,9 +321,9 @@ class DutyReportController extends Controller
|
||||
'duty' => [
|
||||
'beds' => $bedsInDepartment ?? 0,
|
||||
'loaded' => $loaded,
|
||||
'current' => $baseMetrics['current'],// $patients['meta']['counts']['in_department'] ?? 0,
|
||||
'recipient' => $baseMetrics['recipient'] ?? 0,
|
||||
'discharged' => $baseMetrics['outcome'] + ($patients['meta']['counts']['deceased'] ?? 0), //($patients['meta']['counts']['discharged'] ?? 0) + ($patients['meta']['counts']['deceased'] ?? 0),
|
||||
'current' => $currentValue,
|
||||
'recipient' => $recipientValue,
|
||||
'discharged' => $dischargedValue,
|
||||
'deceased' => $patients['meta']['counts']['deceased'] ?? 0,
|
||||
'lethality' => $lethality,
|
||||
'surgical_planned' => $patients['meta']['counts']['surgical_planned'] ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user