@foreach ($groups as $group) @endforeach
Requisition No. First Name Last Name Patient Code Date of Birth Gender Age Contact Nos Email Mother's Name Institution Nsc Code Referral Reason Test Due Doctor 1 Doctor 2 Test(s) Test Status Cancellation Remarks Contract Total Cost Total Due OR Numbers Endorsement Type Type of Patient Releasing Type Date Created Created By Average TAT Billing Status Payment Status Remarks / Notes Status
{{ $group['invoice_no'] }} {{ $group['patient']['name'] }} {{ $group['patient']['last_name'] }} {{ $group['patient']['code'] }} {{ $group['patient']['dob'] }} {{ $group['patient']['gender'] }} {{ $group['patient']['age'] }} @if (isset($group['patient']['phone'])) {{ $group['patient']['phone'] }} @elseif (isset($group['patient']['phones'])) @foreach ($group['patient']['phones'] as $phone) {{ $phone['phone'] }} @if (!$loop->last)
@endif @endforeach @else null @endif
{{ $group['patient']['email'] }} {{ $group['patient']['mother_name'] }} {{ $group['institution'] ? $group['institution']['name'] : '' }} {{ $group['institution'] ? $group['institution']['code'] : '' }} @foreach ($group['reasons'] as $reason) {{ $reason['reason'] }} @if (!$loop->last) , @endif @endforeach @if (isset($group['all_tests'])) @foreach ($group['all_tests'] as $test) @isset($test->tat) {{ date('F d, Y', strtotime($test->tat)) }} @else @if ($test->sample) @php $tat = $test->test->tat; $tat_unit = $test->test->tat_unit; $patient_type_id = $test->group->patient_type_id; $lab_receive_date = $test->sample->lab_receive_date; $patient_type_tat = $test->test->test_patient_type->where('patient_type', $patient_type_id)->first(); if ($patient_type_tat) { $tat = $patient_type_tat->tat; $tat_unit = $patient_type_tat->tat_unit; } $dueDate = strtotime($lab_receive_date . '+' . $tat . ' ' . $tat_unit); $holidays_in_between = 0; if (isset($holidays) && !$test->done) { $holidays_in_between = $holidays->where('date', '>=', $lab_receive_date)->where('date', '<=', date('Y-m-d', $dueDate))->count(); } $dueDate = strtotime('+' . $holidays_in_between . ' day', $dueDate); @endphp @if ($lab_receive_date) {{ date('F d, Y', $dueDate) }} @else No Lab Received Date @endif @else No Sample @endif @endisset
@endforeach @else null @endif
{{ $group['doctor'] ? $group['doctor']['name'] : '' }} {{ $group['doctor2'] ? $group['doctor2']['name'] : '' }} @foreach ($group['tests'] as $test) {{ $test['test']['name'] }}
@endforeach
@foreach ($group['all_tests'] as $group_test) {{ isset($group_test) ? ($group_test['done'] === 1 ? 'Done' : (is_null($group_test['cancelled']) ? 'Pending' : ($group_test['cancelled'] === 0 ? 'Pending Cancellation' : 'Cancelled'))) : '' }}
@endforeach
@foreach ($group['all_tests'] as $group_test_remarks) {{ isset($group_test_remarks) && ($group_test_remarks['cancelled'] === 0 || $group_test_remarks['cancelled'] === 1) ? $group_test_remarks['comment'] : '' }}
@endforeach
{{ $group['contract'] ? $group['contract']['title'] : '' }} {{ $group['total'] }} {{ $group['due'] }} {{ $group->attachments->pluck('group_or_number')->implode(',') }} {{ ucfirst($group['endorsement']) }} {{ $group['patient_type'] ? $group['patient_type']['name'] : '' }} @if ($group['release_type_id'] == 1) Email @elseif ($group['release_type_id'] == 2) Pick Up @elseif ($group['release_type_id'] == 3) Email @elseif ($group['release_type_id'] == 4) Relayed thru sms @elseif ($group['release_type_id'] == 5) Relayed through call @endif {{ date('F d, Y', strtotime($group['created_at'])) }} @if ($group['created_by_user']) {{ $group['created_by_user']['name'] }} {{ $group['created_by_user']['last_name'] }} @endif @foreach ($group['all_tests'] as $test) @if ($test->sample) @if ($test->sample->lab_receive_date && $test->releaseReport) @php $date1 = new DateTime($test->sample->lab_receive_date); $date2 = new DateTime($test->releaseReport->releasing_datetime); $holidays_in_between = 0; // get holidays count in between lab_receive_date and due date if (isset($holidays) && isset($date1) && isset($date2)) { $holidays_in_between = $holidays->where('date', '>=', $date1->format('Y-m-d'))->where('date', '<=', $date2->format('Y-m-d'))->count(); } $interval = $date1->diff($date2); $days = $interval->days - $holidays_in_between . ' days '; @endphp {{ $days }} @else - @endif @else No Sample @endif
@endforeach
{{ $group['billing_status'] }} @if ($group['due'] > 0) Pending @elseif ($group['due'] <= 0 ) Paid @endif @foreach ($group['comments'] as $comment) {{ $comment['comment'] }}
@endforeach
{{ $group['done'] == 1 ? 'Done' : 'Pending' }}