@include('patient_mangement.patient._record_styles')
@include('layouts.print_header', ['printTitle' => ['all' => 'Visit record', 'medical' => 'Visit medical record', 'financial' => 'Visit bill'][$view_mode]])
{{-- ===== Header ===== --}}
{{ $p?->name }}
ID: {{ $p?->patient_id }}
@if ($p?->gender) · {{ ucfirst($p->gender) }} @endif
@if ($p?->dob) · {{ \Carbon\Carbon::parse($p->dob)->age }} years @endif
@if ($p?->phone) · {{ $p->phone }} @endif
@if ($visit->appointment_no) · Visit #{{ $visit->appointment_no }} @endif
{{ $visit->entry_status ?: 'Not Entered' }}
Date
{{ $fmtDate($visit->date) }}
Doctor
{{ $visit->dr?->name ?? '-' }}
Department
{{ $visit->dept?->name ?? '-' }}
Type
{{ $visitType ?? '-' }}
@if ($f)
Total
{{ $money($f['total']['charge']) }}
Balance
{{ $money($f['total']['balance']) }}
@endif
@if ($sections->isEmpty())
Nothing has been recorded for this visit yet.
@else
@endif
{{-- ===== Financial summary: per type, pay the whole visit ===== --}}
@if ($sections->has('billing'))
{!! $head('billing') !!}
{{-- the other format, when wanted (default = Users → Receipt print) --}}
@if (!empty($canPay))
@endif
@if (!empty($notPayable))
{{ $notPayable }} unpaid bill(s) of a kind you can't take payment for
@endif
| Bill type | Bills | Charge | Paid | Discount | Balance | Status |
@foreach ($f['byType'] as $b)
| {{ $b['label'] }} |
{{ $b['count'] }} |
{{ $money($b['charge']) }} |
{{ $money($b['paid']) }} |
{{ $money($b['discount']) }} |
{{ $money($b['balance']) }} |
{{ $b['balance'] <= 0.009 ? 'Paid' : ($b['paid'] > 0 ? 'Partially paid' : 'Unpaid') }} |
@endforeach
| TOTAL | |
{{ $money($f['total']['charge']) }} |
{{ $money($f['total']['paid']) }} |
{{ $money($f['total']['discount']) }} |
{{ $money($f['total']['balance']) }} |
|
@endif
{{-- ===== Every bill, type by type, like the patient statement ===== --}}
@if ($sections->has('statement'))
{!! $head('statement') !!}
@include('bills.statements._by_type', ['typeGroups' => $f['typeGroups'], 'money' => $money, 'fmt' => $fmtDate])
@endif
{{-- ===== Consultation ===== --}}
@if ($sections->has('consult'))
{!! $head('consult') !!}
{!! $kvt([
'Chief complaint' => $c->chief_complaint,
'Symptoms' => $c->symptoms,
'Present illness' => $c->present_illness,
'Physical examination' => $c->physical_examination,
'Diagnosis' => implode(', ', $m['diagnoses']),
'Differential diagnosis' => implode(', ', $m['differential']),
'Past medical history' => $c->past_medical_history,
'Past surgical history' => $c->past_surgical_history,
'Drug history' => $c->drug_history,
'Family history' => $c->family_history,
'Social history' => $c->social_history,
'LMP' => $c->lmp,
'Gestational age' => $c->gestational_age,
'Note' => $c->note,
]) !!}
@endif
{{-- ===== Vital signs ===== --}}
@if ($sections->has('vitals'))
{!! $head('vitals') !!}
| Date | Temp | BP | Pulse | Resp | SpO₂ | Weight | Height | BMI |
@foreach ($m['vitals'] as $v)
| {{ $fmtDate($v->date ?? $v->created_at) }} |
{{ $v->body_temperature ? $v->body_temperature . ' °C' : '-' }} |
{{ $v->blood_pressure_systolic ? $v->blood_pressure_systolic . '/' . $v->blood_pressure_diastolic : '-' }} |
{{ $v->heart_rate ?: '-' }} |
{{ $v->respiratory_rate ?: '-' }} |
{{ $v->oxygen_concentration ? $v->oxygen_concentration . '%' : '-' }} |
{{ $v->weight ? $v->weight . ' ' . ($v->weight_type ?: 'kg') : '-' }} |
{{ $v->height ? $v->height . ' ' . ($v->height_type ?: '') : '-' }} |
{{ $v->bmi ?: '-' }} |
@endforeach
@endif
{{-- ===== Laboratory ===== --}}
@if ($sections->has('labs'))
{!! $head('labs') !!}
@foreach ($m['labs'] as $l)
Lab #{{ str_pad($l->request_no ?: $l->id, 4, '0', STR_PAD_LEFT) }} · {{ $l->name }}{{ $l->tests ? ' — ' . $l->tests : '' }}
{{ $fmtDate($l->date) }} {!! $pill($l->status) !!}
@if ($l->results->isNotEmpty())
| Test | Result | Unit | Normal range |
@foreach ($l->results as $r)
| {{ $r->test }} | {{ $r->result }} | {{ $r->unit }} | {{ $r->normal_range }} |
@endforeach
@else
@endif
@endforeach
@endif
{{-- ===== Imaging ===== --}}
@if ($sections->has('images'))
{!! $head('images') !!}
@foreach ($m['images'] as $i)
Imaging #{{ $i->request_no ?: $i->id }} · {{ $i->name ?? 'Imaging' }}{{ $fmtDate($i->date) }} {!! $pill($i->status) !!}
@forelse ($i->results as $r)
| {{ $r->test ?: 'Report' }} | {{ strip_tags($r->result) }} |
@empty
| No report yet.{{ $i->notes ? ' Note: ' . $i->notes : '' }} |
@endforelse
@endforeach
@endif
{{-- ===== Prescriptions ===== --}}
@if ($sections->has('pres'))
{!! $head('pres') !!}
@foreach ($m['prescriptions'] as $h)
{{ $h->name ?: 'Prescription' }}{{ $h->prescription_no ? ' #' . $h->prescription_no : '' }}{{ $fmtDate($h->date) }}
| Drug | Dose | Frequency | Duration | Qty | Instruction |
@forelse ($h->drugs as $d)
| {{ $d->name ?? '-' }} | {{ $d->dose }} | {{ $d->frequency }} |
{{ $d->duration ? (is_numeric($d->duration) ? $d->duration . ' days' : $d->duration) : '' }} | {{ $d->quantity }} | {{ $d->instruction }} |
@empty
| No drugs. |
@endforelse
@endforeach
@endif
{{-- ===== Services ===== --}}
@if ($sections->has('services'))
{!! $head('services') !!}
| No. | Date | Service | Status | Notes |
@foreach ($m['services'] as $s)
| {{ $s['no'] }} | {{ $fmtDate($s['date']) }} | {{ $s['name'] }} | {{ $s['status'] ?: '-' }} | {{ $s['notes'] }} |
@endforeach
@endif
{{-- ===== Operations ===== --}}
@if ($sections->has('operations'))
{!! $head('operations') !!}
| No. | Date | Operation | Surgeon | Status | Notes |
@foreach ($m['operations'] as $o)
| {{ $o->operation_number ?: $o->id }} | {{ $fmtDate($o->date) }} | {{ $o->op?->name ?? '-' }} |
{{ $o->doctor?->name ?? '-' }} | {{ $o->status ?: 'Pending' }} | {{ $o->notes }} |
@endforeach
@endif