@extends('layouts.app') @section('content')
Medication Dispensing
Review and reconcile prescribed medications
{{ $encounter->first_name }} {{ $encounter->last_name }}
{{ $encounter->patient_no }}
{{ $encounter->visit_no }}
TOTAL MEDICATIONS
{{ $items->count() }}
@php $hasExternalPrescription = $items->contains(function ($item) { return in_array( $item->dispensing_status, [ 'partial', 'out_of_stock', 'not_dispensed', ] ); }); $isLocked = false; if (isset($prescription)) { $isLocked = (int) ($prescription->dispensing_locked ?? 0) === 1; } @endphp
@csrf
PRESCRIBED MEDICATIONS
@foreach($items as $item) @php $availableStock = (int) ( $item->available_stock ?? 0 ); $prescribedQty = (int) ( $item->quantity_prescribed ?? 0 ); $stockSufficient = $availableStock >= $prescribedQty; @endphp @endforeach
Medication Dose Available Prescribed Dispense Qty Frequency Duration Instructions
{{ $item->medication_name }}
{{ $item->prescription_no ?? 'Prescription' }}
{{ $item->dose_quantity ?? '—' }}
@if($availableStock > 0)
{{ $availableStock }} Available
@if(!$stockSufficient)
LOW STOCK
@endif @else
OUT OF STOCK
@endif
{{ $prescribedQty }}
{{ $item->frequency }}
{{ $item->duration_value }} {{ $item->duration_unit }}
{{ $item->instructions ?? '—' }}
Back to Queue Print Prescription @if($hasExternalPrescription) External Prescription @endif @if($isLocked) @else @endif
@endsection