Exemplo n.º 1
0
        /// <summary>
        /// 按日结序号查询日结明细
        /// </summary>
        /// <param name="BalanceNo"></param>
        /// <returns></returns>
        public ArrayList Query(string BalanceNo)
        {
            string sql = "";

            if (this.Sql.GetSql("Registration.DayReport.Query.3", ref sql) == -1)
            {
                return(null);
            }

            try
            {
                sql = string.Format(sql, BalanceNo);
            }
            catch (Exception e)
            {
                this.Err     = "查询日结信息时出错![Registration.DayReport.Query.3]" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }

            if (this.ExecQuery(sql) == -1)
            {
                return(null);
            }

            ArrayList al = new ArrayList();

            try
            {
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Registration.DayDetail report = new Neusoft.HISFC.Models.Registration.DayDetail();

                    report.ID            = this.Reader[2].ToString();
                    report.OrderNO       = this.Reader[3].ToString();
                    report.BeginRecipeNo = this.Reader[4].ToString();
                    report.EndRecipeNo   = this.Reader[5].ToString();
                    report.Count         = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[6].ToString());
                    report.RegFee        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[7].ToString());
                    report.ChkFee        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[8].ToString());
                    report.DigFee        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[9].ToString());
                    report.OthFee        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[10].ToString());
                    report.OwnCost       = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[11].ToString());
                    report.PayCost       = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[12].ToString());
                    report.PubCost       = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[13].ToString());
                    report.Status        = (Neusoft.HISFC.Models.Base.EnumRegisterStatus)Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[14].ToString());

                    al.Add(report);
                }
                this.Reader.Close();
            }
            catch (Exception e)
            {
                this.Err     = "查询日结信息时出错![Registration.DayReport.Query.3]" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }

            return(al);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 生成日结实体
        /// </summary>
        private void SetReport()
        {
            for (int i = 0; i < this.objDayReport.Details.Count; i++)
            {
                Neusoft.HISFC.Models.Registration.DayDetail detail = this.objDayReport.Details[i];
                detail.OrderNO = i.ToString();

                this.objDayReport.SumCount += detail.Count;
                if (detail.Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Cancel)
                {
                    continue;
                }

                this.objDayReport.SumRegFee  += detail.RegFee;
                this.objDayReport.SumChkFee  += detail.ChkFee;
                this.objDayReport.SumDigFee  += detail.DigFee;
                this.objDayReport.SumOthFee  += detail.OthFee;
                this.objDayReport.SumOwnCost += detail.OwnCost;
                this.objDayReport.SumPayCost += detail.PayCost;
                this.objDayReport.SumPubCost += detail.PubCost;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 登记日结明细
        /// </summary>
        /// <param name="dayDetail"></param>
        /// <returns></returns>
        public int Insert(Neusoft.HISFC.Models.Registration.DayDetail dayDetail)
        {
            string sql = "";

            if (this.Sql.GetSql("Registration.DayReport.Insert.Detail", ref sql) == -1)
            {
                return(-1);
            }

            try
            {
                sql = string.Format(sql, dayDetail.ID, dayDetail.OrderNO, dayDetail.BeginRecipeNo,
                                    dayDetail.EndRecipeNo, dayDetail.Count, dayDetail.RegFee, dayDetail.ChkFee, dayDetail.DigFee,
                                    dayDetail.OthFee, dayDetail.OwnCost, dayDetail.PayCost, dayDetail.PubCost, (int)dayDetail.Status);
            }
            catch (Exception e)
            {
                this.Err     = "[Registration.DayReport.Insert.Detail]格式不匹配!" + e.Message;
                this.ErrCode = e.Message;
                return(-1);
            }

            return(this.ExecNoQuery(sql));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 生成日结明细实体
        /// </summary>
        /// <param name="begin"></param>
        /// <param name="end"></param>
        /// <param name="operID"></param>
        /// <param name="operName"></param>
        private void SetReportDetail(DateTime begin, DateTime end, string operID, string operName)
        {
            DateTime current = this.regMgr.GetDateTimeFromSysDateTime();

            this.objDayReport               = new Neusoft.HISFC.Models.Registration.DayReport();
            this.objDayReport.BeginDate     = begin;
            this.objDayReport.EndDate       = end;
            this.objDayReport.Oper.ID       = operID;
            this.objDayReport.Oper.Name     = operName;
            this.objDayReport.Oper.OperTime = current;

            Neusoft.HISFC.Models.Registration.DayDetail detail = new Neusoft.HISFC.Models.Registration.DayDetail();
            detail.EndRecipeNo = "-1";


            //生成日报实体,原则:连续处方、处方状态一致的合为一条日结明细
            for (int i = 0; i < this.dsRegInfo.Tables[0].Rows.Count; i++)
            {
                DataRow row = this.dsRegInfo.Tables[0].Rows[i];

                ///挂号状态为退号、日结人不是作废人、未日结,此种情况为别人退该操作员号,此号有效
                ///
                if (row[8].ToString() == "0" && operID != row[9].ToString())
                {
                    row[8] = "1";//置为有效
                }



                if (long.Parse(row[0].ToString()) - 1 != long.Parse(detail.EndRecipeNo) || //处方不连续
                    int.Parse(row[8].ToString()) != (int)detail.Status)                    //状态改变
                {
                    //生成新的日结明细
                    if (i != 0)//第一条不处理
                    {
                        this.objDayReport.Details.Add(detail);
                    }

                    //重新生成新的明细
                    detail = new Neusoft.HISFC.Models.Registration.DayDetail();
                    detail.BeginRecipeNo = row[0].ToString();    //开始号
                    detail.EndRecipeNo   = detail.BeginRecipeNo; //Convert.ToString(long.Parse(row[0].ToString()) -1) ;
                    detail.Status        = (Neusoft.HISFC.Models.Base.EnumRegisterStatus) int.Parse(row[8].ToString());
                }

                detail.EndRecipeNo = row[0].ToString();
                detail.Count++;
                detail.RegFee  += decimal.Parse(row[1].ToString());
                detail.ChkFee  += decimal.Parse(row[2].ToString());
                detail.DigFee  += decimal.Parse(row[3].ToString());
                detail.OthFee  += decimal.Parse(row[4].ToString());
                detail.OwnCost += decimal.Parse(row[5].ToString());
                detail.PayCost += decimal.Parse(row[6].ToString());
                detail.PubCost += decimal.Parse(row[7].ToString());

                if (i == this.dsRegInfo.Tables[0].Rows.Count - 1)
                {
                    this.objDayReport.Details.Add(detail);//最后一条也重新生成明细
                }
            }
        }