Esempio n. 1
0
 /// <summary>
 /// 验证入参是否合法
 /// [参数1: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 返回的各种比率]
 /// [参数2: bool boolForce - 是否强制使用项目类别约束,true - 使用项目类别约束,false - 不使用项目类别约束]
 /// [返回: bool,true-有错误不合法,false-没有错误]
 /// </summary>
 /// <param name="ecoRate">返回的各种比率</param>
 /// <param name="boolForce">是否强制使用项目类别约束,true - 使用项目类别约束,false - 不使用项目类别约束</param>
 /// <returns>true-有错误不合法,false-没有错误</returns>
 private bool ValidParameter(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate, bool boolForce)
 {
     //
     // 判断比率类别编码是否合法
     //
     if (ecoRate.RateType.ID.Equals("") || ecoRate.RateType.ID == null)
     {
         this.Err = "比率类别编码ecoRate.EcoCode不允许为空";
         return(true);
     }
     //
     // 判断项目编码是否合法
     //
     if (ecoRate.Item.ID.Equals("") || ecoRate.Item.ID == null)
     {
         this.Err = "项目编码ecoRate.ItemCode不允许为空";
         return(true);
     }
     //
     // 如果有项目类别约束,那么项目类别不允许为空
     //
     if (boolForce)
     {
         if (ecoRate.ItemType.Equals("") || ecoRate.ItemType == null)
         {
             this.Err = "项目类别ecoRate.ItemType不允许为空";
             return(true);
         }
     }
     //
     // 合法
     //
     return(false);
 }
Esempio n. 2
0
 /// <summary>
 /// 转换Object成Parameters数组
 /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 优惠比率类]
 /// </summary>
 /// <param name="ecoRate">优惠比率类</param>
 private void ChangeObjectToParameters(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
 {
     // 清空数组
     this.InitParameters();
     // 父级编码
     this.parameters[(int)Field.ParentCode] = ecoRate.Hospital.ID;
     // 本级编码
     this.parameters[(int)Field.CurrentCode] = ecoRate.Hospital.Name;
     // 比率类别编码
     this.parameters[(int)Field.EcoCode] = ecoRate.RateType.ID;
     // 项目类别编码
     this.parameters[(int)Field.TypeCode] = ecoRate.ItemType.ID;
     // 项目编码
     this.parameters[(int)Field.ItemCode] = ecoRate.Item.ID;
     // 公费比率
     this.parameters[(int)Field.PubRate] = ecoRate.Rate.PubRate.ToString();
     // 自费比率
     this.parameters[(int)Field.OwnRate] = ecoRate.Rate.OwnRate.ToString();
     // 自付比率
     this.parameters[(int)Field.PayRate] = ecoRate.Rate.PayRate.ToString();
     // 优惠比率
     this.parameters[(int)Field.EcoRate] = ecoRate.Rate.RebateRate.ToString();
     // 减免比率
     this.parameters[(int)Field.ArrRate] = ecoRate.Rate.DerateRate.ToString();
     // 操作员编码
     this.parameters[(int)Field.OperatorCode] = ecoRate.CurrentOperator.ID;
     // 操作时间
     this.parameters[(int)Field.OperateDate] = ecoRate.OperateDateTime.ToString();
 }
Esempio n. 3
0
 /// <summary>
 /// 更新比率
 /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 优惠比率类]
 /// [返回: int,-1-失败,否则-影响的行数]
 /// </summary>
 /// <param name="ecoRate">优惠比率类</param>
 /// <returns>int,-1-失败,否则-影响的行数</returns>
 public int UpdateEcoRate(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
 {
     //
     // 获取SQL语句
     //
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.UpdateEcoRate.Update", ref this.SELECT);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句Neusoft.HISFC.BizLogic.Fee.EcoRate.UpdateEcoRate.Update失败!";
         return(-1);
     }
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Where", ref this.WHERE);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Where失败!";
         return(-1);
     }
     this.SQL = this.SELECT + " " + this.WHERE;
     //
     // 转换对象为字符串数组
     //
     this.ChangeObjectToParameters(ecoRate);
     //
     // 格式化SQL语句
     //
     try
     {
         this.SQL = string.Format(this.SQL,
                                  ecoRate.RateType.ID,           // 比率类别编码
                                  ecoRate.ItemType.ID,           // 项目类别
                                  ecoRate.Item.ID,               // 项目编码
                                  ecoRate.Rate.PubRate,          // 公费比率
                                  ecoRate.Rate.OwnRate,          // 自费比率
                                  ecoRate.Rate.PayRate,          // 自付比率
                                  ecoRate.Rate.RebateRate,       // 优惠比率
                                  ecoRate.Rate.DerateRate,       // 减免比率
                                  ecoRate.CurrentOperator.ID,    // 操作员代码
                                  ecoRate.OperateDateTime        // 操作时间
                                  );
     }
     catch (Exception e)
     {
         this.Err = "格式化SQL语句失败!" + "\n" + e.Message;
         return(-1);
     }
     //
     // 执行SQL语句
     //
     this.intReturn = this.ExecNoQuery(this.SQL);
     if (this.intReturn == -1)
     {
         this.Err = "更新执行SQL语句失败!" + "\n" + this.Err;
         return(-1);
     }
     //
     // 返回影响的行数
     //
     return(this.intReturn);
 }
Esempio n. 4
0
 /// <summary>
 /// 设置各种比率为100%
 /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 返回的各种比率]
 /// </summary>
 /// <param name="ecoRate">返回的各种比率</param>
 private void FullRate(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
 {
     ecoRate.Rate.ArrearageRate = 1m;
     ecoRate.Rate.DerateRate    = 1m;
     ecoRate.Rate.OwnRate       = 1m;
     ecoRate.Rate.PayRate       = 1m;
     ecoRate.Rate.PubRate       = 1m;
     ecoRate.Rate.RebateRate    = 1m;
 }
Esempio n. 5
0
 /// <summary>
 /// 根据优惠比率类别编码和大类编码(非最小费用编码和非项目编码)获取各种比率
 /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 返回的各种比率]
 /// [返回 : int,1-成功,0-不存在,-1-失败]
 /// </summary>
 /// <param name="ecoRate">返回的各种比率</param>
 /// <returns>1-成功,0-不存在,-1-失败</returns>
 public int GetRateByClass(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
 {
     //
     // 获取SQL语句
     //
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.GetRate.Select", ref this.SELECT);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句失败!";
         return(-1);
     }
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.GetRateByClass.Where", ref this.WHERE);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句失败!";
         return(-1);
     }
     this.SQL = this.SELECT + " " + this.WHERE;
     //
     // 格式化SQL语句
     //
     try
     {
         this.SQL = string.Format(this.SQL, ecoRate.RateType.ID, ecoRate.Item.ID);
     }
     catch (Exception e)
     {
         this.Err = "格式化SQL语句失败!" + "\n" + e.Message;
         return(-1);
     }
     //
     // 执行SQL语句
     //
     this.intReturn = this.ExecQuery(this.SQL);
     if (this.intReturn == -1)
     {
         this.Err = "执行SQL语句失败!" + "\n" + this.Err;
         return(-1);
     }
     //
     // 获取结果
     //
     if (this.Reader.Read())
     {
         this.ChangeReaderToObject(ecoRate);
         this.Reader.Close();
     }
     else
     {
         this.Reader.Close();
         return(0);
     }
     //
     // 成功返回1
     //
     return(1);
 }
Esempio n. 6
0
 /// <summary>
 /// 删除比率
 /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 优惠比率类]
 /// [返回: int,影响的行数]
 /// </summary>
 /// <param name="ecoRate">优惠比率类</param>
 /// <returns>影响的行数</returns>
 public int DeleteEcoRate(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
 {
     //
     // 获取SQL语句
     //
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Delete", ref this.SELECT);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Delete失败!";
     }
     this.intReturn = this.Sql.GetSql("Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Where", ref this.WHERE);
     if (this.intReturn == -1)
     {
         this.Err = "获取SQL语句Neusoft.HISFC.BizLogic.Fee.EcoRate.DeleteEcoRate.Where失败!";
     }
     this.SQL = this.SELECT + " " + this.WHERE;
     //
     // 转换对象为字符串数组
     //
     this.ChangeObjectToParameters(ecoRate);
     //
     // 格式化SQL语句
     //
     try
     {
         this.SQL = string.Format(this.SQL,
                                  this.parameters[(int)Field.EcoCode],           // 比率类别
                                  this.parameters[(int)Field.TypeCode],          // 项目类别
                                  this.parameters[(int)Field.ItemCode]           // 项目编码
                                  );
     }
     catch (Exception e)
     {
         this.Err = "格式化SQL语句失败!" + "\n" + e.Message;
         return(-1);
     }
     //
     // 执行SQL语句
     //
     return(this.ExecNoQuery(this.SQL));
 }
Esempio n. 7
0
        /// <summary>
        /// 根据优惠比率类别编码和项目编码获取各种比率。
        /// (1)使用项目类别约束:如果获取项目不存在,那么直接返回。
        /// (2)不使用项目类别约束:必须设置ecoRate.ItemType,
        /// 程序首先按项目编码获取,
        /// 如果不存在,按最小费用编码获取,
        /// 如果再不存在,按大类编码获取。
        /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 返回的各种比率]
        /// [参数: bool boolForce - 是否强制使用项目类别约束,true - 使用项目类别约束,false - 不使用项目类别约束]
        /// [入参: ecoRate.EcoCode - 比率类别编码]
        /// [入参: ecoRate.ItemCode - 项目编码、最小费用编码或大类编码]
        /// [入参: ecoRate.ItemType]
        /// [返回 : int,1-成功,-1-失败]
        /// </summary>
        /// <param name="ecoRate">返回的各种比率</param>
        /// <returns>1-成功,-1-失败</returns>
        public int GetRate(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate, bool boolForce)
        {
            //
            // 验证合法性
            //
            if (this.ValidParameter(ecoRate, boolForce))
            {
                return(-1);
            }
            //
            // 如果强制类别约束
            //
            if (boolForce)
            {
                switch (ecoRate.ItemType.ID)
                {
                case "0":
                    // 按大类编码获取
                    this.intReturn = this.GetRateByClass(ecoRate);
                    break;

                case "1":
                    // 按最小费用编码获取
                    this.intReturn = this.GetRateByMinFee(ecoRate);
                    break;

                case "2":
                    // 按项目编码获取
                    this.intReturn = this.GetRateByItem(ecoRate);
                    break;
                }
                if (this.intReturn == -1)
                {
                    this.Err = "获取项目比率失败!" + "\n" + this.Err;
                    return(-1);
                }
                //
                // 如果项目不存在,那么设置项目比率为100%
                //
                if (this.intReturn == 0)
                {
                    this.FullRate(ecoRate);
                }
                //
                // 成功返回1
                //
                return(1);
            }
            //
            // 如果没有类别约束,根据项目编码获取项目比率
            //
            this.intReturn = this.GetRateByItem(ecoRate);
            if (this.intReturn == -1)
            {
                this.Err = "获取项目比率失败!" + "\n" + this.Err;
                return(-1);
            }
            else
            //
            // 如果获取项目不存在,那么根据上级最小费用代码获取比率
            //
            if (this.intReturn == 0)
            {
                this.intReturn = this.GetRateByMinFee(ecoRate);
                if (this.intReturn == -1)
                {
                    this.Err = "获取项目比率失败!" + "\n" + this.Err;
                }
            }
            //
            // 如果获取项目不存在,那么根据大类编码获取比率
            //
            if (this.intReturn == 0)
            {
                this.intReturn = this.GetRateByClass(ecoRate);
                if (this.intReturn == -1)
                {
                    this.Err = "获取项目比率失败!" + "\n" + this.Err;
                }
            }
            //
            // 如果获取项目不存在,那么设置各种费用比率为100%
            //
            if (this.intReturn == 0)
            {
                this.FullRate(ecoRate);
            }
            //
            // 成功返回1
            //
            return(1);
        }
Esempio n. 8
0
        /// <summary>
        /// 转换Reader成Object
        /// [参数: Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate - 优惠比率类]
        /// </summary>
        /// <param name="ecoRate">优惠比率类</param>
        private void ChangeReaderToObject(Neusoft.HISFC.Models.Fee.Outpatient.EcoRate ecoRate)
        {
            // 父级编码
            ecoRate.Hospital.ID = this.Reader[(int)Field.ParentCode].ToString();
            // 本级编码
            ecoRate.Hospital.Name = this.Reader[(int)Field.CurrentCode].ToString();
            // 比率类别编码
            ecoRate.RateType.ID = this.Reader[(int)Field.EcoCode].ToString();
            // 项目类别编码
            ecoRate.ItemType.ID = this.Reader[(int)Field.TypeCode].ToString();
            switch (ecoRate.ItemType.ID)
            {
            case "0":
                ecoRate.ItemType.Name = "大类";
                break;

            case "1":
                ecoRate.ItemType.Name = "最小费用";
                break;

            case "2":
                ecoRate.ItemType.Name = "收费项目";
                break;
            }
            // 项目编码
            ecoRate.Item.ID = this.Reader[(int)Field.ItemCode].ToString();
            // 项目名称
            ecoRate.Item.Name = this.Reader[(int)Field.ItemName].ToString();
            // 公费比率
            try
            {
                ecoRate.Rate.PubRate = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[(int)Field.PubRate].ToString());
            }
            catch
            {
                ecoRate.Rate.PubRate = 1m;
            }
            // 自费比率
            try
            {
                ecoRate.Rate.OwnRate = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[(int)Field.OwnRate].ToString());
            }
            catch
            {
                ecoRate.Rate.OwnRate = 1m;
            }
            // 自付比率
            try
            {
                ecoRate.Rate.PayRate = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[(int)Field.PayRate].ToString());
            }
            catch
            {
                ecoRate.Rate.PayRate = 1m;
            }
            // 优惠比率
            try
            {
                ecoRate.Rate.RebateRate = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[(int)Field.EcoRate].ToString());
            }
            catch
            {
                ecoRate.Rate.RebateRate = 1m;
            }
            // 减免比率
            try
            {
                ecoRate.Rate.DerateRate = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[(int)Field.ArrRate].ToString());
            }
            catch
            {
                ecoRate.Rate.DerateRate = 1m;
            }
            // 操作员
            ecoRate.CurrentOperator.ID = this.Reader[(int)Field.OperatorCode].ToString();
            // 操作时间
            try
            {
                ecoRate.OperateDateTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[(int)Field.OperateDate].ToString());
            }
            catch { };
        }