|
|
|
|
@ -272,30 +272,35 @@ public function CancelSignIn(){
|
|
|
|
|
public function SignInOnPacs(){
|
|
|
|
|
$orderNo = request('orderNo');//医嘱号
|
|
|
|
|
$checkNo = request('checkNo');//报道号(检查号)
|
|
|
|
|
$type = request('type');//签到 或 完成
|
|
|
|
|
if(!isset($orderNo)) return \Yz::JsonReturn(true, '成功', ['warn' => '医嘱号不能为空']);
|
|
|
|
|
if(!isset($checkNo)) return \Yz::JsonReturn(true, '成功', ['warn' => '报道号不能为空']);
|
|
|
|
|
$targetStatus = ($type === '完成') ? 3 : 2;
|
|
|
|
|
$allowedStatus = ($type === '完成') ? [0, 1, 2] : [0, 1];
|
|
|
|
|
$entrust = DB::table('s_list')->where(['entrust_id' => $orderNo,'is_nullify'=>0,'is_del'=>0])->first();
|
|
|
|
|
if(!$entrust) return \Yz::JsonReturn(true, '成功', ['warn' => '未找到对应医嘱']);
|
|
|
|
|
if(!in_array($entrust->list_status, [0, 1])) return \Yz::JsonReturn(true, '成功', ['warn' => '医嘱当前状态无法报道']);
|
|
|
|
|
if(!in_array($entrust->list_status, $allowedStatus)) return \Yz::JsonReturn(true, '成功', ['warn' => '医嘱当前状态无法操作']);
|
|
|
|
|
$data = [
|
|
|
|
|
'list_status' => 2,
|
|
|
|
|
'list_status' => $targetStatus,
|
|
|
|
|
'check_num' => $checkNo,
|
|
|
|
|
];
|
|
|
|
|
$u = DB::table('s_list')->where(['entrust_id' => $orderNo])->update($data);
|
|
|
|
|
if($u){
|
|
|
|
|
$note = ($type === '完成') ? '完成' : '报到成功';
|
|
|
|
|
$createUser = ($type === '完成') ? 'Pacs完成' : 'Pacs通知';
|
|
|
|
|
$i_log = DB::table('s_list_log')->insert([
|
|
|
|
|
'list_id' =>$entrust->id,
|
|
|
|
|
'reg_num' => $entrust->reg_num,
|
|
|
|
|
'old_status' => $entrust->list_status,
|
|
|
|
|
'new_status' => 2,
|
|
|
|
|
'create_user' => 'Pacs通知',
|
|
|
|
|
'note' => '报到成功',
|
|
|
|
|
'data' => json_encode(['checkNo'=>$checkNo],JSON_UNESCAPED_UNICODE)
|
|
|
|
|
'new_status' => $targetStatus,
|
|
|
|
|
'create_user' => $createUser,
|
|
|
|
|
'note' => $note,
|
|
|
|
|
'data' => json_encode(['checkNo'=>$checkNo, 'type'=>$type],JSON_UNESCAPED_UNICODE)
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
return \Yz::JsonReturn(true,'报道成功',['orderNo'=>$orderNo]);
|
|
|
|
|
return \Yz::JsonReturn(true, $note, ['orderNo'=>$orderNo]);
|
|
|
|
|
}else{
|
|
|
|
|
return \Yz::JsonReturn(true, '成功', ['warn' => '报道失败']);
|
|
|
|
|
return \Yz::JsonReturn(true, '成功', ['warn' => '操作失败']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -317,7 +322,7 @@ public function CancelSignInOnPacs(){
|
|
|
|
|
$orderNo = request('orderNo');
|
|
|
|
|
$entrust = DB::table('s_list')->where(['entrust_id' => $orderNo,'is_nullify'=>0,'is_del'=>0])->first();
|
|
|
|
|
if(!$entrust) return \Yz::JsonReturn(true, '成功', ['warn' => '未找到对应医嘱']);
|
|
|
|
|
if($entrust->list_status <> 2) return \Yz::JsonReturn(true, '成功', ['warn' => '医嘱当前状态无法取消报道']);
|
|
|
|
|
if(!in_array($entrust->list_status, [2, 3])) return \Yz::JsonReturn(true, '成功', ['warn' => '医嘱当前状态无法取消报道']);
|
|
|
|
|
$newStatus = $entrust->reservation_date ? 1 : 0;
|
|
|
|
|
$data = [
|
|
|
|
|
'list_status' => $newStatus,
|
|
|
|
|
|