@include('pdf.partials.patient_information') @php $latestHealth = $appointment->healthQuestionnaire ?? ($appointment->patient && $appointment->patient->healthQuestionnaires ? $appointment->patient->healthQuestionnaires->where('appointment_id', $appointment->id)->first() ?? $appointment->patient->healthQuestionnaires->sortByDesc('id')->first() : null); @endphp @if ($latestHealth)
RIWAYAT KESEHATAN
Apakah Anda Pernah Menderita Y/N Apakah Anda Pernah Menderita Y/N Apakah Anda Pernah Menderita Y/N
Cedera Kepala {{ $latestHealth->has_head_injury ? 'Y' : 'N' }} Sakit Kuning / Hepatitis {{ $latestHealth->has_yellow_fever_hepatitis ? 'Y' : 'N' }} Nyeri Dada / Jantung {{ $latestHealth->has_heart_chest_pain ? 'Y' : 'N' }}
Ayan {{ $latestHealth->has_seizure ? 'Y' : 'N' }} Batuk Kronis {{ $latestHealth->has_chronic_cough_issue ? 'Y' : 'N' }} Malaria {{ $latestHealth->has_malaria_disease ? 'Y' : 'N' }}
Gangguan Penglihatan {{ $latestHealth->has_vision_disorder ? 'Y' : 'N' }} Ambeien / Hemoroid {{ $latestHealth->has_hemorrhoids_issue ? 'Y' : 'N' }} Operasi Pembedahan {{ $latestHealth->has_surgical_operation ? 'Y' : 'N' }}
Gangguan Pendengaran {{ $latestHealth->has_hearing_disorder ? 'Y' : 'N' }} Nyeri Perut Kronis {{ $latestHealth->has_chronic_abdominal_pain ? 'Y' : 'N' }} Perubahan BB tdk normal {{ $latestHealth->has_abnormal_weight_change ? 'Y' : 'N' }}
Masalah Telinga, Hidung {{ $latestHealth->has_ear_nose_throat_problem ? 'Y' : 'N' }} Penyakit Kelamin {{ $latestHealth->has_sexual_transmitted_disease ? 'Y' : 'N' }} Nyeri Pinggang > 4 mgg {{ $latestHealth->has_back_pain_4weeks ? 'Y' : 'N' }}
Masalah Telinga > 4 Minggu {{ $latestHealth->has_ear_problem_4weeks ? 'Y' : 'N' }} Kencing Manis / Diabetes {{ $latestHealth->has_diabetes_mellitus ? 'Y' : 'N' }} Demam Thyfoid {{ $latestHealth->has_typhoid_fever ? 'Y' : 'N' }}
Masalah Kewanitaan {{ $latestHealth->has_womens_health_issue ? 'Y' : 'N' }} Asma / Sesak Napas {{ $latestHealth->has_asthma_shortness ? 'Y' : 'N' }} Bengkak / Nyeri pd sendi {{ $latestHealth->has_joint_swelling_pain ? 'Y' : 'N' }}
Penyakit Kulit Menahun {{ $latestHealth->has_chronic_skin_problem ? 'Y' : 'N' }} Alergi {{ $latestHealth->has_allergy_issue ? 'Y' : 'N' }} Kencing Batu / Ginjal {{ $latestHealth->has_kidney_stone_disease ? 'Y' : 'N' }}
Diare Kronis {{ $latestHealth->has_chronic_diarrhea_issue ? 'Y' : 'N' }} TB Paru {{ $latestHealth->has_tuberculosis ? 'Y' : 'N' }} Nafsu Makan Menurun > 4 mgg {{ $latestHealth->has_appetite_loss_4weeks ? 'Y' : 'N' }}
Gastritis / Radang Lambung {{ $latestHealth->has_gastritis_ulcer ? 'Y' : 'N' }} Tekanan Darah Tinggi {{ $latestHealth->has_hypertension_issue ? 'Y' : 'N' }} Masalah Kejiwaan {{ $latestHealth->has_mental_health_problem ? 'Y' : 'N' }}
@endif @php $latestFamily = $appointment->patient && $appointment->patient->familyHealthHistories ? $appointment->patient->familyHealthHistories->where('appointment_id', $appointment->id)->first() ?? $appointment->patient->familyHealthHistories->sortByDesc('id')->first() : null; @endphp @if ($latestFamily)
RIWAYAT KESEHATAN KELUARGA
Anggota Keluarga Diabetes Hipertensi Penyakit Lainnya
Bapak {{ $latestFamily->father_diabetes ?? '-' }} {{ $latestFamily->father_hypertension ?? '-' }} {{ $latestFamily->father_other_diseases ?? '-' }}
Ibu {{ $latestFamily->mother_diabetes ?? '-' }} {{ $latestFamily->mother_hypertension ?? '-' }} {{ $latestFamily->mother_other_diseases ?? '-' }}
Saudara {{ $latestFamily->siblings_diabetes ?? '-' }} {{ $latestFamily->siblings_hypertension ?? '-' }} {{ $latestFamily->siblings_other_diseases ?? '-' }}
Lain-lain {{ $latestFamily->others_diabetes ?? '-' }} {{ $latestFamily->others_hypertension ?? '-' }} {{ $latestFamily->others_other_diseases ?? '-' }}
@else
RIWAYAT KESEHATAN KELUARGA
Anggota Keluarga Diabetes Hipertensi Penyakit Lainnya
Bapak - - -
Ibu - - -
Saudara - - -
Lain-lain - - -
@endif @php // Gunakan $lifestyleForPdf yang sudah di-resolve di controller berdasarkan // appointment->id spesifik ini, atau query langsung berdasarkan appointment->id. // Tidak ada fallback ke data MCU lain agar data selalu akurat untuk MCU ini. $latestLifestyle = $lifestyleForPdf ?? ($appointment->patient ? \App\Models\PatientLifestyleData::where('patient_id', $appointment->patient_id) ->where('appointment_id', $appointment->id) ->first() : null); @endphp
DATA GAYA HIDUP
Konsumsi Alkohol Frekuensi/Minggu Merokok Jumlah/Hari Obat yang Dikonsumsi Keterangan
@if ($latestLifestyle && $latestLifestyle->consumes_alcohol !== null) {{ $latestLifestyle->consumes_alcohol ? 'YA' : 'TIDAK' }} @else - @endif @if ($latestLifestyle && $latestLifestyle->consumes_alcohol && !empty(trim($latestLifestyle->alcohol_frequency ?? ''))) {{ $latestLifestyle->alcohol_frequency }} @else - @endif @if ($latestLifestyle && $latestLifestyle->is_smoker !== null) {{ $latestLifestyle->is_smoker ? 'YA' : 'TIDAK' }} @else - @endif @if ($latestLifestyle && $latestLifestyle->is_smoker && !empty(trim($latestLifestyle->smoking_amount ?? ''))) {{ $latestLifestyle->smoking_amount }} @else - @endif @if ($latestLifestyle && !empty(trim($latestLifestyle->medications_consumed ?? ''))) {{ $latestLifestyle->medications_consumed }} @else - @endif @if ($latestLifestyle && !empty(trim($latestLifestyle->medication_prescription ?? ''))) {{ $latestLifestyle->medication_prescription }} @else - @endif
Tanggal MCU :
{{ $appointment->mcuResult && $appointment->mcuResult->finalized_at ? \App\Helpers\DateHelper::formatFull($appointment->mcuResult->finalized_at) : ($appointment->mcuResult && $appointment->mcuResult->examination_date ? \App\Helpers\DateHelper::formatFull($appointment->mcuResult->examination_date) : \App\Helpers\DateHelper::formatFull(now())) }}
Peserta MCU
@if ($appointment->patient && $appointment->patient->signature_path) @php $patientSigFullPath = storage_path('app/public/' . $appointment->patient->signature_path); $patientSigAltPath = public_path('storage/' . $appointment->patient->signature_path); $patientSigImageData = null; $patientSigMimeType = 'png'; if (file_exists($patientSigFullPath)) { try { $patientSigImageData = base64_encode(file_get_contents($patientSigFullPath)); $patientSigImageType = pathinfo($patientSigFullPath, PATHINFO_EXTENSION); $patientSigMimeType = $patientSigImageType === 'jpg' ? 'jpeg' : strtolower($patientSigImageType); } catch (Exception $e) { $patientSigImageData = null; } } elseif (file_exists($patientSigAltPath)) { try { $patientSigImageData = base64_encode(file_get_contents($patientSigAltPath)); $patientSigImageType = pathinfo($patientSigAltPath, PATHINFO_EXTENSION); $patientSigMimeType = $patientSigImageType === 'jpg' ? 'jpeg' : strtolower($patientSigImageType); } catch (Exception $e) { $patientSigImageData = null; } } @endphp @if ($patientSigImageData)
Tanda tangan {{ $appointment->patient->full_name ?? $appointment->patient->name ?? 'Pasien' }}
@else
Tanda tangan tidak tersedia
@endif @else
Tanda tangan tidak tersedia
@endif
{{ $appointment->patient->full_name ?? ($appointment->patient->name ?? '-') }}