Exemple #1
0
        /// <summary>
        /// 保存门诊结算数据
        /// </summary>
        public void SaveOutSettleMain(int _payTypeId)
        {
            #region 保存农合中心返回值参数列表
            //保存农合中心返回值参数列表
            try
            {
                OutNetworkSettleList outNetworkSettleList;
                foreach (var item in dicSettleInfo)
                {
                    //if (dicSettleInfo["report"]=="report")

                    if (item.Key.ToString() == "report")
                    {
                        continue;
                    }
                    outNetworkSettleList                    = new OutNetworkSettleList();
                    outNetworkSettleList.OutPatId           = outReimPara.PatInfo.OutPatId;
                    outNetworkSettleList.OutNetworkSettleId = outReimPara.CommPara.OutNetworkSettleId;
                    outNetworkSettleList.ParaName           = item.Key.ToString();
                    outNetworkSettleList.ParaValue          = item.Value;
                    outNetworkSettleList.Memo               = "";
                    outReimPara.SettleParaList.Add(outNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Error("保存农合中心返回值参数列表 插入值 失败" + ex.Message, ex);
            }
            #endregion

            OutNetworkSettleMain outSettleMain = new OutNetworkSettleMain();
            outSettleMain.SettleNo             = dicSettleInfo["jshid"];                                                                  //医保中心交易流水号
            outSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["zje"]);                                                 //本次医疗费用
            outSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]); //本次现金支出
            outSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                              //本次帐户支出
            outSettleMain.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                              //本次统筹支出
            outSettleMain.MedAmountDb          = 0;                                                                                       //本次大病支出
            outSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                              //本次大病支出
            outSettleMain.MedAmountTotal       = Convert.ToDecimal(outSettleMain.Amount) - Convert.ToDecimal(outSettleMain.GetAmount);
            outSettleMain.NetworkingPatClassId = Convert.ToInt32(outReimPara.CommPara.NetworkPatClassId);
            outSettleMain.NetworkPatName       = outReimPara.PatInfo.PatName;
            outSettleMain.NetworkPatType       = "0";
            outSettleMain.OutNetworkSettleId   = Convert.ToDecimal(outReimPara.CommPara.OutNetworkSettleId);
            outSettleMain.SettleBackNo         = outReimPara.CommPara.OutNetworkSettleId.ToString("0");
            outSettleMain.SettleType           = "1";

            outReimPara.SettleInfo = outSettleMain;

            //门诊付费方式 本接口 4 医保 6农合
            PayAPIInterface.Model.Comm.PayType payType;
            outReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = _payTypeId;
            payType.PayTypeName = "医保";
            payType.PayAmount   = outReimPara.SettleInfo.MedAmountTotal;
            outReimPara.PayTypeList.Add(payType);
        }
Exemple #2
0
        /// <summary>
        /// 保存门诊结算数据
        /// </summary>
        public void SaveOutSettleMain()
        {
            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                model.outReimPara.SettleParaList = new List <PayAPIInterface.Model.Out.OutNetworkSettleList>();
                AddToSettleList_MZ("Name", tbName.Text, "姓名");
                AddToSettleList_MZ("IDCardNo", tbIDCardNo.Text, "身份证号");
                AddToSettleList_MZ("AidCardNo", tbAidCardNo.Text, "救助卡号");
                AddToSettleList_MZ("TotalFee", tbTotalFee.Text, "本次消费总金额");
                AddToSettleList_MZ("SiPayment", tbSiPayment.Text, "本次消费医保总金额");
                AddToSettleList_MZ("SiBaseline", tbSiBaseline.Text, "本次消费医保起付线金额");
                AddToSettleList_MZ("AidPercentage", tbAidPercentage.Text, "救助比例");
                AddToSettleList_MZ("AidPayment", tbAidPayment.Text, "本次消费大病救助垫付金额");
                AddToSettleList_MZ("HolderPayment", tbHolderPayment.Text, "本次消费自付金额");
                AddToSettleList_MZ("AidCardPayment", tbAidCardPayment.Text, "本次消费使用旧卡余额支付金额");
                AddToSettleList_MZ("AidCardBalance", tbAidCardBalance.Text, "本次消费结算后的旧卡余额");
                AddToSettleList_MZ("AidBaseline", tbAidBaseline.Text, "本次消费大病救助垫付基数");
            }
            catch (Exception ex)
            {
                LogManager.Info("保存中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            OutNetworkSettleMain outSettleMain = new OutNetworkSettleMain();
            outSettleMain.OutPatId             = model.outReimPara.PatInfo.OutPatId;
            outSettleMain.SettleNo             = model.outReimPara.CommPara.OutNetworkSettleId.ToString();
            outSettleMain.Amount               = Convert.ToDecimal(tbTotalFee.Text);       //本次医疗费用
            outSettleMain.GetAmount            = Convert.ToDecimal(tbHolderPayment.Text);  //本次现金支出
            outSettleMain.MedAmountZhzf        = Convert.ToDecimal(tbAidCardPayment.Text); //本次消费使用旧卡余额支付金额
            outSettleMain.MedAmountTc          = Convert.ToDecimal(tbSiPayment.Text);      //本次消费医保总金额
            outSettleMain.MedAmountDb          = Convert.ToDecimal(tbAidPayment.Text);     //本次消费大病救助垫付金额
            outSettleMain.MedAmountBz          = Convert.ToDecimal(tbAidBaseline.Text);    //本次消费大病救助垫付基数
            outSettleMain.MedAmountJm          = Convert.ToDecimal(tbAidCardBalance.Text); //本次消费结算后的旧卡余额
            outSettleMain.CreateTime           = DateTime.Now;
            outSettleMain.InvoiceId            = -1;
            outSettleMain.IsCash               = true;
            outSettleMain.IsInvalid            = false;
            outSettleMain.IsNeedRefund         = false;
            outSettleMain.IsRefundDo           = false;
            outSettleMain.IsSettle             = true;
            outSettleMain.MedAmountTotal       = Convert.ToDecimal(outSettleMain.Amount) - Convert.ToDecimal(outSettleMain.GetAmount);
            outSettleMain.NetworkingPatClassId = Convert.ToInt32(model.outReimPara.SettleInfo.NetworkingPatClassId);
            outSettleMain.NetworkPatName       = model.outReimPara.RegInfo.NetPatName;
            outSettleMain.NetworkPatType       = "0";
            outSettleMain.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            outSettleMain.NetworkSettleTime    = DateTime.Now;
            outSettleMain.OperatorId           = PayAPIConfig.Operator.UserSysId; //operatorInfo.UserSysId;
            outSettleMain.OutNetworkSettleId   = Convert.ToDecimal(model.outReimPara.SettleInfo.OutNetworkSettleId);
            outSettleMain.SettleBackNo         = "";


            model.outReimPara.SettleInfo = outSettleMain;

            PayAPIInterface.Model.Comm.PayType payType;
            model.outReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 8;
            payType.PayTypeName = "低保";
            payType.PayAmount   = Convert.ToDecimal(outSettleMain.MedAmountTotal);
            model.outReimPara.PayTypeList.Add(payType);
        }
        /// <summary>
        /// 保存门诊结算数据
        /// </summary>
        public void SaveOutSettleMain()
        {
            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                OutNetworkSettleList outNetworkSettleList;
                foreach (var item in dicSettleInfo)
                {
                    outNetworkSettleList                    = new OutNetworkSettleList();
                    outNetworkSettleList.OutPatId           = outReimPara.PatInfo.OutPatId;
                    outNetworkSettleList.OutNetworkSettleId = outReimPara.CommPara.OutNetworkSettleId;
                    outNetworkSettleList.ParaName           = item.Key.ToString();
                    outNetworkSettleList.ParaValue          = item.Value;
                    outNetworkSettleList.Memo               = "";
                    outReimPara.SettleParaList.Add(outNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Info("保存中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            OutNetworkSettleMain outSettleMain = new OutNetworkSettleMain();
            outSettleMain.OutPatId             = outReimPara.RegInfo.OutPatId;
            outSettleMain.SettleNo             = dicSettleInfo["brjsh"];                                                                                                                           //医保中心交易流水号
            outSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["brfdje"]) + Convert.ToDecimal(dicSettleInfo["ybfdje"]) + Convert.ToDecimal(dicSettleInfo["yljmje"]);             //本次医疗费用
            outSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                                       //本次帐户支出
            outSettleMain.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                                                                                       //本次统筹支出
            outSettleMain.MedAmountDb          = dicSettleInfoDibao.Count > 0 ? Convert.ToDecimal(dicSettleInfoDibao["AidPayment"]) + Convert.ToDecimal(dicSettleInfoDibao["AidCardPayment"]) : 0; //低保支付
            outSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                                                                                       //补助金额
            outSettleMain.MedAmountJm          = Convert.ToDecimal(dicSettleInfo["yljmje"]);                                                                                                       //减免金额
            outSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]) - outSettleMain.MedAmountDb;                              //本次现金支出
            outSettleMain.CreateTime           = DateTime.Now;
            outSettleMain.InvoiceId            = -1;
            outSettleMain.IsCash               = true;
            outSettleMain.IsInvalid            = false;
            outSettleMain.IsNeedRefund         = false;
            outSettleMain.IsRefundDo           = false;
            outSettleMain.IsSettle             = true;
            outSettleMain.MedAmountTotal       = Convert.ToDecimal(outSettleMain.Amount) - Convert.ToDecimal(outSettleMain.GetAmount);
            outSettleMain.NetworkingPatClassId = Convert.ToInt32(outReimPara.SettleInfo.NetworkingPatClassId);
            outSettleMain.NetworkPatName       = dicPatInfo["xm"];
            outSettleMain.NetworkPatType       = dicSettleInfoDibao.Count > 0 ? "低保" : ""; //低保病人结算
            outSettleMain.SettleType           = dicSettleInfoDibao.Count > 0 ? "1" : "0"; //低保结算标志
            outSettleMain.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            outSettleMain.NetworkSettleTime    = DateTime.Now;
            outSettleMain.OperatorId           = PayAPIConfig.Operator.UserSysId; //operatorInfo.UserSysId;
            outSettleMain.OutNetworkSettleId   = Convert.ToDecimal(outReimPara.SettleInfo.OutNetworkSettleId);
            outSettleMain.SettleBackNo         = "";

            outReimPara.SettleInfo = outSettleMain;

            PayAPIInterface.Model.Comm.PayType payType;
            outReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 4;
            payType.PayTypeName = "医保";
            payType.PayAmount   = outReimPara.SettleInfo.MedAmountTotal - Convert.ToDecimal(outReimPara.SettleInfo.MedAmountDb);
            outReimPara.PayTypeList.Add(payType);

            if (dicSettleInfoDibao.Count > 0)
            {
                payType             = new PayAPIInterface.Model.Comm.PayType();
                payType.PayTypeId   = 8;
                payType.PayTypeName = "低保";
                payType.PayAmount   = Convert.ToDecimal(outReimPara.SettleInfo.MedAmountDb);
                outReimPara.PayTypeList.Add(payType);
            }
        }
Exemple #4
0
        /// <summary>
        /// 保存住院结算数据
        /// </summary>
        public void SaveInSettleMain()
        {
            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                InNetworkSettleList inNetworkSettleList = new InNetworkSettleList();
                foreach (var item in dicSettleInfo)
                {
                    inNetworkSettleList                   = new InNetworkSettleList();
                    inNetworkSettleList.PatInHosId        = inReimPara.PatInfo.PatInHosId;
                    inNetworkSettleList.InNetworkSettleId = -1;
                    inNetworkSettleList.ParaName          = item.Key;
                    inNetworkSettleList.ParaValue         = item.Value.ToString();
                    inNetworkSettleList.Memo              = "";
                    inReimPara.SettleParaList.Add(inNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Info("保存农合中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            InNetworkSettleMain inSettleMain = new InNetworkSettleMain();
            inSettleMain.PatInHosId           = inReimPara.PatInfo.PatInHosId;
            inSettleMain.SettleNo             = dicSettleInfo["brjsh"];                                                                                                               //医保中心交易流水号
            inSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["brfdje"]) + Convert.ToDecimal(dicSettleInfo["ybfdje"]) + Convert.ToDecimal(dicSettleInfo["ylbzje"]); //本次医疗费用
            inSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                              //本次现金支出
            inSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                           //本次帐户支出
            inSettleMain.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                                                                           //本次统筹支出
            inSettleMain.MedAmountDb          = 0;                                                                                                                                    //本次大病支出
            inSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                                                                           //本次大病支出
            inSettleMain.CreateTime           = DateTime.Now;
            inSettleMain.InvoiceId            = -1;
            inSettleMain.IsCash               = true;
            inSettleMain.IsInvalid            = false;
            inSettleMain.IsNeedRefund         = false;
            inSettleMain.IsRefundDo           = false;
            inSettleMain.IsSettle             = true;
            inSettleMain.MedAmountTotal       = Convert.ToDecimal(inSettleMain.Amount) - Convert.ToDecimal(inSettleMain.GetAmount);
            inSettleMain.NetworkingPatClassId = Convert.ToInt32(inReimPara.SettleInfo.NetworkingPatClassId);
            inSettleMain.NetworkPatName       = netPatInfo.PatName;
            inSettleMain.NetworkPatType       = "0";
            inSettleMain.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            inSettleMain.NetworkSettleTime    = DateTime.Now;
            inSettleMain.OperatorId           = operatorInfo.UserSysId;
            inSettleMain.SettleBackNo         = "";
            inSettleMain.SettleType           = "1";



            PayAPIInterface.Model.Comm.PayType payType;
            inReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 4;
            payType.PayTypeName = "医保";
            payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountTotal);
            inReimPara.PayTypeList.Add(payType);

            payType.PayTypeId   = 5;
            payType.PayTypeName = "医保卡";
            payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountZhzf);
            inReimPara.PayTypeList.Add(payType);
        }
Exemple #5
0
        /// <summary>
        /// 保存门诊结算数据
        /// </summary>
        public void SaveOutSettleMain_ZHZF()
        {
            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                OutNetworkSettleList outNetworkSettleList;
                foreach (var item in dicSettleInfo)
                {
                    outNetworkSettleList                    = new OutNetworkSettleList();
                    outNetworkSettleList.OutPatId           = outReimPara.PatInfo.OutPatId;
                    outNetworkSettleList.OutNetworkSettleId = outReimPara.CommPara.OutNetworkSettleId;
                    outNetworkSettleList.ParaName           = item.Key.ToString();
                    outNetworkSettleList.ParaValue          = item.Value;
                    outNetworkSettleList.Memo               = "";
                    outReimPara.SettleParaList.Add(outNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Info("保存中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            OutNetworkSettleMain outSettleMain = new OutNetworkSettleMain();
            outSettleMain.OutPatId             = outReimPara.PatInfo.OutPatId;
            outSettleMain.SettleNo             = dicSettleInfo["mzzdlsh"];                                                             //医保中心交易流水号
            outSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["zje"]);                                              //本次医疗费用
            outSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["zje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]); //本次现金支出
            outSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                           //本次帐户支出
            outSettleMain.MedAmountTc          = 0;                                                                                    //本次统筹支出
            outSettleMain.MedAmountDb          = 0;                                                                                    //本次大病支出
            outSettleMain.MedAmountBz          = 0;                                                                                    //本次大病支出
            outSettleMain.CreateTime           = DateTime.Now;
            outSettleMain.InvoiceId            = -1;
            outSettleMain.IsCash               = true;
            outSettleMain.IsInvalid            = false;
            outSettleMain.IsNeedRefund         = false;
            outSettleMain.IsRefundDo           = false;
            outSettleMain.IsSettle             = true;
            outSettleMain.MedAmountTotal       = Convert.ToDecimal(outSettleMain.Amount) - Convert.ToDecimal(outSettleMain.GetAmount);
            outSettleMain.NetworkingPatClassId = Convert.ToInt32(outReimPara.SettleInfo.NetworkingPatClassId);
            outSettleMain.NetworkPatName       = dicPatInfo["xm"];
            outSettleMain.NetworkPatType       = "0";
            outSettleMain.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            outSettleMain.NetworkSettleTime    = DateTime.Now;
            outSettleMain.OperatorId           = operatorInfo.UserSysId;
            outSettleMain.OutNetworkSettleId   = Convert.ToDecimal(outReimPara.SettleInfo.OutNetworkSettleId);
            outSettleMain.SettleBackNo         = "";
            outSettleMain.SettleType           = "2";

            PayAPIInterface.Model.Comm.PayType payType;
            outReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 4;
            payType.PayTypeName = "医保";
            payType.PayAmount   = Convert.ToDecimal(outSettleMain.MedAmountTotal);
            outReimPara.PayTypeList.Add(payType);

            payType.PayTypeId   = 5;
            payType.PayTypeName = "医保卡";
            payType.PayAmount   = Convert.ToDecimal(outReimPara.SettleInfo.MedAmountZhzf);
            outReimPara.PayTypeList.Add(payType);;
        }
        /// <summary>
        /// 住院预结算
        /// </summary>
        /// <param name="inPara">住院接口入参</param>
        /// <returns></returns>
        public void InNetworkPreSettle(InPayParameter para)
        {
            inReimPara = para;

            if (inReimPara.SettleInfo != null && inReimPara.SettleInfo.MedAmountTotal != 0)
            {
                PayAPIInterface.Model.Comm.PayType payType;
                inReimPara.PayTypeList = new List <PayType>();
                payType             = new PayAPIInterface.Model.Comm.PayType();
                payType.PayTypeId   = 4;
                payType.PayTypeName = "医保";
                payType.PayAmount   = inReimPara.SettleInfo.MedAmountTotal;
                inReimPara.PayTypeList.Add(payType);

                payType             = new PayAPIInterface.Model.Comm.PayType();
                payType.PayTypeId   = 5;
                payType.PayTypeName = "医保卡";
                payType.PayAmount   = inReimPara.SettleInfo.MedAmountZhzf;
                inReimPara.PayTypeList.Add(payType);

                return;
            }

            InterfaceInit();
            inReimPara.Details = PayAPIUtilities.Tools.CommonTools.GetGroupList(inReimPara.Details);
            string notMatchedCharge = "";

            foreach (var item in inReimPara.Details)
            {
                if (item.NetworkItemCode.ToString().Trim().Length == 0)
                {
                    notMatchedCharge += "编码:" + item.ChargeCode + "," + "名称:" + item.ChargeName + ";";
                }
            }
            if (notMatchedCharge.Trim().Length > 0)
            {
                if (MessageBox.Show("有以下项目未对应:\n" + notMatchedCharge + "\n是否继续?选择”是“将按自费项目进行收费报销。否则,取消本次收费报销!", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    throw new Exception("取消上传费用");
                }

                //MessageBox.Show("有以下项目未对应:\n" + notMatchedCharge + "\n不能收费报销!", "提示", MessageBoxButtons.OK);

                //throw new Exception("项目未对照");
            }

            handelModel.InitZY(inReimPara.PatInfo.PatInHosCode);
            string ishaceCed = "";

            if (MessageBox.Show("是否有医保卡?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ishaceCed = "1";
            }
            else
            {
                ishaceCed = "0";
            }

            handelModel.DelAllInItems(inReimPara.PatInfo.PatInHosCode);
            if (inReimPara.Details.Count > 0)
            {
                handelModel.SaveInItems(inReimPara.Details,
                                        //"001", // 医师编码
                                        inReimPara.PatInfo.DoctorCode,

                                        inReimPara.PatInfo.OutDateTime.ToString("yyyy-MM-dd"),   //费用发生日期
                                        inReimPara.PatInfo.PatInHosCode
                                        );


                //  if (MessageBox.Show("是否有医保卡?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                if (ishaceCed == "1")
                {
                    dicSettleInfo = handelModel.SettleZY("");

                    //SaveInSettleMain();
                    //保存住院结算数据
                    #region 保存中心返回值参数列表
                    //保存中心返回值参数列表
                    #region 保存SettleList值
                    try
                    {
                        InNetworkSettleList inNetworkSettleList = new InNetworkSettleList();
                        foreach (var item in dicSettleInfo)
                        {
                            inNetworkSettleList                   = new InNetworkSettleList();
                            inNetworkSettleList.PatInHosId        = inReimPara.PatInfo.PatInHosId;
                            inNetworkSettleList.InNetworkSettleId = -1;
                            inNetworkSettleList.ParaName          = item.Key;
                            inNetworkSettleList.ParaValue         = item.Value.ToString();
                            inNetworkSettleList.Memo              = "";
                            inReimPara.SettleParaList.Add(inNetworkSettleList);
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManager.Error("保存农合中心返回值参数列表 插入值 失败" + ex.Message, ex);
                    }
                    #endregion
                    InNetworkSettleMain inSettleMain = new InNetworkSettleMain();
                    inSettleMain.PatInHosId           = inReimPara.PatInfo.PatInHosId;
                    inSettleMain.SettleNo             = dicSettleInfo["brjsh"] + "|" + DateTime.Now.ToString("yyyyMMddHHmmss");                                                               //医保中心交易流水号
                    inSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["brfdje"]) + Convert.ToDecimal(dicSettleInfo["ybfdje"]) + Convert.ToDecimal(dicSettleInfo["yljmje"]); //本次医疗费用
                    inSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                              //本次现金支出
                    inSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                           //本次帐户支出
                    inSettleMain.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                                                                           //本次统筹支出
                    inSettleMain.MedAmountDb          = 0;                                                                                                                                    //本次大病支出
                    inSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                                                                           //本次大病支出
                    inSettleMain.MedAmountJm          = Convert.ToDecimal(dicSettleInfo["yljmje"]);                                                                                           //减免金额
                    inSettleMain.MedAmountTotal       = Convert.ToDecimal(inSettleMain.Amount) - Convert.ToDecimal(inSettleMain.GetAmount);
                    inSettleMain.NetworkingPatClassId = Convert.ToInt32(inReimPara.CommPara.NetworkPatClassId);
                    inSettleMain.NetworkPatName       = inReimPara.PatInfo.InPatName;
                    inSettleMain.NetworkPatType       = "0";
                    inSettleMain.SettleBackNo         = inReimPara.PatInfo.PatInHosCode;
                    inSettleMain.SettleType           = "1";
                    inReimPara.SettleInfo             = inSettleMain;

                    //保存结算数据
                    IInClientBLL inBLl = PayAPIClassLib.Factory.ClientBLLFactory.GetInClientBLLInstance();
                    //获取联网结算ID 并重新组织数据
                    inBLl.GetInSettleIdAndReorganizeData(inReimPara);
                    inBLl.SaveInNetworkSettleMain(inSettleMain);
                    inBLl.SaveInNetworkSettleList(inReimPara.SettleParaList);//保存settleLis结算数据


                    PayAPIInterface.Model.Comm.PayType payType;
                    inReimPara.PayTypeList = new List <PayType>();
                    payType             = new PayAPIInterface.Model.Comm.PayType();
                    payType.PayTypeId   = 4;
                    payType.PayTypeName = "医保";
                    payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountTotal);
                    inReimPara.PayTypeList.Add(payType);

                    payType             = new PayAPIInterface.Model.Comm.PayType();
                    payType.PayTypeId   = 5;
                    payType.PayTypeName = "医保卡";
                    payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountZhzf);
                    inReimPara.PayTypeList.Add(payType);
                    #endregion
                }
                else
                {
                    dicSettleInfo = handelModel.SettleZY("wkzy");
                    //SaveInSettleMain();
                    //保存住院结算数据
                    #region 保存中心返回值参数列表
                    //保存中心返回值参数列表
                    #region 保存SettleList值
                    try
                    {
                        InNetworkSettleList inNetworkSettleList = new InNetworkSettleList();
                        foreach (var item in dicSettleInfo)
                        {
                            inNetworkSettleList                   = new InNetworkSettleList();
                            inNetworkSettleList.PatInHosId        = inReimPara.PatInfo.PatInHosId;
                            inNetworkSettleList.InNetworkSettleId = -1;
                            inNetworkSettleList.ParaName          = item.Key;
                            inNetworkSettleList.ParaValue         = item.Value.ToString();
                            inNetworkSettleList.Memo              = "";
                            inReimPara.SettleParaList.Add(inNetworkSettleList);
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManager.Error("保存农合中心返回值参数列表 插入值 失败" + ex.Message, ex);
                    }
                    #endregion
                    InNetworkSettleMain inSettleMain = new InNetworkSettleMain();
                    inSettleMain.PatInHosId           = inReimPara.PatInfo.PatInHosId;
                    inSettleMain.SettleNo             = dicSettleInfo["brjsh"] + "|" + DateTime.Now.ToString("yyyyMMddHHmmss");                                                               //医保中心交易流水号
                    inSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["brfdje"]) + Convert.ToDecimal(dicSettleInfo["ybfdje"]) + Convert.ToDecimal(dicSettleInfo["yljmje"]); //本次医疗费用
                    inSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                              //本次现金支出
                    inSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                           //本次帐户支出
                    inSettleMain.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                                                                           //本次统筹支出
                    inSettleMain.MedAmountDb          = 0;                                                                                                                                    //本次大病支出
                    inSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                                                                           //本次大病支出
                    inSettleMain.MedAmountJm          = Convert.ToDecimal(dicSettleInfo["yljmje"]);                                                                                           //减免金额
                    inSettleMain.MedAmountTotal       = Convert.ToDecimal(inSettleMain.Amount) - Convert.ToDecimal(inSettleMain.GetAmount);
                    inSettleMain.NetworkingPatClassId = Convert.ToInt32(inReimPara.CommPara.NetworkPatClassId);
                    inSettleMain.NetworkPatName       = inReimPara.PatInfo.InPatName;
                    inSettleMain.NetworkPatType       = "0";
                    inSettleMain.SettleBackNo         = inReimPara.PatInfo.PatInHosCode;
                    inSettleMain.SettleType           = "1";
                    inReimPara.SettleInfo             = inSettleMain;

                    //保存结算数据
                    IInClientBLL inBLl = PayAPIClassLib.Factory.ClientBLLFactory.GetInClientBLLInstance();
                    //获取联网结算ID 并重新组织数据
                    inBLl.GetInSettleIdAndReorganizeData(inReimPara);
                    inBLl.SaveInNetworkSettleMain(inSettleMain);
                    inBLl.SaveInNetworkSettleList(inReimPara.SettleParaList);//保存settleLis结算数据


                    PayAPIInterface.Model.Comm.PayType payType;
                    inReimPara.PayTypeList = new List <PayType>();
                    payType             = new PayAPIInterface.Model.Comm.PayType();
                    payType.PayTypeId   = 4;
                    payType.PayTypeName = "医保";
                    payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountTotal);
                    inReimPara.PayTypeList.Add(payType);

                    payType             = new PayAPIInterface.Model.Comm.PayType();
                    payType.PayTypeId   = 5;
                    payType.PayTypeName = "医保卡";
                    payType.PayAmount   = Convert.ToDecimal(inSettleMain.MedAmountZhzf);
                    inReimPara.PayTypeList.Add(payType);
                    #endregion
                }
            }
        }
Exemple #7
0
        /// <summary>
        /// 保存住院结算数据
        /// </summary>
        public void SaveInSettleMain()
        {
            //保存农合中心返回值参数列表
            try
            {
                PayAPIInterface.Model.In.InNetworkSettleList inNetworkSettleList = new PayAPIInterface.Model.In.InNetworkSettleList();


                for (int i = 0; i < JS.Length; i++)
                {
                    inNetworkSettleList                   = new PayAPIInterface.Model.In.InNetworkSettleList();
                    inNetworkSettleList.PatInHosId        = InPayPara.PatInfo.PatInHosId;
                    inNetworkSettleList.InNetworkSettleId = -1;
                    inNetworkSettleList.ParaName          = i.ToString();
                    inNetworkSettleList.ParaValue         = JS[i];
                    inNetworkSettleList.Memo              = "";
                    InPayPara.SettleParaList.Add(inNetworkSettleList);
                }
            }

            catch (Exception ex)
            {
                //LogManager.RecordException("保存农合中心返回值参数列表 插入值 失败" + ex.Message, "@JSBCInterfaceModel:住院结算");
            }

            InPayPara.SettleInfo                      = new PayAPIInterface.Model.In.InNetworkSettleMain();
            InPayPara.SettleInfo.PatInHosId           = InPayPara.PatInfo.PatInHosId;
            InPayPara.SettleInfo.SettleNo             = InPayPara.RegInfo.MemberNo;           //医保中心交易流水号//农合就诊证号
            InPayPara.SettleInfo.Amount               = Convert.ToDecimal(JS[0].ToString());  //本次医疗费用
            InPayPara.SettleInfo.GetAmount            = Convert.ToDecimal(JS[2].ToString());  //本次现金支出
            InPayPara.SettleInfo.MedAmountZhzf        = Convert.ToDecimal(JS[5].ToString());  //本次帐户支出
            InPayPara.SettleInfo.MedAmountTc          = Convert.ToDecimal(JS[1].ToString());  //本次统筹支出
            InPayPara.SettleInfo.MedAmountDb          = 0;                                    //本次大病支出
            InPayPara.SettleInfo.MedAmountBz          = Convert.ToDecimal(JS[24].ToString()); //本次民政补助金额
            InPayPara.SettleInfo.MedAmountGwy         = Convert.ToDecimal(0);                 //本次公务员补助
            InPayPara.SettleInfo.CreateTime           = DateTime.Now;
            InPayPara.SettleInfo.InvoiceId            = -1;
            InPayPara.SettleInfo.IsCash               = true;
            InPayPara.SettleInfo.IsInvalid            = false;
            InPayPara.SettleInfo.IsNeedRefund         = false;
            InPayPara.SettleInfo.IsRefundDo           = false;
            InPayPara.SettleInfo.IsSettle             = true; //总费用                                                         //基金统筹                            //民政救助                           //   大病保险                          //180补偿金额
            InPayPara.SettleInfo.MedAmountTotal       = Convert.ToDecimal(InPayPara.SettleInfo.Amount) - Convert.ToDecimal(InPayPara.SettleInfo.GetAmount) - Convert.ToDecimal(JS[24].ToString()) - Convert.ToDecimal(JS[29].ToString()) - Convert.ToDecimal(JS[33].ToString()) - Convert.ToDecimal(JS[35].ToString());
            InPayPara.SettleInfo.NetworkingPatClassId = Convert.ToInt32("10002");
            InPayPara.SettleInfo.NetworkPatName       = networkPatInfo.PatName;
            InPayPara.SettleInfo.NetworkPatType       = "0";
            InPayPara.SettleInfo.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            InPayPara.SettleInfo.NetworkSettleTime    = DateTime.Now;
            InPayPara.SettleInfo.OperatorId           = PayAPIConfig.Operator.UserSysId;
            InPayPara.SettleInfo.SettleBackNo         = "";
            InPayPara.SettleInfo.SettleType           = JS[12];//中心单据号,报补单号
            InPayPara.SettleInfo.NetworkPatName       = "";



            //门诊付费方式 本接口 4 医保 5  农合
            PayAPIInterface.Model.Comm.PayType payType;
            InPayPara.PayTypeList = new List <PayType>();



            payType           = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId = 5;
            // payType.PayAmount = Convert.ToDecimal(neusoftResolver.ListOutParas[49]);
            InPayPara.PayTypeList.Add(payType);
        }
        /// <summary>
        /// 保存门诊结算数据
        /// </summary>
        public void SaveOutSettleMain(string bz)
        {
            string[] arr = new string[6];
            arr[0] = "病人结算号";
            arr[1] = "病人负担金额";
            arr[2] = "医保负担金额";
            arr[3] = "个人账户支付";
            arr[4] = "统筹支付";
            arr[5] = "账户支付";

            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                int a = 0;
                OutNetworkSettleList outNetworkSettleList;
                foreach (var item in dicSettleInfo)
                {
                    outNetworkSettleList                    = new OutNetworkSettleList();
                    outNetworkSettleList.OutPatId           = outReimPara.PatInfo.OutPatId;
                    outNetworkSettleList.OutNetworkSettleId = outReimPara.CommPara.OutNetworkSettleId;
                    outNetworkSettleList.ParaName           = item.Key.ToString();
                    outNetworkSettleList.ParaValue          = item.Value;
                    if (a < 6)
                    {
                        outNetworkSettleList.Memo = arr[a];
                    }
                    else
                    {
                        outNetworkSettleList.Memo = "索引出界请查询文档";
                    }
                    a++;
                    outReimPara.SettleParaList.Add(outNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Info("保存中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            OutNetworkSettleMain outSettleMain = new OutNetworkSettleMain();
            outSettleMain.OutPatId             = outReimPara.PatInfo.OutPatId;
            outSettleMain.SettleNo             = dicSettleInfo["mzzdlsh"];                                                                                                        //医保中心交易流水号
            outSettleMain.Amount               = Convert.ToDecimal(dicSettleInfo["zje"]);                                                                                         //本次医疗费用
            outSettleMain.GetAmount            = Convert.ToDecimal(dicSettleInfo["zje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]) - Convert.ToDecimal(dicSettleInfo["jmje"]); //本次现金支出
            outSettleMain.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                      //本次帐户支出
            outSettleMain.MedAmountTc          = 0;                                                                                                                               //本次统筹支出
            outSettleMain.MedAmountDb          = 0;                                                                                                                               //本次大病支出
            outSettleMain.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["jmje"]);                                                                                        //本次大病支出
            outSettleMain.CreateTime           = DateTime.Now;
            outSettleMain.InvoiceId            = -1;
            outSettleMain.IsCash               = true;
            outSettleMain.IsInvalid            = false;
            outSettleMain.IsNeedRefund         = false;
            outSettleMain.IsRefundDo           = false;
            outSettleMain.IsSettle             = true;
            outSettleMain.MedAmountTotal       = Convert.ToDecimal(outSettleMain.Amount) - Convert.ToDecimal(outSettleMain.GetAmount);
            outSettleMain.NetworkingPatClassId = Convert.ToInt32(outReimPara.SettleInfo.NetworkingPatClassId);
            outSettleMain.NetworkPatName       = dicPatInfo["xm"];
            outSettleMain.NetworkPatType       = "0";
            outSettleMain.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            outSettleMain.NetworkSettleTime    = DateTime.Now;
            outSettleMain.OperatorId           = PayAPIConfig.Operator.UserSysId; //operatorInfo.UserSysId;
            outSettleMain.OutNetworkSettleId   = Convert.ToDecimal(outReimPara.SettleInfo.OutNetworkSettleId);
            outSettleMain.SettleBackNo         = "";

            outSettleMain.SettleType = (bz == "Deduct" ? "10" : (bz == "JZ" ? "9" : "1")); //自定义暂存款SettleType为10,急诊的SettleType为9
            outReimPara.SettleInfo   = outSettleMain;

            PayAPIInterface.Model.Comm.PayType payType;
            outReimPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 4;
            payType.PayTypeName = "医保";
            payType.PayAmount   = Convert.ToDecimal(outSettleMain.MedAmountTotal);
            outReimPara.PayTypeList.Add(payType);

            //payType = new PayAPIInterface.Model.Comm.PayType();
            //payType.PayTypeId = 5;
            //payType.PayTypeName = "医保卡";
            //payType.PayAmount = Convert.ToDecimal(outReimPara.SettleInfo.MedAmountZhzf);
            //outReimPara.PayTypeList.Add(payType);
        }
        /// <summary>
        /// 住院预结算
        /// </summary>
        /// <param name="inPara">住院接口入参</param>
        /// <returns></returns>
        public void InNetworkPreSettle(InPayParameter para)
        {
            inReimPara = para;

            if (inReimPara.SettleInfo != null && inReimPara.SettleInfo.MedAmountTotal != 0)
            {
                PayAPIInterface.Model.Comm.PayType payType;
                inReimPara.PayTypeList = new List <PayType>();
                payType             = new PayAPIInterface.Model.Comm.PayType();
                payType.PayTypeId   = 4;
                payType.PayTypeName = "医保";
                payType.PayAmount   = inReimPara.SettleInfo.MedAmountTotal;
                inReimPara.PayTypeList.Add(payType);

                //payType = new PayAPIInterface.Model.Comm.PayType();
                //payType.PayTypeId = 5;
                //payType.PayTypeName = "医保卡";
                //payType.PayAmount = inReimPara.SettleInfo.MedAmountZhzf;
                //inReimPara.PayTypeList.Add(payType);

                return;
            }

            //StringBuilder str = new StringBuilder();
            //str.Append("SELECT MEMBER_NO FROM ZY.[IN].IN_NETWORK_REGISTERS WHERE PAT_IN_HOS_ID='"+para.PatInfo.PatInHosId.ToString("f0")+"'");
            //DataSet ds = JNDWInterfaceModel.handelModel.sqlHelperHis.ExecSqlReDs(str.ToString());
            //DataTable dt = ds.Tables[0];
            ////string MEMBERNO = dt.Rows[0]["MEMBER_NO"].ToString();
            ////if (inReimPara.RegInfo.MemberNo == null)
            //if (dt.Rows.Count>0)
            //{
            //    //throw new Exception("没有找到联网登记信息,请确认是否联网登记!");
            //}
            //else
            //{
            //    throw new Exception("没有找到联网登记信息,请确认是否联网登记!");
            //}

            if (inReimPara.RegInfo.MemberNo == null)
            {
                //throw new Exception("没有找到联网登记信息,请确认是否联网登记!");
            }

            InterfaceInit();
            handelModel.InitZY(inReimPara.RegInfo.PatInHosSerial);
            InReimUpItems();

            //----------------------------------------------------------------------
            #region
            //StringBuilder str = new StringBuilder();
            //str.Append("SELECT  ");
            ////str.Append("--TOP 1 ");
            //str.Append("IN_PAT_NAME AS 姓名,");
            //str.Append("SEX_NAME AS 性别,");
            //str.Append("d.ID_NO AS 身份证号,");
            //str.Append("d.PAT_IN_HOS_SERIAL AS 住院号,");
            //str.Append("PAT_AGAIN_IN_TIMES AS 住院次数, ");
            //str.Append("PAT_MAIN_DIAGNOSE_ID AS 诊断编码, ");
            //str.Append("MAIN_DIAG_NAME AS 诊断名称, ");
            //str.Append("b.DIAGNOSIS_CODE  as ICD疾病编码, ");
            //str.Append("PAT_IN_CHARGE_DOC_ID AS 经治医生编号, ");
            //str.Append("c.UESR_NAME AS 经治医生姓名, ");
            //str.Append("PAT_IN_TIME AS 入院时间, ");
            //str.Append("PAT_LEAVE_ORDER_LEAVE_TIME AS 出院时间, ");
            //str.Append("DATEDIFF(DAY, PAT_IN_TIME, PAT_LEAVE_ORDER_LEAVE_TIME) AS 天数, ");
            //str.Append("PAT_IN_TIME AS 确诊日期, ");
            //str.Append("DATEDIFF(DAY, PAT_IN_TIME, PAT_IN_TIME + 1) AS 确诊天数 ");
            //str.Append("FROM  ZY.[IN].PAT_ALL_INFO_VIEW a ");
            //str.Append("LEFT JOIN COMM.DICT.DIAGNOSIS b ON a.PAT_MAIN_DIAGNOSE_ID = b.DIAGNOSIS_ID ");
            //str.Append("LEFT JOIN COMM.COMM.USERINFO_VIEW c ON a.PAT_IN_CHARGE_DOC_ID = c.USER_SYS_ID ");
            //str.Append("LEFT JOIN ZY.[IN].IN_NETWORK_REGISTERS d ON a.PAT_IN_HOS_ID = d.PAT_IN_HOS_ID ");
            //str.Append("WHERE  a.PAT_IN_HOS_ID = '" + para.PatInfo.PatInHosId.ToString("f0") + "' ");

            //DataSet ds = JNDWInterfaceModel.handelModel.sqlHelperHis.ExecSqlReDs(str.ToString());
            //DataTable dt = ds.Tables[0];
            ////病历首页初始化
            //handelModel.BlsyCsh(para.PatInfo.PatInHosCode);
            ////比例首页上传参数保存
            //handelModel.BlsySc(dt);

            #endregion
            //----------------------------------------------------------------------------------------------------
            //if (MessageBox.Show("是否有医保卡?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            if (inReimPara.RegInfo.Memo2 == "1")
            {
                dicSettleInfo = handelModel.SettleZY("");
            }
            else
            {
                dicSettleInfo = handelModel.SettleZY("wkzy");
            }

            SaveInSettleMain();
        }
Exemple #10
0
        public void SaveInSettleMain()
        {
            try
            {
                InNetworkSettleList inNetworkSettleList = new InNetworkSettleList();
                foreach (var item in dicSettleInfo)
                {
                    inNetworkSettleList                   = new InNetworkSettleList();
                    inNetworkSettleList.PatInHosId        = InPayPara.PatInfo.PatInHosId;
                    inNetworkSettleList.InNetworkSettleId = -1;
                    inNetworkSettleList.ParaName          = item.Key;
                    inNetworkSettleList.ParaValue         = item.Value.ToString();
                    inNetworkSettleList.Memo              = "";
                    InPayPara.SettleParaList.Add(inNetworkSettleList);
                }
            }

            catch (Exception ex)
            {
                //LogManager.RecordException("保存农合中心返回值参数列表 插入值 失败" + ex.Message, "@JSBCInterfaceModel:住院结算");
            }

            InPayPara.SettleInfo                      = new PayAPIInterface.Model.In.InNetworkSettleMain();
            InPayPara.SettleInfo.PatInHosId           = InPayPara.PatInfo.PatInHosId;
            InPayPara.SettleInfo.SettleNo             = dicSettleInfo["brjsh"];                                                                                                                                                            //医保中心交易流水号
            InPayPara.SettleInfo.Amount               = Convert.ToDecimal(dicSettleInfo["brfdje"]) + Convert.ToDecimal(dicSettleInfo["ybfdje"]) + Convert.ToDecimal(dicSettleInfo["ylbzje"]) + Convert.ToDecimal(dicSettleInfo["yyfdje"]); //本次医疗费用
            InPayPara.SettleInfo.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                           //本次现金支出
            InPayPara.SettleInfo.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                                                                                                                        //本次帐户支出
            InPayPara.SettleInfo.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                                                                                                                        //本次统筹支出
            InPayPara.SettleInfo.MedAmountDb          = 0;                                                                                                                                                                                 //大病救助
            InPayPara.SettleInfo.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                                                                                                                        //医疗补助金额(优抚对象补助)
            InPayPara.SettleInfo.MedAmountGwy         = 0;                                                                                                                                                                                 //公务员补助
            InPayPara.SettleInfo.MedAmountJm          = Convert.ToDecimal(dicSettleInfo["yyfdje"]);                                                                                                                                        //医院负担金额
            InPayPara.SettleInfo.CreateTime           = DateTime.Now;
            InPayPara.SettleInfo.InvoiceId            = -1;
            InPayPara.SettleInfo.IsCash               = true;
            InPayPara.SettleInfo.IsInvalid            = false;
            InPayPara.SettleInfo.IsNeedRefund         = false;
            InPayPara.SettleInfo.IsRefundDo           = false;
            InPayPara.SettleInfo.IsSettle             = true;
            InPayPara.SettleInfo.MedAmountTotal       = Convert.ToDecimal(InPayPara.SettleInfo.Amount) - Convert.ToDecimal(InPayPara.SettleInfo.GetAmount);
            InPayPara.SettleInfo.NetworkingPatClassId = Convert.ToInt32(InPayPara.CommPara.NetworkPatClassId);
            InPayPara.SettleInfo.NetworkPatName       = InPayPara.RegInfo.NetPatName;
            InPayPara.SettleInfo.NetworkPatType       = InPayPara.RegInfo.NetPatType; // "0";
            InPayPara.SettleInfo.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            InPayPara.SettleInfo.NetworkSettleTime    = DateTime.Now;
            InPayPara.SettleInfo.OperatorId           = PayAPIConfig.Operator.UserSysId;
            InPayPara.SettleInfo.SettleBackNo         = InPayPara.RegInfo.NetPatType;
            InPayPara.SettleInfo.SettleType           = InPayPara.RegInfo.NetType;

            InPayPara.RegInfo.OutDiagnoseCode = ""; //出院诊断编号
            InPayPara.RegInfo.OutDiagnoseName = ""; //出院诊断名称

            //门诊付费方式 本接口 4 医保 6农合
            PayAPIInterface.Model.Comm.PayType payType;
            InPayPara.PayTypeList = new List <PayType>();
            payType             = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId   = 4;
            payType.PayTypeName = "医保";
            payType.PayAmount   = InPayPara.SettleInfo.MedAmountTotal;
            InPayPara.PayTypeList.Add(payType);
        }
Exemple #11
0
        public void SaveOutSettleMain()
        {
            #region 保存中心返回值参数列表
            //保存中心返回值参数列表
            try
            {
                OutPayPara.SettleParaList = new List <PayAPIInterface.Model.Out.OutNetworkSettleList>();
                PayAPIInterface.Model.Out.OutNetworkSettleList outNetworkSettleList;
                foreach (var item in dicSettleInfo)
                {
                    outNetworkSettleList                    = new PayAPIInterface.Model.Out.OutNetworkSettleList();
                    outNetworkSettleList.OutPatId           = OutPayPara.PatInfo.OutPatId;
                    outNetworkSettleList.OutNetworkSettleId = OutPayPara.CommPara.OutNetworkSettleId;
                    outNetworkSettleList.ParaName           = item.Key.ToString();
                    outNetworkSettleList.ParaValue          = item.Value.ToString();
                    outNetworkSettleList.Memo               = "";
                    OutPayPara.SettleParaList.Add(outNetworkSettleList);
                }
            }
            catch (Exception ex)
            {
                LogManager.Error("门诊结算保存中心返回值参数列表 插入值 失败" + ex.Message);
            }
            #endregion

            OutPayPara.SettleInfo                      = new PayAPIInterface.Model.Out.OutNetworkSettleMain();
            OutPayPara.SettleInfo.OutPatId             = OutPayPara.PatInfo.OutPatId;
            OutPayPara.SettleInfo.SettleNo             = dicSettleInfo["brjsh"];
            OutPayPara.SettleInfo.Amount               = Convert.ToDecimal(dicSettleInfo["zje"]);                                                 //本次医疗费用
            OutPayPara.SettleInfo.GetAmount            = Convert.ToDecimal(dicSettleInfo["brfdje"]) - Convert.ToDecimal(dicSettleInfo["grzhzf"]); //本次现金支出
            OutPayPara.SettleInfo.MedAmountZhzf        = Convert.ToDecimal(dicSettleInfo["grzhzf"]);                                              //本次帐户支出
            OutPayPara.SettleInfo.MedAmountTc          = Convert.ToDecimal(dicSettleInfo["ybfdje"]);                                              //本次统筹支出
            OutPayPara.SettleInfo.MedAmountDb          = Convert.ToDecimal(dicSettleInfo["dezf"]);                                                //本次大额支出
            OutPayPara.SettleInfo.MedAmountBz          = Convert.ToDecimal(dicSettleInfo["ylbzje"]);                                              //医疗补助支付
            OutPayPara.SettleInfo.MedAmountGwy         = 0;                                                                                       //公务员补助
            OutPayPara.SettleInfo.MedAmountJm          = Convert.ToDecimal(dicSettleInfo["yljmje"]);                                              //医疗减免支付
            OutPayPara.SettleInfo.CreateTime           = DateTime.Now;
            OutPayPara.SettleInfo.InvoiceId            = -1;
            OutPayPara.SettleInfo.IsCash               = true;
            OutPayPara.SettleInfo.IsInvalid            = false;
            OutPayPara.SettleInfo.IsNeedRefund         = false;
            OutPayPara.SettleInfo.IsRefundDo           = false;
            OutPayPara.SettleInfo.IsSettle             = true;
            OutPayPara.SettleInfo.MedAmountTotal       = Convert.ToDecimal(OutPayPara.SettleInfo.Amount) - Convert.ToDecimal(OutPayPara.SettleInfo.GetAmount);
            OutPayPara.SettleInfo.NetworkingPatClassId = Convert.ToInt32(OutPayPara.CommPara.NetworkPatClassId);
            OutPayPara.SettleInfo.NetworkPatName       = networkPatInfo.PatName;
            OutPayPara.SettleInfo.NetworkPatType       = networkPatInfo.MedicalType;// "0";
            OutPayPara.SettleInfo.NetworkRefundTime    = Convert.ToDateTime("2000-01-01");
            OutPayPara.SettleInfo.NetworkSettleTime    = DateTime.Now;
            OutPayPara.SettleInfo.OperatorId           = PayAPIConfig.Operator.UserSysId;
            OutPayPara.SettleInfo.OutNetworkSettleId   = Convert.ToDecimal(OutPayPara.CommPara.OutNetworkSettleId);
            OutPayPara.SettleInfo.SettleBackNo         = OutPayPara.RegInfo.NetPatType;
            OutPayPara.SettleInfo.SettleType           = OutPayPara.RegInfo.NetType;

            //门诊付费方式 本接口 4 医保 6农合
            PayAPIInterface.Model.Comm.PayType payType = new PayAPIInterface.Model.Comm.PayType();
            payType.PayTypeId      = 4;
            payType.PayTypeName    = "医保";
            payType.PayAmount      = Convert.ToDecimal(OutPayPara.SettleInfo.MedAmountTotal);
            OutPayPara.PayTypeList = new List <PayType>();
            OutPayPara.PayTypeList.Add(payType);
        }