@foreach($tb_hisconnect as $his) @php $json = jsonDecode($his->his_json); $aaa = explode(".",$json->SURGEON); $bbb = explode(" ",end($aaa)); $doctor = DB::table('users') ->where('user_firstname',$bbb[0]) ->where('user_lastname',$bbb[1]) ->first(); $operation = checkPROCEDURE($json->OPERATION); // "HN" => "1561603" // "PTNAME" => "นางประภาพร อนุวรรณ" // "MALE" => "หญิง" // "AGE" => "59" // "PTTYPE" => "400" // "PTTYPE_NAME" => "ข้าราชการเบิกจ่ายตรง/บำนาญ" // "OPERATION" => "EGD" // "SURGEON" => "ผศ.นพ.ศิษฏ์ ศิรมลพิวัฒน์" // "DIAG" => "dyspepsia" // "REQDATE" => "8/4/2564 0:00:00" // "VIP" => null @endphp @csrf @endforeach
# HN Patient name Gender Age OPERATION SURGEON Create
{{$his->his_id}} {{$his->his_hn}} {{$json->PTNAME}} {{$json->MALE}} {{$json->AGE}} {{$json->OPERATION}} @foreach($operation as $oper)
{{$oper}} @endforeach
{{$json->SURGEON}}