@foreach ($send_off as $data) @endforeach
Name of Patient Sample Barcode Custom Code Date of Birth Mother's Name Diagnostic Test Specimen Type D.O.C Date of Sample Reception Date sent Facilitator Courier/Waybill Number TAT Test Results Status
{{ $data->patient->last_name }}, {{ $data->patient->name }} {{ $data->patient->middle_name }} {{ $data->samples->barcode }} {{ $data->samples->accession_no }} {{ $data->patient->dob ? \Carbon\Carbon::parse($data->patient->dob)->format('F d, Y') : '' }} {{ $data->patient->mother_name }} {{ $data->samples->test->name }} {{ $data->samples->sample_type->name }} {{ $data->samples->collection_date ? \Carbon\Carbon::parse($data->samples->collection_date)->format('F d, Y') : '' }} {{ $data->samples->lab_receive_date ? \Carbon\Carbon::parse($data->samples->lab_receive_date)->format('F d, Y') : '' }} {{ $data->date_result_received ? \Carbon\Carbon::parse($data->date_result_received)->format('F d, Y') : '' }} {{ $data->facilitator }} {{ $data->courier_waybill }} @php $labReceivedDate = null; $sendOutDate = null; $tat = null; if ($data->samples->lab_receive_date) { $labReceivedDate = Carbon\Carbon::parse($data->samples->lab_receive_date); $sendOutDate = Carbon\Carbon::parse($data->send_off_date); $tat = $labReceivedDate->diffInDays($sendOutDate); } @endphp @if ($labReceivedDate) {{ $tat }} @endif {{ $data->test_results }} {{ $data->status }}