{{-- This Blade will receive $entry (the Call model) --}} @foreach($entry->aiPrescriptions as $prescription) @php $class = ""; $hasCollect = $prescription->has_collect; if ( $hasCollect ) { $class = "completed"; } @endphp @endforeach
ID RX Status Location Medicine Repeats Action
{{ $prescription->rx_id }} {{ $prescription->rxStatus->name ?? "" }} {{ $prescription->location->name ?? "" }} @if(!empty($prescription->medicines)) @foreach($prescription->medicines as $med)
{{ $med->name }}
@endforeach @else N/A @endif
@if(!empty($prescription->repeats)) @foreach($prescription->repeats as $repeat)
{{ $repeat->name }}
@endforeach @else N/A @endif
@php $entryId = $entry->getKey(); $messageUrl = route('message', [ 'call_id' => $entryId, 'prescription_id' => $prescription->id, ]); $updateUrl = route('updateAiPrescriptionAiEndpoint', ['prescription_id' => $prescription->id]); $completeUrl = route('collectAiPrescriptionAiEndpoint', ['prescription_id' => $prescription->id]); $pivot = $prescription->calls()->wherePivot('call_id', $entryId)->first(); $textBackNumber = $pivot->pivot->text_back_number; @endphp
Ready for collect
@if ( !empty($textBackNumber ))
Ready for collect and Send SMS
@endif {{--
Complete
--}}
@if ( $entry->hasIncompleteAiPrescriptions() ) This call has pending prescription @else This call is completed @endif