select( "list_status", "is_nullify", "reg_num", "user_name", "user_sex", "user_brithday", "user_phone", "entrust_code", "entrust", "is_pay", "reservation_department", "entrust_date", "entrust_time", "docotr as doctor", "patient_type", "implement_department", "entrust_id", "episodeid", "RISRAcceptDeptCode", "reservation_date", "reservation_time", "canel_time as cancel_time", "warddesc", "wardcode", "bedname", "bedno", "app_num", "medicalHistory", "diagnosisName", "idCardNumber" ); if(isset($dateRange)){ if(!is_array($dateRange)) return \Yz::JsonError("日期范围必须是数组"); $entrust_list=$entrust_list->whereBetween('entrust_date',[$dateRange[0],$dateRange[1]]); } if(isset($orderNo)){ $entrust_list=$entrust_list->where('entrust_id',$orderNo); } if(isset($visitSqNo)){ $entrust_list=$entrust_list->where('episodeid',$visitSqNo); } if(isset($requestNo)){ $entrust_list=$entrust_list->where('app_num',$requestNo); } if(isset($idCardNumber)){ $entrust_list=$entrust_list->where('idCardNumber',$idCardNumber); } $entrust_list=$entrust_list->get(); return \Yz::JsonReturn(true,'查询完成',$entrust_list); } //pacs调用此接口通知已经报道 public function SignIn(){ $orderNo = request('orderNo');//医嘱号 $checkNo = request('checkNo');//报道号(检查号) if(!isset($orderNo)) return \Yz::JsonError('医嘱号不能为空'); if(!isset($checkNo)) return \Yz::JsonError('报道号不能为空'); $entrust = DB::table('s_list')->where(['entrust_id' => $orderNo,'is_nullify'=>0,'is_del'=>0])->first(); if(!$entrust) return \Yz::JsonError('未找到对应医嘱'); if($entrust->list_status <> 1) return \Yz::JsonError('医嘱当前状态无法报道'); $data = [ 'list_status' => 2, 'check_num' => $checkNo, ]; $u = DB::table('s_list')->where(['entrust_id' => $orderNo])->update($data); if($u){ return \Yz::JsonReturn(true,'报道成功',['orderNo'=>$orderNo]); }else{ return \Yz::JsonError('报道失败'); } } //pacs调用此接口通知取消报道 public function CancelSignIn(){ $orderNo = request('orderNo'); $entrust = DB::table('s_list')->where(['entrust_id' => $orderNo,'is_nullify'=>0,'is_del'=>0])->first(); if(!$entrust) return \Yz::JsonError('未找到对应医嘱'); if($entrust->list_status <> 2) return \Yz::JsonError('医嘱当前状态无法取消报道'); $data = [ 'list_status' => 1, 'check_num' => '', ]; $u = DB::table('s_list')->where(['entrust_id' => $orderNo])->update($data); if($u){ return \Yz::JsonReturn(true,'取消报道成功',['orderNo'=>$orderNo]); }else{ return \Yz::JsonError('取消报道失败'); } } }