Esempio n. 1
0
        /// <summary>
        /// add a record to farpoint
        /// </summary>
        /// <param name="reg"></param>
        private void addRegister(Neusoft.HISFC.Models.Registration.Register reg)
        {
            this.fpSpread1_Sheet1.Rows.Add(this.fpSpread1_Sheet1.RowCount, 1);

            int cnt = this.fpSpread1_Sheet1.RowCount - 1;

            this.fpSpread1_Sheet1.SetValue(cnt, 0, reg.Name, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 1, reg.Sex.Name, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 2, reg.DoctorInfo.SeeDate.ToString(), false);
            this.fpSpread1_Sheet1.SetValue(cnt, 3, reg.DoctorInfo.Templet.Dept.Name, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 4, reg.DoctorInfo.Templet.RegLevel.Name, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 5, reg.DoctorInfo.Templet.Doct.Name, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 6, reg.RegLvlFee.RegFee, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 7, reg.RegLvlFee.OwnDigFee + reg.RegLvlFee.ChkFee + reg.RegLvlFee.OthFee, false);
            this.fpSpread1_Sheet1.SetValue(cnt, 8, reg.InvoiceNO, false);
            this.fpSpread1_Sheet1.Rows[cnt].Tag = reg;

            if (reg.IsSee)
            {
                this.fpSpread1_Sheet1.Rows[cnt].BackColor = Color.LightCyan;
            }
            if (reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Back ||
                reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Cancel)
            {
                this.fpSpread1_Sheet1.Rows[cnt].BackColor = Color.MistyRose;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 冲费用明细
 /// </summary>
 /// <param name="r">患者挂号信息</param>
 /// <param name="f">费用实体</param>
 /// <param name="cancelTime">作废时间</param>
 /// <param name="errText">错误信息</param>
 /// <returns></returns>
 private int CancelFeeItemList(Neusoft.HISFC.Models.Registration.Register r, FeeItemList f, DateTime cancelTime, ref string errText)
 {
     if (r.Pact.ID == "8")
     {
         ArrayList al = outPatientFee.QueryValidFeeDetailbyComoNOAndClinicCode(f.Order.Combo.ID, r.ID);
         if (al == null || al.Count == 0)
         {
             errText = "查询费用信息失败!";
             return(-1);
         }
         foreach (FeeItemList tempf in al)
         {
             if (CancelFeeItemList(tempf, cancelTime, ref errText) < 0)
             {
                 return(-1);
             }
         }
     }
     else
     {
         if (CancelFeeItemList(f, cancelTime, ref errText) < 0)
         {
             return(-1);
         }
     }
     return(1);
 }
Esempio n. 3
0
        /// <summary>
        /// 医生站直接收费
        /// </summary>
        /// <param name="r">患者挂号信息</param>
        /// <param name="feeItemLists">患者费用信息</param>
        /// <param name="FeeTime">收费时间</param>
        /// <param name="errText">错误信息</param>
        /// <returns>1成功 0普通患者不处理 -1失败</returns>
        public int DoctIdirectFee(Neusoft.HISFC.Models.Registration.Register r, System.Collections.ArrayList feeItemLists, DateTime FeeTime, ref string errText)
        {
            //普通患者
            if (r.Pact.ID == "6" || r.Pact.ID == "7" || r.Pact.ID == "8")
            {
                noFeeList = new ArrayList();
                feeList   = new ArrayList();
                //拆分记账费用
                bool bReturn = this.SplitFeeItemList(r, feeItemLists, ref errText);
                if (!bReturn)
                {
                    return(-1);
                }

                //记账费用直接收费
                if (noFeeList.Count > 0)
                {
                    if (!IdirectFee(r, FeeTime, ref errText))
                    {
                        return(-1);
                    }
                }
                //非记账费用划价
                if (feeList.Count > 0)
                {
                    if (!feeIntegrate.SetChargeInfo(r, feeList, FeeTime, ref errText))
                    {
                        return(-1);
                    }
                }
                return(1);
            }
            return(0);
        }
        /// <summary>
        /// 获取挂号科室和合同单位


        /// </summary>
        /// <param name="argRegister">返回的挂号实体</param>
        public int SetPactAndRegDept(ref Neusoft.HISFC.Models.Registration.Register argRegister)
        {
            Neusoft.HISFC.BizProcess.Integrate.Terminal.Result result = new Result();
            // 业务
            Neusoft.HISFC.BizProcess.Integrate.Terminal.Confirm confirmIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Terminal.Confirm();
            // 合同单位实体
            Neusoft.HISFC.Models.Base.PactInfo pact = new PactInfo();
            // 科室实体
            Neusoft.HISFC.Models.Base.Department dept = new Neusoft.HISFC.Models.Base.Department();

            // 获取合同单位信息
            result = confirmIntegrate.GetPact(ref pact, argRegister.Pact.ID);
            if (result != Result.Success)
            {
                Neusoft.FrameWork.Management.Language.Msg("获取合同单位失败。" + confirmIntegrate.Err);

                return(-1);
            }

            argRegister.Pact = pact;
            // 获取科室信息
            result = confirmIntegrate.GetDept(ref dept, argRegister.DoctorInfo.Templet.Dept.ID);
            if (result != Result.Success)
            {
                Neusoft.FrameWork.Management.Language.Msg("获取科室信息失败。" + confirmIntegrate.Err);

                return(-1);
            }
            argRegister.DoctorInfo.Templet.Dept = dept;

            return(1);
        }
Esempio n. 5
0
        public void GetBirthDay(Neusoft.HISFC.Models.Registration.Register Register)
        {
            DateTime dtBirth = Register.Birthday;
            DateTime dtNow   = confirmMgr.GetDateTimeFromSysDateTime();
            int      years   = 0;

            System.TimeSpan span = new TimeSpan(dtNow.Ticks - dtBirth.Ticks);

            years = span.Days / 365;

            if (years <= 0)
            {
                int month = span.Days / 30;

                if (month <= 0)
                {
                    textBoxAge.Text = span.Days.ToString() + "天";
                }
                else
                {
                    textBoxAge.Text = month.ToString() + "月";
                }
            }
            else
            {
                textBoxAge.Text = years.ToString();
            }
        }
Esempio n. 6
0
 /// <summary>
 /// 设置打印值
 /// </summary>
 /// <param name="register">挂号实体</param>
 /// <returns></returns>
 public int SetPrintValue(Neusoft.HISFC.Models.Registration.Register register)
 {
     try
     {
         this.InitReceipt();
         //门诊号
         this.lblCardNo.Text = register.PID.CardNO;
         //挂号科室
         this.lblDeptName.Text = register.DoctorInfo.Templet.Dept.Name;
         //号别
         this.lblRegLevel.Text = register.DoctorInfo.Templet.RegLevel.Name;
         //姓名
         this.lblPatientName.Text = register.Name;
         //挂号员号
         this.lblRegOper.Text = register.InputOper.ID;
         //小记
         this.lblCostsum.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
             register.PubCost + register.PayCost + register.OwnCost, 2) +
                                "元";
         //大写
         this.lblUpperCostSum.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(
             register.PubCost + register.PayCost + register.OwnCost
             );
         //挂号日期
         this.lblRegDate.Text = register.DoctorInfo.SeeDate.ToShortDateString();
         //医疗类别
         this.lblPactName.Text = register.Pact.Name;
         //挂号费
         this.lblRegFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
             register.RegLvlFee.RegFee, 2) +
                               "元";
         //诊察费
         this.lblChkFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
             register.RegLvlFee.ChkFee + register.RegLvlFee.PubDigFee + register.RegLvlFee.OwnDigFee, 2) +
                               "元";
         //病历手册 暂无 留空
         this.lblCaseBookCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
             0m, 2) +
                                     "元";
         //控制根据打印和预览显示选项
         if (IsPreview)
         {
             SetToPreviewMode();
         }
         else
         {
             SetToPrintMode();
         }
     }
     catch (Exception ex)
     {
         return(-1);
     }
     return(0);
 }
 /// <summary>
 /// 清空界面
 /// </summary>
 private void Clear()
 {
     this.ucPatientInformation.Register = null;
     if (this.neuSpread1_Sheet1.RowCount > 0)
     {
         this.neuSpread1_Sheet1.RemoveRows(0, this.neuSpread1_Sheet1.RowCount);
     }
     if (this.neuSpread2_Sheet1.RowCount > 0)
     {
         this.neuSpread2_Sheet1.RemoveRows(0, this.neuSpread2_Sheet1.RowCount);
     }
 }
        /// <summary>
        /// 在患者病历号回车检索明细
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ucPatientInformation_KeyDownInQureyCode(object sender, KeyEventArgs e)
        {
            // 检索码
            string queryCode = "";

            // 患者信息

            Neusoft.HISFC.Models.Registration.Register queryRegister = new Register();
            // 患者姓名确认

            Terminal.Confirm.frmPatientName frmPatient = new frmPatientName();
            // 操作结果
            Neusoft.HISFC.BizProcess.Integrate.Terminal.Result result = new Result();
            // 执行检索

            #region 门诊病历号

            //{6FC43DF1-86E1-4720-BA3F-356C25C74F16}
            #region 账户新增
            queryCode = this.ucPatientInformation.textBoxCode.Text.Trim();
            Neusoft.HISFC.Models.Account.AccountCard accountCard = new Neusoft.HISFC.Models.Account.AccountCard();
            if (feeIntegrate.ValidMarkNO(queryCode, ref accountCard) > 0)
            {
                queryCode = accountCard.Patient.PID.CardNO;
            }
            else
            {
                queryCode = this.ucPatientInformation.textBoxCode.Text.PadLeft(10, '0');
                // 显示填充后的病历号
            }

            #endregion

            //queryCode = this.ucPatientInformation.textBoxCode.Text.PadLeft(10, '0');
            // 显示填充后的病历号

            this.ucPatientInformation.textBoxCode.Text = queryCode;
            // 根据病历号从申请单获取患者基本信息
            result = confirmIntegrate.GetOutpatientByCardNOFromRegister(ref queryRegister, queryCode);
            if (result == Neusoft.HISFC.BizProcess.Integrate.Terminal.Result.Success)
            {
                this.ucPatientInformation.Register = queryRegister;
                //查询患者终端已确认信息并插入到sheet1
                this.QueryConfirmInfo(queryRegister.PID.CardNO);
            }
            else
            {
                MessageBox.Show("查找患者挂号信息失败!");
                this.ucPatientInformation.Focus();
            }
            #endregion
        }
Esempio n. 9
0
 /// <summary>
 /// 拆分记账费用
 /// </summary>
 /// <param name="r">患者挂号信息</param>
 /// <param name="FeeItemList">费用信息</param>
 /// <param name="nofeeList">记账费用</param>
 /// <param name="feeList">收费项目</param>
 /// <returns></returns>
 private bool SplitFeeItemList(Neusoft.HISFC.Models.Registration.Register r, ArrayList feeItemLists, ref string errText)
 {
     Neusoft.HISFC.Models.Base.PactItemRate pRate = null;
     foreach (FeeItemList f in feeItemLists)
     {
         //城镇医疗
         if (r.Pact.ID == "6" || r.Pact.ID == "7")
         {
             if (f.Item.ItemType == EnumItemType.Drug)
             {
                 Neusoft.HISFC.Models.Pharmacy.Item item = pharmarcyManager.GetItem(f.Item.ID);
                 if (item == null)
                 {
                     errText = "查询药品项目失败!" + pharmarcyManager.Err;
                     return(false);
                 }
                 if (item.SpecialFlag == "1")
                 {
                     pRate = pactItemRate.GetOnepPactUnitItemRateByItem(r.Pact.ID, f.Item.ID);
                     if (pRate != null && pRate.Rate.PubRate == 1)
                     {
                         f.FT.PayCost = 0;
                         f.FT.PubCost = f.FT.OwnCost;
                         f.FT.OwnCost = 0;
                         noFeeList.Add(f);
                     }
                     else
                     {
                         feeList.Add(f);
                     }
                 }
                 else
                 {
                     feeList.Add(f);
                 }
             }
             else
             {
                 feeList.Add(f);
             }
         }
         //美的全部记账
         if (r.Pact.ID == "8")
         {
             f.FT.PayCost = 0;
             f.FT.PubCost = f.FT.OwnCost;
             f.FT.OwnCost = 0;
             noFeeList.Add(f);
         }
     }
     return(true);
 }
Esempio n. 10
0
        /// <summary>
        /// 作废已确认的医嘱
        /// </summary>
        /// <returns></returns>
        private int CancelOrderConfirm(Neusoft.HISFC.Models.Registration.Register r, FeeItemList f, DateTime cancelTime, ref string errText)
        {
            if (f.NoBackQty != f.Item.Qty)
            {
                if (f.Item.ItemType == EnumItemType.Drug)
                {
                    errText = f.Item.Name + "已发药,请终端将药品全部后再作废医嘱!";
                    return(-1);
                }
                else
                {
                    errText = f.Item.Name + "终端已确认,请取消确认后再作废医嘱!";
                    return(-1);
                }
            }
            #region 冲费用明细

            if (CancelFeeItemList(r, f, cancelTime, ref errText) < 0)
            {
                return(-1);
            }
            #endregion

            #region 作废退费申请数据
            ArrayList al = returnApplyManager.QueryReturnApplys(f.Patient.PID.CardNO, f.RecipeNO, f.SequenceNO, "1");
            if (al == null)
            {
                errText = "查询退费申请数据失败!" + returnApplyManager.Err;
                return(-1);
            }

            foreach (Neusoft.HISFC.Models.Fee.ReturnApply returnApply in al)
            {
                returnApply.CancelType          = CancelTypes.Valid;
                returnApply.CancelOper.ID       = outPatientFee.Operator.ID;
                returnApply.CancelOper.OperTime = cancelTime;
                if (returnApplyManager.UpdateApplyCharge(returnApply) <= 0)
                {
                    errText = "更新申请表退费标记失败!" + returnApplyManager.Err;
                    return(-1);
                }
            }
            #endregion

            return(1);
        }
Esempio n. 11
0
        //{7E7ED83C-8A9D-4277-827A-4D8CB478FDDA}
        protected override int OnPrint(object sender, object neuObject)
        {
            Neusoft.HISFC.Models.Registration.Register reg = (Neusoft.HISFC.Models.Registration.Register) this.fpSpread1_Sheet1.Rows[this.fpSpread1_Sheet1.ActiveRowIndex].Tag;

            reg = this.regMgr.GetByClinic(reg.ID);
            if (this.ValidCardNO(reg.PID.CardNO) < 0)
            {
                return(-1);
            }
            //出错
            if (reg == null || reg.ID == null || reg.ID == "")
            {
                MessageBox.Show(this.regMgr.Err, "提示");
                return(-1);
            }

            //使用,不能作废
            //{05E82D53-9B25-44b1-902E-36F8FF4F50F3}
            //{182DA62D-6BCE-4c4c-956F-6F2A363138A0}
            //if ((reg.IsSee || reg.IsFee) && !this.isSeeedCanCancelRegInfo)
            if (reg.IsSee && !this.isSeeedCanCancelRegInfo)
            {
                MessageBox.Show("该号已经看诊,不能作废!", "提示");
                return(-1);
            }

            //是否已经退号
            if (reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Back)
            {
                MessageBox.Show("该挂号记录已经退号,不能再次退号!", "提示");
                return(-1);
            }

            //是否已经作废
            if (reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Cancel)
            {
                MessageBox.Show("该挂号记录已经作废,不能进行退号!", "提示");
                return(-1);
            }

            this.Print(reg);

            return(1);
        }
Esempio n. 12
0
        //{B700292D-50A6-4cdf-8B03-F556F990BB9B}
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="regObj"></param>
        private void Print(Neusoft.HISFC.Models.Registration.Register regObj)
        {
            Neusoft.HISFC.BizProcess.Interface.Registration.IRegPrint regprint = null;
            regprint = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.Registration.IRegPrint)) as Neusoft.HISFC.BizProcess.Interface.Registration.IRegPrint;

            if (regprint == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("打印票据失败,请在报表维护中维护退号票"));
            }
            else
            {
                if (regObj.IsEncrypt)
                {
                    regObj.Name = Neusoft.FrameWork.WinForms.Classes.Function.Decrypt3DES(regObj.NormalName);
                }

                regprint.SetPrintValue(regObj);
                regprint.Print();
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 显示应退挂号金额
        /// </summary>
        /// <param name="row"></param>
        private void SetReturnFee(int row)
        {
            if (this.fpSpread1_Sheet1.RowCount <= 0)
            {
                return;
            }

            Neusoft.HISFC.Models.Registration.Register obj = (Neusoft.HISFC.Models.Registration.Register) this.fpSpread1_Sheet1.Rows[row].Tag;

            if (obj == null)
            {
                return;
            }

            decimal ownCost = 0;

            //病例本处理
            //{F3258E87-7BCC-411a-865E-A9843AD2C6DD}
            if (this.otherFeeType == "1" && !this.chbQuitFeeBookFee.Checked) //不退病例本
            {
                ownCost = obj.OwnCost - obj.RegLvlFee.OthFee;                //减去病历本
            }

            //{DA67A335-E85E-46e1-A672-4DB409BCC11B}
            //帐户处理
            if (!IsQuitAccount)
            {
                if (this.otherFeeType == "1" && !this.chbQuitFeeBookFee.Checked) //不退病例本
                {
                    ownCost = obj.OwnCost - obj.RegLvlFee.OthFee + obj.PayCost;  //减去病历本
                }
                else
                {
                    ownCost = obj.OwnCost + obj.PayCost;
                }
            }


            this.lbTot.Text    = Convert.ToString(obj.OwnCost + obj.PayCost + obj.PubCost);
            this.lbReturn.Text = ownCost.ToString();
        }
Esempio n. 14
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        private int save()
        {
            #region 验证
            if (this.fpSpread1_Sheet1.RowCount == 0)
            {
                MessageBox.Show("没有可退挂号记录!", "提示");
                return(-1);
            }

            int row = this.fpSpread1_Sheet1.ActiveRowIndex;

            if (MessageBox.Show("是否要作废该挂号信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return(-1);
            }

            //实体
            Neusoft.HISFC.Models.Registration.Register reg = (Neusoft.HISFC.Models.Registration.Register) this.fpSpread1_Sheet1.Rows[row].Tag;

            #endregion

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

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(this.regMgr.con);
            //t.BeginTransaction();

            this.regMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            this.schMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            this.feeMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            //this.assMgr.SetTrans(t.Trans);

            int rtn;
            Neusoft.HISFC.BizLogic.Registration.EnumUpdateStatus flag = Neusoft.HISFC.BizLogic.Registration.EnumUpdateStatus.Cancel;

            try
            {
                DateTime current = this.regMgr.GetDateTimeFromSysDateTime();


                //重新获取患者实体,防止并发

                reg = this.regMgr.GetByClinic(reg.ID);
                if (this.ValidCardNO(reg.PID.CardNO) < 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return(-1);
                }
                //出错
                if (reg == null || reg.ID == null || reg.ID == "")
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(this.regMgr.Err, "提示");
                    return(-1);
                }

                //使用,不能作废
                //{05E82D53-9B25-44b1-902E-36F8FF4F50F3}
                //{182DA62D-6BCE-4c4c-956F-6F2A363138A0}
                //if ((reg.IsSee || reg.IsFee) && !this.isSeeedCanCancelRegInfo)
                if (reg.IsSee && !this.isSeeedCanCancelRegInfo)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("该号已经看诊,不能作废!", "提示");
                    return(-1);
                }

                //是否已经退号
                if (reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Back)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("该挂号记录已经退号,不能再次退号!", "提示");
                    return(-1);
                }

                //是否已经作废
                if (reg.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Cancel)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("该挂号记录已经作废,不能进行退号!", "提示");
                    return(-1);
                }

                #region 判断是不是门诊帐户患者
                decimal vacancy      = 0;
                bool    isAccountPay = false;
                string  accountNO    = string.Empty;
                if (!isFree)
                {
                    int result = this.feeMgr.GetAccountVacancy(reg.PID.CardNO, ref vacancy, ref accountNO);
                    if (result < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(this.feeMgr.Err);
                        return(-1);
                    }
                    if (result > 0)
                    {
                        DialogResult digResult = MessageBox.Show("该患者存在账户,是否退费入户?", "提示", MessageBoxButtons.YesNo);
                        if (digResult == DialogResult.Yes)
                        {
                            if (!feeMgr.CheckAccountPassWord(reg))
                            {
                                return(-1);
                            }
                            isAccountPay = true;
                        }
                    }
                }

                #endregion
                //{5839C7FC-8162-4586-8473-B5F26C018DDE}
                //if (reg.InputOper.ID == regMgr.Operator.ID && reg.BalanceOperStat.IsCheck == false && result == 0  )
                //{
                //    #region 作废
                //    #endregion
                //}
                //else
                //{
                #region 退号
                Neusoft.HISFC.Models.Registration.Register objReturn = reg.Clone();
                objReturn.RegLvlFee.ChkFee    = -reg.RegLvlFee.ChkFee;    //检查费
                objReturn.RegLvlFee.OwnDigFee = -reg.RegLvlFee.OwnDigFee; //侦察费


                objReturn.RegLvlFee.OthFee = -reg.RegLvlFee.OthFee; //其他费
                objReturn.RegLvlFee.RegFee = -reg.RegLvlFee.RegFee; //挂号费
                if (isAccountPay)                                   //退到账户中
                {
                    objReturn.PayCost = -(reg.OwnCost + reg.PayCost);
                    objReturn.OwnCost = 0;
                }
                else
                {
                    objReturn.PayCost = 0;
                    objReturn.OwnCost = -(reg.OwnCost + reg.PayCost);
                }
                objReturn.PubCost = -reg.PubCost;
                objReturn.BalanceOperStat.IsCheck = false;    //是否结算
                objReturn.BalanceOperStat.ID      = "";
                objReturn.BalanceOperStat.Oper.ID = "";
                //objReturn.BeginTime = DateTime.MinValue;
                objReturn.CheckOperStat.IsCheck = false;                                           //是否核查
                objReturn.Status              = Neusoft.HISFC.Models.Base.EnumRegisterStatus.Back; //退号
                objReturn.InputOper.OperTime  = current;                                           //操作时间
                objReturn.InputOper.ID        = regMgr.Operator.ID;                                //操作人
                objReturn.CancelOper.ID       = regMgr.Operator.ID;                                //退号人
                objReturn.CancelOper.OperTime = current;                                           //退号时间
                //{F3258E87-7BCC-411a-865E-A9843AD2C6DD}
                //objReturn.OwnCost = -reg.OwnCost;//自费
                //objReturn.PayCost = -reg.PayCost;
                objReturn.PubCost = -reg.PubCost;
                //病历本本费处理
                //{F3258E87-7BCC-411a-865E-A9843AD2C6DD}
                if (this.otherFeeType == "1" && !this.chbQuitFeeBookFee.Checked)
                {
                    objReturn.OwnCost          = objReturn.OwnCost - objReturn.RegLvlFee.OthFee;
                    objReturn.RegLvlFee.OthFee = 0;
                }

                objReturn.TranType = Neusoft.HISFC.Models.Base.TransTypes.Negative;

                if (isAccountPay)
                {
                    objReturn.AccountNO = accountNO;
                }

                if (this.regMgr.Insert(objReturn) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(this.regMgr.Err, "提示");
                    return(-1);
                }
                if (isAccountPay)
                {
                    string deptCode = (regMgr.Operator as Neusoft.HISFC.Models.Base.Employee).Dept.ID;
                    rtn = feeMgr.AccountCancelPay(objReturn, objReturn.PayCost, objReturn.InvoiceNO, deptCode, "R");
                    if (rtn < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("退费入户失败!" + feeMgr.Err);
                        return(-1);
                    }
                }
                flag = Neusoft.HISFC.BizLogic.Registration.EnumUpdateStatus.Return;

                #endregion
                //}

                reg.CancelOper.ID       = regMgr.Operator.ID;
                reg.CancelOper.OperTime = current;

                //更新原来项目为作废
                rtn = this.regMgr.Update(flag, reg);
                if (rtn == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(this.regMgr.Err, "提示");
                    return(-1);
                }
                if (rtn == 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("该挂号信息状态已经变更,请重新检索数据!", "提示");
                    return(-1);
                }

                //取消分诊4.5
                //if (this.assMgr.Delete(reg.ID) == -1)
                //{
                //    t.RollBack();
                //    MessageBox.Show("删除分诊信息出错!" + this.assMgr.Err, "提示");
                //    return -1;
                //}

                #region 恢复限额
                //恢复原来排班限额
                //如果原来更新限额,那么恢复限额
                if (reg.DoctorInfo.Templet.ID != null && reg.DoctorInfo.Templet.ID != "")
                {
                    //现场号、预约号、特诊号

                    bool IsReged = false, IsTeled = false, IsSped = false;

                    if (reg.RegType == Neusoft.HISFC.Models.Base.EnumRegType.Pre)
                    {
                        IsTeled = true; //预约号
                    }
                    else if (reg.RegType == Neusoft.HISFC.Models.Base.EnumRegType.Reg)
                    {
                        IsReged = true;//现场号
                    }
                    else
                    {
                        IsSped = true;//特诊号
                    }

                    rtn = this.schMgr.Reduce(reg.DoctorInfo.Templet.ID, IsReged, false, IsTeled, IsSped);
                    if (rtn == -1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(this.schMgr.Err, "提示");
                        return(-1);
                    }

                    if (rtn == 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("已无排班信息,无法恢复限额!", "提示");
                        return(-1);
                    }
                }
                #endregion


                long returnValue = 0;
                Neusoft.HISFC.Models.Registration.Register myYBregObject = reg.Clone();
                this.medcareInterfaceProxy.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                this.medcareInterfaceProxy.SetPactCode(reg.Pact.ID);
                //初始化医保dll
                returnValue = this.medcareInterfaceProxy.Connect();
                if (returnValue == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    this.medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("初始化失败") + this.medcareInterfaceProxy.ErrMsg);
                    return(-1);
                }
                //读卡取患者信息
                returnValue = this.medcareInterfaceProxy.GetRegInfoOutpatient(myYBregObject);
                if (returnValue == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    this.medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("读取患者信息失败") + this.medcareInterfaceProxy.ErrMsg);
                    return(-1);
                }
                //医保信息赋值
                reg.SIMainInfo = myYBregObject.SIMainInfo;
                //退号
                reg.User01 = "-1";    //退号借用
                //错误的调用了挂号方法{719DEE22-E3E3-4d3c-8711-829391BEA73C} by GengXiaoLei
                //returnValue = this.medcareInterfaceProxy.UploadRegInfoOutpatient(reg);
                returnValue = this.medcareInterfaceProxy.CancelRegInfoOutpatient(reg);
                if (returnValue == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    this.medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("患者退号失败") + this.medcareInterfaceProxy.ErrMsg);
                    return(-1);
                }
                returnValue = this.medcareInterfaceProxy.Commit();
                if (returnValue == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    this.medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("患者退号提交失败") + this.medcareInterfaceProxy.ErrMsg);
                    return(-1);
                }
                this.medcareInterfaceProxy.Disconnect();


                Neusoft.FrameWork.Management.PublicTrans.Commit();
            }
            catch (Exception e)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("退号出错!" + e.Message, "提示");
                return(-1);
            }

            this.fpSpread1_Sheet1.Rows.Remove(row, 1);
            //如果已经打印发票,提示收回发票
            MessageBox.Show("退号成功!", "提示");

            //{B700292D-50A6-4cdf-8B03-F556F990BB9B}
            if (this.IsPrintBackBill)
            {
                //打印推退号票
                this.Print(reg);
            }
            this.Clear();

            return(0);
        }
 /// <summary>
 /// 设置Register
 /// </summary>
 /// <param name="argRegister">传入的register</param>
 public void SetAllRegister(Neusoft.HISFC.Models.Registration.Register argRegister)
 {
     this.Register = argRegister;
     this.ucPatientInformation.Register = argRegister;
 }
Esempio n. 16
0
        /// <summary>
        /// 设置打印值
        /// </summary>
        /// <param name="register">挂号实体</param>
        /// <returns></returns>
        public int SetPrintValue(Neusoft.HISFC.Models.Registration.Register register)
        {
            this.lblHosptialName.Text = manageIntegrate.GetHospitalName();

            MessageBox.Show("请记录门诊号:" + register.PID.CardNO);
            try
            {
                this.InitReceipt();
                //门诊号
                this.lblCardNo.Text = register.PID.CardNO;
                //挂号科室
                this.lblDeptName.Text = register.DoctorInfo.Templet.Dept.Name;
                //号别
                this.lblRegLevel.Text = register.DoctorInfo.Templet.RegLevel.Name;
                //挂号发票号
                this.lblInvoiceno.Text = register.InvoiceNO;
                //姓名
                this.lblPatientName.Text = register.Name;
                //挂号员号
                this.lblRegOper.Text = register.InputOper.ID;
                //小记
                this.lblCostsum.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                    register.PubCost + register.PayCost + register.OwnCost, 2) +
                                       "元";
                //大写
                this.lblUpperCostSum.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(
                    register.PubCost + register.PayCost + register.OwnCost
                    );
                //挂号日期
                this.lblRegDate.Text = register.DoctorInfo.SeeDate.ToString();
                string medicalTypeName = string.Empty;

                //this.lblPayCostTitle.Visible = false;
                //this.lblOwnCostTitle.Visible = false;
                //this.lblIndividualBalanceTitle.Visible = false;
                //register.Pact.ID = "2";

                //医疗类别
                this.lblPactName.Text = register.Pact.Name + medicalTypeName;

                //挂号费
                this.lblRegFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                    register.RegLvlFee.RegFee, 2) +
                                      "元";
                //诊察费
                this.lblChkFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                    register.RegLvlFee.ChkFee + register.RegLvlFee.PubDigFee + register.RegLvlFee.OwnDigFee, 2) +
                                      "元";
                //病历手册
                this.lblOherFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                    register.RegLvlFee.OthFee, 2) +
                                       "元";
                //控制根据打印和预览显示选项
                if (IsPreview)
                {
                    SetToPreviewMode();
                }
                else
                {
                    SetToPrintMode();
                }
            }
            catch (Exception ex)
            {
                return(-1);
            }
            return(0);
        }
Esempio n. 17
0
        /// <summary>
        ///直接收费
        /// </summary>
        /// <returns></returns>
        private bool IdirectFee(Neusoft.HISFC.Models.Registration.Register r, DateTime FeeTime, ref string errText)
        {
            //删除申请数据
            #region  除申请表
            ArrayList drugLists  = new ArrayList();
            ArrayList undrugList = new ArrayList();
            Dictionary <string, string> dicRecipe = new Dictionary <string, string>();
            string keyStr = string.Empty;
            foreach (FeeItemList f in noFeeList)
            {
                if (f.Item.ItemType == EnumItemType.Drug)
                {
                    #region  除药品申请表数据

                    if (!f.IsConfirmed)
                    {
                        if (!f.Item.IsNeedConfirm)
                        {
                            if (string.IsNullOrEmpty(f.RecipeNO))
                            {
                                if (pharmarcyManager.DelApplyOut(f.RecipeNO, f.SequenceNO.ToString()) < 0)
                                {
                                    errText = "删除发药申请信息细失败!" + confirmIntegrate.Err;
                                    return(false);
                                }


                                keyStr = f.RecipeNO + "||" + f.ExecOper.Dept.ID;
                                if (!dicRecipe.ContainsKey(keyStr))
                                {
                                    dicRecipe.Add(keyStr, f.ExecOper.Dept.ID);
                                }
                                else
                                {
                                    if (dicRecipe[keyStr] != f.ExecOper.Dept.ID)
                                    {
                                        dicRecipe.Add(keyStr, f.ExecOper.Dept.ID);
                                    }
                                }
                                drugLists.Add(f);
                            }
                        }
                    }
                    #endregion
                }
                else
                {
                    #region  除非药品申请表数据
                    if (!f.IsConfirmed)
                    {
                        if (f.Item.IsNeedConfirm)
                        {
                            if (f.Order.ID == null || f.Order.ID == string.Empty)
                            {
                                f.Order.ID = orderManager.GetNewOrderID();
                            }
                            if (f.Order.ID == null || f.Order.ID == string.Empty)
                            {
                                errText = "获得医嘱流水号出错!";

                                return(false);
                            }

                            if (confirmIntegrate.DelTecApply(f.RecipeNO, f.SequenceNO.ToString()) < 0)
                            {
                                errText = "删除终端申请信息失败!" + confirmIntegrate.Err;
                                return(false);
                            }
                            undrugList.Add(f);
                        }
                    }
                    #endregion
                }
            }
            #endregion

            #region  除药品调剂头表
            foreach (string strKey in dicRecipe.Keys)
            {
                string recipeNO = strKey.Substring(0, strKey.IndexOf("||"));

                if (pharmarcyManager.DeleteDrugStoRecipe(recipeNO, dicRecipe[strKey]) < 0)
                {
                    errText = "删除调剂头表信息失败!" + pharmarcyManager.Err;
                    return(false);
                }
            }
            #endregion

            #region 收费
            //划价
            if (!feeIntegrate.SetChargeInfo(r, noFeeList, FeeTime, ref errText))
            {
                return(false);
            }
            //更新收费标记
            string operCode = outPatientFee.Operator.ID;
            foreach (FeeItemList f in noFeeList)
            {
                f.FeeOper.OperTime = FeeTime;
                f.FeeOper.ID       = operCode;
                f.PayType          = PayTypes.Balanced;
                if (outPatientFee.UpdateFeeDetailFeeFlag(f) <= 0)
                {
                    errText = "更新费用明细失败!" + outPatientFee.Err;
                    return(false);
                }
            }
            #endregion

            #region 插入药品申请表
            string drugSendInfo = null;
            //插入发药申请信息,返回发药窗口,显示在发票上
            if (drugLists.Count > 0)
            {
                foreach (FeeItemList f in drugLists)
                {
                    if (((Register)f.Patient).DoctorInfo.Templet.Doct.ID == null || ((Register)f.Patient).DoctorInfo.Templet.Doct.ID == string.Empty)
                    {
                        ((Register)f.Patient).DoctorInfo.Templet.Doct = this.outPatientFee.Operator;
                    }
                }

                int iReturn = pharmarcyManager.ApplyOut(r, drugLists, string.Empty, FeeTime, false, out drugSendInfo);
                if (iReturn == -1)
                {
                    errText = "处理药品明细失败!" + pharmarcyManager.Err;

                    return(false);
                }
            }
            #endregion

            #region 插入终端项目申请
            foreach (FeeItemList f in undrugList)
            {
                Neusoft.HISFC.BizProcess.Integrate.Terminal.Result result = confirmIntegrate.ServiceInsertTerminalApply(f, r);

                if (result != Neusoft.HISFC.BizProcess.Integrate.Terminal.Result.Success)
                {
                    errText = "处理终端申请确认表失败!" + confirmIntegrate.Err;

                    return(false);
                }
            }
            #endregion

            return(true);
        }
Esempio n. 18
0
        /// <summary>
        /// 作废未确认的医嘱项目
        /// </summary>
        /// <param name="f"></param>
        /// <param name="cancelTime"></param>
        /// <param name="errText"></param>
        /// <returns></returns>
        private int CancelOrderNOConfirm(Neusoft.HISFC.Models.Registration.Register r, FeeItemList f, DateTime cancelTime, ref string errText)
        {
            if (f.NoBackQty == 0)
            {
                if (f.Item.ItemType == EnumItemType.Drug)
                {
                    errText = f.Item.Name + "已发药,请终端审核后再作废医嘱!";
                    return(-1);
                }
                else
                {
                    errText = f.Item.Name + "终端已确认,请取消确认后再作废医嘱!";
                    return(-1);
                }
            }

            #region 冲费用明细
            if (CancelFeeItemList(r, f, cancelTime, ref errText) < 0)
            {
                return(-1);
            }
            #endregion

            #region  除申请数据
            if (f.Item.ItemType == EnumItemType.Drug)
            {
                #region  除药品申请表数据

                if (!f.IsConfirmed)
                {
                    if (!f.Item.IsNeedConfirm)
                    {
                        if (pharmarcyManager.CancelApplyOutClinic(f.RecipeNO, f.SequenceNO) < 0)
                        {
                            errText = "作废药房发药申请失败!" + pharmarcyManager.Err;
                            return(-1);
                        }
                    }
                }
                #endregion
            }
            else
            {
                #region  除非药品申请表数据
                if (!f.IsConfirmed)
                {
                    if (f.Item.IsNeedConfirm)
                    {
                        if (f.Order.ID == null || f.Order.ID == string.Empty)
                        {
                            f.Order.ID = orderManager.GetNewOrderID();
                        }
                        if (f.Order.ID == null || f.Order.ID == string.Empty)
                        {
                            errText = "获得医嘱流水号出错!";

                            return(-1);
                        }

                        if (confirmIntegrate.DelTecApply(f.RecipeNO, f.SequenceNO.ToString()) < 0)
                        {
                            errText = "删除终端申请信息失败!" + confirmIntegrate.Err;
                            return(-1);
                        }
                    }
                }
                #endregion
            }
            #endregion

            return(1);
        }
Esempio n. 19
0
        /// <summary>
        /// 设置打印值
        /// </summary>
        /// <param name="register">挂号实体</param>
        /// <returns></returns>
        public int SetPrintValue(Neusoft.HISFC.Models.Registration.Register register)
        {
            /// <summary>
            /// 控制参数业务层--{C6BACB66-61EF-4d55-B93D-00E8C8F1C2CA}
            /// </summary>
            Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam controlParamIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Common.ControlParam();
            bool RegCostStyle = controlParamIntegrate.GetControlParam <bool>(Neusoft.HISFC.BizProcess.Integrate.Const.REG_COST_STYLE, false, false);



            this.lblHosptialName.Text  = manageIntegrate.GetHospitalName();
            this.lblHosptialName1.Text = manageIntegrate.GetHospitalName();
            this.lblHosptialName2.Text = manageIntegrate.GetHospitalName();

            //MessageBox.Show("请记录门诊号:"+register.PID.CardNO);
            try
            {
                this.InitReceipt();

                //挂号费---{C6BACB66-61EF-4d55-B93D-00E8C8F1C2CA}
                //if (RegCostStyle)//免费号
                //{
                //    this.lblRegFee.Text = "免费号";
                //}
                //else //收费号
                //{
                //    this.lblRegFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                //        register.RegLvlFee.RegFee, 2) +
                //        "元";
                //}

                //诊察费
                //挂号费---{C6BACB66-61EF-4d55-B93D-00E8C8F1C2CA}
                if (RegCostStyle)//免费号
                {
                    this.neuLabel5.Text  = "免费号";
                    this.lblChkFee.Text  = "免费号";
                    this.neuLabel28.Text = "免费号";
                }
                else //收费号
                {
                    this.neuLabel5.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                        register.RegLvlFee.ChkFee + register.RegLvlFee.PubDigFee + register.RegLvlFee.OwnDigFee, 2) +
                                          "元";
                    this.lblChkFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                        register.RegLvlFee.ChkFee + register.RegLvlFee.PubDigFee + register.RegLvlFee.OwnDigFee, 2) +
                                          "元";
                    this.neuLabel28.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                        register.RegLvlFee.ChkFee + register.RegLvlFee.PubDigFee + register.RegLvlFee.OwnDigFee, 2) +
                                           "元";
                }


                //医生名称
                this.lblDocName.Text  = register.DoctorInfo.Templet.Doct.Name;
                this.lblDocName1.Text = register.DoctorInfo.Templet.Doct.Name;
                this.lblDocName2.Text = register.DoctorInfo.Templet.Doct.Name;
                //挂号日期
                this.lblRegDate.Text  = register.DoctorInfo.SeeDate.ToString();
                this.lblRegDate1.Text = register.DoctorInfo.SeeDate.ToString();
                this.lblRegDate2.Text = register.DoctorInfo.SeeDate.ToString();
                //挂号员号
                this.lblRegOper.Text  = register.InputOper.ID;
                this.lblRegOper1.Text = register.InputOper.ID;
                this.lblRegOper2.Text = register.InputOper.ID;

                //流水号
                this.lblOrderNo.Text  = register.OperSeq;//.OrderNO.ToString();
                this.lblOrderNo1.Text = register.OperSeq;
                this.lblOrderNo2.Text = register.OperSeq;

                //就诊号+午别
                this.lblSeeNo.Text  = register.DoctorInfo.SeeNO.ToString() + "  " + register.DoctorInfo.Templet.Noon.Name;
                this.lblSeeNo1.Text = register.DoctorInfo.SeeNO.ToString() + "  " + register.DoctorInfo.Templet.Noon.Name;
                this.lblSeeNo2.Text = register.DoctorInfo.SeeNO.ToString() + "  " + register.DoctorInfo.Templet.Noon.Name;

                //发票号
                this.lblInvoiceno.Text = register.InvoiceNO;


                //挂号科室
                this.lblDeptName.Text = register.DoctorInfo.Templet.Dept.Name;

                //就诊科室地点
                Neusoft.HISFC.BizLogic.Manager.Department deptMgr = new Neusoft.HISFC.BizLogic.Manager.Department();
                this.lblDeptAddr.Text = deptMgr.GetDeptAddress(register.DoctorInfo.Templet.Dept.ID);

                //标志号
                this.lblCardNo.Text  = register.PID.CardNO;
                this.lblCardNo1.Text = register.PID.CardNO;
                this.lblCardNo2.Text = register.PID.CardNO;

                ////号别
                //this.lblRegLevel.Text = register.DoctorInfo.Templet.RegLevel.Name;

                //姓名
                this.lblPatientName.Text  = register.Name;
                this.lblPatientName1.Text = register.Name;
                this.lblPatientName2.Text = register.Name;

                ////小记
                //this.lblCostsum.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                //    register.PubCost + register.PayCost + register.OwnCost, 2) +
                //    "元";
                ////大写
                //this.lblUpperCostSum.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(
                //   register.PubCost + register.PayCost + register.OwnCost
                //    );

                //string medicalTypeName = string.Empty;

                //this.lblPayCostTitle.Visible = false;
                //this.lblOwnCostTitle.Visible = false;
                //this.lblIndividualBalanceTitle.Visible = false;
                //register.Pact.ID = "2";

                //医疗类别
                ////this.lblPactName.Text = register.Pact.Name + medicalTypeName;


                //病历手册
                ////this.lblOherFee.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(
                ////    register.RegLvlFee.OthFee, 2) +
                ////    "元";

                //控制根据打印和预览显示选项
                if (IsPreview)
                {
                    SetToPreviewMode();
                }
                else
                {
                    SetToPrintMode();
                }
            }
            catch (Exception ex)
            {
                return(-1);
            }
            return(0);
        }