Consumption edits & deletions · last {{ config('ncd_medication_audit.history_days',100) }} days

@if($history['available']){{ $history['counts']['update'] }} edit events · {{ $history['counts']['delete'] }} deletion events@endif

Committed consumption changes collected on the selected clinic server and securely synced here. Scheduled sync: 08:30–16:30, hourly at :30, every day (Myanmar time). Counts are events; a record can be edited several times.

@foreach(['run','from','to','pid','medicine','show','flow','flow_date','flow_pid','history_from','history_to','history_pid','history_medicine','history_action'] as $field) @if(request()->has($field))@endif @endforeach @foreach($filters['clinics'] as $connection)@endforeach
@if(!$history['available']) @else

Clinic: {{ config('ncd_medication_audit.history_clinics')[$history['filters']['clinic']] }} · Last received: {{ $history['received'] }}
Last collected at clinic: {{ $history['updated'] }} · Next scheduled sync: {{ $history['next_sync'] }} · Myanmar time.
Snapshot window: {{ $history['from'] }} → {{ $history['until'] }}.

@if($history['stale'])
The scheduled clinic sync is overdue (expected {{ $history['expected_sync'] }}). Showing the last received snapshot; recent changes may be missing.
@endif @if(($history['status']['ok']??true)===false)
{{ $history['status']['message'] }}
@endif @if(!$history['coverage_complete'])
Available history does not cover the full {{ config('ncd_medication_audit.history_days',100) }}-day window. Available coverage begins {{ $history['coverage_start'] }}. Missing history must not be interpreted as no edits or deletions.
@endif @if($history['table_operations'])
Table-wide operations were detected. These can remove records without per-row General IDs. @foreach($history['table_operations'] as $operation){{ $operation['at'] }} · {{ $operation['operation'] }} · {{ $operation['binlog'] }}:{{ $operation['position'] }}@endforeach
@endif
@foreach(['run','from','to','pid','medicine','show','flow','flow_date','flow_pid'] as $field)@if(request()->has($field))@endif @endforeach @foreach($filters['clinics'] as $connection)@endforeach

{{ $history['rows']->total() }} matching events. Filters use the time the change was committed, not the original Given Date. Expand Database evidence to see record creation/update times in Myanmar time; arrows show the previous → new value. General ID matches either the previous or new Pid. Medicine name matches items in the before or after record, including removed medicines. Recorded Nurse is a saved field; binary logs do not identify which logged-in staff member made the change.

@forelse($history['rows'] as $event) @php($previous=$event['before']??[]) @php($current=$event['after']??[]) @empty@endforelse
Changed atActionGeneral ID / recordGiven Date / recorded nurseRecorded changes
{{ $event['display_time'] }}{{ $event['action']==='delete'?'Deleted':'Edited' }} {{ $current['Pid'] ?? $previous['Pid'] ?? 'Unavailable in row image' }}@if(isset($previous['Pid'],$current['Pid']) && $previous['Pid']!==$current['Pid'])Previously: {{ $previous['Pid'] }}@endifConsumption #{{ $current['id'] ?? $previous['id'] ?? '—' }}@if($event['incomplete_image'])Incomplete binary-log row image@endif {{ $current['Given_Date'] ?? $previous['Given_Date'] ?? '—' }}Nurse: {{ $current['Nurse'] ?? $previous['Nurse'] ?? '—' }}
    @foreach($event['details'] as $detail)
  • {{ $detail }}
  • @endforeach
Database evidence @if($event['change_days_after_creation']??null){{ $event['change_days_after_creation'] }} {{ $event['change_days_after_creation']===1?'day':'days' }} later@endif@if($event['change_days_after_creation']??null)

{{ $event['action']==='delete'?'Deleted':'Edited' }} {{ $event['change_days_after_creation'] }} calendar {{ $event['change_days_after_creation']===1?'day':'days' }} after creation (Myanmar dates).

@endif @foreach($event['record_times'] as $time)
{{ $time['label'] }}: {{ $time['value'] }}
@endforeach{{ $event['binlog'] }}:{{ $event['position'] }} · row {{ $event['row_index'] }}
GTID: {{ $event['gtid'] ?? '—' }}
No edit or deletion events match these filters in the available snapshot.
@if($history['rows']->hasPages())@endif @endif