Drug Management

Manage drug catalog and information

@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif @if (session()->has('bulk_upload_errors'))

Upload Errors:

    @foreach(session('bulk_upload_errors') as $error)
  • {{ $error }}
  • @endforeach
@endif
@forelse($drugs as $drug) @empty @endforelse
Name Dosage Form Strength Price (₦) Qty Status Actions
{{ $drug->name }} {{ $drug->dosage_form }} {{ $drug->strength }} {{ $drug->unit }} @php $latestStock = $drug->pharmacyStocks ->where('quantity', '>', 0) ->whereNotNull('unit_price') ->sortByDesc('created_at') ->first(); @endphp @if($latestStock && $latestStock->unit_price) {{ number_format($latestStock->unit_price, 2) }} @else - @endif @php $totalQuantity = $drug->pharmacyStocks->sum('quantity') ?? 0; $availableQuantity = $drug->pharmacyStocks->filter(function($stock) { return !$stock->expiry_date || $stock->expiry_date->isFuture(); })->sum('quantity') ?? 0; @endphp @if($totalQuantity > 0) {{ number_format($availableQuantity) }} @if($totalQuantity != $availableQuantity) ({{ number_format($totalQuantity) }} total) @endif units @else No stock @endif {{ $drug->is_active ? 'Active' : 'Inactive' }}
View
No drugs found.
{{ $drugs->links() }}
@if($showModal)

{{ $editingDrug ? 'Edit Drug' : 'Create New Drug' }}

@error('name') {{ $message }} @enderror
@error('generic_name') {{ $message }} @enderror
@error('manufacturer') {{ $message }} @enderror
@error('category_id') {{ $message }} @enderror @error('category') {{ $message }} @enderror
@error('dosage_form') {{ $message }} @enderror
@error('strength') {{ $message }} @enderror
@error('unit') {{ $message }} @enderror
@error('expiry_alert_days') {{ $message }} @enderror
@error('description') {{ $message }} @enderror
@error('storage_conditions') {{ $message }} @enderror
@foreach($side_effects as $index => $effect) {{ $effect }} @endforeach
@foreach($contraindications as $index => $contra) {{ $contra }} @endforeach
@foreach($interactions as $index => $interaction) {{ $interaction }} @endforeach
@endif @if($showCategoryModal)

Add New Category

@error('category_name') {{ $message }} @enderror
@error('category_description') {{ $message }} @enderror
@endif @if($showBulkUploadModal)

Bulk Upload Drugs

CSV Format Requirements:

Upload a CSV file with the following columns (header row optional):

Required Drug Fields:

  • name - Drug name
  • generic_name - Generic name
  • manufacturer - Manufacturer name
  • category - Category (auto-created if missing)
  • dosage_form - e.g., Tablet, Capsule
  • strength - e.g., 500mg
  • unit - e.g., mg, ml

Optional Fields:

  • description - Drug description
  • prescription_required - true/false (default: true)
  • is_active - true/false (default: true)

Inventory Fields (Optional):

  • quantity - Stock quantity
  • reorder_level - Reorder level (default: 10)
  • unit_price - Unit price
  • expiry_date - YYYY-MM-DD
  • batch_number - Batch number
  • supplier - Supplier name
  • supply_date - YYYY-MM-DD (default: today)
  • notes - Additional notes

Example (with inventory):

Panadol,paracetamol,GlaxoSmithKline,Pain Reliever,Tablet,500mg,mg,Common pain killer,true,true,100,10,50.00,2025-12-31,BATCH001,Supplier ABC,2024-01-15,Initial stock

Example (drug only, no inventory):

Panadol,paracetamol,GlaxoSmithKline,Pain Reliever,Tablet,500mg,mg,Common pain killer,true,true

💡 Tip: If quantity is provided, inventory will be automatically created for the drug!

@error('bulk_upload_file') {{ $message }} @enderror @if($bulk_upload_file)

Selected: {{ $bulk_upload_file->getClientOriginalName() }}

@endif
@endif