diff --git a/Laravel/app/Http/Controllers/API/H5/ReportController.php b/Laravel/app/Http/Controllers/API/H5/ReportController.php index d257330..9f72e3c 100644 --- a/Laravel/app/Http/Controllers/API/H5/ReportController.php +++ b/Laravel/app/Http/Controllers/API/H5/ReportController.php @@ -21,6 +21,16 @@ class ReportController extends Controller } public function GetReportJieLunJianYi() { + $YiBanJianChaList=[ + ['name'=>"身高(cm)", + 'code'=>"SG"], + ['name'=>"体重(kg)", + 'code'=>"TZ"], + ['name'=>"收缩压", + 'code'=>"XY(SSY)"], + ['name'=>"血红蛋白", + 'code'=>"BXBSM"], + ]; $tijian_num =request('tijian_num'); $report=DB::table('report_l1_records as a')->where(['a.体检号'=>$tijian_num])->first(); if(!!$report){ @@ -28,7 +38,16 @@ class ReportController extends Controller $items=DB::table('report_l2_items as b')->leftJoin('report_l3_base_items as c' ,'b.id','=','c.report_l2_id')->where(['b.reprort_l1_id'=>$report->id])->get(); $v_error_items=[]; $error_items=[]; + $base_items=[]; foreach($items as $item){ + foreach ($YiBanJianChaList as $ybitem) { + if($item->基础项目代码==$ybitem['code']){ + $base_items[]=[ + 'name'=>$ybitem['name'], + 'value'=>$item->结果值, + ]; + } + } if($item->异常标识!=null and $item->异常标识!=''){ $error_items[]=$item; } @@ -36,7 +55,7 @@ class ReportController extends Controller $info=[]; $info['name']=$report->姓名; - $info['base_date']=$report->姓名; + $info['base_date']=$base_items; $info['items']=[ 'all_count'=>count($items), 'ipt_error_count'=>count($v_error_items),//重要异常数量 @@ -50,4 +69,22 @@ class ReportController extends Controller return \Yz::echoError1("查询报告失败"); } } + //完整报告中的列表 + public function GetReportDetaiList() + { + $tijian_num =request('tijian_num'); + $report=DB::table('report_l1_records as a')->where(['a.体检号'=>$tijian_num])->first(); + if(!$report) return \Yz::echoError1("查询报告失败"); + if($report->体检状态=='报告未出') return \Yz::echoError1("此报告暂时未出"); + $items=DB::table('report_l2_items as b')->leftJoin('report_l3_base_items as c' ,'b.id','=','c.report_l2_id')->where(['b.reprort_l1_id'=>$report->id])->get(); + $list=[]; + foreach($items as $item){ + $keshiName = $item->科室名称; + if (!isset($list[$keshiName])) { + $list[$keshiName] = []; + } + $list[$keshiName][] = $item; + } + } + }