@php $rightto = DB::table('patient') //->leftjoin('dd_righttotreatment','dd_righttotreatment.id','patient.righttotreatment') ->where('patient.hn',$casedata->case_hn)->first(); $ward = "-"; $refer= "-"; if(isset($this_json->ward)){ if($this_json->ward != ''){ $ward = $this_json->ward; } } if(isset($this_json->refer)){ if($this_json->refer != ''){ $refer = $this_json->refer; } } @endphp @php $user_list = DB::table('users')->where('id',"999999999")->get(); if(isset($json->user_in_case)){ $lists = json_decode($json->user_in_case); $user_list = DB::table('users')->whereIn('id',$lists)->get(); } $no_doctor = true; $no_nurse = true; $no_anes = true; @endphp
{{$hospital->hospital_name}}
{{$hospital->hospital_address}}
Tel : {{$hospital->hospital_tel}}
Procedure Report
{{$casedata->procedure_name}}
PATIENT NAME :{{$casedata->prefix.$casedata->firstname." ".$casedata->lastname}} HN : {{ $casedata->hn }}       Ward :{{@$json->ward != null ? @$json->ward:'-'}}
GENDER : {{@$casedata->gender_name }}   Age : {{age($casedata->birthdate)}} RIGHT TO TREATMENT :{{@$json->righttotreatment}}
DATE OF PROCEDURE : {{swapDATE($casedata->case_dateappointment)}} OPERATION TIME : @if(isset($json->start_time) && isset($json->end_time)) @php $start_date = new DateTime($json->start_time); $since_start = $start_date->diff(new DateTime($json->end_time)); @endphp {{substr($json->start_time,0,-3)}} - {{substr($json->end_time,0,-3)}} ({{$since_start->i}}) @else  - @endif
ENDOSCOPIST : {{$doctor[1]}} ENDOSCOPE : @foreach($scopeall as $scope) {{$scope}} @endforeach
CONSULTANT : @foreach($user_list as $user) @if($user->user_type=="doctor") {{$user->user_prefix}}{{$user->user_firstname}} {{$user->user_lastname}}
@php $no_doctor = false; @endphp @endif @endforeach @if($no_doctor) N/A @endif
NURSE, ASSIST : @foreach($user_list as $user) @if($user->user_type=="nurse") {{$user->user_prefix}}{{$user->user_firstname}} {{$user->user_lastname}}
@php $no_nurse = false; @endphp @endif @endforeach @isset($json->assistant)
{{$json->assistant}} @endisset @if($no_nurse) N/A @endif
ANESTHESIST : @foreach($user_list as $user) @if($user->user_type=="anes") {{$user->user_prefix}}{{$user->user_firstname}} {{$user->user_lastname}}
@php $no_anes = false; @endphp @endif @endforeach @foreach($user_list as $user) @if($user->user_type=="nurse_anes") {{$user->user_prefix}}{{$user->user_firstname}} {{$user->user_lastname}}
@php $no_anes = false; @endphp @endif @endforeach @if($no_anes) N/A @endif