Exemple #1
0
        // 检查费用是否发生更改
        private bool CheckFee()
        {
            PatFee _patFee = zyCostMaster.GetPatCostFee();

            if (_patFee.chargeFee != patFee.chargeFee || _patFee.costFee != patFee.costFee)
            {
                IfrmCostView.ChargePatData();
                return(false);
            }
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 根据住院号加载病人的信息
        /// </summary>
        public void GetInpatNo()
        {
            ZY_PatList zypl = zyPatlist.GetPatInfo(IfrmCostView.InpatNo);

            if (zypl != null)
            {
                if (zypl.PatType == "4" || zypl.PatType == "5")
                {
                    throw new Exception("您输入的住院号病人已出院!");
                }
                zyPatlist = zypl;
                IfrmCostView.zyPatList = zyPatlist;
                IfrmCostView.ChargePatData();
            }
            else
            {
                IfrmCostView.InpatNo = "0";
                throw new Exception("您输入的住院号病人不存在!");
            }
        }
Exemple #3
0
        /// <summary>
        /// 病人结算
        /// </summary>
        /// <param name="_costType">结算类型</param>
        public void CostPat(CostType _costType, FrmCostController controller)
        {
            if (zyPatlist == null || zyPatlist.PatListID <= 0)
            {
                throw new Exception("请指定一个病人!");
            }
            if (zyPatlist.CureDate.Date > XcDate.ServerDateTime.Date)
            {
                throw new Exception("入院日期大于结算日期,不能结算!");
            }

            if (CheckFee() == false)
            {
                throw new Exception("该病人的费用发生变化,请重新核对后再结算!");
            }

            switch (_costType)
            {
            case CostType.中途结算:
                #region 中途结算

                if (zyPatlist.PatType != "1" && zyPatlist.PatType != "2" && zyPatlist.PatType != "7")
                {
                    throw new Exception("该病人无法办理[中途]结算!");
                }
                if (patFee.receiveFee > 0)
                {
                    throw new Exception("该病人已经欠费,请先补交费用再结算!");
                }

                #endregion
                break;

            case CostType.出院结算:
                #region 出院结算
                if (zyConfig008 == 0)
                {
                    if (zyPatlist.PatType != "3")
                    {
                        throw new Exception("该病人没有定义出院,无法办理[出院]结算!");
                    }
                }
                else
                {
                    if (zyPatlist.PatType == "4" || zyPatlist.PatType == "5")
                    {
                        throw new Exception("该病人已经办理了出院结算!");
                    }
                }
                #endregion
                break;

            case CostType.费结算:
                #region  费结算
                if (zyConfig008 == 0)
                {
                    if (zyPatlist.PatType != "3")
                    {
                        throw new Exception("该病人没有定义出院,无法办理[欠费]结算!");
                    }
                }
                else
                {
                    if (zyPatlist.PatType == "4" || zyPatlist.PatType == "5")
                    {
                        throw new Exception("该病人已经办理了出院结算!");
                    }
                }
                if (patFee.retreatFee > 0 || patFee.receiveFee == 0)
                {
                    throw new Exception("该病人没有欠费,不能办理欠费结算!");
                }
                #endregion
                break;
            }

            FrmCostDiag fcd = new FrmCostDiag(_costType, this);
            fcd.ShowDialog();

            if (CheckFee() == false)
            {
                throw new Exception("该病人的费用发生变化,请重新核对后再结算!");
            }

            if (fcd.isDiag)
            {
                zyPatlist = IfrmCostDiagView.zyPatList;
                _patType  = zyPatlist.PatientCode;
                int CostmasterID = CostPat((int)_costType, fcd);
                if (CostmasterID > 0)//住院中途结算
                {
                    if (IfrmCostDiagView.Ptt != PrintTicketType.打发票)
                    {
                        IfrmCostView.CostPrint(CostmasterID);//打印发票
                    }
                    IfrmCostView.BrushPatList();
                }
                else
                {
                    throw new Exception("结算失败!");
                }
            }
        }