Доработка наблюдения в отчете дежурного
This commit is contained in:
@@ -37,7 +37,7 @@ class DutyReportExport
|
|||||||
'plannedOperations' => $this->operationsGroup($patients, [6]),
|
'plannedOperations' => $this->operationsGroup($patients, [6]),
|
||||||
'urgentOperations' => $this->operationsGroup($patients, [4, 5]),
|
'urgentOperations' => $this->operationsGroup($patients, [4, 5]),
|
||||||
'reanimation' => $this->flagGroup($patients, 'in_reanimation'),
|
'reanimation' => $this->flagGroup($patients, 'in_reanimation'),
|
||||||
'observableCount' => $patients->where('in_observable', true)->count(),
|
'observables' => $this->observableGroup($patients),
|
||||||
'deceased' => $this->flagGroup($patients, 'period_flags.deceased'),
|
'deceased' => $this->flagGroup($patients, 'period_flags.deceased'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -92,10 +92,23 @@ class DutyReportExport
|
|||||||
'full_name' => $patient['full_name'],
|
'full_name' => $patient['full_name'],
|
||||||
'age' => $age !== null ? "{$age} ".$this->pluralizeAge($age) : '',
|
'age' => $age !== null ? "{$age} ".$this->pluralizeAge($age) : '',
|
||||||
'diagnosis' => $withDiagnosis ? (data_get($patient, 'latest_migration.diagnosis_name') ?? '') : null,
|
'diagnosis' => $withDiagnosis ? (data_get($patient, 'latest_migration.diagnosis_name') ?? '') : null,
|
||||||
'migration_id' => (data_get($patient, 'latest_migration.original_id') ?? '')
|
'migration_id' => (data_get($patient, 'latest_migration.original_id') ?? ''),
|
||||||
|
'observable_reason' => (data_get($patient, 'observable.observable_reason') ?? '')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function observableGroup(Collection $patients): array
|
||||||
|
{
|
||||||
|
// Поступившие именно в этот отчётный период (сутки), а не все, кто вообще сейчас в отделении
|
||||||
|
$filtered = $patients
|
||||||
|
->where('in_observable', true)
|
||||||
|
->values();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'count' => $filtered->count(),
|
||||||
|
'patients' => $filtered->map(fn (array $p) => $this->presentPatient($p))->all(),
|
||||||
|
];
|
||||||
|
}
|
||||||
private function pluralizeAge(int $age): string
|
private function pluralizeAge(int $age): string
|
||||||
{
|
{
|
||||||
$mod100 = $age % 100;
|
$mod100 = $age % 100;
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
|
|
||||||
<p class="label">Плановые: {{ $planned['count'] }}</p>
|
<p class="label">Плановые: {{ $planned['count'] }}</p>
|
||||||
@foreach ($planned['patients'] as $i => $p)
|
@foreach ($planned['patients'] as $i => $p)
|
||||||
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">Экстренные: {{ $urgent['count'] }}</p>
|
<p class="label">Экстренные: {{ $urgent['count'] }}</p>
|
||||||
@foreach ($urgent['patients'] as $i => $p)
|
@foreach ($urgent['patients'] as $i => $p)
|
||||||
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">В отделении состоит: {{ $inDepartment }}</p>
|
<p class="label">В отделении состоит: {{ $inDepartment }}</p>
|
||||||
@@ -43,7 +43,10 @@
|
|||||||
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) {{ $p['diagnosis'] }}.@endif</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) {{ $p['diagnosis'] }}.@endif</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">Под наблюдением: {{ $observableCount }}</p>
|
<p class="label">Под наблюдением: {{ $observables['count'] }}</p>
|
||||||
|
@foreach ($observables['patients'] as $i => $p)
|
||||||
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) {{ $p['diagnosis'] }}.@endif<br>@if ($p['observable_reason']) {{ $p['observable_reason'] }}.@endif</p>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
<p class="label">Летальные исходы: {{ $deceased['count'] > 0 ? '' : 'не было.' }}</p>
|
<p class="label">Летальные исходы: {{ $deceased['count'] > 0 ? '' : 'не было.' }}</p>
|
||||||
@foreach ($deceased['patients'] as $i => $p)
|
@foreach ($deceased['patients'] as $i => $p)
|
||||||
|
|||||||
Reference in New Issue
Block a user