Форматирование
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
// app/Services/MetricCalculators/AverageBedDaysCalculator.php
|
||||
|
||||
namespace App\Services\MetricCalculators;
|
||||
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use App\Contracts\MetricCalculatorInterface;
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AverageBedDaysCalculator extends BaseMetricService implements MetricCalculatorInterface
|
||||
@@ -37,7 +38,7 @@ class AverageBedDaysCalculator extends BaseMetricService implements MetricCalcul
|
||||
$averages = [];
|
||||
foreach ($departmentIds as $deptId) {
|
||||
$averages[$deptId] = isset($results[$deptId])
|
||||
? round((float)$results[$deptId]->avg_value, 1)
|
||||
? round((float) $results[$deptId]->avg_value, 1)
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
// app/Services/MetricCalculators/LethalityCalculator.php
|
||||
|
||||
namespace App\Services\MetricCalculators;
|
||||
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use App\Contracts\MetricCalculatorInterface;
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LethalityCalculator extends BaseMetricService implements MetricCalculatorInterface
|
||||
@@ -42,8 +43,11 @@ class LethalityCalculator extends BaseMetricService implements MetricCalculatorI
|
||||
|
||||
if (isset($results[$deptId])) {
|
||||
foreach ($results[$deptId] as $item) {
|
||||
if ($item->rf_metrika_item_id == 9) $deceased = (int)$item->total;
|
||||
else $discharged = (int)$item->total;
|
||||
if ($item->rf_metrika_item_id == 9) {
|
||||
$deceased = (int) $item->total;
|
||||
} else {
|
||||
$discharged = (int) $item->total;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
// app/Services/MetricCalculators/PreoperativeDaysCalculator.php
|
||||
|
||||
namespace App\Services\MetricCalculators;
|
||||
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use App\Contracts\MetricCalculatorInterface;
|
||||
use App\Models\MedicalHistorySnapshot;
|
||||
use App\Models\Report;
|
||||
use App\Services\Base\BaseMetricService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -68,7 +69,7 @@ class PreoperativeDaysCalculator extends BaseMetricService implements MetricCalc
|
||||
$deptId = $reports[$snapshot->rf_report_id]->rf_department_id;
|
||||
$historyId = $snapshot->rf_medicalhistory_id;
|
||||
|
||||
if (!isset($operations[$historyId])) {
|
||||
if (! isset($operations[$historyId])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ class PreoperativeDaysCalculator extends BaseMetricService implements MetricCalc
|
||||
->diffInDays(Carbon::parse($op->first_operation));
|
||||
|
||||
if ($days >= 0) {
|
||||
if (!isset($results[$deptId])) {
|
||||
if (! isset($results[$deptId])) {
|
||||
$results[$deptId] = ['total' => 0, 'count' => 0];
|
||||
}
|
||||
$results[$deptId]['total'] += $days;
|
||||
|
||||
Reference in New Issue
Block a user