| {{ $group['group']['patient']['code'] }} |
{{ $group['group']['patient_type'] ? $group['group']['patient_type']['name'] : '' }} |
{{ $group['group']['patient']['name'] . ' ' . $group['group']['patient']['last_name'] }} |
{{ $group['group']['patient']['gender'] }} |
{{ $group['group']['patient']['dob'] }} |
@if (session('branch_id') == 3)
{{ $group['group']['patient']['metabolic_registry'] == 1 ? 'Positive' : ($group['group']['patient']['metabolic_registry'] == 2 ? 'Negative' : ($group['group']['patient']['metabolic_registry'] == 3 ? 'Inconclusive' : '')) }}
|
@endif
{{ $group['group']['patient']['mother_name'] }} |
{{ $group['test']['name'] }} |
{{ $group['group']['invoice_no'] }} |
{{ $group['sample'] ? $group['sample']['barcode'] : '' }} |
@if ($group->sample)
@if ($group->sample->task)
@if ($group->sample->task->task_analysis->where('done', 0))
@isset($group->sample->task->task_analysis->where('done', 0)[0])
{{ $group->sample->task->task_analysis->where('done', 0)[0]->analysis->name }}
@endisset
@endif
@endif
@endif
|
{{ $group['sample'] ? $group['sample']['lab_receive_date'] : '' }} |
{{ $group['sample'] ? $group['sample']['collection_date'] : '' }} |
@if ($group->sample)
@if ($group['sample']['collection_date'])
@php
$date = strtotime($group['sample']['collection_date']) - strtotime($group->group->patient->dob);
$days = round($date / (60 * 60 * 24));
@endphp
{{ $days >= 0 ? $days . ' day(s)' : '' }}
@endif
@endif
|
@if ($group->releaseReport)
@php
$date = strtotime($group->releaseReport->created_at) - strtotime($group->group->patient->dob);
$days = round($date / (60 * 60 * 24));
@endphp
{{ $days >= 0 ? $days . ' day(s)' : '' }}
@endif
|
@if ($group->sample)
@if ($group['sample']['lab_receive_date'])
@php
$date = strtotime($group['sample']['lab_receive_date']) - strtotime($group->group->patient->dob);
$days = round($date / (60 * 60 * 24));
@endphp
{{ $days >= 0 ? $days . ' day(s)' : '' }}
@endif
@endif
|
{{ $group['test']['sample_types'] ? $group['test']['sample_types']['name'] : '' }} |
@foreach ($group->group->reasons as $reason)
{{ $reason->reason }}
@if (!$loop->last), @endif
@endforeach
|
{{ $group['group']['doctor'] ? $group['group']['doctor']['name'] : '' }} |
{{ $group['group']['doctor2'] ? $group['group']['doctor2']['name'] : '' }} |
{{ $group['group']['institution'] ? $group['group']['institution']['name'] : '' }} |
@if ($group['group']['release_type_id'] == 1)
Mail
@elseif($group['group']['release_type_id'] == 2)
Pick Up
@elseif($group['group']['release_type_id'] == 3)
Email
@endif
|
@if ($group['cancelled'] != null)
Cancelled |
@else
@if ($group['done'])
Done |
@else
Ongoing |
@endif
@endif
{{ $group['final_result'] }} |
{{ $group->group->due > 0 ? 'Pending' : 'Paid' }} |
{{ $group->group->due > 0 ? 'Pending' : 'Done' }} |
@if ($group->releaseReport)
{{ date('F d, Y', strtotime($group->releaseReport->created_at)) }}
@endif
|
{{ date('F d, Y', strtotime($group->created_at)) }} |
@php
// $currentDate = new DateTime();
// $dueDate = $group->tat ? strtotime($group->tat) : ($group->sample && $group->sample->lab_receive_date ? strtotime($group->sample->lab_receive_date . '+' . $group->test->tat . ' ' . $group->test->tat_unit) : null);
// $daysDiff = $dueDate ? (int)((strtotime('now') - $dueDate) / (60 * 60 * 24)) : null;
// $holidays_in_between = 0;
// // get holidays count in between lab_receive_date and due date
// if(isset($holidays) && ($group->sample && $group->sample->lab_receive_date)){
// $holidays_in_between = $holidays->where('date', '>=', $group->sample->lab_receive_date)->where('date', '<=', date('Y-m-d', $dueDate))->count();
// }
// $dueDate = strtotime('+'.$holidays_in_between.' day', $dueDate);
$currentDate = new DateTime();
$dueDate = $group->tat ? strtotime($group->tat) : ($group->sample && $group->sample->lab_receive_date ? strtotime($group->sample->lab_receive_date . '+' . $group->test->tat . ' ' . $group->test->tat_unit) : null);
$holidays_in_between = 0;
// get holidays count in between lab_receive_date and due date
if(isset($holidays) && ($group->sample && $group->sample->lab_receive_date) && !isset($group->tat)){
$holidays_in_between = $holidays->where('date', '>=', $group->sample->lab_receive_date)->where('date', '<=', date('Y-m-d', $dueDate))->count();
}
// add holidays count and check if the due date fall in a holiday, if yes, add 1 day
if (!$group->done && $dueDate) {
$dueDate = strtotime('+'.$holidays_in_between.' day', $dueDate);
// while (in_array(date('Y-m-d', $dueDate), $holidays->pluck('date')->toArray())){
// $dueDate = strtotime('+1 day', $dueDate);
// }
}
$daysDiff = $dueDate ? (int)(($dueDate - strtotime('now')) / (60 * 60 * 24)) : null;
$dateToShow = $dueDate ? date('F d, Y', $dueDate) : 'No Lab Received Date';
$color = 'black';
if ($group->done == 1) {
$color = '#32CD32'; // green
} elseif ($dueDate) {
if ($daysDiff <= 5 && $daysDiff >= 0) {
$color = 'orange';
} elseif ($daysDiff < 0) {
$color = 'red';
}
}
@endphp
@if ($dateToShow === 'No Lab Received Date')
{{ $dateToShow }}
@else
{{ $dateToShow }}
@endif
|
@if ($group->sample)
@if ($group->sample->lab_receive_date && $group->releaseReport)
@php
$date1 = new DateTime($group->sample->lab_receive_date);
$date2 = new DateTime($group->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
@if ($group->sample->lab_receive_date && !$group->releaseReport)
No Released Date
@else
No Lab Received Date
@endif
@endif
@endif
|
@foreach($headersDisplayed2 as $tableDisplayed)
@php
$if_matched = false;
@endphp
@foreach ($group->signatories as $sig)
@if (!empty($sig->user_id && $tableDisplayed == $sig['designation']['shortcut']))
{{ $sig['user']['name']. ' '. $sig['user']['last_name'] }} (Level {{ $sig['designation']['level'] }}) |
{{ $sig['date_signed'] }} |
@php
$if_matched = true;
@endphp
@break
@endif
@endforeach
@if(!$if_matched)
|
|
@endif
@endforeach
@endforeach