@extends('Admin.layout') @section('content') {{-- Header --}}
Details
{{-- Patient identity strip --}}
{{ strtoupper(substr($patient->patient_name, 0, 1)) }}
{{ $patient->patient_name }}
Patient ID · {{ $patient->sheet_no }}
{{-- Step navigation --}}
{{-- Form panel --}}
{{-- Medicine History --}}
Medicine History {{ $medicineHistory->count() }}
@forelse($medicineHistory->groupBy(function($medicine){ return $medicine->created_at->format('Y-m-d'); }) as $date => $medicines) @php $reuseMedicines = []; foreach ($medicines as $medicine) { $reuseMedicines[] = [ 'category_id' => $medicine->product->category_id ?? '', 'category_name' => optional(optional($medicine->product)->category)->name ?? '-', 'product_id' => $medicine->product_id ?? '', 'product_name' => optional($medicine->product)->product_name ?? '-', 'dosage' => $medicine->dosage, 'days' => $medicine->days, 'morning' => $medicine->morning ? 1 : 0, 'lunch' => $medicine->lunch ? 1 : 0, 'evening' => $medicine->evening ? 1 : 0, 'dinner' => $medicine->dinner ? 1 : 0, 'before_food' => $medicine->before_food ? 1 : 0, 'after_food' => $medicine->after_food ? 1 : 0, 'note' => $medicine->note ?? '', ]; } @endphp
{{ \Carbon\Carbon::parse($date)->format('d M Y') }}
@foreach($medicines as $medicine) {{ $medicine->product->product_name ?? 'N/A' }} {{ $medicine->dosage }} · {{ $medicine->days }}d @endforeach
@empty
No medicine history found.
@endforelse
Medicines
@csrf

{{-- Medicines table --}}
{{-- Rows are added dynamically via JS. Server-rendered existing medicines (edit mode) can still be looped here with @foreach, just keep the same column order and .sno-cell class on SNO
SNO Type Name Dosage Days Time Note Before Food After Food Action
. --}}
{{-- Sticky bottom action bar --}}
@if ($latestDate) @else @endif
@endsection