Beispiel #1
0
        /// <summary>
        /// 设置显示信息
        /// </summary>
        /// <param name="patient">挂号基本信息</param>
        /// <param name="ft">计算后的费用分项信息</param>
        /// <param name="feeItemLists">费用明细基本信息</param>
        /// <param name="diagLists">诊断信息</param>
        /// <param name="otherInfomations">其他信息</param>
        public void SetInfomation(Neusoft.HISFC.Models.Registration.Register patient, Neusoft.HISFC.Models.Base.FT ft, ArrayList feeItemLists, ArrayList diagLists,
                                  params string[] otherInfomations)
        {
            if (this.medcareInterfaceProxy == null)
            {
                this.medcareInterfaceProxy = new Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy();
            }

            if (this.medcareInterfaceProxy == null)
            {
                return;
            }

            if (patient == null)
            {
                return;
            }

            this.medcareInterfaceProxy.SetPactCode(patient.Pact.ID);
            if (feeItemLists == null)// || feeItemLists.Count <= 0)
            {
                if (ft != null)
                {
                    this.tbDrugSendInfo.Text = ft.User01;
                    this.tbRealOwnCost.Text  = ft.RealCost.ToString();
                    this.tbReturnCost.Text   = ft.ReturnCost.ToString();
                }

                this.Clear();

                return;
            }

            //if (feeItemLists == null || feeItemLists.Count <= 0)
            //{
            //    return;
            //}


            //if (patient.Pact.PayKind.ID == "02" && isPreeFee == false)
            //{
            //    //医保划价按自费来
            //}
            //else
            //{

            //{CC93C88A-9DD0-49fe-9DC0-B6DA445A7F30}根据参数判断、不区分是否是医保患者了,要不该参数控制不了自费患者。--修改新乡分币时发现的问题
            if (isPreeFee)
            {
                long returnValue = this.medcareInterfaceProxy.DeleteUploadedFeeDetailsOutpatient(patient, ref feeItemLists);
                if (returnValue == -1)
                {
                    MessageBox.Show(Language.Msg("待遇接口上传明细失败!") + this.medcareInterfaceProxy.ErrMsg);

                    return;
                }
                returnValue = this.medcareInterfaceProxy.UploadFeeDetailsOutpatient(patient, ref feeItemLists);
                if (returnValue == -1)
                {
                    MessageBox.Show(Language.Msg("待遇接口上传明细失败!") + this.medcareInterfaceProxy.ErrMsg);

                    return;
                }

                returnValue = this.medcareInterfaceProxy.PreBalanceOutpatient(patient, ref feeItemLists);
                if (returnValue == -1)
                {
                    MessageBox.Show(Language.Msg("待遇接口预结算计算失败!") + this.medcareInterfaceProxy.ErrMsg);

                    return;
                }
                //清除上传明细,结算再传
                this.medcareInterfaceProxy.Rollback();
            }

            decimal sumTotCost = 0, sumPayCost = 0, sumPubCost = 0, sumOwnCost = 0; decimal sumDrugCost = 0;

            if (feeItemLists != null)
            {
                foreach (Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList f in feeItemLists)
                {
                    if (f.IsAccounted)
                    {
                        if (f.FT.OwnCost > 0)
                        {
                            sumPayCost += f.FT.OwnCost;
                            sumOwnCost += 0;
                        }
                        else
                        {
                            sumPayCost += f.FT.PayCost;
                        }
                    }
                    else
                    {
                        sumTotCost += f.FT.TotCost;
                        sumPayCost += f.FT.PayCost;
                        //{C623A693-19A7-4378-859D-5C07CFF9BEB1}
                        sumPubCost += f.FT.PubCost + f.FT.RebateCost;
                        sumOwnCost += f.FT.OwnCost - f.FT.RebateCost;
                    }
                    if (this.drugFeeCodeHelper.ArrayObject != null && this.drugFeeCodeHelper.ArrayObject.Count > 0 && this.drugFeeCodeHelper.GetObjectFromID(f.Item.MinFee.ID) != null)
                    {
                        sumDrugCost += f.FT.OwnCost + f.FT.PayCost + f.FT.PubCost;
                    }
                }

                if (patient.Pact.PayKind.ID == "01")
                {
                    this.tbOwnCost.Text = Neusoft.FrameWork.Public.String.FormatNumber(sumOwnCost, 2).ToString();
                    this.tbTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumber(sumTotCost, 2).ToString();
                    this.tbPayCost.Text = sumPayCost.ToString();
                    //{C623A693-19A7-4378-859D-5C07CFF9BEB1}
                    //this.tbPubCost.Text = "0.00";
                    this.tbPubCost.Text  = sumPubCost.ToString();
                    this.tbDrugCost.Text = sumDrugCost.ToString();
                }
                else if (patient.Pact.PayKind.ID == "03")
                {
                    this.tbTotCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumTotCost, 2).ToString();
                    this.tbOwnCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumOwnCost, 2).ToString();
                    this.tbPayCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumPayCost, 2).ToString();
                    this.tbPubCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumPubCost, 2).ToString();
                    this.tbDrugCost.Text = sumDrugCost.ToString();
                }
                else
                {
                    if (patient.Pact.PayKind.ID == "02" && isPreeFee == false)
                    {
                        //医保划价按自费来
                        this.tbOwnCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumOwnCost, 2).ToString();
                        this.tbTotCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(sumTotCost, 2).ToString();
                        this.tbPayCost.Text  = sumPayCost.ToString();
                        this.tbPubCost.Text  = "0.00";
                        this.tbDrugCost.Text = sumDrugCost.ToString();
                    }
                    else
                    {
                        this.tbTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumber(sumTotCost, 2).ToString();
                        //this.tbOwnCost.Text = Neusoft.FrameWork.Public.String.FormatNumber(sumTotCost, 2).ToString();
                        //this.tbPayCost.Text = "0.00";
                        //this.tbPubCost.Text = "0.00";
                        this.tbOwnCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(patient.SIMainInfo.OwnCost, 2).ToString();
                        this.tbPayCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(patient.SIMainInfo.PayCost, 2).ToString();
                        this.tbPubCost.Text  = Neusoft.FrameWork.Public.String.FormatNumber(patient.SIMainInfo.PubCost, 2).ToString();
                        this.tbDrugCost.Text = sumDrugCost.ToString();
                    }
                }
            }

            if (ft != null)
            {
                this.tbDrugSendInfo.Text = ft.User01;
                this.tbRealOwnCost.Text  = ft.RealCost.ToString();
                this.tbReturnCost.Text   = ft.ReturnCost.ToString();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 显示患者的发票信息
        /// </summary>
        /// <param name="feeItemList"></param>
        /// <returns></returns>
        public int RefreshDisplayInfomation(ArrayList feeItemList)
        {
            for (int i = 0; i < this.fpSpread1_Sheet1.Rows.Count; i++)
            {
                for (int j = 0; j < this.fpSpread1_Sheet1.Columns.Count; j++)
                {
                    this.fpSpread1_Sheet1.Cells[i, j].Text = "";
                }
            }

            decimal totCost     = 0m;
            decimal totPay      = 0m;
            decimal totPub      = 0m;
            decimal totPubPha   = 0m;
            decimal totPubZYPha = 0m;

            if (feeItemList == null)
            {
                MessageBox.Show("没有费用明细!");

                return(-1);
            }
            if (dsInvoice == null || dsInvoice.Tables[0].Rows.Count <= 0)
            {
                MessageBox.Show("没有发票信息!请维护!");

                return(-1);
            }

            foreach (DataRow row in dsInvoice.Tables[0].Rows)
            {
                row["Tot_Cost"] = 0;
                row["Own_Cost"] = 0;
                row["Pay_Cost"] = 0;
                row["Pub_Cost"] = 0;
            }

            foreach (FeeItemList f in feeItemList)
            {
                DataRow rowFind = dsInvoice.Tables[0].Rows.Find(new object[] { f.Item.MinFee.ID });
                if (rowFind == null)
                {
                    MessageBox.Show("最小费用为" + f.Item.MinFee.ID + "的最小费用没有在MZ01的发票大类中维护");
                    return(-1);
                }
                rowFind["Tot_Cost"] = NConvert.ToDecimal(rowFind["Tot_Cost"].ToString()) + f.FT.TotCost;
                rowFind["Own_Cost"] = NConvert.ToDecimal(rowFind["Own_Cost"].ToString()) + f.FT.OwnCost;
                rowFind["Pay_Cost"] = NConvert.ToDecimal(rowFind["Pay_Cost"].ToString()) + f.FT.PayCost;
                rowFind["Pub_Cost"] = NConvert.ToDecimal(rowFind["Pub_Cost"].ToString()) + f.FT.PubCost;

                if (this.regInfo.Pact.PayKind.ID == "03")
                {
                    totPub += f.FT.PubCost;
                    totPay += f.FT.PayCost;
                }
            }
            //by 牛鑫元

            if (feeItemList.Count > 0)
            {
                if (this.isPreFee)
                {
                    if (this.regInfo.Pact.PayKind.ID == "02")
                    {
                        //医保患者处理预结算
                        long returnValue = 0;
                        Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy medcareInterfaceProxy = new Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy();
                        returnValue = medcareInterfaceProxy.SetPactCode(this.regInfo.Pact.ID);
                        //medcareInterfaceProxy.SetTrans()

                        returnValue = medcareInterfaceProxy.Connect();
                        if (returnValue != 1)
                        {
                            medcareInterfaceProxy.Rollback();
                            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口初始化失败") + medcareInterfaceProxy.ErrMsg);
                            return(-1);
                        }

                        returnValue = medcareInterfaceProxy.UploadFeeDetailsOutpatient(this.regInfo, ref feeItemList);
                        if (returnValue < 0)
                        {
                            MessageBox.Show("待遇接口" + medcareInterfaceProxy.ErrMsg);
                            return(-1);
                        }
                        returnValue = medcareInterfaceProxy.PreBalanceOutpatient(this.regInfo, ref feeItemList);
                        if (returnValue < 0)
                        {
                            MessageBox.Show("待遇接口" + medcareInterfaceProxy.ErrMsg);
                            return(-1);
                        }
                        medcareInterfaceProxy.Rollback();
                        totPay = this.regInfo.SIMainInfo.PayCost;
                        totPub = this.regInfo.SIMainInfo.PubCost;
                    }
                }
            }

            for (int i = 1; i < 50; i++)
            {
                DataRow[] rowFind = dsInvoice.Tables[0].Select("SEQ = " + i.ToString(), "SEQ ASC");
                if (rowFind.Length == 0)
                {
                    //break;
                }
                else
                {
                    Neusoft.HISFC.Models.Fee.Outpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Outpatient.BalanceList();

                    detail.InvoiceSquence   = NConvert.ToInt32(rowFind[0]["SEQ"].ToString());
                    detail.FeeCodeStat.ID   = rowFind[0]["FEE_STAT_CATE"].ToString();
                    detail.FeeCodeStat.Name = rowFind[0]["FEE_STAT_NAME"].ToString();

                    foreach (DataRow row in rowFind)
                    {
                        detail.BalanceBase.FT.PubCost += NConvert.ToDecimal(row["Pub_Cost"].ToString());
                        detail.BalanceBase.FT.OwnCost += NConvert.ToDecimal(row["Own_Cost"].ToString());
                        detail.BalanceBase.FT.PayCost += NConvert.ToDecimal(row["Pay_Cost"].ToString());
                        detail.BalanceBase.FT.TotCost += NConvert.ToDecimal(row["Tot_Cost"].ToString());
                    }

                    if (invoicePreviewType == "1" && this.regInfo.Pact.PayKind.ID == "03" && detail.InvoiceSquence != 7 && detail.InvoiceSquence != 8 && detail.InvoiceSquence != 22 && detail.InvoiceSquence != 23)
                    {
                        totCost += detail.BalanceBase.FT.PubCost + detail.BalanceBase.FT.PayCost;
                    }
                    else
                    {
                        totCost += detail.BalanceBase.FT.TotCost;
                    }
                    if (detail.BalanceBase.FT.TotCost > 0)
                    {
                        int y = detail.InvoiceSquence / 8;
                        int x = detail.InvoiceSquence - 8 * y;
                        if (x == 0)
                        {
                            x = 8;
                        }
                        if (y == 3)
                        {
                            y = 2;
                        }
                        if (detail.InvoiceSquence == 16)
                        {
                            y = 1;
                        }
                        #region Changed by zuowy -- 2006/07/28

                        if (detail.InvoiceSquence % 8 == 0)
                        {
                            y = (detail.InvoiceSquence - 8) / 8;
                        }

                        #endregion
                        this.fpSpread1_Sheet1.Cells[x - 1, 2 * y].Text = detail.FeeCodeStat.Name;
                        if (invoicePreviewType == "1" && this.regInfo.Pact.PayKind.ID == "03" && detail.InvoiceSquence != 7 && detail.InvoiceSquence != 8 && detail.InvoiceSquence != 22 && detail.InvoiceSquence != 23)//中山模式公费显示记帐部分
                        {
                            this.fpSpread1_Sheet1.Cells[x - 1, 2 * y + 1].Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString((detail.BalanceBase.FT.PayCost + detail.BalanceBase.FT.PubCost), 2);
                        }
                        else
                        {
                            this.fpSpread1_Sheet1.Cells[x - 1, 2 * y + 1].Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(detail.BalanceBase.FT.TotCost, 2);
                        }
                    }
                }
            }

            this.lblTotCost.Text = "大写总金额: " + Neusoft.FrameWork.Public.String.LowerMoneyToUpper(totCost);

            return(1);
        }
Beispiel #3
0
 /// <summary>
 /// 设置待遇接口变量
 /// </summary>
 /// <param name="medcareInterfaceProxy">接口变量</param>
 public void SetMedcareInterfaceProxy(Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy medcareInterfaceProxy)
 {
     this.medcareInterfaceProxy = medcareInterfaceProxy;
 }
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public virtual int Save()
        {
            if (cmbZg.Tag == null || cmbZg.Tag.ToString().Trim() == string.Empty)
            {
                this.Err = "请输入出院情况";
                this.cmbZg.Focus();
                return(-1);
            }
            //如果患者不是当天出院提示
            if (this.dtOutDate.Value.Date != this.inpatient.GetDateTimeFromSysDateTime().Date)
            {
                DialogResult dr = MessageBox.Show("该患者的出院日期是: " +
                                                  this.dtOutDate.Value.ToString("yyyy年MM月dd日") + "  是否继续?", "提示",
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Information,
                                                  MessageBoxDefaultButton.Button1);
                if (dr == DialogResult.No)
                {
                    this.Err = "";
                    return(-1);
                }
            }

            if (this.PatientInfo == null || string.IsNullOrEmpty(this.PatientInfo.ID))
            {
                this.Err = "请回车确认住院号是否存在!";

                return(-1);
            }

            //取患者最新的住院主表信息
            PatientInfo = this.radt.GetPatientInfomation(this.PatientInfo.ID);
            if (PatientInfo == null)
            {
                this.Err = this.radt.Err;
                return(-1);
            }
            this.Err = "";

            //如果患者在院状态发生变化,则不允许操作

            string in_State = PatientInfo.PVisit.InState.ID.ToString();

            if (PatientInfo.PVisit.InState.ID.ToString() != "I")
            {
                this.Err = "该患者没有接诊";
                return(-1);
            }

            //取出院登记信息
            this.GetOutInfo();
            //{2A467990-BDA3-4cb4-BB89-5801796EBC95}
            Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid obj = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid)) as Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid;
            if (obj != null)
            {
                string err = string.Empty;
                bool   bl  = obj.IsPatientShiftValid(PatientInfo, Neusoft.HISFC.Models.Base.EnumPatientShiftValid.O, ref err);
                if (!bl)
                {
                    MessageBox.Show(err);
                    return(-1);
                }
            }
            //出院登记
            HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy medcareInterfaceProxy = new Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy();
            long returnValue = medcareInterfaceProxy.SetPactCode(this.PatientInfo.Pact.ID);

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            radt.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            medcareInterfaceProxy.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            medcareInterfaceProxy.BeginTranscation();

            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得合同单位失败" + medcareInterfaceProxy.ErrMsg));
                return(-1);
            }

            returnValue = medcareInterfaceProxy.Connect();
            {
                if (returnValue != 1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得合同单位失败" + medcareInterfaceProxy.ErrMsg));
                    return(-1);
                }
            }
            medcareInterfaceProxy.BeginTranscation();
            //returnValue = medcareInterfaceProxy.GetRegInfoInpatient(this.PatientInfo);
            //if (returnValue != 1)
            //{
            //    t.RollBack();
            //    medcareInterfaceProxy.Rollback();
            //    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得患者信息失败" + medcareInterfaceProxy.ErrMsg));
            //    return -1;
            //}
            //出院登记(带改)
            returnValue = medcareInterfaceProxy.LogoutInpatient(this.PatientInfo);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获出院登记失败" + medcareInterfaceProxy.ErrMsg));
                return(-1);
            }


            int i = radt.OutPatient(PatientInfo);

            this.Err = radt.Err;
            if (i == -1)
            {
                         //失败
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    medcareInterfaceProxy.Rollback();
                    return(-1);
                }
            }
            else if (i == 0)//取消
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                this.Err = "";
                return(0);
            }
            //zhangjunyi 注释掉 改为commit
            //medcareInterfaceProxy.Rollback();
            if (medcareInterfaceProxy.Commit() < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                this.Err = "医保接口提交事务出错!请检查读卡器连接是否正确";
                return(-1);
            }

            #region addby xuewj 2010-3-15

            if (this.adt == null)
            {
                this.adt = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.IHE.IADT)) as Neusoft.HISFC.BizProcess.Interface.IHE.IADT;
            }
            if (this.adt != null)
            {
                this.adt.DischargeInpatient(this.PatientInfo);
            }

            #endregion

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



            return(1);
        }