@can('view opd') @endcan

Patient Details

{{ $patient->is_active ? 'Active' : 'Inactive' }}

UHID

{{ $patient->uhid }}

Contact

{{ $patient->phone ?? '—' }}

Gender / Age

{{ $patient->gender ?? '—' }} · {{ $patient->age ?? '—' }}

Date of Birth

{{ $patient->date_of_birth ? \Illuminate\Support\Carbon::parse($patient->date_of_birth)->format('d M Y') : '—' }}

Residential Address

{{ $patient->address ?? '—' }}

@if($patient->insurance_provider || $patient->insurance_policy)

Provider

{{ $patient->insurance_provider ?? '—' }}

Policy No

{{ $patient->insurance_policy ?? '—' }}

Coverage Validity

{{ $patient->insurance_validity ? \Illuminate\Support\Carbon::parse($patient->insurance_validity)->format('d M Y') : 'Life-time' }}

@if($patient->insurance_validity && \Illuminate\Support\Carbon::parse($patient->insurance_validity)->isPast()) Expired @else Valid @endif
@else

Self-Paying Patient

@endif
@if(count($alerts) || $patient->allergies)
{{-- Alerts now handled solely by the loop below to avoid duplication --}} @foreach($alerts as $alert) @php $alertClasses = match($alert['type']) { 'danger' => 'bg-red-50 dark:bg-red-900/10 border-red-100 dark:border-red-800/30 text-red-700 dark:text-red-300', 'warning' => 'bg-amber-50 dark:bg-amber-950/10 border-amber-100 dark:border-amber-800/30 text-amber-700 dark:text-amber-300', 'success' => 'bg-emerald-50 dark:bg-emerald-950/10 border-emerald-100 dark:border-emerald-800/30 text-emerald-700 dark:text-emerald-300', default => 'bg-gray-50 dark:bg-gray-950/10 border-gray-100 dark:border-gray-800/30 text-gray-700 dark:text-gray-300', }; @endphp

{{ $alert['label'] }}

{{ $alert['msg'] }}

@endforeach
@else

No active alerts

@endif
@if($tab === 'overview' || $tab === 'treatment' || $tab === 'vaccinations') {{-- No quick filters needed for these --}} @else
@endif
Refreshing View…
@if($tab === 'overview')

Total Visits

{{ $counts['visits'] }}

Admissions

{{ $counts['admissions'] }}

Total Bills

{{ $counts['bills'] }}

30 Day Spend

₹{{ number_format($billStats['thirty_days'], 0) }}

@forelse($overview['timeline'] as $item)
@if($item->type === 'Visit') @elseif($item->type === 'IPD') @else @endif

{{ \Illuminate\Support\Carbon::parse($item->date)->format('d M Y') }} · {{ $item->type }}

{{ $item->title }}

{{ $item->meta }}

@if(isset($item->print_route)) Print Record @endif
@empty
No timeline data available.
@endforelse
@forelse($overview['latestBills'] as $b)

{{ $b->created_at?->format('d M Y') }}

{{ $b->bill_number }}

₹{{ number_format($b->total_amount, 0) }} @if($b->payment_status === 'Paid') @else @endif
@empty
No financial records found.
@endforelse
@endif @if($tab === 'treatment')
@forelse($treatmentPreview['visits'] as $v)

{{ $v->consultation_date?->format('d M Y') }} · Token #{{ $v->token_number }}

{{ $v->doctor?->full_name ?? '—' }}

{{ $v->notes ?: '—' }}

@empty
No OP notes.
@endforelse
@forelse($treatmentPreview['prescriptions'] as $p)

{{ $p->created_at?->format('d M Y') }}

{{ $p->doctor?->full_name ?? '—' }}

{{ $p->diagnosis ?: '—' }}

{{ $p->advice ?: '—' }}

@empty
No prescriptions.
@endforelse
@forelse($treatmentPreview['admissions'] as $a)

{{ $a->admission_date?->format('d M Y') }} · {{ $a->admission_number }}

{{ $a->doctor?->full_name ?? '—' }}

{{ $a->notes ?: ($a->reason_for_admission ?: '—') }}

@if($a->discharge_date) @endif
@empty
No IPD notes.
@endforelse
@endif @if($tab === 'consents')
High Risk Consent Form (Telugu) High Risk Consent Form (English)

Upload File

@error('consentFile')

{{ $message }}

@enderror
@forelse($datasets['consents'] as $c) @php $url = \Illuminate\Support\Facades\Storage::disk('public')->url($c->file_path); $isImage = $c->mime_type && str_starts_with($c->mime_type, 'image/'); @endphp

{{ strtoupper(str_replace('_', ' ', $c->type)) }} @if($c->signed_at) · {{ \Illuminate\Support\Carbon::parse($c->signed_at)->format('d M Y') }} @endif

{{ $c->original_name ?? 'Consent File' }}

@if($c->notes)

{{ $c->notes }}

@endif

Uploaded {{ $c->created_at?->format('d M Y, h:i A') }}{{ $c->creator ? ' · ' . $c->creator->name : '' }}

View
@if($isImage)
Consent
@endif
@empty
No consent documents uploaded yet.
@endforelse
@if($datasets['consents'])
{{ $datasets['consents']->links() }}
@endif
@endif @if($tab === 'billing')
@forelse($datasets['bills'] as $bill)

{{ $bill->bill_number }}

{{ $bill->type }}

₹{{ number_format($bill->total_amount, 2) }}

{{ \Carbon\Carbon::parse($bill->created_at)->format('d M Y') }}

{{ $bill->payment_method ?? '—' }}

{{ $bill->payment_status }}

@if($bill->is_formal) Print @else Print Token @endif
@empty
No billing records.
@endforelse
@if($datasets['bills'])
{{ $datasets['bills']->links() }}
@endif
@endif @if($tab === 'visits')
@forelse($datasets['visits'] as $v)

Token #{{ $v->token_number }}

{{ $v->consultation_date?->format('d M Y') }} · {{ $v->doctor?->full_name }}

{{ $v->status }} · {{ $v->payment_status }}

@can('view opd') @if($v->status !== 'Cancelled') @endif @endcan Print
@empty
No OP visits.
@endforelse
@if($datasets['visits'])
{{ $datasets['visits']->links() }}
@endif
@endif @if($tab === 'appointments')
@forelse($datasets['appointments'] as $a)

{{ $a->consultation_date?->format('d M Y') }}

Token #{{ $a->token_number }} · {{ $a->doctor?->full_name ?? '—' }}

{{ $a->status }}

@empty
No appointments scheduled.
@endforelse
@if($datasets['appointments'])
{{ $datasets['appointments']->links() }}
@endif
@endif @if($tab === 'admissions')
@forelse($datasets['admissions'] as $a)

{{ $a->admission_number }}

{{ $a->admission_date?->format('d M Y') }} · {{ $a->status }}

{{ $a->bed?->ward?->name ?? '—' }} · {{ $a->bed?->bed_number ?? '—' }}

@if($a->discharge_date) @endif
@empty
No admissions found.
@endforelse
@if($datasets['admissions'])
{{ $datasets['admissions']->links() }}
@endif
@endif @if($tab === 'discharges')
@forelse($datasets['discharges'] as $a)

{{ $a->admission_number }}

{{ $a->discharge_date?->format('d M Y') }}

{{ $a->bed?->ward?->name ?? '—' }} · {{ $a->bed?->bed_number ?? '—' }}

@empty
No discharge summaries found.
@endforelse
@if($datasets['discharges'])
{{ $datasets['discharges']->links() }}
@endif
@endif @if($tab === 'prescriptions')
@forelse($datasets['prescriptions'] as $p)

{{ $p->created_at?->format('d M Y') }}

{{ $p->doctor?->full_name ?? '—' }}

{{ $p->diagnosis ?: '—' }}

@empty
No medication records.
@endforelse
@if($datasets['prescriptions'])
{{ $datasets['prescriptions']->links() }}
@endif
@endif @if($tab === 'labs')
@forelse($datasets['labs'] as $o)

{{ $o->labTest?->name ?? '—' }}

{{ $o->created_at?->format('d M Y') }} · {{ $o->status }}

Collected: {{ $o->collected_at?->format('d M Y H:i') ?? '—' }}

Completed: {{ $o->completed_at?->format('d M Y H:i') ?? '—' }}

@empty
No diagnostic reports.
@endforelse
@if($datasets['labs'])
{{ $datasets['labs']->links() }}
@endif
@endif @if($tab === 'payments')
@forelse($datasets['payments'] as $b)

{{ $b->bill_number }}

₹{{ number_format($b->total_amount, 2) }}

{{ $b->created_at?->format('d M Y') }} · {{ $b->payment_status }}

@empty
No payment records.
@endforelse
@if($datasets['payments'])
{{ $datasets['payments']->links() }}
@endif
@endif @if($tab === 'vitals')
@forelse($datasets['vitals'] as $v)

{{ $v->created_at?->format('d M Y H:i') }}

@if($v->consultation) T#{{ $v->consultation->token_number }} @endif

Wt: {{ $v->weight ? $v->weight . 'kg' : '—' }}

Temp: {{ $v->temperature ? $v->temperature . '°F' : '—' }}

BP: {{ $v->bp_systolic && $v->bp_diastolic ? ($v->bp_systolic . '/' . $v->bp_diastolic) : '—' }}

Pulse: {{ $v->pulse ? $v->pulse . 'bpm' : '—' }}

SPO2: {{ $v->spo2 ? $v->spo2 . '%' : '—' }}

Staff: {{ $v->recorder?->name ?? '—' }}

@empty
No vital logs.
@endforelse
@if($datasets['vitals'])
{{ $datasets['vitals']->links() }}
@endif
@endif @if($tab === 'vaccinations')
@foreach($allVaccines as $v) @php $given = $vaccinations->firstWhere('vaccine_id', $v->id); @endphp @endforeach
Recommended Age Vaccine Status Action
{{ $v->recommended_age }} {{ $v->name }} @if($given) Given @else Pending @endif @if(!$given) @else {{ $given->date_given ? \Illuminate\Support\Carbon::parse($given->date_given)->format('d M Y') : '—' }} @endif
@endif