{{-- resources/views/admin/encounters/show.blade.php --}}
@extends('layouts.app')
@section('content')
@php
$latestLabRequest = DB::table('encounter_lab_requests')
->where('encounter_id', $encounter->id)
->latest()
->first();
@endphp
{{ ucfirst($encounter->encounter_type) }} Encounter
Encounter No:
{{ $encounter->encounter_no }}
@php
$bg = match($encounter->status) {
'open' => '#dbeafe',
'completed' => '#dcfce7',
'cancelled' => '#fee2e2',
default => '#f3f4f6'
};
$color = match($encounter->status) {
'open' => '#1d4ed8',
'completed' => '#166534',
'cancelled' => '#991b1b',
default => '#374151'
};
@endphp
{{ ucfirst($encounter->status) }}
Patient
{{ $encounter->first_name }}
{{ $encounter->last_name }}
Patient No
{{ $encounter->patient_no ?? '—' }}
Visit
{{ $encounter->visit_no }}
Encounter Details
|
Encounter Type
|
{{ ucfirst($encounter->encounter_type) }}
|
|
Date & Time
|
{{ \Carbon\Carbon::parse($encounter->encounter_datetime)->format('d M Y H:i') }}
|
|
Provider
|
{{ $encounter->provider_name ?? '—' }}
|
Record Information
|
Status
|
{{ ucfirst($encounter->status) }}
|
|
Created
|
{{ $encounter->created_at }}
|
|
Updated
|
{{ $encounter->updated_at }}
|
Clinical Summary
{{ $encounter->summary ?: 'No summary documented.' }}
@php
$vitals = DB::table('visit_vitals')
->where('encounter_id', $encounter->id)
->latest()
->first();
@endphp
@if(!$vitals)
No vitals recorded
@else
|
Temperature
|
{{ $vitals->temperature ?? '—' }}
@if($vitals->temperature) °C @endif
|
|
Blood Pressure
|
@if($vitals->systolic_bp || $vitals->diastolic_bp)
{{ $vitals->systolic_bp }}/{{ $vitals->diastolic_bp }} mmHg
@else
—
@endif
|
|
Pulse Rate
|
{{ $vitals->pulse_rate ?? '—' }}
@if($vitals->pulse_rate) bpm @endif
|
|
Respiratory Rate
|
{{ $vitals->respiratory_rate ?? '—' }}
@if($vitals->respiratory_rate) breaths/min @endif
|
|
Oxygen Saturation
|
{{ $vitals->oxygen_saturation ?? '—' }}
@if($vitals->oxygen_saturation) % @endif
|
|
Weight
|
{{ $vitals->weight ?? '—' }}
@if($vitals->weight) kg @endif
|
|
Height
|
{{ $vitals->height ?? '—' }}
@if($vitals->height) cm @endif
|
|
BMI
|
{{ $vitals->bmi ?? '—' }}
|
@endif
@php
$diagnoses = DB::table('encounter_diagnoses')
->where('encounter_id', $encounter->id)
->latest()
->get();
@endphp
@if($diagnoses->isEmpty())
No diagnoses recorded
@else
@foreach($diagnoses as $diagnosis)
|
{{ ucfirst($diagnosis->diagnosis_type) }}
|
{{ $diagnosis->diagnosis_name }}
@if($diagnosis->icd10_code)
ICD10:
{{ $diagnosis->icd10_code }}
@endif
@if($diagnosis->notes)
{{ $diagnosis->notes }}
@endif
|
@endforeach
@endif
Laboratory Results
@if($latestLabRequest)
+ Add Result
@endif
@php
$labResults = DB::table('encounter_lab_results')
->where('encounter_id', $encounter->id)
->latest()
->get();
@endphp
@if($labResults->isEmpty())
No laboratory results available
@else
|
Test
|
Result
|
Reference Range
|
Interpretation
|
Status
|
@foreach($labResults as $result)
|
{{ $result->test_name }}
|
{{ $result->result_value ?? '—' }}
|
{{ $result->reference_range ?? '—' }}
|
{{ ucfirst($result->interpretation ?? '—') }}
|
{{ ucfirst($result->result_status ?? 'completed') }}
|
@if($result->notes)
|
Notes:
{{ $result->notes }}
|
@endif
@endforeach
@endif
@php
$prescriptions = DB::table('encounter_prescriptions')
->where('encounter_id', $encounter->id)
->latest()
->get();
@endphp
@if($prescriptions->isEmpty())
No prescriptions recorded
@else
|
Drug
|
Dose
|
Frequency
|
Duration
|
Route
|
@foreach($prescriptions as $prescription)
|
{{ $prescription->drug_name }}
@if($prescription->instructions)
{{ $prescription->instructions }}
@endif
|
{{ $prescription->dosage ?? '—' }}
|
{{ $prescription->frequency ?? '—' }}
|
{{ $prescription->duration ?? '—' }}
|
{{ ucfirst($prescription->route ?? '—') }}
|
@endforeach
@endif
@endsection