@extends('layouts.medical_report_pdf5') @section('title') {{'medical_report_'.$invoice['barcode'].'_'.date('d-m-Y_H-i',strtotime($invoice['created_at'])).'.pdf'}} @endsection @section('content')
@if(count($data['custom_tests'])) @php $count_custom_tests=0; @endphp @foreach($data['custom_tests'] as $custom_test) @php $count_custom_tests++; @endphp @include('pdf.custom_reports.v5.'.$custom_test['test']['custom_name']) @if(count($data['custom_tests'])>$count_custom_tests) @endif @endforeach @if(count($data['categories'])) @endif @endif @php $count_categories=0; @endphp @if(count($data['categories'])) @foreach($data['categories'] as $category) @php $count_categories++; $count_category_test=0; @endphp @foreach($category['main_tests'] as $main_test) @php $count_category_test++; @endphp @if($count_category_test==1) @endif @if(count($main_test['childs'])) @foreach($main_test["childs"] as $test) @foreach($test["results"] as $result) @if(isset($result['component'])) @if($result['component']['title']) @php $next_title=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where('title',true) ->first(); if(isset($next_title)) { $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->whereBetween('id',[$result['id'],$next_title['id']]) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } else{ $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } @endphp @if($next_tests) @endif @elseif(!$result['component']['title']) @if(isset($result["result"])||isset($result["note"])) @include('pdf.medical_report.template_5.partials.component',['result'=>$result]) @endif @endif @endif @endforeach @endforeach @else @foreach($main_test["results"] as $result) @if(isset($result['component'])) @if($result['component']['title']) @php $next_title=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where('title',true) ->first(); if(isset($next_title)) { $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->whereBetween('id',[$result['id'],$next_title['id']]) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } else{ $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } @endphp @if($next_tests) @endif @elseif(!$result['component']['title']) @if(isset($result["result"])||isset($result["note"])) @include('pdf.medical_report.template_5.partials.component',['result'=>$result]) @endif @endif @endif @endforeach @endif @if(!empty($main_test['comment'])) @endif
@include('pdf.medical_report.template_5.partials.category',['category'=>$category])
{{$main_test['test']['name']}}
{{$result['component']['name']}}
{{$result['component']['name']}}
Comment : {!! $main_test['comment_html'] !!}
@endforeach {{-- @if(count($data['categories'])>$count_categories) @endif --}} @endforeach @endif @if((count($data['custom_tests'])&&count($data['alone_tests']))||(count($data['categories'])&&count($data['alone_tests']))) @endif @php $count_alone=0; @endphp @foreach($data['alone_tests'] as $test) @php $count_alone++; @endphp @foreach($test["results"] as $result) @if(isset($result['component'])) @if($result['component']['title']) @php $next_title=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where('title',true) ->first(); if(isset($next_title)) { $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->whereBetween('id',[$result['id'],$next_title['id']]) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } else{ $next_tests=\App\Models\InvoiceTestResult::where('invoice_test_id',$result['invoice_test_id']) ->where('id','>',$result['id']) ->where(function($query){ $query->where('result','!=','') ->orWhere('note','!=',''); }) ->where('title',false) ->count(); } @endphp @if($next_tests) @endif @elseif(!$result['component']['title']) @if(isset($result['result'])||isset($result['note'])) @include('pdf.medical_report.template_5.partials.component',['result'=>$result]) @endif @endif @endif @endforeach @if(!empty($test['comment'])) @endif
@include('pdf.medical_report.template_5.partials.test_name',['test'=>$test['test']])
{{$result['component']['name']}}
Comment : {!! $test['comment_html'] !!}
@if($count_alone @endif @endforeach @if((count($data['cultures'])&&count($data['alone_tests']))||(count($data['cultures'])&&count($data['categories']))||(count($data['cultures'])&&count($data['custom_tests']))) @endif @php $count_cultures=0; @endphp @if(count($data['cultures'])) @foreach($data['cultures'] as $culture) @php $count_cultures++; @endphp
@include('pdf.medical_report.template_5.partials.test_name',['test'=>$culture['culture']])
@if(count($culture['report_culture_options'])) @php $count_options=1; @endphp @foreach($culture['report_culture_options'] as $culture_option) @if($count_options%2>0) @endif @if($count_options%2>0) @endif @php $count_options++; @endphp @endforeach
{{$culture_option['name']}} : @include('pdf.partials.culture_option_result',['culture_option'=>$culture_option])
@endif @include('pdf.partials.culture_'.$medical_report_settings['culture_format']) @if(!empty($culture['comment']))
Conclusion : {!! $culture['comment_html'] !!}
@endif @if($count_cultures @endif @endforeach @endif
@endsection