@php $pattern = '/\b0\d{7,12}\b/'; // adjust length if needed @endphp @foreach($entry->calls as $call) @php // Replace matched phone numbers with clickable tel links $contentWithLinks = preg_replace_callback($pattern, function ($matches) { $phone = $matches[0]; return '' . $phone . ''; }, $call->ai_summary); $firstMessageWithLinks = preg_replace_callback($pattern, function ($matches) { $phone = $matches[0]; return '' . $phone . ''; }, $call->first_message); $trClass = ""; if ($call->aiPrescriptions()->exists()) { if (!$call->hasNotReadyAiPrescriptions() ) { $trClass = "bg-light-green"; } // All Prescription Complete if (!$call->hasIncompleteAiPrescriptions() ) { $trClass = "bg-light-blue"; } if ($call->hasNotReadyAiPrescriptions() && $call->hasIncompleteAiPrescriptions() ) { $trClass = "bg-light-red"; } } @endphp @endforeach
Summary Call Create Call End Duration Action
Summary: {!! $contentWithLinks !!}
Initial Request: {!! !empty($firstMessageWithLinks) ? $firstMessageWithLinks : "No Message" !!}
{{ \Carbon\Carbon::parse($call->call_created_at)->format('Y-m-d H:i:s'); }} {{ \Carbon\Carbon::parse($call->call_ended_at)->format('Y-m-d H:i:s'); }} @php $start = \Carbon\Carbon::parse($call->call_created_at)->setTimezone('Pacific/Auckland'); $end = \Carbon\Carbon::parse($call->call_ended_at)->setTimezone('Pacific/Auckland'); $diffInSeconds = $start->diffInSeconds($end) - $call->pharmacist_duration ?? 0 ; // Format as mm:ss $minutes = floor($diffInSeconds / 60); $seconds = $diffInSeconds % 60; $return = sprintf("%02d:%02d", $minutes, $seconds); $pharmacistDurationMinutes = null; if (!empty($call->pharmacist_duration)) { $pharmacistDurationMinutes = floor($call->pharmacist_duration / 60); $pharmacistDurationSecond = $call->pharmacist_duration % 60; $return .= "/
". sprintf("%02d:%02d", $pharmacistDurationMinutes, $pharmacistDurationSecond); } echo $return; @endphp
@php $downloadTranscriptAiEndpointUrl = route('downloadTranscriptAiEndpoint', ['callId' => $call->id]); $downloadTranscriptTextAiEndpointUrl = route('downloadTranscriptTextAiEndpoint', ['callId' => $call->id, 'download' => 'view']); @endphp @foreach( $call->aiPrescriptions as $prescription) @php $class = ""; if ( $prescription->has_update) { $class = "collect"; } if ( $prescription->has_collect ) { $class = "completed"; } $showUrl = backpack_url('ai-prescription/' . $prescription->id . '/edit'); $messageUrl = route('message', [ 'call_id' => $call->id, 'prescription_id' => $prescription->id, ]); $updateUrl = route('updateAiPrescriptionAiEndpoint', ['prescription_id' => $prescription->id]); $completeUrl = route('collectAiPrescriptionAiEndpoint', ['prescription_id' => $prescription->id]); $pivot = $prescription->calls()->wherePivot('call_id', $call->id)->first(); $textBackNumber = $pivot->pivot->text_back_number; @endphp
{{ $prescription->rx_id}}
@if (!empty($textBackNumber)) @endif
@endforeach
@section('after_styles') {{-- DATA TABLES --}} @basset('https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css') @endsection @section('after_scripts') @basset('https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js') @basset('https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js') @basset('https://cdn.datatables.net/responsive/2.4.0/js/dataTables.responsive.min.js') @basset('https://cdn.datatables.net/responsive/2.4.0/css/responsive.dataTables.min.css') @basset('https://cdn.datatables.net/fixedheader/3.3.1/js/dataTables.fixedHeader.min.js') @basset('https://cdn.datatables.net/fixedheader/3.3.1/css/fixedHeader.dataTables.min.css') @endsection