{{ $patient->full_name }}

Patient ID: {{ $patient->patient_id }}

{{ $patient->age }} years old • {{ ucfirst($patient->gender) }}

@if(!auth()->user()->isDoctor()) @endif Back to List
@if (session()->has('message'))
{{ session('message') }}
@endif
@include('livewire.patients.patient-profile-tabs')
@if($activeTab === 'overview')

Patient Information

@if($editing)
Save Changes Saving...
@else

{{ $patient->email ?? 'N/A' }}

{{ $patient->phone ?? 'N/A' }}

{{ $patient->date_of_birth->format('M d, Y') }}

{{ $patient->blood_type ?? 'N/A' }}

{{ $patient->height ? $patient->height . ' cm' : 'N/A' }}

{{ $patient->weight ? $patient->weight . ' kg' : 'N/A' }}

@if($patient->address)

{{ $patient->display_address ?? 'N/A' }}

@endif @if($patient->medical_history)

{{ $patient->medical_history }}

@endif @if($patient->allergies)

{{ $patient->allergies }}

@endif @endif
@elseif($activeTab === 'history')

Medical History

@if(!$editingHistory && !auth()->user()->isDoctor()) @endif
@if($editingHistory)
Save Changes Saving...
@else @if($patient->medical_history || $patient->allergies)
@if($patient->medical_history)

{{ $patient->medical_history }}

@endif @if($patient->allergies)

{{ $patient->allergies }}

@endif
@else

No medical history recorded yet.

@endif @endif

Medical Records

@if(!auth()->user()->isDoctor()) @endif
@if($patient->medicalRecords->count() > 0)
@foreach($patient->medicalRecords->sortByDesc('visit_date') as $record)

{{ ucfirst(str_replace('_', ' ', $record->visit_type)) }}

{{ $record->visit_date->format('M d, Y') }} • Dr. {{ ucwords(strtolower($record->doctor->name)) }}

@if(!auth()->user()->isDoctor())
@endif
@if($record->symptoms)
Symptoms:

{{ $record->symptoms }}

@endif @if($record->diagnosis)
Diagnosis:

{{ $record->diagnosis }}

@endif @if($record->treatment_plan)
Treatment Plan:

{{ $record->treatment_plan }}

@endif @if($record->notes)
Notes:

{{ $record->notes }}

@endif @if($record->follow_up_date)
Follow-up Date:

{{ $record->follow_up_date->format('M d, Y') }}

@endif
@endforeach
@else

No medical records found.

@endif

Change History

@php $auditLogs = \App\Services\AuditLogService::getPatientLogs($patient->id, null); $historyLogs = $auditLogs->filter(function($log) { return in_array($log->field_name, ['medical_history', 'allergies']); }); @endphp @if($historyLogs->count() > 0)
@foreach($historyLogs as $log)
{{ $log->field_label }} {{ $log->action_label }}

by {{ $log->user ? ucwords(strtolower($log->user->name)) : 'System' }} @if($log->visit) • Visit: {{ $log->visit->visit_number }} @endif • {{ $log->created_at->format('M d, Y h:i A') }}

@if($log->old_value || $log->new_value)
@if($log->old_value)
Previous:

{{ strlen($log->old_value) > 200 ? substr($log->old_value, 0, 200) . '...' : $log->old_value }}

@endif @if($log->new_value)
New:

{{ strlen($log->new_value) > 200 ? substr($log->new_value, 0, 200) . '...' : $log->new_value }}

@endif
@endif
@endforeach
@else

No change history recorded yet.

@endif
@elseif($activeTab === 'appointments')

Appointments

View All →
@if($patient->appointments->count() > 0)
@foreach($patient->appointments->sortByDesc('appointment_date') as $appointment)

{{ ucfirst(str_replace('_', ' ', $appointment->type)) }}

{{ ucfirst(str_replace('_', ' ', $appointment->status)) }}

{{ $appointment->appointment_date->format('M d, Y') }} at {{ \Carbon\Carbon::parse($appointment->appointment_time)->format('h:i A') }}

Dr. {{ ucwords(strtolower($appointment->doctor->name)) }} • {{ $appointment->duration }} minutes

@if($appointment->reason)

Reason: {{ $appointment->reason }}

@endif
@endforeach
@else

No appointments found.

@endif
@elseif($activeTab === 'prescriptions')

Prescriptions

View All →
@if($patient->prescriptions->count() > 0)
@foreach($patient->prescriptions->sortByDesc('prescription_date') as $prescription)

{{ $prescription->drug ? ucwords(strtolower($prescription->drug->name)) : 'Unknown Drug' }}

{{ ucfirst($prescription->status) }}

{{ $prescription->prescription_date->format('M d, Y') }} by Dr. {{ ucwords(strtolower($prescription->doctor->name)) }}

Dosage: {{ $prescription->dosage }}

Frequency: {{ $prescription->frequency }}

Duration: {{ $prescription->duration }}

@if($prescription->instructions)

Instructions: {{ $prescription->instructions }}

@endif
@endforeach
@else

No prescriptions found.

@endif
@endif
@if($patient->emergency_contact_name)

Emergency Contact

{{ $patient->display_emergency_contact_name ?? 'N/A' }}

@if($patient->emergency_contact_phone)

{{ $patient->emergency_contact_phone }}

@endif
@endif @if($patient->insurance_provider)

Insurance

{{ $patient->display_insurance_provider ?? 'N/A' }}

@if($patient->insurance_number)

{{ $patient->insurance_number }}

@endif
@endif

Quick Stats

Medical Records: {{ $patient->medicalRecords->count() }}
Appointments: {{ $patient->appointments->count() }}
Active Medications: {{ $patient->medications->filter(function($med) { return $med->is_active; })->count() }}
@if($showRecordModal) @endif