@php($currentAdmission=\App\Models\Hms\Admission::where('organization_id',$patient->organization_id)->where('patient_id',$patient->id)->whereIn('status',['recommended','admitted'])->latest()->first())
@if($currentAdmission)
@php($currentBed=$currentAdmission->bed_id?\App\Models\Hms\Bed::where('organization_id',$patient->organization_id)->find($currentAdmission->bed_id):null)
@php($currentRoom=$currentBed?\App\Models\Hms\Room::where('organization_id',$patient->organization_id)->find($currentBed->room_id):null)
Current inpatient status · {{ ucfirst($currentAdmission->status) }}
{{ $currentRoom ? (($currentRoom->ward?:'Unassigned ward').' / Room '.$currentRoom->name.' / Bed '.$currentBed->label) : 'Awaiting bed assignment' }} · Admissions directory
@endif
- Date of birth
- {{ $patient->date_of_birth?->format('d M Y') ?? 'Not provided' }}
- Sex
- {{ $patient->sex ? ucfirst($patient->sex) : 'Not provided' }}
- Phone
- {{ $patient->phone ?? 'Not provided' }}
- Email
- {{ $patient->email ?? 'Not provided' }}
- Postal / physical address
- {{ \App\Services\Hms\Address::format($patient,true) ?: 'Not provided' }}
- Residence area
- {{ collect([$patient->residence_town,$patient->residence_district,$patient->residence_region,$patient->residence_country])->filter()->implode(', ') ?: 'Not provided' }}
- Emergency contact
- {{ $patient->emergency_contact ?? 'Not provided' }}
@include('hms.patients.visit-rows',['profileVisits'=>$visits->take(6)])
@if($visits->count()>6)
Older visits {{ $visits->count()-6 }}
@include('hms.patients.visit-rows',['profileVisits'=>$visits->slice(6)])
@endif
@if($canManagePortal)
any()) open @endif>Patient portal access {{ ucfirst($portalAccount?->status ?? 'Not invited') }}
Patient sign-in page
Verify identity and the patient's personal email before inviting them. Shared emails cannot identify multiple patients. Changing the email revokes access until a new invitation is issued.
@if(!$portalAccount || $portalAccount->status!=='active')
@elseThe patient can use Forgot password to reset their password.
@endif
@if($portalAccount && $portalAccount->status!=='revoked')
@endif
@endif
@if($summary)
@php($profilePhysician=\App\Models\Hms\Membership::where('organization_id',$patient->organization_id)->where('user_id',auth()->id())->value('role')==='physician')
Migrated patient history & source documents
Search historical records, scanned notes and reviewed sections.Open patient history
@foreach(['Visits'=>$summary['visits'],'Consultations'=>$summary['consultations'],'Lab requests'=>$summary['lab_requests']] as $label=>$value)
{{ $value }}{{ $label }}
@endforeach
Conditions, allergies and medical history
@foreach(['allergy'=>'Allergies','chronic_condition'=>'Chronic conditions','medical_history'=>'Other medical history'] as $category=>$label)
{{ $label }}
@forelse($summary['flags']->where('category',$category) as $flag)
{{ $flag->name }}
@if($flag->details)
{{ $flag->details }}
@endif
{{ ucfirst($flag->status) }}
@if($flag->status==='active' && $profilePhysician)
@endif
@emptyNot documented
@endforelse
@endforeach
Recent vital-sign trends
| Recorded | BP | Pulse | Temp | SpO₂ |
@forelse($summary['recent_vitals'] as $v)| {{ $v->created_at->format('d M Y') }} | {{ $v->systolic_bp??'—' }}/{{ $v->diastolic_bp??'—' }} | {{ $v->pulse_bpm??'—' }} | {{ $v->temperature_c??'—' }} | {{ $v->oxygen_saturation??'—' }} |
@empty| No observations recorded. |
@endforelse
Visit trends and recurring complaints
Repeated complaints are grouped by exact text, not diagnoses.
Visit trend by month
@if($summary['monthly']->isEmpty())
No visit history.
@else
@php($peak=max(1,$summary['monthly']->max()))
@foreach($summary['monthly']->take(-12) as $month=>$count)
@endforeach
@endif
Most frequently recorded chief complaints
@forelse($summary['issues'] as $issue)
{{ $issue['label'] }}{{ $issue['count'] }}
@empty
No documented chief complaints.
@endforelse
@if($profilePhysician)
any()) open @endif>Add clinical history entry
@endif
@endif
@endsection