调整细节,报告趋势(未完成),医生web套餐、项目

wenjuan
yanzai 1 year ago
parent 3d992994b3
commit 61c590448c

@ -115,37 +115,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
'color' => '#E9F8F3', 'color' => '#E9F8F3',
]; ];
} }
// $item = [
// 'cover' => '/assets/h5/combo.png',
// 'name' => '中老年体检套餐(女)',
// 'sex' => 2,
// 'combo_type' => '1',
// 'person_type' => '1',
// 'tag' => [[
// 'text' => '女已婚',
// 'text_color' => '#47ABD8',
// 'color' => '#EBF5FC',
// ], [
// 'text' => '22个项目',
// 'text_color' => '#34C292',
// 'color' => '#E9F8F3',
// ]],
// 'desc' => ['血糖', '腹部超声', '心电图'],
// 'price' => '1229.00',
// 'original_price' => '2048.88',
// 'count' => '77'
// ];
// $list = [];
// for ($i = 0; $i < 20; $i++) {
// $list[] = $item;
// }
// $hospital_info = [
// 'id' => $hospital,
// 'name' => '秀英院区',
// 'address' => '秀英院区秀英院区秀英院区地址',
// 'latitude' => '39.867671',
// 'longitude' => '119.514223',
// ];
$hospital_info = $hospital; $hospital_info = $hospital;
$info = [ $info = [
'name' => $person->name, 'name' => $person->name,

@ -70,9 +70,9 @@ class HomeController extends Controller
'jump' => '/pages/main/zysx/zysx', 'jump' => '/pages/main/zysx/zysx',
'icon' => '/assets/h5/zhuyishixiang.png' 'icon' => '/assets/h5/zhuyishixiang.png'
], [ ], [
'message' => '暂未开放', 'message' => '',
'name' => '体检引导', 'name' => '体检引导',
'jump' => '/pages/main/cjwt/cjwt', 'jump' => '/pages/user/pick/pick',
'icon' => '/assets/h5/changjianwenti.png' 'icon' => '/assets/h5/changjianwenti.png'
]], [[ ]], [[
'message' => '', 'message' => '',

@ -22,6 +22,8 @@ class QuestionController extends Controller
])->orderBy('order','asc')->get(); ])->orderBy('order','asc')->get();
foreach ($list as $key=>$item){ foreach ($list as $key=>$item){
$item->content=json_decode($item->content,true); $item->content=json_decode($item->content,true);
} }
return \Yz::Return(true,"查询成功",['list'=>$list]); return \Yz::Return(true,"查询成功",['list'=>$list]);
} }

@ -390,6 +390,124 @@ class ReportController extends Controller
$data_arr = []; $data_arr = [];
$res_done_arr = []; $res_done_arr = [];
//查询数据库 //查询数据库
$reports=DB::table('') $reports=DB::table('report_l1_records')->where(['证件号码'=>$id_number])
->whereIn('体检状态',['报告已出','总检完成'])->orderBy('报告日期','asc')->get();
$date_list = [];
$datetime = '';
foreach ($reports as $item) {
$datetime=explode('T', $item['登记时间'])[0];
$jc_item=DB::table('report_l2_items as a')->leftJoin(['report_l3_base_items as b','a.id','=','b.report_l2_id'])->where(['a.reprort_l1_id'=>$item->id])->get();
foreach ($jc_item as $i) {
if ($i['基础项目代码'] == $mark) {
if ($i['结果类型'] == '数值' && !!$i['结果值范围']) {
$date_list[] = $datetime;
$result = '正常';
if ($i['异常标识'] == '↑') $result = '偏高';
if ($i['异常标识'] == '↓') $result = '偏低';
$range_str = $i['结果值范围'];
if (strtotime($datetime) > $time) {
$info['result'] = $result;
$info['value'] = $i['异常标识'] . $i['结果值'] . $i['结果值单位'];
$value = $i['结果值'];
$data_arr[] = [
'value' => $value,
'datetime' => $datetime,
];
$unit = $i['结果值单位'];
$info['date'] = $datetime;
$time = strtotime($datetime);
}
$info['name'] = $i['基础项目名称'];
$info['table']['name'] = $i['基础项目名称'];
$info['table']['list'][] = [
'date' => $datetime,
'value' => $i['异常标识'] . $i['结果值'],
'assess' => $result,
];
}
}
}
}
if ($date == '') $date = $datetime;
$rc = 0;
foreach ($reports as $item) {
$datetime=explode('T', $item['登记时间'])[0];
$jc_item=DB::table('report_l2_items as a')->leftJoin(['report_l3_base_items as b','a.id','=','b.report_l2_id'])->where(['a.reprort_l1_id'=>$item->id])->get();
foreach ($jc_item as $i) {
if ($i['基础项目代码'] == $mark) {
$result = '正常';
if ($i['异常标识'] == '↑') $result = '偏高';
if ($i['异常标识'] == '↓') $result = '偏低';
if ($datetime == $date) {
$info['result'] = $result;
$info['value'] = $i['异常标识'] . $i['结果值'] . $i['结果值单位'];
$value = $i['结果值'];
$unit = $i['结果值单位'];
$info['date'] = $datetime;
$rc++;
}
$info['name'] = $i['基础项目名称'];
$info['table']['name'] = $i['基础项目名称'];
}
}
}
$chart1_option = [
'show' => true,
'range' => [],
'min' => 0,
'max' => 0,
'value' => $value,
'label' => $label,
];
$chart2_option = [
'show' => true,
'data' => $data_arr,
'min' => 0,
'max' => 0,
'unit' => $unit,
'step' => $step,
'range' => [],
];
$data_show = true;
if (!$range_str) {
$data_show = false;
$chart1_option['show'] = false;
$chart2_option['show'] = false;
} else if (strstr($range_str, '>') || strstr($range_str, '<')) {
$data_show = false;
$chart1_option['show'] = false;
$chart2_option['show'] = false;
} else {
$range_str = str_replace('~~', '-', $range_str);
$range_str = str_replace('--', '-', $range_str);
$range_str = str_replace('~', '-', $range_str);
$range_arr = explode('-', $range_str);
$min_index = array_search("min", $range);
$max_index = array_search("max", $range);
$range[$min_index] = $range_arr[0];
$range[$max_index] = $range_arr[1];
$chart1_option['min'] = $range_arr[0];
$chart1_option['max'] = $range_arr[1];
$chart2_option['range'] = $range_arr;
$chart2_option['min'] = $range[0];
$chart2_option['max'] = $range[count($range) - 1];
foreach ($range as $key => $item) {
$chart1_option['range'][] = [
'percent' => $item / ($range[count($range) - 1] - $range[0]),
'value' => $item,
'color' => $color[$key - $min_index + 1],
];
}
}
return \Yz::return(true,"查询完成",[
'date' => $date,
'date_list' => $date_list,
'show' => $data_show,
'info' => $info,
'chart1_option' => $chart1_option,
'chart2_option' => $chart2_option,
]);
} }
} }

@ -0,0 +1,97 @@
<?php
namespace App\Http\Controllers\API\Web;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ComboController extends Controller
{
//医生端网页打开页面获取套餐列表
public function GetList(){
$hospital = request('hospital');
$sex=request('sex');
$combo_sort = request('combo_sort');
$combo_type = request('combo_type');
$combo_crowd = request('combo_crowd');
$combo_price =request('combo_price');
$combo_item = request('combo_item');
$hospital = DB::table('hospitals')->select('id', 'name', 'address', 'latitude', 'longitude')->where(['id' => $hospital])->first();
$canshu = [];
$canshu[]=$sex;
$sql = '';
if (isset($combo_price)) {
$price_list = [
"1" => [0, 299],
"2" => [300, 999],
"3" => [1000, 1499],
"4" => [1500, 2999],
"5" => [3000, 999999],
];
$sql = " and (a.price>=? and a.price<=?) ";
$canshu[] = $price_list[$combo_price][0];
$canshu[] = $price_list[$combo_price][1];
}
if (isset($combo_type)) {
$sql = $sql . " and a.type_id=? ";
$canshu[] = $combo_type;
}
if (isset($combo_crowd)) {
$sql = $sql . " and a.crowd_id=? ";
$canshu[] = $combo_crowd;
}
if (isset($combo_sort)) {
if ($combo_sort == 1) {
$sql = $sql . " ";
}
if ($combo_sort == 2) {
$sql = $sql . " ";
}
if ($combo_sort == 3) {
$sql = $sql . " order by a.price";
}
if ($combo_sort == 4) {
$sql = $sql . " order by a.price desc";
}
}
$combos = DB::select("select * from combos as a LEFT JOIN (
select combo_id as c_id,count(*) as count from orders where status in(2,4) group by combo_id
) as b on a.combo_id=b.c_id where a.status=1 and a.sex=?" . $sql, $canshu);
foreach ($combos as $key => $combo) {
$combo->count=$combo->count?$combo->count:0;
$tags = json_decode($combo->tags, true);
$combo->tags2 = json_decode($combo->tags2, true);
foreach ($tags as $k => $tag) {
$tags[$k] = ['text' => $tag,
'text_color' => '#47ABD8',
'color' => '#EBF5FC'
];
}
$combo->tag = $tags;
$combo->tag[] = [
'text' => $combo->item_count . '个项目',
'text_color' => '#34C292',
'color' => '#E9F8F3',
];
}
$hospital_info = $hospital;
return \Yz::Return(true, '获取成功', [
'list' => $combos,
'hospital' => $hospital_info
]);
}
}

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers\API\Web;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ItemController extends Controller
{
//医生端网页打开页面获取项目列表
public function GetList()
{
$hospital = request('hospital');
$sex=request('sex');
//查询所有可以自选的项目
$items=DB::table('items')->where(['is_choose'=>1,'status'=>1])->get();
$search= request('search');
$list = [];
$group_arr = [];
$group_list = [];
foreach ($items as $item) {
if($item->sex <> $sex and $item->sex<>0){
continue;
}
$push_type = false;
if ($search == '') {
$push_type = true;
} else {
$check_name = $item->name;
if (strpos($check_name, $search) !== false) {
$push_type = true;
}
$check_py = $item->pinyin;
if (strpos($check_py, mb_strtoupper($search)) !== false) {
$push_type = true;
}
$check_group = $item->keshi_name;
if (strpos($check_group, $search) !== false) {
$push_type = true;
}
}
if ($push_type) {
if (!in_array($item->keshi_id, $group_arr)) {
$group_list["科室{$item->keshi_id}"] = [
'id' => $item->keshi_id,
'title' => $item->keshi_name,
'head_img'=>'/storage/20240822/banner1.png',
'children' => [],
];
$group_arr[] = $item->keshi_id;
}
$group_list["科室{$item->keshi_id}"]['children'][] = [
'id' => $item->item_id,
'title' => $item->name,
'price' =>$item->price,
'original_price'=>$item->original_price,
'pinyin' => $item->pinyin,
'desc'=>$item->jianjie
];
}
}
return \Yz::Return(true,"查询成功",['list'=>$group_list]);
}
}

@ -76,5 +76,10 @@ Route::group(['prefix' => 'api/H5'], function () {
}); });
Route::group(['prefix' => 'api/Web'], function () {
Route::post('/ComboGetList', 'App\Http\Controllers\API\Web\ComboController@GetList');//Web套餐列表
Route::post('/ItemGetList', 'App\Http\Controllers\API\Web\ItemController@GetList');//Web套餐列表
});
//对外------ //对外------
Route::any('/TJPushInfo', 'App\Http\Controllers\API\Internal\SiXinPushController@PushInfo');//接收思信推送 Route::any('/TJPushInfo', 'App\Http\Controllers\API\Internal\SiXinPushController@PushInfo');//接收思信推送

Loading…
Cancel
Save