@extends('layouts.app') @section('title') {{ __('Extended Statistics') }} @endsection @section('breadcrumb')

{{ __('Extended Statistics') }}

@endsection @section('content')

These two filters (Reason for referral and final result) only applies on Lists Tab.

@if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif
PATIENT COUNT
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($client['count'] != 0) {{ $client['count'] }} @else {{ $client['count'] }}@endif@if(isset($patients_tab) && $patients_tab['overall']['total_count'] != 0) {{$patients_tab['overall']['total_count']}} @else 0 @endif
@if(isset($patients_tab)) @foreach($patients_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($patients_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['count']; @endphp @endforeach @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($client['count'] != 0) {{$client['count']}} @else {{$client['count']}}@endif@if($date['total_count'] != 0) {{$date['total_count']}} @else {{$date['total_count']}}@endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}}@endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}}@endif
AVERAGE@if(round($totals[$key] / 12, 2 != 0)) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}}@endif
@endforeach @endif
@if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif
# of Patients that are Female
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($client['count_female'] != 0) {{ $client['count_female'] }} @else {{ $client['count_female'] }} @endif@if(isset($patients_tab) && $patients_tab['overall']['total_count_female'] != 0) {{$patients_tab['overall']['total_count_female']}} @else 0 @endif
@if(isset($patients_tab)) @foreach($patients_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($patients_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['count_female']; @endphp @endforeach @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($client['count_female'] != 0) {{$client['count_female']}} @else {{$client['count_female']}} @endif@if($date['total_count_female'] != 0) {{$date['total_count_female']}} @else {{$date['total_count_female']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}}@endif
@endforeach @endif
@if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @endif
# of Patients that are Male
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($client['count_male'] != 0) {{ $client['count_male'] }} @else {{ $client['count_male'] }} @endif@if(isset($patients_tab) && $patients_tab['overall']['total_count_male'] != 0) {{$patients_tab['overall']['total_count_male']}} @else 0 @endif
@if(isset($patients_tab)) @foreach($patients_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($patients_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['count_male']; @endphp @endforeach @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach @foreach($patients_tab['overall']['clients'] as $key => $client) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($client['count_male'] != 0) {{$client['count_male']}} @else {{$client['count_male']}} @endif@if($date['total_count_male'] != 0) {{$date['total_count_male']}} @else {{$date['total_count_male']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}}@endif
@endforeach @endif
@if(isset($patients_tab)) @foreach($patients_tab['overall']['def_patients'] as $key => $patient) @endforeach @endif
Patients with Deferred Samples
ALL PATIENTS
{{$key + 1}} {{$patient->name}} {{$patient->middle_name}} {{$patient->last_name}}
@if(isset($patients_tab)) @foreach($patients_tab['overall']['clients'] as $key_client => $client) @foreach($patients_tab['dates']['years'] as $key => $year) @foreach($year as $key_date => $date) @if(isset($date['clients'][$key_client]['def_patients']) && $date['clients'][$key_client]['def_patients']->count() > 0) @endif @endforeach @endforeach
{{$key_client}}
Month Patients
{{$key_date}} @foreach($date['clients'][$key_client]['def_patients'] as $key => $patient)

{{$key + 1}} - {{$patient->name}} {{$patient->middle_name}} {{$patient->last_name}}

@endforeach
@endforeach @endif
@if (isset($components_tab))

OVERALL

@foreach ($components_tab['overall'] as $test) @foreach (array_reverse($test) as $key => $year) @if (is_array($year)) @foreach ($year as $item) @if ($key == 'headers') @else @endif @endforeach @else @endif @endforeach @endforeach
{{$item}}{{$item}}
{{$year}}
{{-- L28 --}}

AVERAGE FOR < 28 DAYS OLD

@foreach ($components_tab['l_28'] as $test) @foreach (array_reverse($test) as $key => $year) @if (is_array($year)) @foreach ($year as $item) @if ($key == 'headers') @else @endif @endforeach @else @endif @endforeach @endforeach
{{$item}}{{$item}}
{{$year}}
{{-- M28 --}}

AVERAGE FOR > 28 DAYS OLD

@foreach ($components_tab['m_28'] as $test) @foreach (array_reverse($test) as $key => $year) @if (is_array($year)) @foreach ($year as $item) @if ($key == 'headers') @else @endif @endforeach @else @endif @endforeach @endforeach
{{$item}}{{$item}}
{{$year}}
{{-- FEMALE --}}

AVERAGE FOR FEMALES

@foreach ($components_tab['female'] as $test) @foreach (array_reverse($test) as $key => $year) @if (is_array($year)) @foreach ($year as $item) @if ($key == 'headers') @else @endif @endforeach @else @endif @endforeach @endforeach
{{$item}}{{$item}}
{{$year}}
{{-- FEMALE --}}

AVERAGE FOR MALES

@foreach ($components_tab['male'] as $test) @foreach (array_reverse($test) as $key => $year) @if (is_array($year)) @foreach ($year as $item) @if ($key == 'headers') @else @endif @endforeach @else @endif @endforeach @endforeach
{{$item}}{{$item}}
{{$year}}
@endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL NUMBER OF SAMPLES PER TEST
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($test['count'] != 0) {{ $test['count'] }} @else {{ $test['count'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count'] != 0) {{$tests_tab['overall']['total_count']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($test['count'] != 0) {{$test['count']}} @else {{$test['count']}}@endif@if($date['total_count']) {{$date['total_count']}} @else {{$date['total_count']}}@endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else{{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL NUMBER OF REPEAT SAMPLES PER TEST
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($test['count_repeat_samples'] != 0) {{ $test['count_repeat_samples'] }} @else {{ $test['count_repeat_samples'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count_repeat_samples'] != 0) {{$tests_tab['overall']['total_count_repeat_samples']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_repeat_samples']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($test['count_repeat_samples'] != 0) {{ $test['count_repeat_samples'] }} @else {{ $test['count_repeat_samples'] }} @endif@if($date['total_count_repeat_samples'] != 0) {{$date['total_count_repeat_samples']}} @else {{$date['total_count_repeat_samples']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}}@endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @endif
TOTAL NUMBER OF TESTS PER CLIENT
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($client['count_per_client'] != 0) {{ $client['count_per_client'] }} @else {{ $client['count_per_client'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count_per_client'] != 0) {{$tests_tab['overall']['total_count_per_client']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['count_per_client']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($client['count_per_client'] != 0) {{$client['count_per_client']}} @else {{$client['count_per_client']}} @endif@if($date['total_count_per_client'] != 0) {{$date['total_count_per_client']}} @else {{$date['total_count_per_client']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0){{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif
Average TAT per Test
MONTH/YEAR{{$key}}Average
OVERALL@if($test['count_avg_tat_per_test'] != 0) {{ $test['count_avg_tat_per_test'] }} @else {{ $test['count_avg_tat_per_test'] }}@endif@if(isset($tats_tab) && round($tats_tab['overall']['total_count_avg_tat_per_test'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($tats_tab['overall']['total_count_avg_tat_per_test'] / count($tats_tab['overall']['tests']), 2)}} @else 0 @endif
@if(isset($tats_tab)) @foreach($tats_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tats_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_avg_tat_per_test']; @endphp @endforeach @endforeach @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}Average
{{$key_date}}@if($test['count_avg_tat_per_test'] != 0) {{$test['count_avg_tat_per_test'] }} @else 0 @endif@if(round($date['total_count_avg_tat_per_test'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($date['total_count_avg_tat_per_test'] / count($tats_tab['overall']['tests']), 2)}} @else {{round($date['total_count_avg_tat_per_test'] / count($tats_tab['overall']['tests']), 2)}} @endif
Ave per Test@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}}@endif
@endforeach @endif
@if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif
TAT OF REPEAT SAMPLES PER TEST
MONTH/YEAR{{$key}}Average
OVERALL@if($test['count_repeat_tat'] != 0) {{ $test['count_repeat_tat'] }} @else {{ $test['count_repeat_tat'] }} @endif@if(isset($tats_tab) && round($tats_tab['overall']['total_count_repeat_tat'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($tats_tab['overall']['total_count_repeat_tat'] / count($tats_tab['overall']['tests']), 2)}} @else 0 @endif
@if(isset($tats_tab)) @foreach($tats_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tats_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_repeat_tat']; @endphp @endforeach @endforeach @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}Average
{{$key_date}}@if($test['count_repeat_tat'] != 0) {{ $test['count_repeat_tat'] }} @else {{ $test['count_repeat_tat'] }} @endif@if(round($date['total_count_repeat_tat'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($date['total_count_repeat_tat'] / count($tats_tab['overall']['tests']), 2)}} @else {{round($date['total_count_repeat_tat'] / count($tats_tab['overall']['tests']), 2)}} @endif
Ave per Test@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tats_tab)) @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach @endif
% OF RPT SAMPLES PER TEST
MONTH/YEAR{{$key}}Average
OVERALL@if($test['count_rpt_samples'] != 0) {{ $test['count_rpt_samples'] }} @else {{ $test['count_rpt_samples'] }} @endif@if(isset($tats_tab) && round($tats_tab['overall']['total_count_rpt_samples'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($tats_tab['overall']['total_count_rpt_samples'] / count($tats_tab['overall']['tests']), 2)}} @else 0 @endif
@if(isset($tats_tab)) @foreach($tats_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tats_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_rpt_samples']; @endphp @endforeach @endforeach @foreach($tats_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}Average
{{$key_date}}@if($test['count_rpt_samples'] != 0) {{$test['count_rpt_samples']}} @else {{$test['count_rpt_samples']}} @endif@if(round($date['total_count_rpt_samples'] / count($tats_tab['overall']['tests']), 2) != 0) {{round($date['total_count_rpt_samples'] / count($tats_tab['overall']['tests']), 2)}} @else {{round($date['total_count_rpt_samples'] / count($tats_tab['overall']['tests']), 2)}} @endif
Ave per Test@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT RECEIPT (months)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_receipt_months'] != 0) {{ $client['avg_at_receipt_months'] }} @else {{ $client['avg_at_receipt_months'] }} @endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_receipt_months'] != 0) {{round($ages_tab['overall']['total_avg_at_receipt_months']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_receipt_months']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_receipt_months'] != 0) {{$client['avg_at_receipt_months']}} @else {{$client['avg_at_receipt_months']}}@endif@if($date['total_avg_at_receipt_months'] != 0) {{round($date['total_avg_at_receipt_months']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_receipt_months']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT RECEIPT (days)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_receipt_days'] != 0) {{ $client['avg_at_receipt_days'] }} @else {{ $client['avg_at_receipt_days'] }} @endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_receipt_days'] != 0) {{round($ages_tab['overall']['total_avg_at_receipt_days']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_receipt_days']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_receipt_days'] != 0) {{$client['avg_at_receipt_days']}} @else {{$client['avg_at_receipt_days']}} @endif@if($date['total_avg_at_receipt_days'] != 0) {{round($date['total_avg_at_receipt_days']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_receipt_days']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT COLLECTION (months)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_collection_months'] != 0) {{ $client['avg_at_collection_months'] }} @else{{ $client['avg_at_collection_months'] }} @endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_collection_months'] != 0) {{round($ages_tab['overall']['total_avg_at_collection_months']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_collection_months']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_collection_months'] != 0) {{$client['avg_at_collection_months']}} @else {{$client['avg_at_collection_months']}} @endif@if($date['total_avg_at_collection_months'] != 0) {{round($date['total_avg_at_collection_months']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_collection_months']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT COLLECTION (days)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_collection_days'] != 0) {{ $client['avg_at_collection_days'] }} @else {{ $client['avg_at_collection_days'] }}@endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_collection_days'] != 0) {{round($ages_tab['overall']['total_avg_at_collection_days']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_collection_days']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_collection_days'] != 0) {{$client['avg_at_collection_days']}} @else {{$client['avg_at_collection_days']}} @endif@if($date['total_avg_at_collection_days'] != 0) {{round($date['total_avg_at_collection_days']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_collection_days']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0){{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT RELEASE (months)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_release_months'] != 0) {{ $client['avg_at_release_months'] }} @else {{ $client['avg_at_release_months'] }} @endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_release_months'] != 0) {{round($ages_tab['overall']['total_avg_at_release_months']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_release_months']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_release_months'] != 0) {{$client['avg_at_release_months']}} @else {{$client['avg_at_release_months']}} @endif@if($date['total_avg_at_release_months'] != 0){{round($date['total_avg_at_release_months']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_release_months']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($ages_tab)) @foreach($ages_tab['overall']['clients'] as $key => $client) @endforeach @endif
Average Age AT RELEASE (days)
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($client['avg_at_release_days'] != 0) {{ $client['avg_at_release_days'] }} @else {{ $client['avg_at_release_days'] }} @endif@if(isset($ages_tab) && $ages_tab['overall']['total_avg_at_release_days'] != 0) {{round($ages_tab['overall']['total_avg_at_release_days']/count($ages_tab['overall']['clients']), 2)}} @else 0 @endif
@if(isset($ages_tab)) @foreach($ages_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['avg_at_release_days']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($ages_tab['overall']['clients'] as $key => $client) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}AVERAGE
{{$key_date}}@if($client['avg_at_release_days'] != 0) {{$client['avg_at_release_days']}} @else {{$client['avg_at_release_days']}} @endif@if($date['total_avg_at_release_days'] != 0){{round($date['total_avg_at_release_days']/count($ages_tab['overall']['clients']), 2)}} @else {{$date['total_avg_at_release_days']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/12, 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{round(array_sum($avgs)/count($ages_tab['overall']['clients']), 2)}} @else {{array_sum($totals)}} @endif
@endforeach @endif
@if(isset($ages_tab)) @php $totals = []; @endphp @foreach($ages_tab['disorder_dates']['years'][0]['disorder_symptoms'] as $key => $symp_avg) @php $totals[$key] = 0; @endphp @endforeach @foreach($ages_tab['disorder_dates']['years'] as $year) @foreach($year['disorder_symptoms'] as $key => $symp) @php $totals[$key] += $symp; @endphp @endforeach @endforeach @php $totals_avg = []; @endphp @foreach($year['disorder_symptoms'] as $key => $symp) @php $totals_avg[] = round($totals[$key]/count($ages_tab['disorder_dates']['years']), 2); @endphp @endforeach
AVE AGE (MONTH) OF RELEASE PER DISORDERS / SYMPTOMS
YEAR{{$key}}AVERAGE
{{$year['year']}}@if($symp != 0) {{$symp}} @else {{$symp}} @endif@if($year['disorder_symptoms_total_avg'] != 0) {{$year['disorder_symptoms_total_avg']}}@else {{$year['disorder_symptoms_total_avg']}} @endif
AVERAGE@if($totals[$key] != 0) {{round($totals[$key]/count($ages_tab['disorder_dates']['years']), 2)}} @else {{$totals[$key]}} @endif@if(array_sum($totals_avg) != 0 && count($ages_tab['disorder_dates']['years'][0]['disorder_symptoms']) > 0) {{round(array_sum($totals_avg)/count($ages_tab['disorder_dates']['years'][0]['disorder_symptoms']), 2)}} @else {{array_sum($totals_avg)}} @endif
@endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL NUMBER SAMPLES PER MONTH
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($test['count'] != 0) {{ $test['count'] }} @else {{ $test['count'] }} @endif@if(isset($samples_tab) && $samples_tab['overall']['total_count'] != 0) {{$samples_tab['overall']['total_count']}} @else 0 @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count']; @endphp @endforeach @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($test['count'] != 0) {{ $test['count'] }} @else {{ $test['count'] }} @endif@if($date['total_count'] != 0) {{ $date['total_count'] }} @else {{ $date['total_count'] }} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2)) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL (ACCEPTED AND DEFER) SAMPLE COUNT
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($test['count_acc_def'] != 0) {{ $test['count_acc_def'] }} @else {{ $test['count_acc_def'] }} @endif@if(isset($samples_tab) && $samples_tab['overall']['total_count_acc_def'] != 0) {{$samples_tab['overall']['total_count_acc_def']}} @else 0 @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_acc_def']; @endphp @endforeach @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($test['count_acc_def'] != 0) {{ $test['count_acc_def'] }} @else {{ $test['count_acc_def'] }} @endif@if($date['total_count_acc_def'] != 0) {{$date['total_count_acc_def']}} @else {{$date['total_count_acc_def']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
DEFERRED SAMPLE COUNT
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($test['count_deferred'] != 0) {{ $test['count_deferred'] }} @else {{ $test['count_deferred'] }} @endif@if(isset($samples_tab) && $samples_tab['overall']['total_count_deferred'] != 0) {{$samples_tab['overall']['total_count_deferred']}} @else 0 @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_deferred']; @endphp @endforeach @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($test['count_deferred'] != 0) {{ $test['count_deferred'] }} @else {{ $test['count_deferred'] }} @endif@if($date['total_count_deferred'] != 0) {{$date['total_count_deferred']}} @else {{$date['total_count_deferred']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
ACCEPTED SAMPLE COUNT
MONTH/YEAR{{$key}}TOTAL
OVERALL@if($test['count_accepted'] != 0) {{ $test['count_accepted'] }} @else {{ $test['count_accepted'] }} @endif@if(isset($samples_tab) && $samples_tab['overall']['total_count_accepted'] != 0) {{$samples_tab['overall']['total_count_accepted']}} @else 0 @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_accepted']; @endphp @endforeach @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL
{{$key_date}}@if($test['count_accepted'] != 0) {{ $test['count_accepted'] }} @else {{ $test['count_accepted'] }} @endif@if($date['total_count_accepted'] != 0) {{$date['total_count_accepted']}} @else {{$date['total_count_accepted']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
# OF SAMPLES RELEASED <=7 DAYS PER TEST
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($test['count_sample_released'] != 0) {{ $test['count_sample_released'] }} @else {{ $test['count_sample_released'] }} @endif@if(isset($samples_tab) && count($samples_tab['overall']['tests']) > 0) @if($samples_tab['overall']['total_count_sample_released'] > 0) {{round($samples_tab['overall']['total_count_sample_released']/count($samples_tab['overall']['tests']), 2)}} @else {{$samples_tab['overall']['total_count_sample_released']}} @endif @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_sample_released']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}Average
{{$key_date}}@if($test['count_sample_released'] != 0) {{ $test['count_sample_released'] }} @else {{ $test['count_sample_released'] }} @endif@if(round($date['total_count_sample_released']/count($samples_tab['overall']['tests']), 2) != 0) {{round($date['total_count_sample_released']/count($samples_tab['overall']['tests']), 2)}} @else {{round($date['total_count_sample_released']/count($samples_tab['overall']['tests']), 2)}} @endif
AVG PER TEST@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2) != 0) {{{round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2)}}} @else {{{round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2)}}} @endif
@endforeach @endif
@if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($samples_tab)) @foreach($samples_tab['overall']['tests'] as $key => $test) @endforeach @endif
% OF SAMPLES RELEASED <=7 DAYS PER TEST
MONTH/YEAR{{$key}}AVERAGE
OVERALL@if($test['percent_sample_released'] != 0) {{ $test['percent_sample_released'] }} @else {{ $test['percent_sample_released'] }} @endif@if(isset($samples_tab) && round($samples_tab['overall']['total_avg_sample_released']/count($samples_tab['overall']['tests']), 2) != 0) {{round($samples_tab['overall']['total_avg_sample_released']/count($samples_tab['overall']['tests']), 2)}} @else 0 @endif
@if(isset($samples_tab)) @foreach($samples_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['percent_sample_released']; @endphp @endforeach @endforeach @php $avgs = []; @endphp @foreach($samples_tab['overall']['tests'] as $key => $test) @php $avgs[] = round($totals[$key] / 12, 2); @endphp @endforeach
MONTH/YEAR{{$key}}Average
{{$key_date}}@if($test['percent_sample_released'] != 0) {{ $test['percent_sample_released'] }} @else {{ $test['percent_sample_released'] }} @endif@if(round($date['total_avg_sample_released']/count($samples_tab['overall']['tests']), 2) != 0) {{round($date['total_avg_sample_released']/count($samples_tab['overall']['tests']), 2)}} @else {{round($date['total_avg_sample_released']/count($samples_tab['overall']['tests']), 2)}} @endif
AVG PER TEST@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2) != 0) {{{round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2)}}} @else {{{round(array_sum($avgs) / count($samples_tab['overall']['tests']), 2)}}} @endif
@endforeach @endif
@if(isset($results_tab)) @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($results_tab)) @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL RELEASED RESULTS PER MONTH
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL{{ $test['count_per_month'] }}@if(isset($results_tab)) {{$results_tab['overall']['total_count_per_month']}} @else 0 @endif
@if(isset($results_tab)) @foreach($results_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($results_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_per_week']; @endphp @endforeach @endforeach @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}{{$test['count_per_week']}}{{$date['total_count_per_week']}}
TOTAL{{$totals[$key]}}{{array_sum($totals)}}
AVERAGE{{round($totals[$key] / 12, 2)}}{{{round(array_sum($totals) / 12, 2)}}}
@endforeach @endif
@if(isset($results_tab)) @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($results_tab)) @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL RELEASED RESULTS PER WEEK
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL{{ $test['count_per_week'] }}@if(isset($results_tab)) {{$results_tab['overall']['total_count_per_week']}} @else 0 @endif
@if(isset($results_tab)) @foreach($results_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($results_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_per_week']; @endphp @endforeach @endforeach @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR WEEKS{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}} @foreach($date['weeks'] as $key => $week)

{{$key}}: {{$week}}

@endforeach
{{$test['count_per_week']}}{{$date['total_count_per_week']}}
TOTAL{{$totals[$key]}}{{array_sum($totals)}}
AVERAGE{{round($totals[$key] / 12, 2)}}{{{round(array_sum($totals) / 12, 2)}}}
@endforeach @endif
{{-- FILTERS --}} @if (isset($lists_tab))
@endif
@if(isset($lists_tab['overall'])) @endif @if(isset($lists_tab['overall'])) @foreach($lists_tab['overall'] as $key => $list) @endforeach @endif
Top 10 Disorders Diagnosed Overall
# FINAL RESULT COUNT
{{$key+1}} {{$list->final_result}} {{$list->count}}
@if(isset($lists_tab['year'])) @foreach($lists_tab['year'] as $key => $list_year) {{-- @if(isset($list_year['overall'])) --}} @foreach($list_year as $key => $list) @endforeach {{-- @endif --}}
Top 10 Disorders Diagnosed {{$key}}
# FINAL RESULT COUNT
{{$key+1}} {{$list->final_result}} {{$list->count}}
@endforeach @endif
{{-- --}}
List of patients with a specified elevation in a certain metabolite/COMPONENT
NAME TEST AND COMPONENT VALUE
1 Top 1 0
List of patients with suggestive/positive results
@if(isset($lists_tab['patients_w_postive'])) @foreach($lists_tab['patients_w_postive'] as $key => $pwl) {{-- {{$pwl->pluck('month_name')->unique()}} --}} @foreach($pwl->pluck('month_name')->unique() as $month) @foreach($pwl as $patient_positive) {{-- {{$patient_positive}} --}} @if($month == $patient_positive->month_name) @endif @endforeach @endforeach
Year {{$key}}
PATIENT NAME DATE
{{$month}}
{{$patient_positive->name}} {{$patient_positive->last_name}} {{$patient_positive->metabolic_registry_date}}
@endforeach @endif
{{-- --}}
List of patients with suggestive/positive results List of patients with a specified elevation in a certain metabolite/COMPONENT
@if(isset($results_tab)) @foreach(array_reverse($lists_tab['dates']['years']) as $key => $year) @php $totals = []; @endphp {{-- @foreach($results_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach --}} @foreach($year as $key_date => $date) {{-- @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_per_week']; @endphp @endforeach --}} @endforeach {{-- @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach @foreach($results_tab['overall']['tests'] as $key => $test) @endforeach --}}
MONTH/YEAR Result{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}} @if (isset($date['name'])) @foreach ($date['name'] as $name_key => $item) {{$name_key}} @foreach ($item as $component) @foreach ($component as $res) @php $component_name = explode(':', $res)[1]; $trimmed = trim($component_name); $char_arr = [' ', '(', ')']; $replace_char_arr = ['','','']; @endphp

{{$res}}

@endforeach @endforeach @endforeach @endif
{{$test['count_per_week']}}{{$date['total_count_per_week']}}
TOTAL{{$totals[$key]}}{{array_sum($totals)}}
AVERAGE{{round($totals[$key] / 12, 2)}}{{{round(array_sum($totals) / 12, 2)}}}
@endforeach @endif
@if(isset($lists_tab['patients_w_postive'])) @foreach($lists_tab['patients_w_postive'] as $key => $pwl) {{-- --}} {{-- {{$pwl->pluck('month_name')->unique()}} --}} @foreach($pwl->pluck('month_name')->unique() as $month) @foreach($pwl as $patient_positive) {{-- {{$patient_positive}} --}} @if($month == $patient_positive->month_name) @endif @endforeach @endforeach
List of patients with suggestive/positive resultsYear {{$key}}
PATIENT NAME DATE
{{$month}}
{{$patient_positive->name}} {{$patient_positive->last_name}} {{$patient_positive->metabolic_registry_date}}
@endforeach @endif
List of patients with Negative results
@if(isset($lists_tab['patients_w_negative'])) @foreach($lists_tab['patients_w_negative'] as $key => $pwp) @foreach($pwp->pluck('month_name')->unique() as $month) @foreach($pwp as $patient_negative) @if($month == $patient_negative->month_name) @endif @endforeach @endforeach
Year {{$key}}
PATIENT NAME DATE
{{$month}}
{{$patient_negative->name}} {{$patient_negative->last_name}} {{$patient_negative->metabolic_registry_date}}
@endforeach @endif
# of patients with suggestive results
@if(isset($lists_tab['patients_w_postive_count_overall'])) {{-- --}} @foreach($lists_tab['patients_w_postive_count_overall'] as $client => $pwpco) @endforeach
Overall# of patients with suggestive results
CLIENT NAME COUNT
{{$client}} {{$pwpco}}
@endif @if(isset($lists_tab['patients_w_postive_count'])) @foreach($lists_tab['patients_w_postive_count'] as $key => $pwp) {{-- --}} @foreach([ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] as $mn) @endforeach {{-- {{$pwp->pluck('month_name')->unique()}} --}} @foreach($pwp as $client_name => $client) @foreach($client as $month => $count) @endforeach @endforeach
List of patients with suggestive/positive resultsYear {{$key}}
{{$mn}}
{{$client_name}}{{$count}}
@endforeach @endif
# of patients with Negative results
@if(isset($lists_tab['patients_w_negative_count_overall'])) @foreach($lists_tab['patients_w_negative_count_overall'] as $client => $pwpco) @endforeach
Overall
CLIENT NAME COUNT
{{$client}} {{$pwpco}}
@endif @if(isset($lists_tab['patients_w_negative_count'])) @foreach($lists_tab['patients_w_negative_count'] as $key => $pwp) @foreach([ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] as $mn) @endforeach {{-- {{$pwp->pluck('month_name')->unique()}} --}} @foreach($pwp as $client_name => $client) @foreach($client as $month => $count) @endforeach @endforeach
Year {{$key}}
{{$mn}}
{{$client_name}}{{$count}}
@endforeach @endif
Identify patients with suggestive results and a certain elevated metabolite
@if(isset($lists_tab['patients_w_postive_w_components'])) @foreach($lists_tab['patients_w_postive_w_components'] as $key => $pwl) @foreach($pwl->pluck('month_name')->unique() as $month) @foreach($pwl as $patient_positive) @php $component_code = []; @endphp @if($month == $patient_positive->month_name && $patient_positive->status == 'Outside Normal Values') @endif @endforeach @endforeach
Year {{$key}}
PATIENT NAME TEST COMPONENT VALUE
{{$month}}
{{$patient_positive->name}} {{$patient_positive->last_name}} {{$patient_positive->test_name}} @php $components = explode(',', $patient_positive['component_names']); $values = explode(',', $patient_positive['test_value']); @endphp @foreach ($components as $key => $component) @if (isset($values[$key]) && trim($values[$key]) !== '') @php $trimmed = trim($component); $char_arr = [' ', '(', ')']; $replace_char_arr = ['','','']; $new_component_code = str_replace($char_arr, $replace_char_arr, $trimmed); $component_code[] = $new_component_code; @endphp

{{ $trimmed }}

@endif @endforeach
@php $counter = 0; @endphp @foreach ($values as $value)

{{ trim($value) }}

@php $counter++; @endphp @endforeach
@endforeach @endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL NUMBER OF SAMPLES PER TEST
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($test['count'] != 0) {{ $test['count'] }} @else {{ $test['count'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count'] != 0) {{$tests_tab['overall']['total_count']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($test['count'] != 0) {{$test['count']}} @else {{$test['count']}}@endif@if($date['total_count']) {{$date['total_count']}} @else {{$date['total_count']}}@endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else{{round($totals[$key] / 12, 2)}}@endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @endif
TOTAL NUMBER OF REPEAT SAMPLES PER TEST
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($test['count_repeat_samples'] != 0) {{ $test['count_repeat_samples'] }} @else {{ $test['count_repeat_samples'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count_repeat_samples'] != 0) {{$tests_tab['overall']['total_count_repeat_samples']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['tests'] as $key => $test) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['tests'] as $key => $test) @php $totals[$key] += $test['count_repeat_samples']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach @foreach($tests_tab['overall']['tests'] as $key => $test) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($test['count_repeat_samples'] != 0) {{ $test['count_repeat_samples'] }} @else {{ $test['count_repeat_samples'] }} @endif@if($date['total_count_repeat_samples'] != 0) {{$date['total_count_repeat_samples']}} @else {{$date['total_count_repeat_samples']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}}@endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0) {{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($tests_tab)) @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @endif @if(isset($tests_tab)) @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @endif
TOTAL NUMBER OF TESTS PER CLIENT
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
OVERALL@if($client['count_per_client'] != 0) {{ $client['count_per_client'] }} @else {{ $client['count_per_client'] }} @endif@if(isset($tests_tab) && $tests_tab['overall']['total_count_per_client'] != 0) {{$tests_tab['overall']['total_count_per_client']}} @else 0 @endif
@if(isset($tests_tab)) @foreach($tests_tab['dates']['years'] as $key => $year) @php $totals = []; @endphp @foreach($tests_tab['overall']['clients'] as $key => $client) @php $totals[$key] = 0; @endphp @endforeach @foreach($year as $key_date => $date) @foreach($date['clients'] as $key => $client) @php $totals[$key] += $client['count_per_client']; @endphp @endforeach @endforeach @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach @foreach($tests_tab['overall']['clients'] as $key => $client) @endforeach
MONTH/YEAR{{$key}}TOTAL NUMBER OF TESTS
{{$key_date}}@if($client['count_per_client'] != 0) {{$client['count_per_client']}} @else {{$client['count_per_client']}} @endif@if($date['total_count_per_client'] != 0) {{$date['total_count_per_client']}} @else {{$date['total_count_per_client']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if(array_sum($totals) != 0) {{array_sum($totals)}} @else {{array_sum($totals)}} @endif
AVERAGE@if(round($totals[$key] / 12, 2) != 0){{round($totals[$key] / 12, 2)}} @else {{round($totals[$key] / 12, 2)}} @endif@if(round(array_sum($totals) / 12, 2) != 0) {{{round(array_sum($totals) / 12, 2)}}} @else {{{round(array_sum($totals) / 12, 2)}}} @endif
@endforeach @endif
@if(isset($others_tab)) @php $totals = []; @endphp @foreach($others_tab['disorder_dates']['years'][0]['disorder_symptoms'] as $key => $symp) @php $totals[$key] = 0; @endphp @endforeach @foreach($others_tab['disorder_dates']['years'] as $year) @foreach($year['disorder_symptoms'] as $key => $symp) @php $totals[$key] += $symp; @endphp @endforeach @endforeach @php $total = 0; @endphp @foreach($year['disorder_symptoms'] as $key => $symp) @php $total += $totals[$key]; @endphp @endforeach
SCREENED DISORDERS / SYMPTOMS
YEAR{{$key}}TOTAL
{{$year['year']}}@if($symp != 0) {{$symp}} @else {{$symp}} @endif@if($year['overall_count'] != 0) {{$year['overall_count']}}@else {{$year['overall_count']}} @endif
TOTAL@if($totals[$key] != 0) {{$totals[$key]}} @else {{$totals[$key]}} @endif@if($total != 0) {{$total}} @else {{$total}} @endif
@endif
@if(isset($training_tab)) @foreach($training_tab['dates']['years'] as $key => $year) @foreach($year as $key_date => $date) @if($date['trainings']->count() > 0) @foreach($date['trainings'] as $training) @endforeach
{{$key_date}}
Name Training
{{$training->name}} {{$training->last_name}} {{$training->title}}
@endif @endforeach @endforeach @endif
@endsection @section('scripts') @endsection