@extends('layouts.admin')
@php
use App\Enums\DoctorEncounterStatus;
use App\Enums\HospitalVisitStage;
@endphp
@section('page_kicker', 'Encounter')
@section('page_title', 'MRN '.$visit->mrn)
@section('content')
@if (session('status'))
{{ $visit->patient?->name }} · Visit #{{ $visit->id }}
@if(!($isAssignedDoctor ?? true))
Department view — assigned clinician:
{{ $visit->assignedDoctor?->name ?? '—' }}. You can read the chart and add your own progress notes; exam and prescribing stay with the assigned doctor.
@endif
Doctor status
{{ str_replace('_', ' ', $visit->doctor_encounter_status?->value ?? '—') }}
Visit orders (lab / imaging)
@if($visit->orders->isEmpty())
No lab or imaging orders yet.
@else
@foreach($visit->orders as $ord)
@if(in_array($ord->kind, ['lab', 'imaging'], true))
{{ $ord->kind }} — {{ $ord->description }}
· {{ $ord->status }}
@if($ord->completed_at)
· done {{ $ord->completed_at->format('Y-m-d H:i') }}
@endif
@endif
@endforeach
@endif
@if($isAssignedDoctor && $visit->doctor_encounter_status === DoctorEncounterStatus::InConsultation && in_array($visit->stage, [HospitalVisitStage::WithDoctor, HospitalVisitStage::ExamDocumented, HospitalVisitStage::ServicePaymentPending], true))
@endif
@if($visit->diagnosis || $visit->clinical_notes || $visit->treatment_plan)
Current documentation
@if($visit->diagnosis)
Diagnosis {{ $visit->diagnosis }}
@endif
@if($visit->clinical_notes)
Notes {{ $visit->clinical_notes }}
@endif
@if($visit->treatment_plan)
Treatment plan {{ $visit->treatment_plan }}
@endif
@endif
Progress notes (append-only)
Shared within the visit’s department for continuity of care. Each note is tied to the author; notes cannot be edited after save.
@if($canAddProgressNote ?? false)
@endif
@if($isAssignedDoctor && $visit->stage === HospitalVisitStage::WithDoctor && $visit->doctor_encounter_status === DoctorEncounterStatus::InConsultation)
@csrf
Diagnosis, notes & treatment plan
Saved to EMR. Prescriptions can be added after this step.
Diagnosis
{{ old('diagnosis', $visit->diagnosis) }}
Clinical notes
{{ old('clinical_notes', $visit->clinical_notes) }}
Treatment plan
{{ old('treatment_plan', $visit->treatment_plan) }}
Save to EMR
@endif
@if($isAssignedDoctor && $visit->doctor_encounter_status === DoctorEncounterStatus::InConsultation && in_array($visit->stage, [HospitalVisitStage::ExamDocumented, HospitalVisitStage::ServicePaymentPending], true))
@php
$rxLineCount = 6;
$rxRows = collect(range(0, $rxLineCount - 1))->map(function (int $i) {
$oldId = old('items.'.$i.'.medicine_id');
return [
'i' => $i,
'q' => '',
'results' => [],
'hid' => $oldId !== null && $oldId !== '' ? (string) $oldId : '',
'selected' => '',
'loading' => false,
'dosage' => old('items.'.$i.'.dosage', ''),
'frequency' => old('items.'.$i.'.frequency', ''),
'duration_days' => old('items.'.$i.'.duration_days', ''),
'quantity' => old('items.'.$i.'.quantity', ''),
'instructions' => old('items.'.$i.'.instructions', ''),
];
})->values()->all();
@endphp
Prescription to pharmacy
Search the hospital pharmacy catalog (live from inventory). Pick a medicine, then enter dosage, duration, quantity, and instructions. Submitted prescriptions go straight to the pharmacy queue.
@csrf
Prescription notes (optional)
{{ old('notes') }}
Line (leave medicine blank to skip)
Clear medicine
Instructions for patient
Send to pharmacy
@if($visit->prescriptions->isNotEmpty())
@csrf
When you are finished prescribing, complete the encounter. Pharmacy can prepare and dispense; prescription lines cannot be edited in pharmacy.
Complete doctor encounter
@endif
@endif
@if(isset($auditTrail) && $auditTrail->isNotEmpty())