查看报告调整

main
yanzai 9 months ago
parent 4908e712f2
commit 7514a4d734

@ -50,10 +50,10 @@ class ReportController extends Controller
}
}
if(isset($tj_status) and $tj_status!==0){
if($tj_status==1 and $report['体检状态']=='报告已出' || $report['体检状态']=='总检完成'){
if($tj_status==1 and ($report['体检状态']=='报告已出' || $report['体检状态']=='总检完成')){
$list[]= $report_list[$key];
}
if($tj_status==2 and $report['体检状态']=='报告未出'){
if($tj_status==2 and ($report['体检状态']=='报告未出' || $report['体检状态']=='正在进行')){
$list[]= $report_list[$key];
}
}else{
@ -88,13 +88,13 @@ class ReportController extends Controller
{
$YiBanJianChaList = [
['name' => "身高(cm)",
'code' => "SG"],
'code' => "SG",'item_id' => ['5853094','5852882','5853229']],
['name' => "体重(kg)",
'code' => "TZ"],
'code' => "TZ",'item_id' => ['5853095','5852883','5853228']],
['name' => "收缩压",
'code' => "XY(SSY)"],
'code' => "XY(SSY)",'item_id' => ['5853097']],
['name' => "血红蛋白",
'code' => "BXBSM"],
'code' => "BXBSM",'item_id' => ['5852944']],
];
$tijian_num = request('tijian_num');
$hospital_id=request('hospital_id');
@ -133,7 +133,7 @@ class ReportController extends Controller
$base_items = [];
foreach ($items as $item) {
foreach ($YiBanJianChaList as $ybitem) {
if ($item->基础项目代码 == $ybitem['code']) {
if ($item->基础项目代码 == $ybitem['code'] or in_array($item->基础项目代码, $ybitem['item_id'])) {
$base_items[] = [
'name' => $ybitem['name'],
'value' => $item->结果值,
@ -300,7 +300,7 @@ class ReportController extends Controller
'desc' => $r2_map[$key]['结果值范围'],
] : [
'date' => $r2_datetime,
'content' => '',
'content' => '',
'icon' => '',
'desc' => ''
];
@ -330,7 +330,7 @@ class ReportController extends Controller
'desc' => $r1_map[$key]['结果值范围'],
] : [
'date' => $r1_datetime,
'content' => '',
'content' => '',
'icon' => '',
'desc' => '',
];
@ -360,6 +360,17 @@ class ReportController extends Controller
foreach ($clear_type2_list as $item) {
$report_type2_content[] = $item;
}
$desiredOrder = ['血压(舒张压)', '血压(收缩压)'];
// 创建一个关联数组来映射名字到它们的顺序值
$orderMap = array_flip($desiredOrder);
// 使用 usort 和一个自定义的比较函数来进行排序
usort($report_type2_content, function ($a, $b) use ($orderMap) {
$pos_a = isset($orderMap[$a['title']]) ? $orderMap[$a['title']] : PHP_INT_MAX;
$pos_b = isset($orderMap[$b['title']]) ? $orderMap[$b['title']] : PHP_INT_MAX;
return $pos_a <=> $pos_b;
});
return \Yz::return(true,"",[
'report_type1_content' => $report_type1_content,
'report_type2_content' => $report_type2_content,

Loading…
Cancel
Save