|
|
|
@ -20,11 +20,11 @@ class ReportController extends Controller
|
|
|
|
$persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
|
|
|
|
$persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
|
|
|
|
|
|
|
|
|
|
|
|
$list = DB::table('report_l1_records')->select('姓名', '性别', '登记时间', '套餐名称', '体检号', '体检状态', 'is_read')->whereIn('证件号码', $persons);
|
|
|
|
$list = DB::table('report_l1_records')->select('姓名', '性别', '登记时间', '套餐名称', '体检号', '体检状态', 'is_read')->whereIn('证件号码', $persons);
|
|
|
|
if(isset($tj_status)){
|
|
|
|
if(isset($tj_status) and $tj_status!==0){
|
|
|
|
if($tj_status===0){
|
|
|
|
if($tj_status===1){
|
|
|
|
$tj_status='报告未出';
|
|
|
|
$tj_status='报告未出';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($tj_status===1){
|
|
|
|
if($tj_status===2){
|
|
|
|
$tj_status='报告已出';
|
|
|
|
$tj_status='报告已出';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$list=$list->where('体检状态', $tj_status);
|
|
|
|
$list=$list->where('体检状态', $tj_status);
|
|
|
|
@ -141,6 +141,20 @@ class ReportController extends Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$error_items[] = $item->基础项目名称 . $m;
|
|
|
|
$error_items[] = $item->基础项目名称 . $m;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if($item->结果类型=='数值'){
|
|
|
|
|
|
|
|
$range = $this->convertToArray($item->结果值范围);
|
|
|
|
|
|
|
|
$item->结果值范围=$range;
|
|
|
|
|
|
|
|
$item->最大范围=[];
|
|
|
|
|
|
|
|
if(count($range)>1){
|
|
|
|
|
|
|
|
$kuadu=$range[1]-$range[0];
|
|
|
|
|
|
|
|
if(($item->结果值-$range[1])/$kuadu<=1){
|
|
|
|
|
|
|
|
$max=$range[1]+$kuadu;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$max=$item->结果值;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$item->最大范围=[0,$max];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (count($items) > 0) {
|
|
|
|
if (count($items) > 0) {
|
|
|
|
return \Yz::Return(true, "查询完成", ['is_pacs'=>false,'list' => $items, 'error_items' => $error_items]);
|
|
|
|
return \Yz::Return(true, "查询完成", ['is_pacs'=>false,'list' => $items, 'error_items' => $error_items]);
|
|
|
|
@ -151,5 +165,25 @@ class ReportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function convertToArray($input) {
|
|
|
|
|
|
|
|
// 检查是否是范围表示法
|
|
|
|
|
|
|
|
if (preg_match('/^(\d*\.?\d*)-(\d*\.?\d*)$/', $input, $matches)) {
|
|
|
|
|
|
|
|
return [(float)$matches[1], (float)$matches[2]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 检查是否是小于符号
|
|
|
|
|
|
|
|
if (preg_match('/^<(\d*\.?\d*)$/', $input, $matches)) {
|
|
|
|
|
|
|
|
return [0, (float)$matches[1]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 检查是否是小于等于符号
|
|
|
|
|
|
|
|
if (preg_match('/^<=(\d*\.?\d*)$/', $input, $matches)) {
|
|
|
|
|
|
|
|
return [0, (float)$matches[1]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果没有匹配,返回原始输入
|
|
|
|
|
|
|
|
return $input;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|