Exemplo n.º 1
0
        /// <summary>
        /// 保存划价信息
        /// </summary>
        private void SaveCharge()
        {
            DialogResult result;

            result = MessageBox.Show("是否确定要划价?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button2);

            if (result == DialogResult.No)
            {
                return;
            }

            if (this.currentBalance != null)
            {
                if (hsInvoice.Contains(this.currentBalance))
                {
                    DialogResult r = MessageBox.Show("该发票费用信息已经划价保存过,是否重新划价?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                    if (r == DialogResult.Cancel)
                    {
                        return;
                    }
                }
            }
            else
            {
                return;
            }

            if (this.comFeeItemLists == null || this.comFeeItemLists.Count <= 0)
            {
                MessageBox.Show("费用明细为空!");

                return;
            }

            ArrayList tempFeeItemLists = new ArrayList();

            foreach (FeeItemList f in this.comFeeItemLists)
            {
                tempFeeItemLists.Add(f.Clone());
            }

            string clinicCode = ((FeeItemList)this.comFeeItemLists[0]).Patient.ID;

            Neusoft.HISFC.Models.Registration.Register temPatientInfo = registerIntegrate.GetByClinic(clinicCode);
            if (temPatientInfo == null)
            {
                MessageBox.Show("获得挂号信息失败!" + this.registerIntegrate.Err);

                return;
            }

            temPatientInfo.Pact = this.patientInfo.Pact;

            this.patientInfo = temPatientInfo.Clone();

            foreach (FeeItemList item in tempFeeItemLists)
            {
                item.FT.TotCost = item.FT.PayCost + item.FT.OwnCost + item.FT.PubCost;

                item.FT.PayCost           = 0m;
                item.FT.PubCost           = 0m;
                item.FT.OwnCost           = item.FT.TotCost;
                item.PayType              = Neusoft.HISFC.Models.Base.PayTypes.Charged;
                item.CancelType           = Neusoft.HISFC.Models.Base.CancelTypes.Valid;
                item.RecipeSequence       = "";
                item.RecipeNO             = "";
                item.SequenceNO           = -1;
                item.Invoice.ID           = "";
                item.InvoiceCombNO        = null;
                item.Order.ID             = "";
                item.ConfirmedQty         = 0;
                item.IsConfirmed          = false;
                item.PayType              = Neusoft.HISFC.Models.Base.PayTypes.Charged;
                item.NoBackQty            = item.Item.Qty;
                item.ConfirmedInjectCount = 0;
                item.ConfirmOper          = new Neusoft.HISFC.Models.Base.OperEnvironment();

                item.ChargeOper.ID = this.outpatientManager.Operator.ID;

                item.FeeOper.OperTime = System.DateTime.MinValue;
            }

            bool     iReturn = false;
            DateTime dtNow   = this.outpatientManager.GetDateTimeFromSysDateTime();
            string   errText = "";

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

            this.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            iReturn = this.feeIntegrate.SetChargeInfo(this.patientInfo, tempFeeItemLists, dtNow, ref errText);

            if (iReturn == false)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("划价出错" + errText);

                return;
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                MessageBox.Show("划价成功!");

                if (this.currentBalance != null)
                {
                    Balance invo = this.currentBalance;

                    hsInvoice.Add(invo, null);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 门诊号 住院号
        /// </summary>
        /// <param name="InpatientNo"></param>
        /// <returns></returns>
        public int LoadInfo(string InpatientNo)
        {
            if (InpatientNo == null || InpatientNo == "")
            {
                patientInfo = null;
                MessageBox.Show("传入的住院流水号为空");
                return(-1);
            }

            Neusoft.HISFC.BizProcess.Integrate.RADT radtIntegrate = new Neusoft.HISFC.BizProcess.Integrate.RADT();
            Neusoft.HISFC.BizProcess.Integrate.Registration.Registration registerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Registration.Registration();

            //{8BC09475-C1D9-4765-918B-299E21E04C74} 诊断录入增加医生站、门诊医生站、病案室属性
            if (Enumdiaginput == enumDiagInput.order)//住院医生
            {
                //从住院主表中查旬
                patientInfo = radtIntegrate.GetPatientInfomation(InpatientNo);
                if (patientInfo == null)
                {
                    Neusoft.HISFC.Models.Registration.Register obj = registerIntegrate.GetByClinic(InpatientNo);
                    if (obj == null)
                    {
                        MessageBox.Show("查询病人信息出错");
                        return(-1);
                    }
                    patientInfo           = new Neusoft.HISFC.Models.RADT.PatientInfo();
                    patientInfo.ID        = obj.ID;
                    patientInfo.CaseState = "1";
                }
                //this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC);
                this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC, enumdiaginput.ToString());
            }
            else if (Enumdiaginput == enumDiagInput.outPatientOrder)//门诊医生
            {
                Neusoft.HISFC.Models.Registration.Register obj = registerIntegrate.GetByClinic(InpatientNo);
                if (obj == null)
                {
                    MessageBox.Show("查询病人信息出错");
                    return(-1);
                }
                patientInfo            = new Neusoft.HISFC.Models.RADT.PatientInfo();
                patientInfo.ID         = obj.ID;
                patientInfo.PID.CardNO = obj.PID.CardNO;
                patientInfo.CaseState  = "1";
                this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC, enumdiaginput.ToString());
            }
            else if (Enumdiaginput == enumDiagInput.cas)
            {
                //从住院主表中查旬
                patientInfo = radtIntegrate.GetPatientInfomation(InpatientNo);
                if (patientInfo == null)
                {
                    Neusoft.HISFC.Models.Registration.Register obj = registerIntegrate.GetByClinic(InpatientNo);
                    if (obj == null)
                    {
                        MessageBox.Show("查询病人信息出错");
                        return(-1);
                    }
                    patientInfo           = new Neusoft.HISFC.Models.RADT.PatientInfo();
                    patientInfo.ID        = obj.ID;
                    patientInfo.CaseState = "1";
                }
                this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.CAS, enumdiaginput.ToString());
            }

            this.ucDiagNoseInput1.fpEnterSaveChanges();
            if (this.ucDiagNoseInput1.GetfpSpreadRowCount() == 0)
            {
                this.ucDiagNoseInput1.AddRow();
            }
            return(1);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 执行打印
        /// </summary>
        /// <param name="al">打印数据</param>
        /// <returns>成功返回1 失败返回-1</returns>
        internal int Print(Neusoft.HISFC.Models.Pharmacy.DrugRecipe drugRecipe, ArrayList al, string sendWindow)
        {
            //一次只打印一个处方号的
            //传入的时候按照组合号、院注标记分组 便于打印
            //applyOut.User01 发药窗口号 applyOut.User02 院注次数

            if (al.Count <= 0)
            {
                return(1);
            }

            Neusoft.HISFC.Models.Registration.Register patientInfo = null;              //患者信息

            #region 患者信息获取

            //获取患者信息
            Neusoft.HISFC.BizProcess.Integrate.Registration.Registration regManager = new Neusoft.HISFC.BizProcess.Integrate.Registration.Registration();
            patientInfo = regManager.GetByClinic(drugRecipe.ClinicNO);

            #endregion

            #region  打印方式一 全部数据传输方式

            if (this.isSendAllData)
            {
                patientInfo.User01 = drugRecipe.FeeOper.OperTime.ToString();

                patientInfo.DoctorInfo.Templet.Doct.Name = this.personHelper.GetName(drugRecipe.Doct.ID);

                Function.IDrugPrint.OutpatientInfo = patientInfo;

                Function.IDrugPrint.AddAllData(al);
                Function.IDrugPrint.Print();

                return(1);
            }

            #endregion

            #region 获取标签总页数
            string privCombo     = "";          //上次医嘱组合号
            int    iRecipeTotNum = 0;           //本次需打印标签总页数
            string recipeNo      = "";          //处方号
            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut temp in al)
            {
                temp.SendWindow = sendWindow;
                if (privCombo == temp.CombNO && temp.CombNO != "")
                {
                    continue;
                }
                else
                {
                    iRecipeTotNum = iRecipeTotNum + 1;
                    privCombo     = temp.CombNO;
                }

                recipeNo = temp.RecipeNO;
            }
            #endregion

            Function.IDrugPrint.LabelTotNum = iRecipeTotNum;
            Function.IDrugPrint.DrugTotNum  = al.Count;
            if (patientInfo != null)
            {
                patientInfo.User02 = al.Count.ToString();
                patientInfo.User01 = drugRecipe.FeeOper.OperTime.ToString();

                patientInfo.DoctorInfo.Templet.Doct.Name = this.personHelper.GetName(drugRecipe.Doct.ID);

                patientInfo.User03 = drugRecipe.RecipeNO;

                Function.IDrugPrint.OutpatientInfo = patientInfo;
            }

            privCombo = "-1";
            ArrayList alCombo = new ArrayList();

            #region 打印方式二  数据分组传输

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al)
            {
                info.SendWindow = sendWindow;
                if (privCombo == "-1" || (privCombo == info.CombNO && info.CombNO != ""))
                {
                    alCombo.Add(info);
                    privCombo = info.CombNO;
                    continue;
                }
                else                    //不同处方号
                {
                    if (alCombo.Count == 1)
                    {
                        Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut);
                    }
                    else
                    {
                        Function.IDrugPrint.AddCombo(alCombo);
                    }
                    Function.IDrugPrint.Print();

                    privCombo = info.CombNO;
                    alCombo   = new ArrayList();

                    alCombo.Add(info);
                }
            }
            if (alCombo.Count == 0)
            {
                return(1);
            }
            if (alCombo.Count > 1)
            {
                Function.IDrugPrint.AddCombo(alCombo);
            }
            else
            {
                Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut);
            }

            Function.IDrugPrint.Print();

            #endregion

            return(1);
        }
        private int MakeInvoice()
        {
            if (alFee == null || alFee.Count == 0)
            {
                MessageBox.Show("该患者不存在费用!");
                return(-1);
            }
            listPay.Clear();
            ArrayList al = null;

            Neusoft.HISFC.Models.Base.Employee employee = this.managerIntegrate.GetEmployeeInfo(this.outpatientManager.Operator.ID);
            if (employee == null)
            {
                MessageBox.Show("获取人员信息失败!" + managerIntegrate.Err);
                return(-1);
            }

            string errText = string.Empty;

            #region 获取发票号
            string invoiceNO = string.Empty, realInvoiceNO = string.Empty;

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            //获得本次收费起始发票号
            int iReturnValue = this.feeIntegrate.GetInvoiceNO(employee, ref invoiceNO, ref realInvoiceNO, ref errText, null);
            if (iReturnValue == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(errText, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.RollBack();
            #endregion

            Dictionary <HISFC.Models.Registration.Register, ArrayList> listInvoice = new Dictionary <Neusoft.HISFC.Models.Registration.Register, ArrayList>();
            ArrayList balance = new ArrayList();
            Neusoft.HISFC.Models.Registration.Register r = null;
            //根据每次挂号所生成的费用生成发票
            foreach (string key in listFee.Keys)
            {
                al = listFee[key];
                r  = registerIntegrate.GetByClinic(key);
                if (r == null)
                {
                    MessageBox.Show("查询患者挂号信息失败!");
                    return(-1);
                }
                balance = Class.Function.MakeInvoice(this.feeIntegrate, r, al, invoiceNO, realInvoiceNO, ref errText);
                if (balance == null)
                {
                    return(-1);
                }
                listInvoice.Add(r, balance);
            }
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            string   operID  = outpatientManager.Operator.ID;
            DateTime feeTime = outpatientManager.GetDateTimeFromSysDateTime();
            try
            {
                Neusoft.HISFC.Models.Registration.Register register = null;
                ArrayList             balancesList  = null;
                ArrayList             invoices      = null;
                ArrayList             invoiceDetail = null;
                ArrayList             feeList       = null;
                IDictionaryEnumerator ide           = listInvoice.GetEnumerator();

                while (ide.MoveNext())
                {
                    register     = ide.Key as Neusoft.HISFC.Models.Registration.Register;
                    balancesList = ide.Value as ArrayList;

                    invoices      = balancesList[0] as ArrayList;
                    invoiceDetail = balancesList[1] as ArrayList;
                    feeList       = balancesList[2] as ArrayList;
                    //插入发票信息
                    if (this.InsertInvoices(invoices, register, feeTime, operID, ref errText) < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(errText);
                        return(-1);
                    }
                    //插入发票明细
                    if (this.InsertInvoiceDetails(invoiceDetail, feeTime, operID, ref errText) < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(errText);
                        return(-1);
                    }
                    //插入支付方式信息
                    //if (this.InsertInvocePayMode(invoices, feeTime, operID, ref errText) < 0)
                    //{
                    //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    //    MessageBox.Show(errText);
                    //    return -1;
                    //}
                    feeList = listFee[register.ID];
                    //更新费用明细
                    if (this.UpdateFeeItemList(feeList, ref errText) < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(errText);
                    }
                }


                string invoicePrintDll = null;

                invoicePrintDll = controlParamIntegrate.GetControlParam <string>(Neusoft.HISFC.BizProcess.Integrate.Const.INVOICEPRINT, false, string.Empty);

                if (invoicePrintDll == null || invoicePrintDll == string.Empty)
                {
                    MessageBox.Show("没有设置发票打印参数,收费请维护!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                ide.Reset();

                while (ide.MoveNext())
                {
                    register     = ide.Key as HISFC.Models.Registration.Register;
                    balancesList = ide.Value as ArrayList;
                    invoices     = balancesList[0] as ArrayList;
                    ArrayList tempal = new ArrayList();
                    foreach (ArrayList obj in balancesList[1] as ArrayList)
                    {
                        tempal.Add(obj[0]);
                    }
                    invoiceDetail = new ArrayList();
                    invoiceDetail.Add(tempal);
                    feeList = listFee[register.ID];
                    ArrayList payModList = new ArrayList();
                    this.feeIntegrate.PrintInvoice(invoicePrintDll, register, invoices, invoiceDetail, feeList, payModList, false, ref errText);
                }
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                this.Clear();
            }
            catch (Exception ex)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("打印发票失败!" + ex.Message);
                return(-1);
            }

            return(1);
        }