Medication Chart

@unless($admission->status === 'Discharged') @endunless
@if($this->showForm)

{{ $editingId ? 'Edit' : 'Add' }} Medicine

@if($this->showMedicineSearch && strlen($this->searchMedicine) >= 2 && $medicines && $medicines->count() > 0)
@foreach($medicines as $med) @endforeach
@endif
@error('medicine_name') {{ $message }} @enderror
@endif @if($stoppingId)
@endif
@forelse(($activeTab === 'active' ? $this->activeMedications : ($activeTab === 'stopped' ? $this->stoppedMedications : ($activeTab === 'completed' ? $this->completedMedications : $this->allMedications))) as $med)

{{ $med->medicine_name }}

{{ $med->status }} @if($med->is_dispensed) Dispensed @endif

@if($med->dosage){{ $med->dosage }}@endif @if($med->frequency) · {{ $med->frequency }}@endif @if($med->route) · {{ $med->route }}@endif @if($med->duration) · {{ $med->duration }}@endif

Start: {{ $med->start_date ? $med->start_date->format('d M Y') : 'N/A' }} @if($med->end_date) End: {{ $med->end_date->format('d M Y') }} @endif
@if($med->instructions)

Instructions: {{ $med->instructions }}

@endif @if($med->status === 'Stopped' && $med->stop_reason)

Stop Reason: {{ $med->stop_reason }}

@endif
Doses Given: {{ $med->administrations_count ?? $med->medicationAdministrations->count() }}
@if($med->status === 'Active' && $admission->status !== 'Discharged')
@endif
@empty

No medications in this category.

@endforelse