@php $history = $patient->clinicalHistory; @endphp
{{ $company?->name ?? 'Centro Médico' }}
@if($company?->address){{ $company->address }}
@endif @if($company?->phone)Tel: {{ $company->phone }}@endif

HISTORIA CLÍNICA

@if($history)
No. {{ $history->history_number }}
@endif

Generado el {{ now()->format('d/m/Y') }}

{{ $patient->fullName() }}
@if($patient->document_number)
Documento: {{ strtoupper($patient->document_type ?? '') }} {{ $patient->document_number }}
@endif @if($patient->birthdate)
Nacimiento: {{ $patient->birthdate->format('d/m/Y') }} ({{ $patient->age() }} años)
@endif @if($patient->gender)
Sexo: {{ ['male'=>'Masculino','female'=>'Femenino','other'=>'Otro'][$patient->gender] ?? '—' }}
@endif @if($patient->blood_type)
Sangre: {{ $patient->blood_type }}
@endif @if($patient->phone)
Tel: {{ $patient->phone }}
@endif @if($patient->insurance_company)
EPS: {{ $patient->insurance_company }}
@endif @if($patient->emergency_contact_name)
Emergencia: {{ $patient->emergency_contact_name }} ({{ $patient->emergency_contact_phone }})
@endif
@if($history) {{-- Antecedentes --}} @php $antecedentes = ['allergies'=>'Alergias','diseases'=>'Enfermedades','current_medications'=>'Medicamentos','contraindications'=>'Contraindicaciones','special_conditions'=>'Condiciones especiales','medical_notes'=>'Notas médicas']; $hasAntecedentes = collect($antecedentes)->filter(fn($l,$k) => !empty($history->$k))->isNotEmpty(); @endphp @if($hasAntecedentes)
ANTECEDENTES CLÍNICOS
@foreach($antecedentes as $field => $label) @if(!empty($history->{$field}))
{{ $label }}
{{ $history->{$field} }}
@endif @endforeach
@endif {{-- Evoluciones --}} @if($history->evolutions->count())
EVOLUCIONES CLÍNICAS ({{ $history->evolutions->count() }})
@foreach($history->evolutions as $ev)
{{ $ev->created_at->format('d/m/Y H:i') }} {{ $ev->employee?->user?->name ?? '—' }} @if($ev->isSigned())✓ FIRMADA@endif
Motivo de consulta
{{ $ev->consultation_reason }}
@if($ev->diagnosis_notes)
Notas de diagnóstico
{{ $ev->diagnosis_notes }}
@endif @if($ev->treatment_plan)
Plan de tratamiento
{{ $ev->treatment_plan }}
@endif @if($ev->diagnoses->count())
Diagnósticos
@foreach($ev->diagnoses as $diag)
• {{ $diag->typeLabel() }}: {{ $diag->name }} @if($diag->cie10_code)({{ $diag->cie10_code }})@endif
@endforeach
@endif
@endforeach
@endif {{-- Prescripciones --}} @if($history->prescriptions->count())
RECETAS MÉDICAS ({{ $history->prescriptions->count() }})
@foreach($history->prescriptions as $rx)
{{ $rx->prescription_number }} — {{ $rx->created_at->format('d/m/Y') }} {{ $rx->employee?->user?->name ?? '—' }}
@foreach($rx->items as $item)
{{ $item->medication }} @if($item->dose) {{ $item->dose }}@endif @if($item->frequency) — {{ $item->frequency }}@endif @if($item->duration) por {{ $item->duration }}@endif
@endforeach
@endforeach
@endif @endif