Пример #1
0
        /// <summary>
        /// 将界面实现接口的病人对象转换为业务病人对象
        /// </summary>
        /// <param name="patient"></param>
        /// <returns></returns>
        public static OutPatient ConvertPatient(UIOutPatient p)
        {
            OutPatient pat = new OutPatient( );

            HIS.SYSTEM.PubicBaseClasses.Age age = HIS.SYSTEM.PubicBaseClasses.XcDate.DateToAge(p.BordDay);
            pat.Age          = age.AgeNum;
            pat.AgeUnit      = age.Unit.ToString( );
            pat.BornDate     = p.BordDay;
            pat.CureDate     = p.RegDate == null ? DateTime.Now : p.RegDate.Value;
            pat.CureDeptCode = p.CureDepartment.Value.Code.ToString( );
            pat.CureEmpCode  = p.CureDoctor.Value.Code.ToString( );
            pat.DiseaseCode  = p.Disease == null ? "" : p.Disease.Value.Code.ToString( );
            pat.DiseaseMemo  = "";
            pat.DiseaseName  = p.Disease == null ? "" : p.Disease.Value.Text;
            pat.HisCardNo    = p.CardNo;
            pat.HpCode       = p.WorkUnit.Value.Code == null ? "" : p.WorkUnit.Value.Code.ToString( );
            pat.HpGrade      = pat.AgeUnit;
            pat.MediCard     = p.CardNo;
            pat.MediType     = p.PatientType.Value.Code.ToString( );
            pat.PatID        = p.PatId;
            pat.PatListID    = p.PatListId;
            pat.PatientName  = p.PatientName;
            string[] pywb = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.GetPyWbCode(p.PatientName);
            pat.PYM = pywb[0];
            pat.Sex = p.Sex;
            pat.WBM = pywb[1];

            return(pat);
        }
 public bool SavePatient()
 {
     if (formView.FormAction == 0)
     {
         if (BeforeSaveEvent != null)
         {
             BeforeSaveEventArgs e = new BeforeSaveEventArgs( );
             BeforeSaveEvent(this, e);
             if (e.Cancel)
             {
                 return(false);
             }
         }
         //新增病人
         OutPatient outpatient = new OutPatient( );
         outpatient.NewRegister( );
         int    patlistId = outpatient.PatListID;
         string visitno   = outpatient.VisitNo;
         outpatient           = PatientConvert.ConvertPatient((UIOutPatient)formView.Patient);
         outpatient.PatListID = patlistId;
         outpatient.VisitNo   = visitno;
         outpatient.UpdateRegister( );
         formView.Patient = PatientConvert.ConvertPatient(outpatient);
     }
     return(true);
 }
        /// <summary>
        /// 查找病人
        /// </summary>
        /// <param name="searchMode">查找模式</param>
        /// <param name="keyWord">检索关键字</param>
        public void SearchPatient(SearchPatientMode searchMode, string keyWord)
        {
            //在此调用业务逻辑层的方法查找到业务病人对象
            OutPatient patient = new OutPatient( );

            //TODO:
            switch (searchMode)
            {
            case SearchPatientMode.门诊就诊号:
                patient = new OutPatient(keyWord);
                break;

            //case SearchPatientMode.挂号收据号:
            //    patient = new OutPatient( keyWord , OPDBillKind.门诊挂号发票 );
            //    break;
            //case SearchPatientMode.收费发票号:
            //    patient = new OutPatient( keyWord , OPDBillKind.门诊收费发票 );
            //    break;
            default:
                patient = new OutPatient( );
                break;
            }
            formView.Patient = PatientConvert.ConvertPatient(patient);
            if (patient.CureEmpCode.Trim( ) != "")
            {
                formView.PrescDoctorId = Convert.ToInt32(patient.CureEmpCode);
            }
            if (patient.CureDeptCode.Trim( ) != "")
            {
                formView.DoctorDeptId = Convert.ToInt32(patient.CureDeptCode);
            }
        }
Пример #4
0
        public string GenerateOpNumber(OutPatient patitent)
        {
            var container = new Container(new PatientRegistry());
            var instance  = container.GetInstance <IValidator <OutPatient> >();
            var result    = instance.Validate(patitent);
            var res1      = result.IsValid;

            return("0123");
        }
Пример #5
0
        public void UpdateOutPatient(OutPatient patient)
        {
            var selected = hos.OutPatients.FirstOrDefault((e) => e.OutPatientID == patient.OutPatientID);

            if (selected == null)
            {
                throw new Exception("Patient not found to update");
            }
            hos.SaveChanges();
        }
 public bool SelectedPateint()
 {
     if (formView.SelectedPatientId != 0)
     {
         OutPatient   patient1 = new OutPatient(formView.SelectedPatientId);
         UIOutPatient patient2 = PatientConvert.ConvertPatient(patient1);
         SetPatient(patient2);
         return(true);
     }
     else
     {
         return(false);
     }
 }
        /// <summary>
        /// 预算
        /// </summary>
        public void Budget()
        {
            OutPatient patient = PatientConvert.ConvertPatient((UIOutPatient)formView.Patient);

            Prescription[] prescriptions = GetPrescriptionsFromDataTable();

            List <Prescription> lstPrescription = new List <Prescription>( );

            for (int i = 0; i < prescriptions.Length; i++)
            {
                if (prescriptions[i].Selected)
                {
                    lstPrescription.Add(prescriptions[i]);
                }
            }
            prescriptions = lstPrescription.ToArray( );

            HIS.MZ_BLL.ChargeControl chargeController = new ChargeControl(patient, formView.CurrentEmployeeId);

            AfterBudgetEndArgs e = new AfterBudgetEndArgs( );

            e.ChargeController = chargeController;
            try
            {
                ChargeInfo[] chargeInfos = chargeController.Budget(prescriptions);
                e.BudgetInfos = chargeInfos;
                ChargeInfo chargeInfo = new ChargeInfo( );
                for (int i = 0; i < chargeInfos.Length; i++)
                {
                    chargeInfo.TotalFee   += chargeInfos[i].TotalFee;
                    chargeInfo.FavorFee   += chargeInfos[i].FavorFee;
                    chargeInfo.SelfFee    += chargeInfos[i].SelfFee;
                    chargeInfo.VillageFee += chargeInfos[i].VillageFee;
                }
                e.TotalBugetInfo = chargeInfo;
                e.Prescriptions  = prescriptions;
                e.Success        = true;
            }
            catch (Exception err)
            {
                e.Success = false;
                e.Message = err.Message;
            }

            if (AfterBudgetEndEvent != null)
            {
                AfterBudgetEndEvent(this, e);
            }
        }
        /// <summary>
        /// 保存处方
        /// </summary>
        public bool SavePrescription()
        {
            DataTable tbPresc = formView.Prescriptions;

            if (tbPresc.Rows.Count == 0)
            {
                return(false);
            }

            if (BeforeSavePrescriptionEvent != null)
            {
                BeforeSaveEventArgs be = new BeforeSaveEventArgs( );
                BeforeSavePrescriptionEvent(this, be);

                if (be.Cancel == true)
                {
                    return(false);
                }
            }

            OutPatient patient = PatientConvert.ConvertPatient((UIOutPatient)formView.Patient);
            DataTable  tbAmbit = GetPrescriptionAmbitList( );

            Prescription[]      prescriptions = GetPrescriptionsFromDataTable();
            AfterSavedEventArgs e             = new AfterSavedEventArgs( );

            try
            {
                bool success = prescController.SavePrescription(patient, prescriptions);
                if (success)
                {
                    FillPrescData(prescriptions, tbPresc);
                }
            }
            catch (Exception err)
            {
                e.Cancel  = true;
                e.Message = err.Message;
                return(false);
            }


            if (AfterSavedEvent != null)
            {
                AfterSavedEvent(this, e);
            }

            return(true);
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            TimeSpan span = dtpTo.Value - dtpFrom.Value;

            if ((span.Days + 1) > 7)
            {
                MessageBox.Show("时间最大范围不能超过7天", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            try
            {
                OutPatient[] patients  = null;
                string       beginDate = dtpFrom.Value.ToString("yyyy-MM-dd") + " 00:00:00";
                string       endDate   = dtpTo.Value.ToString("yyyy-MM-dd") + " 23:59:59";
                string       invoiceNo = txtInvoiceNo.Text.Trim();

                if (txtPatient.Text.Trim( ) != "")
                {
                    patients = OutPatient.GetPatient("PatName<>'' AND PatName like '%" + txtPatient.Text.Trim( ) + "%'");
                }
                else
                {
                    patients = OutPatient.GetPatientByPresDate(beginDate, endDate);
                }
                if (txtInvoiceNo.Text.Trim( ) != "")
                {
                    OutPatient patient = new OutPatient(txtInvoiceNo.Text, OPDBillKind.门诊收费发票);
                    patients = new OutPatient[] { patient };
                }

                List <Prescription> listPrescription = new List <Prescription>();
                for (int i = 0; i < patients.Length; i++)
                {
                    Prescription[] prescriptions = patients[i].GetPrescriptions(PresStatus.全部, true, beginDate, endDate, invoiceNo, 0);
                    for (int j = 0; j < prescriptions.Length; j++)
                    {
                        prescriptions[j].PatientName = patients[i].PatientName;
                    }

                    listPrescription.AddRange(prescriptions);
                }
                ShowPrescriptions(listPrescription.ToArray());
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #10
0
        public static UIOutPatient ConvertPatient(OutPatient p)
        {
            string       name = "";
            UIOutPatient pat  = new UIOutPatient( );
            Age          age  = new Age( );

            age.AgeNum = p.Age;
            foreach (object obj in Enum.GetValues(typeof(AgeUnit)))
            {
                if (obj.ToString( ) == p.HpGrade)
                {
                    age.Unit = (AgeUnit)obj;
                    break;
                }
            }
            pat.BordDay = XcDate.AgeToDate(age);
            pat.CardNo  = p.HisCardNo;
            //name = PublicDataReader.GetDeptNameById( Convert.ToInt32( p.CureDeptCode == "" ? "0" : p.CureDeptCode ) );
            name = BaseDataController.GetName(BaseDataCatalog.科室列表, Convert.ToInt32(p.CureDeptCode == "" ? "0" : p.CureDeptCode));
            pat.CureDepartment = new BindValue(p.CureDeptCode, name);

            //name = PublicDataReader.GetEmployeeNameById( Convert.ToInt32( p.CureEmpCode == "" ? "0" : p.CureEmpCode ) );
            name           = BaseDataController.GetName(BaseDataCatalog.人员列表, Convert.ToInt32(p.CureEmpCode == "" ? "0" : p.CureEmpCode));
            pat.CureDoctor = new BindValue(p.CureEmpCode, name);

            pat.Disease      = new BindValue(p.DiseaseCode, p.DiseaseName);
            pat.OutPatientNo = p.VisitNo;
            pat.PatId        = Convert.ToInt32(p.PatID);
            pat.PatientName  = p.PatientName;
            //pat.PatientType = new BindValue( p.MediType , PublicDataReader.GetPatientTypeNameByCode( p.MediType ) );
            pat.PatientType   = new BindValue(p.MediType, BaseDataController.GetName(BaseDataCatalog.病人类型列表, p.MediType));
            pat.PatListId     = p.PatListID;
            pat.RegDate       = p.CureDate;
            pat.RegDepartment = pat.CureDepartment;
            pat.Sex           = p.Sex;

            pat.WorkUnit = new BindValue(p.HpCode, GetWorkUnitNameByCode(p.HpCode));



            return(pat);
        }
Пример #11
0
 private void ShowPatientList(List <BasePatient> lstPatient)
 {
     dgvPatList.Rows.Clear( );
     foreach (BasePatient p in lstPatient)
     {
         OutPatient patient = (OutPatient)p;
         int        row     = dgvPatList.Rows.Add( );
         dgvPatList[COL_PATLISTID.Name, row].Value = patient.PatListID;
         dgvPatList[COL_VISITNO.Name, row].Value   = patient.VisitNo;
         dgvPatList[COL_PATNAME.Name, row].Value   = patient.PatientName;
         dgvPatList[COL_SEX.Name, row].Value       = patient.Sex;
         dgvPatList[COL_AGE.Name, row].Value       = patient.Age;
         dgvPatList[COL_PATTYPE.Name, row].Value   = BaseDataController.GetName(BaseDataCatalog.病人类型列表, patient.MediType.Trim());                                                //PublicDataReader.GetPatientTypeNameByCode( patient.MediType.Trim());
         dgvPatList[COL_DOCTOR.Name, row].Value    = BaseDataController.GetName(BaseDataCatalog.人员列表, Convert.ToInt32(patient.CureEmpCode == "" ? "0" : patient.CureEmpCode));   //PublicDataReader.GetEmployeeNameById( Convert.ToInt32( patient.CureEmpCode == "" ? "0" : patient.CureEmpCode ) );
         dgvPatList[COL_DEPT.Name, row].Value      = BaseDataController.GetName(BaseDataCatalog.科室列表, Convert.ToInt32(patient.CureDeptCode == "" ? "0" : patient.CureDeptCode)); //PublicDataReader.GetDeptNameById( Convert.ToInt32( patient.CureDeptCode == "" ? "0" : patient.CureDeptCode ) );
         dgvPatList[COL_CURDATE.Name, row].Value   = patient.CureDate;
         dgvPatList.Rows[row].Tag = patient;
     }
     dgvPatList.CurrentCell = null;
 }
Пример #12
0
        public void Get()
        {
            OutPatient patient = new OutPatient();

            patient.Addr1     = "New Maruthi Nagar";
            patient.Addr2     = "Hyderabad";
            patient.City      = "Hyd";
            patient.Dob       = new DateTime(1984, 06, 10);
            patient.FirstName = "Pappu";
            patient.LastName  = "Venkatrao";
            patient.Gender    = "Male";
            long phone = 9985010756;

            patient.PhoneNumber = phone;
            patient.State       = "Andhra Pradesh";
            patient.ZipCode     = 533201;
            patient.Country     = "India";
            var result = _outPatient.GenerateOpNumber(patient);
            var res    = result;
        }
        /// <summary>
        /// 查找病人
        /// </summary>
        public void SearchingPatient()
        {
            StringBuilder strWhere = new StringBuilder( );

            strWhere.Append("CUREDATE between ");
            strWhere.Append("'" + condiction.BeginDate.ToString("yyyy-MM-dd") + " 00:00:00'");
            strWhere.Append(" AND ");
            strWhere.Append("'" + condiction.EndDate.ToString("yyyy-MM-dd") + " 23:59:59'");
            if (condiction.PatientNameKeyWord.Trim( ) != "")
            {
                strWhere.Append(" AND PATNAME LIKE '%" + GWI.HIS.Windows.Controls.CommonFun.FormatKeyword(condiction.PatientNameKeyWord) + "%' ");
            }

            if (condiction.OutPatientNo.Trim( ) != "")
            {
                strWhere.Append(" AND VISITNO = '" + condiction.OutPatientNo + "'");
            }

            DataTable tbPatient = OutPatient.GetPatientList(strWhere.ToString());

            formView.SearchResultList = tbPatient;
        }
        /// <summary>
        /// 读取病人未收费的处方
        /// </summary>
        public void ReadPatientNotBalancePrescription(bool afterBalance)
        {
            OutPatient patient = PatientConvert.ConvertPatient((UIOutPatient)formView.Patient);

            Prescription[] prescriptions = patient.GetPrescriptions(PresStatus.未收费, true);
            for (int i = 0; i < prescriptions.Length; i++)
            {
                prescriptions[i].Selected = true;
            }

            DataTable tbPresc = formView.Prescriptions;

            tbPresc.Rows.Clear( );

            FillPrescData(prescriptions, tbPresc);

            CalculateAllPrescriptionFee( );

            AfterReadPatientPrescriptionArgs e = new AfterReadPatientPrescriptionArgs();

            e.PrescCount = GetPrescriptionAmbitList( ).Rows.Count;
            if (tbPresc.Select(COL_DOC_PRESDETAIL_ID + " <> 0").Length > 0)
            {
                e.HasDoctorPresc = true;
            }
            else
            {
                e.HasDoctorPresc = false;
            }

            e.AfterBalance = afterBalance;

            if (AfterReadPatientPrescription != null)
            {
                AfterReadPatientPrescription(this, e);
            }
        }
Пример #15
0
        /// <summary>
        /// 退费处理
        /// </summary>
        private void RefundmentProcess()
        {
               //delete by heyan 2011.3.22 不是该收费员收的费也可以退费
            //if ( _EmployeeID != Convert.ToInt32( currentInvoice.ChargeUserId ) )
            //{
            //    throw new OperatorException( "该发票不是您收费,需收费员【"+currentInvoice.ChargeUser+"】才能退费!" );
            //}
            //得到新的处方
            List <int> returnedDocPresIdList = new List <int>(); //有退费处理的医生处方ID

            Prescription[] remanentPrescriptions = GetPrescriptionRemanentFromGrid(true, out returnedDocPresIdList);
            if (remanentPrescriptions == null)
            {
                throw new OperatorException("至少需要指定一条需要退费项目的数量!");
            }
            //整理处方,除去0数量和没有明细的处方
            List <Prescription> lstPrescription = new List <Prescription>( );

            for (int i = 0; i < remanentPrescriptions.Length; i++)
            {
                remanentPrescriptions[i].PrescriptionID = 0;
                List <PrescriptionDetail> lstDetail = new List <PrescriptionDetail>( );
                for (int j = 0; j < remanentPrescriptions[i].PresDetails.Length; j++)
                {
                    remanentPrescriptions[i].PresDetails[j].DetailId = 0;
                    if (remanentPrescriptions[i].PresDetails[j].Tolal_Fee != 0)
                    {
                        lstDetail.Add(remanentPrescriptions[i].PresDetails[j]);
                    }
                }
                remanentPrescriptions[i].Modified  = true;
                remanentPrescriptions[i].DocPresId = 0;
                if (lstDetail.Count > 0)
                {
                    remanentPrescriptions[i].PresDetails = lstDetail.ToArray( );
                    lstPrescription.Add(remanentPrescriptions[i]);
                }
            }
            remanentPrescriptions = lstPrescription.ToArray( );
            if (remanentPrescriptions.Length == 0)
            {
                remanentPrescriptions = null;
            }


            ChargeControl chargeController = new ChargeControl(currentPatient, _EmployeeID);

            try
            {
                decimal newcost      = 0;
                decimal newmoneypay  = 0;
                decimal newpos       = 0;
                decimal newfoverpay  = 0;
                decimal newtally     = 0;
                decimal invoiceCount = 0;
                if (chargeController.Refundment(currentInvoice, remanentPrescriptions, returnedDocPresIdList))
                {
                    if (remanentPrescriptions != null)
                    {
                        if (chargeController.SavePrescription(remanentPrescriptions))
                        {
                            if (MessageBox.Show("部分退费需要重新补打发票收据,请确认发票是否已经准备就绪!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                            {
                                MessageBox.Show("用户已取消操作,需要重新收费的处方还未收费,请转到收费窗口继续收费!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                ReturnPatient      = currentPatient;
                                HasPresNeedBalance = true;
                                return;
                            }

                            ChargeInfo[] chargeInfos = chargeController.Budget(remanentPrescriptions);
                            #region 合计结算信息并显示给用户
                            //累计结算信息
                            HIS.MZ_BLL.ChargeInfo totalChargeInfo = new HIS.MZ_BLL.ChargeInfo( );
                            for (int i = 0; i < chargeInfos.Length; i++)
                            {
                                totalChargeInfo.TotalFee   += chargeInfos[i].TotalFee;
                                totalChargeInfo.FavorFee   += chargeInfos[i].FavorFee;
                                totalChargeInfo.SelfFee    += chargeInfos[i].SelfFee;
                                totalChargeInfo.VillageFee += chargeInfos[i].VillageFee;
                            }

                            //向用户展示结算信息
                            FrmChargeInfo frmChargeInfo = new FrmChargeInfo(totalChargeInfo, true);
                            frmChargeInfo.ShowDialog( );

                            chargeController.SetChargeInfoPay(ref chargeInfos, frmChargeInfo.ReturnChargeInfo.VillageFee,
                                                              frmChargeInfo.ReturnChargeInfo.PosFee,
                                                              frmChargeInfo.ReturnChargeInfo.CashFee, frmChargeInfo.ReturnChargeInfo.SelfTally);

                            #endregion
                            Invoice[] invoices;
                            chargeController.Charge(chargeInfos, remanentPrescriptions, out invoices);

                            PrintController.PrintChargeInvoice(invoices);
                            invoiceCount = invoices.Length;
                            for (int i = 0; i < invoices.Length; i++)
                            {
                                newcost     += invoices[i].TotalPay;
                                newmoneypay += invoices[i].CashPay;
                                newpos      += invoices[i].PosPay;
                                newfoverpay += invoices[i].FavorPay;
                                newtally    += invoices[i].VillagePay;
                            }
                        }
                    }

                    decimal returncost     = currentInvoice.TotalPay - newcost;
                    decimal returnmoneypay = currentInvoice.CashPay - newmoneypay;
                    decimal returnpos      = currentInvoice.PosPay - newpos;
                    decimal returnfoverpay = currentInvoice.FavorPay - newfoverpay;
                    decimal returntally    = currentInvoice.VillagePay - newtally;
                    GWMHIS.BussinessLogicLayer.Forms.GwmMessageBox.Show("本次操作完成!\r\n需要退病人金额:" + returncost + "元,其中:" +
                                                                        "\r\n退 现 金:" + returnmoneypay + "元" +
                                                                        "\r\n退 POS  :" + returnpos + "元" +
                                                                        "\r\n退 优 惠:" + returnfoverpay + "元" +
                                                                        "\r\n退 记 账:" + returntally + "元" +
                                                                        "\r\n\r\n新打发票:" + invoiceCount + "张" +
                                                                        "\r\n总 金 额:" + newcost + "元",
                                                                        (new Font("宋体", 15F)), Color.Red, "退费成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("退费失败!\r\n可能的原因;+\r\n" + err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #16
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (dgvPatList.CurrentCell == null)
            {
                MessageBox.Show("请在病人查询结果中选折要打印的病人", "", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            bool printSubTotal = chkPrintSub.Checked;

            try
            {
                OutPatient patient = (OutPatient)dgvPatList.CurrentRow.Tag;

                if (chkPrintSingle.Checked)
                {
                    for (int i = 0; i < dgvInvoiceList.Rows.Count; i++)
                    {
                        Invoice invoice = (Invoice)dgvInvoiceList.Rows[i].Tag;
                        invoice.InvoiceNo = invoice.PerfChar + invoice.InvoiceNo;
                        PrintController.PrintOutPatientFeeList(patient, invoice, invoice.Prescription, printSubTotal);
                    }
                }
                else
                {
                    //合并发票
                    Invoice             invoice         = null;
                    List <Prescription> lstPrescription = null;
                    for (int i = 0; i < dgvInvoiceList.Rows.Count; i++)
                    {
                        Invoice invoice1 = (Invoice)dgvInvoiceList.Rows[i].Tag;
                        if (invoice1.Prescription[0].Record_Flag != 0)
                        {
                            continue;
                        }
                        if (invoice == null)
                        {
                            invoice            = new Invoice();
                            invoice.InvoiceNo  = invoice1.PerfChar + invoice1.InvoiceNo;
                            invoice.CashPay    = invoice1.CashPay;
                            invoice.FavorPay   = invoice1.FavorPay;
                            invoice.PosPay     = invoice1.PosPay;
                            invoice.SelfTally  = invoice1.SelfTally;
                            invoice.TotalPay   = invoice1.TotalPay;
                            invoice.VillagePay = invoice1.VillagePay;
                            lstPrescription    = invoice1.Prescription.ToList();

                            continue;
                        }
                        else
                        {
                            invoice.CashPay    += invoice1.CashPay;
                            invoice.FavorPay   += invoice1.FavorPay;
                            invoice.PosPay     += invoice1.PosPay;
                            invoice.SelfTally  += invoice1.SelfTally;
                            invoice.TotalPay   += invoice1.TotalPay;
                            invoice.VillagePay += invoice1.VillagePay;
                            invoice.InvoiceNo   = invoice.InvoiceNo + "  " + (invoice1.PerfChar + invoice1.InvoiceNo);

                            for (int j = 0; j < invoice1.Prescription.Length; j++)
                            {
                                lstPrescription.Add(invoice1.Prescription[j]);
                            }
                        }
                    }
                    if (invoice == null)
                    {
                        MessageBox.Show("没有有效的费用可打印!", "", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }
                    PrintController.PrintOutPatientFeeList(patient, invoice, lstPrescription.ToArray(), printSubTotal);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #17
0
 public void UpdateOutPatient(OutPatient patient)
 {
     pat.UpdateOutPatient(patient);
 }
Пример #18
0
 public void AddOutPatient(OutPatient patient)
 {
     pat.AddOutPatient(patient);
 }
Пример #19
0
        /// <summary>
        /// 获取病人对象列表
        /// </summary>
        /// <param name="InvoiceNo">发票号</param>
        /// <param name="InvoiceType">发票类型</param>
        /// <param name="VisitNo">门诊号</param>
        /// <param name="PatientName">病人姓名</param>
        /// <param name="dateFrom">开始时间</param>
        /// <param name="dateTo">结束时间</param>
        /// <returns></returns>
        public List <BasePatient> GetPatient(string InvoiceNo, OPDBillKind InvoiceType,
                                             string VisitNo,
                                             string PatientName,
                                             DateTime?dateFrom, DateTime?dateTo)
        {
            StringBuilder sbSQL = new StringBuilder( );

            sbSQL.Append("select a.patlistid,visitno,patname,patsex,age,meditype,cureempcode,curedeptcode,curedate from mz_patlist a");
            sbSQL.Append(" inner join ");
            sbSQL.Append("(select patlistid,ticketnum,ticketcode,hang_flag,workid from mz_costmaster where record_flag in (0,1)) b on a.patlistid = b.patlistid");
            sbSQL.Append(" where a.workid=" + EntityConfig.WorkID + " and b.workid=" + EntityConfig.WorkID);
            if (InvoiceNo.Trim( ) != "")
            {
                if (InvoiceType == OPDBillKind.门诊挂号发票)
                {
                    sbSQL.Append(" and b.hang_flag = " + (int)OPDOperationType.门诊挂号);
                }
                else
                {
                    sbSQL.Append(" and b.hang_flag = " + (int)OPDOperationType.门诊收费);
                }
                sbSQL.Append(" and b.ticketnum='" + InvoiceNo + "'");
            }

            if (VisitNo.Trim( ) != "")
            {
                sbSQL.Append(" and visitno = '" + VisitNo.Trim( ) + "' ");
            }
            if (PatientName.Trim( ) != "")
            {
                sbSQL.Append(" and patname like '%" + PatientName.Trim() + "%' ");
            }
            if (dateFrom != null)
            {
                sbSQL.Append(" and curedate >='" + dateFrom.Value.ToString("yyyy-MM-dd HH:mm:ss") + "' ");
            }
            if (dateTo != null)
            {
                sbSQL.Append(" and curedate <='" + dateTo.Value.ToString("yyyy-MM-dd HH:mm:ss") + "' ");
            }

            DataTable          tb   = oleDb.GetDataTable(sbSQL.ToString( ));
            List <BasePatient> list = new List <BasePatient>( );

            for (int i = 0; i < tb.Rows.Count; i++)
            {
                OutPatient patient = new OutPatient( );
                patient.PatListID    = Convert.ToInt32(tb.Rows[i]["PatListID"]);
                patient.VisitNo      = Convert.ToString(tb.Rows[i]["VisitNo"]);
                patient.PatientName  = Convert.ToString(tb.Rows[i]["patname"]);
                patient.Sex          = Convert.ToString(tb.Rows[i]["patsex"]);
                patient.Age          = Convert.ToInt32(tb.Rows[i]["age"]);
                patient.MediType     = Convert.ToString(tb.Rows[i]["meditype"]);
                patient.CureEmpCode  = Convert.ToString(tb.Rows[i]["cureempcode"]);
                patient.CureDeptCode = Convert.ToString(tb.Rows[i]["curedeptcode"]);
                patient.CureDate     = Convert.ToDateTime(tb.Rows[i]["curedate"]);
                if (list.Find(delegate(BasePatient p)
                {
                    return(p.PatListID == patient.PatListID ? true : false);
                }) == null)
                {
                    list.Add(patient);
                }
            }
            return(list);
        }
Пример #20
0
 public void AddOutPatient(OutPatient patient)
 {
     hos.OutPatients.Add(patient);
     hos.SaveChanges();
 }
Пример #21
0
        private void txtInvoiceNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((int)e.KeyChar == 13)
            {
                if (txtInvoiceNo.Text.Trim( ) == "")
                {
                    MessageBox.Show("请输入要退费的发票号", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                else
                {
                    try
                    {
                        string invoiceNo = Convert.ToInt32(txtInvoiceNo.Text).ToString();

                        txtInvoiceNo.Text = HIS.MZ_BLL.InvoiceManager.FormatInvoiceNo(invoiceNo);

                        currentPatient = new HIS.MZ_BLL.OutPatient(invoiceNo, OPDBillKind.门诊收费发票);

                        txtPatientName.Text = currentPatient.PatientName;
                        //lblFeeType.Text = PublicDataReader.GetPatientTypeNameByCode( currentPatient.MediType );
                        lblFeeType.Text = BaseDataController.GetName(BaseDataCatalog.病人类型列表, currentPatient.MediType);

                        currentInvoice = new HIS.MZ_BLL.Invoice(txtPerfChar.Text.Trim(), invoiceNo, OPDBillKind.门诊收费发票);
                        if (currentInvoice.RecordFlag != 0)
                        {
                            MessageBox.Show("该发票已经退费,请确认输入的发票号是否正确!");
                            txtInvoiceNo.Focus();
                            return;
                        }
                        lstRetYP = PublicDataReader.GetDrugReturnValueList(currentInvoice.InvoiceNo);

                        ShowPrescriptions(currentInvoice.Prescription, lstRetYP);
                        lblInvoiceNo.Text = currentInvoice.PerfChar + txtInvoiceNo.Text;
                        lblTotal.Text     = currentInvoice.TotalPay.ToString("0.00");
                        lblCash.Text      = currentInvoice.CashPay.ToString("0.00");
                        lblPOS.Text       = currentInvoice.PosPay.ToString("0.00");
                        lblChargeUp.Text  = currentInvoice.VillagePay.ToString("0.00");
                        lblFover.Text     = currentInvoice.FavorPay.ToString("0.00");
                        lblSelfTally.Text = currentInvoice.SelfTally.ToString("0.00");

                        //
                        if (Convert.ToInt32(HIS.MZ_BLL.OPDParamter.Parameters["016"]) == 0)
                        {
                            btnAll.Enabled    = false;
                            dgvPresc.ReadOnly = true;
                            btnAll_Click(null, null);
                            return;
                        }
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message + "\r\n1、确认发票号是否输入正确。\r\n2、确认是否输入了发票前缀字母。", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtInvoiceNo.Focus();
                        txtInvoiceNo.Text   = "";
                        txtPatientName.Text = "";
                        lblFeeType.Text     = "";
                        dgvPresc.Rows.Clear();
                        lblCash.Text     = "0.00";
                        lblChargeUp.Text = "0.00";
                        lblFover.Text    = "0.00";
                        lblPOS.Text      = "0.00";
                        lblTotal.Text    = "0.00";
                    }

                    //add zenghao
                    this.btnAll.Enabled = true;
                    dgvPresc.Focus( );
                }
            }
        }