{{-- Partial view untuk menampilkan informasi pasien di halaman result detail Dapat digunakan di semua workstation result detail (lab, audiometry, ekg, dll) Termasuk status card untuk menampilkan status pemeriksaan Variables yang diperlukan: - $result: object hasil pemeriksaan dengan relasi appointment, patient, company, mcuPackage - $headerColor: warna header card (default: bg-primary) - $showPhysicalData: boolean untuk menampilkan data fisik (default: false) - $additionalInfo: array untuk informasi tambahan spesifik workstation - $layout: layout type - 'sidebar' (default) atau 'fullwidth' --}} @php $headerColor = $headerColor ?? 'bg-primary'; $showPhysicalData = $showPhysicalData ?? false; $additionalInfo = $additionalInfo ?? []; $layout = $layout ?? 'sidebar'; $bodyClass = $layout === 'horizontal' ? 'p-3' : 'p-4'; // Handle different result variable names from different controllers $result = $result ?? ($radiologyResult ?? ($labResult ?? ($audiometryResult ?? ($visusResult ?? ($spirometryResult ?? ($ekgResult ?? $physicalExamResult)))))); @endphp {{-- Patient Information Card --}}
Informasi Pasien
@if ($layout === 'horizontal')

{{ $result->appointment->patient->name ?? $result->appointment->patient->full_name }}

{{ $result->appointment->patient->gender == 'male' ? 'Laki-laki' : 'Perempuan' }}

{{ $result->appointment->patient->birth_date ? $result->appointment->patient->birth_date->format('d-m-Y') : '-' }}

{{ $result->appointment->patient->detailed_age ?: ($result->appointment->patient->age ? $result->appointment->patient->age . ' tahun' : '-') }}

{{ $result->appointment ? $result->appointment->getJobPosition() : $result->patient->job_position ?? '-' }}

{{ $result->appointment->mcuPackage->name ?? '-' }}

@else
{{ $result->appointment->patient->name ?? $result->appointment->patient->full_name }}
{{ $result->appointment->patient->medical_record_number ?? '-' }}
{{ $result->appointment->patient->birth_date ? \App\Helpers\DateHelper::formatShort($result->appointment->patient->birth_date) : '-' }}
{{ $result->appointment->patient->detailed_age ?: ($result->appointment->patient->age ? $result->appointment->patient->age . ' tahun' : '-') }}
{{ $result->appointment->patient->gender == 'male' ? 'Laki-laki' : 'Perempuan' }}
@php $dispComp = $result->appointment?->company ?? ($result->company ?? $result->patient?->company); @endphp @if ($dispComp) {{ $dispComp->name }} @else Pribadi @endif
{{ $result->appointment ? $result->appointment->getJobPosition() : $result->patient->job_position ?? '-' }}
{{ $result->appointment->mcuPackage->name ?? '-' }}
@php $currentAppointment = $result->appointment; $mcuOrder = $currentAppointment->patient ->appointments() ->where(function ($q) use ($currentAppointment) { $q->where('appointment_date', '<', $currentAppointment->appointment_date)->orWhere(function ($q2) use ( $currentAppointment, ) { $q2->where('appointment_date', $currentAppointment->appointment_date)->where( 'id', '<=', $currentAppointment->id, ); }); }) ->count(); $previousMcu = $currentAppointment->patient ->appointments() ->where(function ($q) use ($currentAppointment) { $q->where('appointment_date', '<', $currentAppointment->appointment_date)->orWhere(function ($q2) use ( $currentAppointment, ) { $q2->where('appointment_date', $currentAppointment->appointment_date)->where( 'id', '<', $currentAppointment->id, ); }); }) ->orderByDesc('appointment_date') ->first(); @endphp MCU ke-{{ $mcuOrder }} @if ($previousMcu)
MCU Terakhir: {{ \App\Helpers\DateHelper::formatShort($previousMcu->appointment_date) }} @else
Pertama kali @endif
@if (!empty($additionalInfo)) @foreach ($additionalInfo as $label => $value)
{!! $value !!}
@endforeach @endif @endif @if ($showPhysicalData && $layout !== 'horizontal')
@if (isset($physicalExamResult) && $physicalExamResult && $physicalExamResult->height) {{ $physicalExamResult->height }} cm @elseif ($result->appointment->patient->height) {{ $result->appointment->patient->height }} cm @else Belum diperiksa @endif
@if (isset($physicalExamResult) && $physicalExamResult && $physicalExamResult->weight) {{ $physicalExamResult->weight }} kg @elseif ($result->appointment->patient->weight) {{ $result->appointment->patient->weight }} kg @else Belum diperiksa @endif
@if (isset($physicalExamResult) && $physicalExamResult && $physicalExamResult->height && $physicalExamResult->weight) @php $heightInMeters = $physicalExamResult->height / 100; $bmi = round($physicalExamResult->weight / ($heightInMeters * $heightInMeters), 1); @endphp {{ $bmi }} @elseif ($result->appointment->patient->height && $result->appointment->patient->weight) @php $heightInMeters = $result->appointment->patient->height / 100; $bmi = round($result->appointment->patient->weight / ($heightInMeters * $heightInMeters), 1); @endphp {{ $bmi }} @else Belum diperiksa @endif
@if (isset($physicalExamResult) && $physicalExamResult && $physicalExamResult->blood_pressure_systolic && $physicalExamResult->blood_pressure_diastolic) {{ $physicalExamResult->blood_pressure_systolic }}/{{ $physicalExamResult->blood_pressure_diastolic }} mmHg @else Belum diperiksa @endif
@endif
{{-- Status Card --}}
Status Pemeriksaan
@if ($result->status == 'verified') Terverifikasi @elseif ($result->status == 'rejected') Ditolak @else Menunggu Verifikasi @endif
{{ $result->appointment->appointment_date ? \App\Helpers\DateHelper::formatShort($result->appointment->appointment_date) : '-' }}
{{ $result->completed_at ? \App\Helpers\DateHelper::formatShort($result->completed_at) . ' ' . $result->completed_at->format('H:i') : '-' }}
@if ($result->verified_at)
{{ \App\Helpers\DateHelper::formatShort( $result->verified_at, ) }} {{ $result->verified_at->format('H:i') }}
@endif