/// <summary>
        /// 关闭流程
        /// </summary>
        /// <returns></returns>
        public JsonResult CloseEvent(string eventId, string applyId)
        {
            UserEventBLL ueBll = new UserEventBLL();

            ueBll.CloseEvent(eventId);
            ueBll.CloseApply(applyId);
            return(Json("ok", JsonRequestBehavior.AllowGet));
        }
Example #2
0
 public ServiceTaskController()
 {
     _user       = new UserInfoService();
     _event      = new UserEventBLL();
     _apply      = new DoctorControlBll();
     _service    = new ServiceTraceInfoService();
     _repository = new CancerUserInfoRepository();
     _member     = new MemberBLL();
 }
Example #3
0
        public IHttpActionResult Get(string id, int currentPage)
        {
            //数据异常判断处理
            if (string.IsNullOrEmpty(id))
            {
                return(BadRequest("数据异常"));
            }

            //查询数据
            IEnumerable <SeeDoctorHistory> _list = new List <SeeDoctorHistory>();
            int count = 1;

            try
            {
                UserEventBLL userBLL   = new UserEventBLL();
                UserEvent    userEvent = userBLL.Get(p => p.EVENTID.Equals(id));
                if (userEvent == null)
                {
                    return(BadRequest("该记录不存在!"));
                }

                _list = _repository.GetList(p => p.PERSONID == userEvent.FromUser);

                count = _list.Count();
                int _pageSize = 10;
                _list = _list.Skip((currentPage - 1) * _pageSize).Take(_pageSize);
                SeeDoctorHistoryBLL seeDoctorBLL = new SeeDoctorHistoryBLL();
                foreach (SeeDoctorHistory item in _list)
                {
                    item.ICD10 = seeDoctorBLL.GetICD10(item.HISTORYID);
                }

                count = count / _pageSize;
                if (count % _pageSize > 0)
                {
                    count += 1;
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteError(ex.ToString());
                return(BadRequest(ex.Message));
            }

            Response <IEnumerable <object> > response = new Response <IEnumerable <object> >();

            response.Data       = _list;
            response.PagesCount = count;

            //返回
            return(Ok(response));
        }
Example #4
0
        /// <summary>
        /// 发送用户待办通知
        /// </summary>
        private void SendEvent(string uid, string loginname)
        {
            string _appleID = Guid.NewGuid().ToString();


            DoctorControlBll dcbll     = new DoctorControlBll();
            UserApply        userApply = new UserApply();

            userApply.ID             = Guid.NewGuid().ToString();
            userApply.APPLYID        = _appleID;
            userApply.USERID         = uid;
            userApply.GUIDELINEID    = "1";
            userApply.STATUS         = "1";
            userApply.CREATEDATETIME = DateTime.Now;
            userApply.ISDELETED      = false;

            dcbll.Add(userApply);

            UserEvent userEvent = new UserEvent();

            userEvent.FromUser     = "";
            userEvent.UserApplyId  = userApply.ID;
            userEvent.ActionType   = ((int)ActionType.待办事项).ToString();
            userEvent.ActionInfo   = "您已注册成功,请上传您的病历资料";
            userEvent.ReceiptTime  = DateTime.Now;
            userEvent.ActionStatus = ((int)ActionStatus.Progress).ToString();
            userEvent.ToUser       = uid;
            userEvent.CreateTime   = DateTime.Now;
            userEvent.LinkUrl      = "ViewUpload";

            UserEventBLL userEventBLL = new UserEventBLL();

            userEventBLL.Add(userEvent);

            CancerUserInfoRepository cancerUserRepository = new CancerUserInfoRepository();
            HR_CNR_USER cnr_User = new HR_CNR_USER();

            cnr_User.CREATTIME = DateTime.Now;
            cnr_User.USERID    = uid;
            cnr_User.NAME      = loginname;
            cancerUserRepository.Insert(cnr_User);
        }
Example #5
0
        public bool SendEvent(UserEvent userEvent, string FormID)
        {
            try
            {
                UserEventBLL userBLL = new UserEventBLL();
                userBLL.CloseEvent(userEvent.EventID);

                UserInfoService _service    = new UserInfoService();
                UserInfo        currentUser = _service.GetCurrentUser();
                string          _fromUser   = currentUser == null ? "" : currentUser.UserId;
                string          _applyId    = userEvent == null ? "" : userEvent.UserApplyId;

                string   _userID    = userEvent.FromUser;
                UserInfo createUser = _service.GetUserInfoByID(_userID);
                string   _name      = createUser == null ? "" : createUser.LoginName;

                UserEvent newUEvent = new UserEvent();
                newUEvent.EventID      = Guid.NewGuid().ToString("N");
                newUEvent.UserApplyId  = _applyId;
                newUEvent.FromUser     = _fromUser;
                newUEvent.ActionType   = ((int)ActionType.待办事项).ToString();
                newUEvent.ActionInfo   = string.Format("您收到了{0}的病历报告,请查看", _name);
                newUEvent.ReceiptTime  = DateTime.Now;
                newUEvent.ActionStatus = ((int)ActionStatus.Progress).ToString();
                newUEvent.CreateTime   = DateTime.Now;
                newUEvent.ModelType    = "DoctorHistory";
                newUEvent.ModelId      = FormID;
                newUEvent.LinkUrl      = "EventDetailForDoc";

                userBLL.AddUserEvent(newUEvent, UserType.医生);

                return(true);
            }
            catch (Exception ex)
            {
                LogHelper.WriteError(ex.ToString());
                return(false);
            }
        }
Example #6
0
        public IHttpActionResult Get(int CurrentPage, string ID, string Date = "")
        {
            //申明参数
            int _pageSize = 10;
            int count     = 1;

            try
            {
                string       _creater  = string.Empty;
                UserEventBLL userBLL   = new UserEventBLL();
                UserEvent    userEvent = userBLL.Get(p => p.EVENTID.Equals(ID));
                if (userEvent == null)
                {
                    return(BadRequest("该记录不存在!"));
                }
                _creater = userEvent.FromUser;

                PageInfo pageInfo = new PageInfo()
                {
                    PageIndex  = CurrentPage,
                    PageSize   = _pageSize,
                    OrderField = "CreatTime",
                    Order      = OrderEnum.desc
                };
                Expression <Func <HR_FILEUPLOAD, bool> > predicate = p => true;
                if (string.IsNullOrEmpty(Date))
                {
                    predicate = p => p.CREATBY.Equals(_creater) && (p.FORMID.Equals(ID) || string.IsNullOrEmpty(p.FORMID));
                }
                else
                {
                    DateTime dt_start = DateTime.Parse(Date);
                    DateTime dt_end   = dt_start.AddHours(24);
                    predicate = p => p.CREATBY.Equals(_creater) && p.CREATTIME >= dt_start && p.CREATTIME <= dt_end && (p.FORMID.Equals(ID) || string.IsNullOrEmpty(p.FORMID));
                }

                var list = bll.GetList(pageInfo, predicate);
                count = pageInfo.Total / _pageSize;
                if (pageInfo.Total % _pageSize > 0)
                {
                    count += 1;
                }

                SeeDoctorHistoryBLL    doctorBLL = new SeeDoctorHistoryBLL();
                List <FileUserArrange> data      = new List <FileUserArrange>();
                foreach (FileUpload item in list)
                {
                    FileUserArrange model = new FileUserArrange();
                    model.FileId    = item.FileUploadid;
                    model.CreatTime = item.CreatTime;
                    model.FileName  = item.FileName;
                    model.FilePath  = item.FilePath;
                    model.FormId    = item.FormId;
                    model.Remark    = item.Remark;
                    switch (item.ModelCode)
                    {
                    case "SeeDoctorHistory":
                        model.Type = "0";
                        break;

                    case "LaboratoryResult":
                        model.Type = "1";
                        break;

                    case "ImageExamination":
                        model.Type = "2";
                        break;

                    default:
                        model.Type = "";
                        break;
                    }

                    SeeDoctorHistory doctorHModel = doctorBLL.GetOne(p => p.HISTORYID.Equals(item.FormId));
                    if (doctorHModel != null)
                    {
                        model.Date     = doctorHModel.DIAGNOSISTIME == null ? "" : ((DateTime)doctorHModel.DIAGNOSISTIME).ToString("yyyy-MM-dd");
                        model.Hosiptal = doctorHModel.HOSPITAL;
                    }

                    data.Add(model);
                }

                Response <IEnumerable <FileUserArrange> > response = new Response <IEnumerable <FileUserArrange> >
                {
                    Data       = data,
                    PagesCount = count
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                LogHelper.WriteInfo(ex.ToString());
                return(BadRequest("异常"));
            }
        }
Example #7
0
        public IHttpActionResult Post([FromBody] Request <UserArrangeItem> request)
        {
            try
            {
                //获取数据
                UserArrangeItem         item      = request.Data;
                string                  eventID   = item.EventID;
                string                  historyID = item.HistoryId;
                string                  uid       = string.Empty;
                bool                    createNew = item.CreateNew;
                string                  remark    = item.Remark;
                IList <FileUserArrange> files     = item.Files;

                //申明返回
                string content = string.Empty;

                UserEventBLL userBLL   = new UserEventBLL();
                UserEvent    userEvent = userBLL.Get(p => p.EVENTID.Equals(eventID));
                if (userEvent == null)
                {
                    return(Json(new { Result = "no", Msg = "参数错误,\n请输入用户信息" }));
                }

                SeeDoctorHistoryBLL doctorBLL    = new SeeDoctorHistoryBLL();
                SeeDoctorHistory    doctorHModel = new SeeDoctorHistory();
                if (createNew)
                {
                    doctorHModel.PERSONID = userEvent.FromUser;
                    doctorHModel.REMARK   = remark;
                    historyID             = doctorBLL.Add(doctorHModel);
                }
                else
                {
                    doctorHModel        = doctorBLL.GetOne(p => p.HISTORYID.Equals(historyID));
                    doctorHModel.REMARK = remark;
                    doctorBLL.Edit(doctorHModel);
                }

                foreach (FileUserArrange file in files)
                {
                    //申明参数
                    string _formId    = string.Empty;
                    string _modelName = string.Empty;
                    string _modelCode = string.Empty;
                    switch (file.Type)
                    {
                    case "0":
                        _modelName = "病历";
                        _modelCode = "SeeDoctorHistory";
                        break;

                    case "1":
                        _modelName = "实验室检查结果";
                        _modelCode = "LaboratoryResult";
                        break;

                    case "2":
                        _modelName = "影像学检查结果";
                        _modelCode = "ImageExamination";
                        break;

                    default:
                        break;
                    }

                    //获取数据
                    FileUpload model = bll.Get(p => p.FILEUPLOADID.Equals(file.FileId));
                    if (model == null)
                    {
                        return(Json(new { Result = "false", ID = "" }));
                    }

                    model.ModelCode = _modelCode;
                    model.ModelName = _modelName;
                    model.FormId    = historyID;
                    bll.Edit(model);
                }

                SendEvent(userEvent, historyID);
                return(Json(new { Result = "ok", ID = historyID, Uid = userEvent.FromUser }));
            }
            catch (Exception ex)
            {
                LogHelper.WriteError(ex.ToString());
                return(BadRequest(ex.Message));
            }
        }