@if(!$selectedPatient)
@foreach([ 'all' => 'General', 'uhid' => 'UHID', 'phone' => 'Mobile', 'name' => 'Name', 'mother_name' => 'Mother' ] as $value => $label) @endforeach
@if(count($patients))
@foreach($patients as $p)
{{ strtoupper(substr($p->first_name, 0, 1)) }}

{{ $p->full_name }}

ID: {{ $p->uhid }} · {{ $p->phone }} @if($p->mother_name) · MOTHER: {{ $p->mother_name }} @endif

@endforeach
@elseif(strlen($searchPatient) >= 3)

No matching patient found in our registry.

@endif
@else
@if($isNewbornBenefit)
Newborn Benefit
@elseif($isEmergency)
Emergency Shift
@elseif($isReview)
Review Visit
@elseif($isFollowUp)
Follow-up Visit
@endif
@if($isNewbornBenefit)

Newborn Privilege

Free consultation for newborns attended by our doctors (Valid till age 7 days).

@elseif($isEmergency)

Emergency Shift Pricing

After-hours or Sunday shift premium applied (₹500 flat fee).

@elseif($isReview)

Review Consultation

This is a follow up review to previous visit (within {{ $latestConsultation->service?->validity_days ?? \App\Models\Setting::get('opd_validity_days', 7) }} days).

@elseif($isFollowUp)

Free Consultation

This patient's previous visit is still within the {{ \App\Models\Setting::get('opd_validity_days', 7) }} day validity period.

@endif @if($latestConsultation)

Previous Visit

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

{{ $latestConsultation->service?->name ?? 'OPD' }}

Last Seen By

{{ $latestConsultation->doctor?->full_name ?? 'N/A' }}

{{ $latestConsultation->doctor?->specialization ?? 'Department' }}

@endif

Appointment Details

@if(!$isReview)
@error('selectedService')

{{ $message }}

@enderror
@else

Review Service

{{ $latestConsultation->service?->name ?? 'OPD Consultation' }}

AUTO-SELECTED FOR REVIEW

@endif

Assigned Doctor

{{ $this->assignedDoctorName }}

@if($growthStatus)
Growth Tracking: {{ $growthStatus['age_label'] }}
WT: {{ $growthStatus['weight']['status'] }} HT: {{ $growthStatus['height']['status'] }}

W. Range (kg)

{{ $growthStatus['weight']['expected_range'] }}

H. Range (cm)

{{ $growthStatus['height']['expected_range'] }}

@if($growthForecast)
Growth Forecast (Expected Median)
@foreach($growthForecast as $milestone)

{{ $milestone['label'] }}

{{ number_format($milestone['data']['weight'], 1) }}kg

{{ number_format($milestone['data']['height'], 1) }}cm

@endforeach
@endif
@endif
@if(!$isReview && !$isNewbornBenefit && !$isFollowUp)

Payment Details

Amount
CALCULATED
@error('fee')

{{ $message }}

@enderror @error('paymentMode')

{{ $message }}

@enderror
@else

Payment Status

{{ $isNewbornBenefit ? 'Newborn Benefit' : ($isReview ? 'Review Visit' : 'Follow-up Visit') }}

No Charge

{{ $isNewbornBenefit ? 'Complimentary consultation for newborns born at our facility.' : 'This visit is within the validity period of a previous consultation.' }}

@endif
@if(!$activeBookingFound) @else

Active Booking Found

@endif
@endif