MEDICAL CHECK UP CERTIFICATE FOR MANAGEMENT
{{-- @include('pdf.partials.patient_information') --}}
Name Occupation Company
{{ $appointment->patient->name ?? '-' }} {{ $appointment->getJobPosition() }} {{ ( $appointment->company ?? ($mcuResult->company ?? $appointment->patient?->company) )?->name ?? '-' }}
Profile Photo KTP Photo
@php $profilePhotoPath = $mcuResult->patient_photo_snapshot ?? ($appointment->patient->photo ?? null); @endphp @if ($profilePhotoPath) @php $patientPhotoFullPath = storage_path('app/public/' . $profilePhotoPath); $patientPhotoAltPath = public_path('storage/' . $profilePhotoPath); $patientPhotoImageData = null; $patientPhotoMimeType = 'png'; if (file_exists($patientPhotoFullPath)) { try { $patientPhotoImageData = base64_encode(file_get_contents($patientPhotoFullPath)); $patientPhotoImageType = pathinfo($patientPhotoFullPath, PATHINFO_EXTENSION); $patientPhotoMimeType = $patientPhotoImageType === 'jpg' ? 'jpeg' : strtolower($patientPhotoImageType); } catch (Exception $e) { $patientPhotoImageData = null; } } elseif (file_exists($patientPhotoAltPath)) { try { $patientPhotoImageData = base64_encode(file_get_contents($patientPhotoAltPath)); $patientPhotoImageType = pathinfo($patientPhotoAltPath, PATHINFO_EXTENSION); $patientPhotoMimeType = $patientPhotoImageType === 'jpg' ? 'jpeg' : strtolower($patientPhotoImageType); } catch (Exception $e) { $patientPhotoImageData = null; } } @endphp @if ($patientPhotoImageData) Patient Photo @else No Photo Available @endif @else No Photo Available @endif @php $ktpPhotoPath = $mcuResult->patient_ktp_photo_snapshot ?? ($appointment->patient->ktp_photo ?? null); @endphp @if ($ktpPhotoPath) @php $ktpPhotoFullPath = storage_path('app/public/' . $ktpPhotoPath); $ktpPhotoAltPath = public_path('storage/' . $ktpPhotoPath); $ktpPhotoImageData = null; $ktpPhotoMimeType = 'png'; if (file_exists($ktpPhotoFullPath)) { try { $ktpPhotoImageData = base64_encode(file_get_contents($ktpPhotoFullPath)); $ktpPhotoImageType = pathinfo($ktpPhotoFullPath, PATHINFO_EXTENSION); $ktpPhotoMimeType = $ktpPhotoImageType === 'jpg' ? 'jpeg' : strtolower($ktpPhotoImageType); } catch (Exception $e) { $ktpPhotoImageData = null; } } elseif (file_exists($ktpPhotoAltPath)) { try { $ktpPhotoImageData = base64_encode(file_get_contents($ktpPhotoAltPath)); $ktpPhotoImageType = pathinfo($ktpPhotoAltPath, PATHINFO_EXTENSION); $ktpPhotoMimeType = $ktpPhotoImageType === 'jpg' ? 'jpeg' : strtolower($ktpPhotoImageType); } catch (Exception $e) { $ktpPhotoImageData = null; } } @endphp @if ($ktpPhotoImageData) KTP Photo @else No Photo Available @endif @else No Photo Available @endif
Result of Medical Check Up
{{ $statusText }}
@php $certMcuResult = $mcuResult ?? $appointment->mcuResult; $certExamDate = $certMcuResult && $certMcuResult->examination_date ? $certMcuResult->examination_date : $appointment->appointment_date; @endphp
MCU Berikutnya : {{ \App\Helpers\DateHelper::formatDate( \Carbon\Carbon::parse($certExamDate)->addYear(), ) }}
KLINIK MUSTIKA SANGSAKA {{ \App\Helpers\DateHelper::formatDate($certExamDate) }}
Dokter Penanggung Jawab
@php $defaultDoctor = $defaultDoctor ?? null; $currentUser = auth()->user(); $mcuResult = $mcuResult ?? null; // Mapping ID dokter ke nama dokter $doctorMapping = [ 1 => 'dr. Said M. Bin. Smith, MAP', 2 => 'dr. Azizah Bin Smith, MKK', 25 => 'dr. Zakia Alaydrus', ]; // Tentukan dokter yang akan ditampilkan tanda tangannya $selectedDoctor = null; $doctorName = null; $signatureBase64 = null; // Prioritas 1: Jika MCU sudah diverifikasi (ada finalized_by), gunakan dokter yang melakukan verifikasi if ($mcuResult && $mcuResult->finalized_by) { $finalizedBy = $mcuResult->finalized_by; if (isset($doctorMapping[$finalizedBy])) { $doctorName = $doctorMapping[$finalizedBy]; $selectedDoctor = $finalizedBy; $signatureBase64 = \App\Helpers\SignatureHelper::getDoctorSignatureBase64($doctorName); } } // Prioritas 2: Jika MCU belum diverifikasi (preview), gunakan dokter yang sedang login elseif ($currentUser && isset($doctorMapping[$currentUser->id])) { $doctorName = $doctorMapping[$currentUser->id]; $selectedDoctor = $currentUser->id; $signatureBase64 = \App\Helpers\SignatureHelper::getDoctorSignatureBase64($doctorName); } // Prioritas 3: Gunakan default doctor elseif ($defaultDoctor && $defaultDoctor->employee) { $doctorName = $defaultDoctor->employee->full_name; $signatureBase64 = \App\Helpers\SignatureHelper::getDoctorSignatureBase64($doctorName); } // Prioritas 4: Jika masih belum ada signature, gunakan yang dari controller if (!$signatureBase64 && isset($doctor_signature) && $doctor_signature) { $signatureBase64 = $doctor_signature; } @endphp @if (isset($qr_image) && $qr_image) QR Code Verifikasi Hasil MCU
@if (!empty($doctorName)) {{ $doctorName }} @elseif (isset($defaultDoctor) && $defaultDoctor && $defaultDoctor->employee) {{ $defaultDoctor->employee->full_name }} @endif
@elseif ($signatureBase64) Tanda Tangan Dokter @endif