{{-- the reporting doctor is the doctor who requested the imaging (set on save) --}}
{{-- Which fieldset renders is normally looked up from the
request's own image type (image_types.report_template) —
see ImagingReportController@categoryFor. An ultrasound is
the one case staff get to choose for themselves: Pregnancy
and General are both right there as tabs on this same page,
defaulting to whichever the image type points at, switchable
before saving. The hidden report_category field carries
whichever tab is active at submit time; the controller only
lets it move between these two, never into xray/generic. --}}
@if (in_array($category, ['ultrasound_obstetric', 'ultrasound_general']))
{{-- ultrasound: the doctor picks the report type — one of the templates
(App\Services\UltrasoundTemplates) or the two older quick forms --}}
@php
$tabs = collect($templates)->map(fn ($t) => $t['short'])->all()
+ ['ultrasound_obstetric' => 'Pregnancy (quick)', 'ultrasound_general' => 'General (abdomen)'];
$isTpl = fn ($k) => str_starts_with($k, 'us_');
@endphp
@foreach ($tabs as $k => $label)
-
@endforeach
@foreach ($templates as $k => $tpl)
{{ $tpl['title'] }}
@include('patient_mangement.appointment.image.report._template', [
'tplKey' => $k, 'tpl' => $tpl, 'patientInfo' => $patientInfo,
'values' => $report?->template === $k ? ($report->report_data ?? []) : [],
])
@endforeach
@include('patient_mangement.appointment.image.report._ultrasound_obstetric', ['details' => $report?->UltrasoundObstetric])
@include('patient_mangement.appointment.image.report._ultrasound_general', ['findings' => $report?->UltrasoundGeneral])
@elseif ($category === 'xray')
@include('patient_mangement.appointment.image.report._xray', ['findings' => $report?->Xray])
@else
@include('patient_mangement.appointment.image.report._generic')
@endif
{{-- a template has its own Impression / Recommendations --}}