예제 #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();
            }
        }
예제 #2
0
        protected override bool ProcessDialogKey(Keys keyData)
        {
            if (this.fpSpread1.ContainsFocus)
            {
                int currRow  = this.fpSpread1_Sheet1.ActiveRowIndex;
                int rowCount = this.fpSpread1_Sheet1.RowCount;

                if (keyData == Keys.Enter)
                {
                    if (currRow < rowCount - 1)
                    {
                        this.fpSpread1_Sheet1.SetActiveCell(currRow + 1, 1, false);
                    }
                    if (currRow == rowCount - 1)
                    {
                        ModifyFinished(seqNO);
                    }
                    Neusoft.HISFC.Models.Fee.Outpatient.BalanceList detailTemp =
                        this.fpSpread1_Sheet1.Rows[currRow].Tag as Neusoft.HISFC.Models.Fee.Outpatient.BalanceList;
                    decimal orgCost = detailTemp.BalanceBase.FT.TotCost;
                    decimal newCost = 0;
                    try
                    {
                        newCost = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[currRow, 1].Text);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("金额输入不合法!" + ex.Message);
                        this.fpSpread1_Sheet1.SetActiveCell(currRow, 1, false);
                        return(false);
                    }
                    if (newCost < 0)
                    {
                        MessageBox.Show("金额不能修改成负数!");
                        this.fpSpread1_Sheet1.SetActiveCell(currRow, 1, false);
                        return(false);
                    }
                    decimal CTFee = 0, MRIFee = 0, SXFee = 0, SYFee = 0;
                    if (detailTemp.FeeCodeStat.ID == this.STATCODEJC)//检查
                    {
                        if ((newCost) < detailTemp.CTFee + detailTemp.MRIFee)
                        {
                            decimal tempCost = 0;
                            decimal errCost  = detailTemp.CTFee + detailTemp.MRIFee - newCost;
                            tempCost = errCost - detailTemp.CTFee;
                            if (tempCost <= 0)
                            {
                                CTFee            = tempCost;
                                detailTemp.CTFee = detailTemp.CTFee - CTFee;
                                MRIFee           = 0;
                            }
                            else
                            {
                                CTFee             = detailTemp.CTFee;
                                detailTemp.CTFee  = 0;
                                MRIFee            = tempCost - detailTemp.CTFee;
                                detailTemp.MRIFee = detailTemp.MRIFee - MRIFee;
                            }
                        }
                    }
                    if (detailTemp.FeeCodeStat.ID == this.STATCODEZL)//治疗
                    {
                        if ((newCost) < detailTemp.SYFee + detailTemp.SXFee)
                        {
                            decimal tempCost = 0;
                            decimal errCost  = detailTemp.SXFee + detailTemp.SYFee - newCost;
                            tempCost = errCost - detailTemp.SXFee;
                            if (tempCost <= 0)
                            {
                                SXFee            = tempCost;
                                detailTemp.SXFee = detailTemp.SXFee - SXFee;
                                SYFee            = 0;
                            }
                            else
                            {
                                SXFee            = detailTemp.SYFee;
                                detailTemp.SXFee = 0;
                                SYFee            = tempCost - detailTemp.SYFee;
                                detailTemp.SYFee = detailTemp.SYFee - SYFee;
                            }
                        }
                    }

                    Neusoft.HISFC.Models.Base.FT ft = new Neusoft.HISFC.Models.Base.FT();

                    ft.OwnCost = detailTemp.BalanceBase.FT.OwnCost;
                    ft.PayCost = detailTemp.BalanceBase.FT.PayCost;
                    ft.PubCost = detailTemp.BalanceBase.FT.PubCost;

                    bool returnValue = this.CostChanged(detailTemp.FeeCodeStat.ID, orgCost, newCost, ref ft, ref CTFee, ref MRIFee, ref SXFee, ref SYFee);
                    if (!returnValue)
                    {
                        this.fpSpread1_Sheet1.Cells[currRow, 1].Text = orgCost.ToString();
                        this.fpSpread1_Sheet1.SetActiveCell(currRow, 1, false);

                        return(false);
                    }
                    else
                    {
                        this.fpSpread1_Sheet1.Cells[currRow, 1].Text = newCost.ToString();
                        detailTemp.BalanceBase.FT.TotCost            = newCost;
                        detailTemp.BalanceBase.FT.OwnCost            = newCost;
                        this.invoice.FT.TotCost = this.invoice.FT.TotCost + (newCost - orgCost);
                        this.invoice.FT.OwnCost = this.invoice.FT.OwnCost + (newCost - orgCost);
                        this.lbCost.Text        = invoice.FT.TotCost.ToString() + " 大写: " + Neusoft.FrameWork.Public.String.LowerMoneyToUpper(invoice.FT.TotCost);
                        if (detailTemp.FeeCodeStat.ID == this.STATCODEJC)//检查
                        {
                            detailTemp.CTFee  += CTFee;
                            detailTemp.MRIFee += MRIFee;
                        }
                        if (detailTemp.FeeCodeStat.ID == this.STATCODEZL)//检查
                        {
                            detailTemp.SXFee += SXFee;
                            detailTemp.SYFee += SYFee;
                        }
                    }
                }
                if (keyData == Keys.Down)
                {
                    this.fpSpread1_Sheet1.ActiveRowIndex = currRow + 1;
                    this.fpSpread1_Sheet1.SetActiveCell(currRow + 1, 1);
                }
                if (keyData == Keys.Up)
                {
                    if (currRow > 0)
                    {
                        this.fpSpread1_Sheet1.ActiveRowIndex = currRow - 1;
                        this.fpSpread1_Sheet1.SetActiveCell(currRow - 1, 1);
                    }
                }
            }
            return(base.ProcessDialogKey(keyData));
        }
예제 #3
0
        bool splitUnit_CostChanged(string feeStat, decimal orgCost, decimal newCost, ref Neusoft.HISFC.Models.Base.FT ft, ref decimal CTFee, ref decimal MRIFee, ref decimal SXFee, ref decimal SYFee)
        {
            ucSplitUnit tempLastSpitUnit = new ucSplitUnit();

            foreach (Control crtl in this.plSplitUnits.Controls)
            {
                if (((ucSplitUnit)crtl).IsLast)
                {
                    tempLastSpitUnit = (ucSplitUnit)crtl;
                    ArrayList detailsTemp = ((ucSplitUnit)crtl).InvoiceDetails;
                    Neusoft.HISFC.Models.Fee.Outpatient.Balance invoiceTemp = ((ucSplitUnit)crtl).Invoice;
                    foreach (Neusoft.HISFC.Models.Fee.Outpatient.BalanceList detail in detailsTemp)
                    {
                        if (detail.FeeCodeStat.ID == feeStat)
                        {
                            if (detail.BalanceBase.FT.TotCost + orgCost < newCost)
                            {
                                MessageBox.Show("分票的金额大于可分金额!");

                                return(false);
                            }
                            else
                            {
                                decimal errCost = newCost - orgCost;

                                if (feeStat == this.STATCODEJC)//检查项目
                                {
                                    detail.CTFee  += CTFee;
                                    detail.MRIFee += MRIFee;
                                    MRIFee         = 0;
                                    CTFee          = 0;
                                }
                                if (feeStat == this.STATCODEZL)//检查项目
                                {
                                    detail.SXFee += SXFee;
                                    detail.SYFee += SYFee;
                                    SXFee         = 0;
                                    SYFee         = 0;
                                }

                                detail.BalanceBase.FT.TotCost = detail.BalanceBase.FT.TotCost - errCost;
                                detail.BalanceBase.FT.OwnCost = detail.BalanceBase.FT.OwnCost - errCost;

                                invoiceTemp.FT.TotCost = invoiceTemp.FT.TotCost - errCost;
                                invoiceTemp.FT.OwnCost = invoiceTemp.FT.OwnCost - errCost;

                                if (feeStat == this.STATCODEJC)//检查
                                {
                                    if ((detail.BalanceBase.FT.TotCost) < detail.CTFee + detail.MRIFee)
                                    {
                                        decimal tempCost   = 0;
                                        decimal errCostOut = detail.CTFee + detail.MRIFee - detail.BalanceBase.FT.TotCost;
                                        tempCost = errCost - detail.CTFee;
                                        if (tempCost <= 0)
                                        {
                                            CTFee        = tempCost;
                                            detail.CTFee = detail.CTFee - tempCost;
                                            MRIFee       = 0;
                                        }
                                        else
                                        {
                                            CTFee         = detail.CTFee;
                                            detail.CTFee  = 0;
                                            MRIFee        = tempCost - detail.CTFee;
                                            detail.MRIFee = detail.MRIFee - MRIFee;
                                        }
                                    }
                                }
                                if (feeStat == this.STATCODEZL)//检查
                                {
                                    if ((detail.BalanceBase.FT.TotCost) < detail.SYFee + detail.SXFee)
                                    {
                                        decimal tempCost   = 0;
                                        decimal errCostOut = detail.SYFee + detail.SXFee - detail.BalanceBase.FT.TotCost;
                                        tempCost = errCost - detail.SYFee;
                                        if (tempCost <= 0)
                                        {
                                            SYFee = tempCost;
                                            SXFee = 0;
                                        }
                                        else
                                        {
                                            SYFee = detail.SYFee;
                                            SXFee = tempCost - detail.SYFee;
                                        }
                                    }
                                }
                            }

                            tempLastSpitUnit.Invoice        = invoiceTemp;
                            tempLastSpitUnit.InvoiceDetails = detailsTemp;
                        }
                    }
                }
            }

            return(true);
        }