@extends('layouts.app') @section('title', 'Imaging Report | ' . $imagingRequest->imaging_type) @section('styles') @endsection @section('content') @php $report = $imagingRequest->report; $isVerified = $report && $report->status === 'verified'; $patient = $imagingRequest->patient; @endphp
Back to Imaging

{{ $isVerified ? 'View' : 'Write' }} Report | {{ $imagingRequest->imaging_type }}

@if($isVerified)@endif
@if($isVerified) {{-- PRINTABLE REPORT --}}
{{-- LETTERHEAD --}} @include('partials._document-header') {{-- PATIENT DEMOGRAPHICS STRIP --}}
Visit #:{{ $imagingRequest->visit->visit_number ?? '' }} Name:{{ $patient->full_name ?? '' }} Gender:{{ ucfirst($patient->gender ?? '') }} Age:{{ $patient->age ?? '' }} Patient ID:{{ $patient->mrn ?? '' }}
Study Type:{{ $imagingRequest->imaging_type }} Body Part:{{ $imagingRequest->body_part ?? '-' }} Department:Imaging Date:{{ $imagingRequest->created_at->format('d M Y H:i') }}
{{-- SEPARATOR --}}
{{-- REPORT TITLE --}}

{{ $imagingRequest->imaging_type }} Report

{{-- REPORT SECTIONS --}}

Clinical Indication

{{ $report->clinical_indication ?? $imagingRequest->clinical_indication ?? '-' }}

Study Performed

{{ $report->study_performed ?? $imagingRequest->imaging_type }}

Findings

{{ $report->findings ?? '-' }}

Conclusion & Recommendation

{{ $report->impression ?? '-' }}

@if(!empty(trim($report?->recommendation ?? '')))

Additional Recommendations

{{ $report?->recommendation }}

@endif
{{-- SIGNATURES --}}

Reported By:

{{ $report->reporter->name ?? '-' }}

Verified By:

{{ $report->approver->name ?? '-' }}

{{ $report->approved_at?->format('d M Y H:i') ?? '' }}

@include('partials._document-footer')
@else {{-- EDITABLE REPORT FORM --}}

Patient

{{ strtoupper(substr($patient->first_name ?? '', 0, 1) . substr($patient->last_name ?? '', 0, 1)) }}

{{ $patient->full_name ?? '' }}

{{ $patient->mrn ?? '' }} · {{ ucfirst($patient->gender ?? '') }} · {{ $patient->age ?? '' }}

Study Details

Study: {{ $imagingRequest->imaging_type }}
Body Part: {{ $imagingRequest->body_part ?? '-' }}
Urgency: {{ ucfirst($imagingRequest->urgency) }}
Ordered: {{ $imagingRequest->created_at->format('d M Y H:i') }}
@csrf

Report

{{-- ROW 1: Clinical Indication + Study Performed (side-by-side, 2 cols) --}}
{{-- ROW 2: Findings — full width, tall, with visual guide lines for sentence-by-sentence entry --}}
{{-- ROW 3: Conclusion & Recommendation — merged into a single field --}}
@php // Combine existing impression + recommendation for display (if both exist). // $report is null for brand-new reports — use null-safe access on every read. $existingImpression = $report?->impression ?? ''; $existingRecommendation = $report?->recommendation ?? ''; $mergedConclusion = trim( $existingImpression . (($existingImpression && $existingRecommendation) ? "\n\n" : '') . $existingRecommendation ); @endphp {{-- Clear any legacy recommendation field so it doesn't show as a separate empty section on the printed report --}}
Cancel
@endif @endsection