Обновление шаблонадежурного
This commit is contained in:
@@ -9,12 +9,6 @@ use Illuminate\Support\Collection;
|
|||||||
|
|
||||||
class DutyReportExport
|
class DutyReportExport
|
||||||
{
|
{
|
||||||
private const RU_MONTHS = [
|
|
||||||
1 => 'январь', 2 => 'февраль', 3 => 'март', 4 => 'апрель',
|
|
||||||
5 => 'май', 6 => 'июнь', 7 => 'июль', 8 => 'август',
|
|
||||||
9 => 'сентябрь', 10 => 'октябрь', 11 => 'ноябрь', 12 => 'декабрь',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected array $patients,
|
protected array $patients,
|
||||||
protected array $dateRange,
|
protected array $dateRange,
|
||||||
@@ -29,12 +23,13 @@ class DutyReportExport
|
|||||||
public function toViewData(): array
|
public function toViewData(): array
|
||||||
{
|
{
|
||||||
$patients = collect($this->patients);
|
$patients = collect($this->patients);
|
||||||
|
$startDate = Carbon::parse($this->dateRange[0]);
|
||||||
$endDate = Carbon::parse($this->dateRange[1]);
|
$endDate = Carbon::parse($this->dateRange[1]);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => sprintf('%s «%s»', $this->reportName, $this->department->name_full ?? $this->department->name_short),
|
'title' => sprintf('%s «%s»', $this->reportName, $this->department->name_full ?? $this->department->name_short),
|
||||||
'day' => $endDate->format('d'),
|
'day' => $startDate->format('d'),
|
||||||
'month' => self::RU_MONTHS[(int) $endDate->format('n')],
|
'month' => $startDate->locale('ru')->getTranslatedMonthName('Do MMMM'),
|
||||||
'year' => $endDate->format('Y'),
|
'year' => $endDate->format('Y'),
|
||||||
'planned' => $this->urgencyGroup($patients, 'planned'),
|
'planned' => $this->urgencyGroup($patients, 'planned'),
|
||||||
'urgent' => $this->urgencyGroup($patients, 'urgent'),
|
'urgent' => $this->urgencyGroup($patients, 'urgent'),
|
||||||
@@ -97,6 +92,7 @@ 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') ?? '')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
.sub { text-align: center; margin: 0 0 16px; }
|
.sub { text-align: center; margin: 0 0 16px; }
|
||||||
.label { font-weight: bold; margin: 10px 0 2px; }
|
.label { font-weight: bold; margin: 10px 0 2px; }
|
||||||
.patient { margin: 2px 0 2px 12px; }
|
.patient { margin: 2px 0 2px 12px; }
|
||||||
.signature { margin-top: 32px; }
|
.signature { position: absolute }
|
||||||
.signature p { margin: 12px 0; }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -19,24 +18,24 @@
|
|||||||
|
|
||||||
<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</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}</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</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">В отделении состоит: {{ $inDepartment }}</p>
|
<p class="label">В отделении состоит: {{ $inDepartment }}</p>
|
||||||
|
|
||||||
<p class="label">Плановых операций: {{ $plannedOperations['count'] }}</p>
|
<p class="label">Плановых операций: {{ $plannedOperations['count'] }}</p>
|
||||||
@foreach ($plannedOperations['patients'] as $p)
|
@foreach ($plannedOperations['patients'] as $i => $p)
|
||||||
<p class="patient">{{ $p['full_name'] }} {{ $p['age'] }}.</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">Экстренных операций: {{ $urgentOperations['count'] }}</p>
|
<p class="label">Экстренных операций: {{ $urgentOperations['count'] }}</p>
|
||||||
@foreach ($urgentOperations['patients'] as $p)
|
@foreach ($urgentOperations['patients'] as $i => $p)
|
||||||
<p class="patient">{{ $p['full_name'] }} {{ $p['age'] }}.</p>
|
<p class="patient">{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<p class="label">Реанимация: {{ $reanimation['count'] }}</p>
|
<p class="label">Реанимация: {{ $reanimation['count'] }}</p>
|
||||||
@@ -51,9 +50,15 @@
|
|||||||
<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
|
||||||
|
|
||||||
<div class="signature">
|
<div class="signature" style="left: 0; bottom: 30px;">
|
||||||
<p>Дежурный врач ПДО: _____________</p>
|
<div>
|
||||||
<p>Дежурный врач отделения: _____________</p>
|
____________________________
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="signature" style="right: 0; bottom: 30px;">
|
||||||
|
<div>
|
||||||
|
____________________________
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user