@php $appointment = $appointment ?? null; $physicalExamResult = $physicalExamResult ?? ($appointment->physicalExamResult ?? null); @endphp @if ($physicalExamResult)
Antropometri :
@if ($physicalExamResult->height)
{{ $physicalExamResult->height }}cm
Tinggi Badan
@endif @if ($physicalExamResult->weight)
{{ $physicalExamResult->weight }}kg
Berat Badan
@endif @if ($physicalExamResult->bmi)
{{ number_format($physicalExamResult->bmi, 2) }}
@php $bmi = $physicalExamResult->bmi; $bmiCategory = ''; if ($bmi < 18.5) { $bmiCategory = 'Underweight'; } elseif ($bmi < 23) { $bmiCategory = 'Normal'; } elseif ($bmi < 25) { $bmiCategory = 'Overweight'; } elseif ($bmi < 30) { $bmiCategory = 'Obesitas I'; } else { $bmiCategory = 'Obesitas II'; } @endphp
{{ $bmiCategory }}
IMT
@endif @if ($physicalExamResult->waist_circumference)
{{ $physicalExamResult->waist_circumference }}cm
@php $waist = (float) $physicalExamResult->waist_circumference; $gender = $appointment->patient ? $appointment->patient->gender : 'male'; $waistNote = ''; if ($gender === 'male') { if ($waist < 90) { $waistNote = 'Normal'; } else { $waistNote = 'Beresiko'; } } else { if ($waist < 80) { $waistNote = 'Normal'; } else { $waistNote = 'Beresiko'; } } @endphp
{{ $waistNote }}
Lingkar Perut
@endif
Tanda Vital :
@if ($physicalExamResult->blood_pressure_systolic && $physicalExamResult->blood_pressure_diastolic)
{{ $physicalExamResult->blood_pressure_systolic }}/{{ $physicalExamResult->blood_pressure_diastolic }}mmHg
@php $sys = (int) $physicalExamResult->blood_pressure_systolic; $dia = (int) $physicalExamResult->blood_pressure_diastolic; $bpCat = ''; if ($sys >= 140 || $dia >= 90) { $bpCat = 'Hipertensi'; } else { $bpCat = 'Normal'; } @endphp
{{ $bpCat }}
Tekanan Darah
@endif @if ($physicalExamResult->heart_rate)
{{ $physicalExamResult->heart_rate }}x/m
@php $hr = (int) $physicalExamResult->heart_rate; $hrCat = ''; if ($hr < 60) { $hrCat = 'Bradikardi'; } elseif ($hr > 100) { $hrCat = 'Takikardi'; } else { $hrCat = 'Normal'; } @endphp
{{ $hrCat }}
Nadi
@endif @if ($physicalExamResult->respiratory_rate)
{{ $physicalExamResult->respiratory_rate }}x/m
@php $rr = (int) $physicalExamResult->respiratory_rate; $rrCat = ''; if ($rr < 12) { $rrCat = 'Bradipnea'; } elseif ($rr > 24) { $rrCat = 'Takipnea'; } else { $rrCat = 'Normal'; } @endphp
{{ $rrCat }}
Respirasi
@endif @if ($physicalExamResult->body_temperature)
{{ number_format( $physicalExamResult->body_temperature, 1, ) }}°C
@php $t = (float) $physicalExamResult->body_temperature; $tCat = ''; if ($t > 42.0) { $tCat = 'Hipertermi'; } elseif ($t >= 40.0 && $t <= 42.0) { $tCat = 'Hiperpireksis'; } elseif ($t >= 38.0 && $t < 40.0) { $tCat = 'Febris'; } elseif ($t >= 37.0 && $t < 38.0) { $tCat = 'Sub Febris'; } elseif ($t >= 36.6 && $t <= 37.2) { $tCat = 'Normal'; } elseif ($t < 36.0) { $tCat = 'Hipotermi'; } else { $tCat = 'Normal'; } @endphp
{{ $tCat }}
Suhu
@endif
@if ($appointment->visusResult)
Pemeriksaan Mata :
@php // Fungsi: menentukan apakah nilai visus lebih buruk dari 6/6 // Mengembalikan true jika pembilang < penyebut (contoh: 6/9, 6/12) // Termasuk kasus khusus non-numerik seperti "1/tak terhingga" atau simbol ∞ if (!function_exists('isAbnormalVisionValue')) { function isAbnormalVisionValue($value) { if (!is_string($value) || trim($value) === '') { return false; } $val = trim(strtolower($value)); if (strpos($val, 'tak') !== false || strpos($val, '∞') !== false) { return true; } if (preg_match('/(\d+)\/(\d+)/', $value, $m)) { $num = (int) $m[1]; $den = (int) $m[2]; return $num < $den; // lebih buruk dari 6/6 } return false; } } // Fungsi: menentukan abnormal untuk teks umum (bukan rasio visus) if (!function_exists('isAbnormalText')) { function isAbnormalText($value) { if (!is_string($value)) { return false; } $trimmed = trim($value); if ($trimmed === '' || $trimmed === '-') { return false; } // Placeholder yang tidak dianggap abnormal if (preg_match('/belum diperiksa|tidak diperiksa|tidak dilakukan/i', $trimmed)) { return false; } // Nilai dianggap normal jika mengandung kata "normal" atau "negatif" if (preg_match('/normal/i', $trimmed) || preg_match('/negatif/i', $trimmed)) { return false; } // Kata kunci umum abnormal if (preg_match('/parsial|partial|total|defek|terbatas|abnormal/i', $trimmed)) { return true; } // Default: selain normal/negatif dianggap abnormal return true; } } $leftUncorrected = $appointment->visusResult->left_eye_uncorrected ?? null; $rightUncorrected = $appointment->visusResult->right_eye_uncorrected ?? null; $leftCorrected = $appointment->visusResult->left_eye_corrected ?? null; $rightCorrected = $appointment->visusResult->right_eye_corrected ?? null; $isLeftUncorrectedAbn = isAbnormalVisionValue($leftUncorrected); $isRightUncorrectedAbn = isAbnormalVisionValue($rightUncorrected); $isLeftCorrectedAbn = isAbnormalVisionValue($leftCorrected); $isRightCorrectedAbn = isAbnormalVisionValue($rightCorrected); // Fungsi: menentukan apakah nilai near vision abnormal // Interpretasi: Dalam Batas Normal = normal; Presbiopia Ringan/Sedang/Berat = abnormal // Nilai Jaeger: J20-J25 = normal, J30 ke atas = abnormal; Tidak Dapat di Evaluasi = abnormal if (!function_exists('isAbnormalNearVision')) { function isAbnormalNearVision($value) { if (!is_string($value) || trim($value) === '') { return false; } $val = trim($value); if (stripos($val, 'Dalam Batas Normal') !== false) { return false; } if (stripos($val, 'Presbiopia') !== false) { return true; } if (stripos($val, 'Tidak Dapat di Evaluasi') !== false) { return true; } if (preg_match('/J(\d+)/', $val, $m)) { $num = (int) $m[1]; return $num >= 30; } return false; } } $nearLeftUncorrected = $appointment->visusResult->near_vision_left_uncorrected ?? null; $nearRightUncorrected = $appointment->visusResult->near_vision_right_uncorrected ?? null; $nearLeftCorrected = $appointment->visusResult->near_vision_left_corrected ?? null; $nearRightCorrected = $appointment->visusResult->near_vision_right_corrected ?? null; $isNearLeftUncorrectedAbn = isAbnormalNearVision($nearLeftUncorrected); $isNearRightUncorrectedAbn = isAbnormalNearVision($nearRightUncorrected); $isNearLeftCorrectedAbn = isAbnormalNearVision($nearLeftCorrected); $isNearRightCorrectedAbn = isAbnormalNearVision($nearRightCorrected); $vfLeft = $appointment->visusResult->visual_field_left ?? null; $vfRight = $appointment->visusResult->visual_field_right ?? null; $colorVision = $appointment->visusResult->color_vision ?? null; $isVfLeftAbn = isAbnormalText($vfLeft); $isVfRightAbn = isAbnormalText($vfRight); $isColorVisionAbn = isAbnormalText($colorVision); @endphp
{{ $leftUncorrected ?: '-' }}
Tanpa Kacamata
Mata Kiri
{{ $rightUncorrected ?: '-' }}
Tanpa Kacamata
Mata Kanan
{{ $leftCorrected ?: '-' }}
Dengan Kacamata
Mata Kiri
{{ $rightCorrected ?: '-' }}
Dengan Kacamata
Mata Kanan
@if ($nearLeftUncorrected)
{{ $nearLeftUncorrected }}
Visus Dekat Tanpa Kacamata
Mata Kiri
@endif @if ($nearRightUncorrected)
{{ $nearRightUncorrected }}
Visus Dekat Tanpa Kacamata
Mata Kanan
@endif
{{ $nearLeftCorrected ?: '-' }}
Visus Dekat Dengan Kacamata
Mata Kiri
{{ $nearRightCorrected ?: '-' }}
Visus Dekat Dengan Kacamata
Mata Kanan
@if ($appointment->visusResult->visual_field_left)
{{ $appointment->visusResult->visual_field_left }}
Lapang Pandang Kiri
@endif @if ($appointment->visusResult->visual_field_right)
{{ $appointment->visusResult->visual_field_right }}
Lapang Pandang Kanan
@endif @if ($appointment->visusResult->color_vision)
{{ $appointment->visusResult->color_vision }}
Buta Warna
@endif @if ($appointment->visusResult->interpretation)
{{ $appointment->visusResult->interpretation }}
Interpretasi
@endif
@endif @endif