示例#1
0
        /// <summary>
        /// 分诊
        /// </summary>
        /// <param name="trans"></param>
        /// <param name="assign"></param>
        /// <param name="TrigeWhereFlag">分诊标志 1.分到队列  2.分到诊台</param>
        /// <param name="error"></param>
        /// <returns></returns>
        public static int Triage(Neusoft.HISFC.Models.Nurse.Assign assign,
                                 string TrigeWhereFlag, ref string error)
        {
            Neusoft.HISFC.BizLogic.Nurse.Assign assignMgr = new Neusoft.HISFC.BizLogic.Nurse.Assign();

            Neusoft.HISFC.BizProcess.Integrate.Registration.Registration regMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Registration();

            try
            {
                //assignMgr.SetTrans(trans.Trans);
                //regMgr.SetTrans(trans.Trans);

                //1、获取队列最大看诊序号
                assign.SeeNO = assignMgr.Query((assign.Queue as Neusoft.FrameWork.Models.NeuObject));
                if (assign.SeeNO == -1)
                {
                    error = assignMgr.Err;
                    return(-1);
                }

                assign.SeeNO = assign.SeeNO + 1;
                //专家的直接取 时间段内的看诊序号
                //				if(neusoft.neNeusoft.HISFC.Components.Function.NConvert.ToInt32(assign.Register.IsPre) == 1)
                if (assign.Register.DoctorInfo.Templet.Doct.ID != null && assign.Register.DoctorInfo.Templet.Doct.ID != "")
                {
                    assign.SeeNO = assign.Register.DoctorInfo.SeeNO;
                }

                //2、插入分诊信息表
                if (assignMgr.Insert(assign) == -1)
                {
                    error = assignMgr.Err;
                    return(-1);
                }

                //3、更新挂号信息表,置分诊标志
                Neusoft.HISFC.BizLogic.Nurse.Assign a = new Neusoft.HISFC.BizLogic.Nurse.Assign();
                //a.SetTrans(trans.Trans);
                if (regMgr.Update(assign.Register.ID, Neusoft.FrameWork.Management.Connection.Operator.ID,
                                  a.GetDateTimeFromSysDateTime() /*regMgr.GetDateTimeFromSysDateTime()*/) == -1)
                {
                    error = regMgr.Err;
                    return(-1);
                }
                //4.队列数量增加1
                if (assignMgr.UpdateQueue(assign.Queue.ID, "1") == -1)
                {
                    error = assignMgr.Err;
                    return(-1);
                }
            }
            catch (Exception e)
            {
                error = e.Message;
                return(-1);
            }

            return(0);
        }
示例#2
0
        /// <summary>
        /// 取消分诊
        /// </summary>
        /// <param name="trans"></param>
        /// <param name="assign"></param>
        /// <param name="error"></param>
        /// <returns></returns>
        public static int CancelTriage(Neusoft.HISFC.Models.Nurse.Assign assign, ref string error)
        {
            Neusoft.HISFC.BizLogic.Nurse.Assign assignMgr = new Neusoft.HISFC.BizLogic.Nurse.Assign();

            Neusoft.HISFC.BizProcess.Integrate.Registration.Registration regMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Registration();

            try
            {
                //assignMgr.SetTrans(trans.Trans);
                //regMgr.SetTrans(trans.Trans);

                //删除分诊信息
                int rtn = assignMgr.Delete(assign);
                if (rtn == -1)//出错
                {
                    error = assignMgr.Err;
                    return(-1);
                }

                if (rtn == 0)
                {
                    error = "该分诊信息状态已经发生改变,请刷新屏幕!";
                    return(-1);
                }
                //恢复挂号信息的分诊状态
                rtn = regMgr.CancelTriage(assign.Register.ID);
                if (rtn == -1)
                {
                    error = regMgr.Err;
                    return(-1);
                }
                //4.队列数量-1
                if (assignMgr.UpdateQueue(assign.Queue.ID, "-1") == -1)
                {
                    error = assignMgr.Err;
                    return(-1);
                }
            }
            catch (Exception e)
            {
                error = e.Message;
                return(-1);
            }

            return(0);
        }
示例#3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Neusoft.FrameWork.Models.NeuObject roomObj = this.cmbRoom.SelectedItem;

            if (this.cmbRoom.Items.Count <= 0)
            {
                MessageBox.Show("请先维护诊室!", "提示");
                return;
            }
            if (roomObj == null)
            {
                MessageBox.Show("请选择分诊诊室!", "提示");
                this.cmbRoom.Focus();
                return;
            }
            Neusoft.FrameWork.Models.NeuObject consoleObj = this.cmbConsole.SelectedItem;

            if (this.cmbConsole.Items.Count <= 0)
            {
                MessageBox.Show("请先维护该诊室的诊台!", "提示");
                return;
            }
            if (consoleObj == null)
            {
                MessageBox.Show("请选择分诊诊台!", "提示");
                this.cmbConsole.Focus();
                return;
            }

            Neusoft.HISFC.BizLogic.Nurse.Assign assMgr = new Neusoft.HISFC.BizLogic.Nurse.Assign();

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction SQLCA = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //SQLCA.BeginTransaction();
            try
            {
                //assMgr.SetTrans(SQLCA.Trans);

                //int rtn = assMgr.Update(this.Assign.Register.ID, roomObj, consoleObj, assMgr.GetDateTimeFromSysDateTime());

                //if (rtn == -1)
                //{
                //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                //    MessageBox.Show(assMgr.Err, "提示");
                //    return;
                //}
                //if (rtn == 0)
                //{
                //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                //    MessageBox.Show("该患者分诊状态已经改变,请重新刷新屏幕!", "提示");
                //    return;
                //}
                //SQLCA.Commit();
            }
            catch (Exception error)
            {
                //Neusoft.FrameWork.Management.PublicTrans.RollBack();
                //MessageBox.Show(error.Message, "提示");
                //return;
            }

            this.FindForm().Close();
        }
示例#4
0
        private void neuButton1_Click(object sender, EventArgs e)
        {
            Neusoft.FrameWork.Models.NeuObject obj = this.cmbQueue.SelectedItem;

            if (obj == null)
            {
                MessageBox.Show("请选择分诊队列!", "提示");
                this.cmbQueue.Focus();
                return;
            }

            Neusoft.HISFC.BizProcess.Integrate.Manager deptMgr = new Neusoft.HISFC.BizProcess.Integrate.Manager();

            Neusoft.HISFC.Models.Nurse.Assign assgin    = new Neusoft.HISFC.Models.Nurse.Assign();
            Neusoft.HISFC.Models.Nurse.Queue  queueinfo = new Neusoft.HISFC.Models.Nurse.Queue();
            queueinfo = (Neusoft.HISFC.Models.Nurse.Queue) this.cmbQueue.SelectedItem;
            if (this.Register.DoctorInfo.Templet.Dept.ID != queueinfo.AssignDept.ID)
            {
            }


            #region 实体赋值
            assgin.Register = this.Register;

            if (obj.GetType() == typeof(Neusoft.HISFC.Models.Nurse.Queue))//队列
            {
                assgin.Queue = (Neusoft.HISFC.Models.Nurse.Queue)obj;
                //if (this.Regdoc_id != null && this.Regdoc_id != "")
                //{
                if (assgin.Queue.ExpertFlag == "1" && assgin.Register.DoctorInfo.Templet.RegLevel.IsExpert == false)
                {
                    if (MessageBox.Show("普通号进诊专家队列" + "是否继续?", "提示", MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                    {
                        return;
                    }
                }
                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(assgin.Queue.ExpertFlag) == assgin.Register.DoctorInfo.Templet.RegLevel.IsExpert && assgin.Queue.Doctor.ID != this.Regdoc_id)
                {
                    if (MessageBox.Show("选择医师与挂号医师不一致,是否继续", " ", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        return;
                    }
                }
                //}
                //if (this.Regdoc_id == null || this.Regdoc_id == "")
                //{
                if (assgin.Queue.ExpertFlag == "0" && assgin.Register.DoctorInfo.Templet.RegLevel.IsExpert == true)
                {
                    if (MessageBox.Show("专家挂号进诊普通队列" + "是否继续?", "提示", MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                    {
                        return;
                    }
                }
                //}
            }
            else
            {
                Neusoft.HISFC.Models.Registration.DoctSchema doct =
                    this.GetDoctor(obj.ID);
                //add by niuxy
                if (this.Regdoc_id != null && this.Regdoc_id != "")
                {
                    if (doct.ID != this.Regdoc_id)
                    {
                        if (MessageBox.Show("专家挂号进诊普通队列" + "是否继续?", "提示", MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            return;
                        }
                    }
                    {
                        if (MessageBox.Show("选择医师与挂号医师不一致,是否继续", " ", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                        {
                            return;
                        }
                    }
                }
                if (this.Regdoc_id == null || this.Regdoc_id == "")
                {
                    if (assgin.Queue.ExpertFlag == "1")
                    {
                        if (MessageBox.Show("普通号进诊专家队列" + "是否继续?", "提示", MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            return;
                        }
                    }
                }
                assgin.Queue.ID      = obj.ID;
                assgin.Queue.Name    = obj.Name;
                assgin.Queue.Dept.ID = doct.Dept;
                assgin.Queue.Doctor  = doct.Doctor;
                assgin.Queue.SRoom   = doct.Room;
            }
            Neusoft.HISFC.BizLogic.Nurse.Assign a = new Neusoft.HISFC.BizLogic.Nurse.Assign();
            assgin.TriageStatus = Neusoft.HISFC.Models.Nurse.EnuTriageStatus.Triage;
            //assgin.TriageDept = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Nurse.ID;
            assgin.TriageDept    = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Dept.ID;
            assgin.TirageTime    = a.GetDateTimeFromSysDateTime();                      // deptMgr.GetDateTimeFromSysDateTime();
            assgin.Oper.OperTime = assgin.TirageTime;
            assgin.Oper.ID       = Neusoft.FrameWork.Management.Connection.Operator.ID; // var.User.ID;
            assgin.Queue.Dept    = assgin.Register.DoctorInfo.Templet.Dept;

            #endregion

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();

            string error = "";

            if (Function.Triage(assgin, "1", ref error) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                #region {9EB5D321-AA03-435f-8581-F64F852D2656}
                MessageBox.Show("无法保存分诊信息,请刷新后重新分诊!", "提示");
                //MessageBox.Show(error, "提示");
                #endregion
                return;
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();

            if (this.OK != null)
            {
                this.OK(assgin);
            }

            this.FindForm().Close();
        }
示例#5
0
        /// <summary>
        /// 保存操作结果
        /// </summary>
        /// <return>0 success, -1 fail</return>
        public int Save()
        {
            this.neuSpread1.StopCellEditing();

            if (this.neuSpread1_Sheet1.RowCount <= 0)
            {
                MessageBox.Show("没有要保存的数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(-1);
            }



            if (this.Valid() == -1)
            {
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction SQLCA = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //SQLCA.BeginTransaction();

            this.seatMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            try
            {
                for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
                {
                    #region 界面生成实体
                    Neusoft.HISFC.Models.Nurse.Seat info = new Neusoft.HISFC.Models.Nurse.Seat();
                    info.ID              = this.neuSpread1_Sheet1.Cells[i, 0].Tag.ToString();
                    info.Name            = this.neuSpread1_Sheet1.GetValue(i, 0).ToString();
                    info.PRoom.InputCode = this.neuSpread1_Sheet1.GetValue(i, 1).ToString();
                    info.PRoom.ID        = this.neuSpread1_Sheet1.Cells[i, 2].Tag.ToString();
                    info.PRoom.Name      = this.neuSpread1_Sheet1.GetValue(i, 2).ToString();
                    //状态
                    string strTemp = "1";
                    if (this.neuSpread1_Sheet1.GetValue(i, 3).ToString().Trim() == "停用")
                    {
                        strTemp = "0";
                    }
                    info.PRoom.IsValid = strTemp;
                    //备注
                    string strMemo = this.neuSpread1_Sheet1.Cells[i, 4].Text.Trim();
                    if (strMemo == null)
                    {
                        strMemo = "";
                    }
                    info.Memo = strMemo;
                    //操作信息
                    info.Oper.ID       = this.seatMgr.Operator.ID;
                    info.Oper.OperTime = this.seatMgr.GetDateTimeFromSysDateTime();



                    #endregion

                    if (!Neusoft.FrameWork.Function.NConvert.ToBoolean(info.PRoom.IsValid))
                    {
                        Neusoft.HISFC.BizLogic.Nurse.Assign assMgr = new Neusoft.HISFC.BizLogic.Nurse.Assign();
                        assMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                        if (assMgr.ExistPatient(info.ID, assMgr.GetSysDateTime()))
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show(info.Name + " 有患者,不能将状态改为无效", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.neuSpread1_Sheet1.SetValue(i, 3, "在用");
                            return(-1);
                        }

                        //if (this.seatMgr.QuerySeatByConsoleID(info.ID) < 0)
                        //{

                        //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        //    MessageBox.Show(this.seatMgr.Err);
                        //    return -1;
                        //}
                        //if (this.seatMgr.QuerySeatByConsoleID(info.ID) > 0)
                        //{

                        //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        //    MessageBox.Show("该诊台正在使用不能置成无效");
                        //    return -1;
                        //}
                    }


                    if (this.seatMgr.Insert(info) == -1)
                    {
                        if (this.seatMgr.Update(info) == -1)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("保存失败!" + this.seatMgr.Err, "提示");
                            return(-1);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("保存失败!" + e.Message, "提示");
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show("保存成功!", "提示");

            this.SetFp();

            return(0);
        }