/// <summary> /// 双击病人列表 /// </summary> public void GetPatlist() { zy_Patlist = view.zy_patlist_get; if (zy_Patlist != null) { zyPresOrder.PatID = zy_Patlist.PatID; zyPresOrder.PatListID = zy_Patlist.PatListID; view.BindPatControlData = zy_Patlist; icM.PatListID = zy_Patlist.PatListID; PatFee patFee = icM.GetPatFee(); view.BindPatFeeControlData = patFee; view.PresDocCode = zy_Patlist.OriginDocCode; } }
//双击病人列表 private void FrmCostList_HIS_DoubleClick(object sender, EventArgs e) { zyPresOrder.PatListID = zy_PatList.PatListID; //this.BindCostData(base.zy_PatList.PatListID, null, null); this.tbInpatNo.Text = base.zy_PatList.CureNo; this.tbpatName.Text = base.zy_PatList.patientInfo.PatName; IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); icM.PatListID = zy_PatList.PatListID; PatFee patFee = icM.GetPatFee(); this.lbChargeTolFee.Text = patFee.chargeFee.ToString(); this.lbCoseTolFee.Text = patFee.costFee.ToString(); this.lbExtFee.Text = patFee.surplusFee.ToString(); DateTime?bdt = null; DateTime?edt = null; string prestype = null; string drugname = null; if (this.checkBox1.Checked) { bdt = this.dtpBdate.Value; edt = this.dtpEdate.Value; } if (this.checkBox5.Checked) { prestype = this.cbPresType.SelectedIndex.ToString(); } if (this.checkBox2.Checked) { drugname = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(this.tb_drugname.MemberValue, ""); } this.dgFee.DataSource = AddAddress(zyPresOrder.GetPresDataTable(bdt, edt, prestype, drugname)); }
public void Delete() { if (BindEntity <HIS.Model.ZY_NURSE_BED> .CreateInstanceDAL(oleDb).Exists("patlist_id=" + this.PatListID + "")) { throw new Exception("该病人已有床位分配,请先取消床位分配再取消入院!"); } try { //NccmCheck_CancelPatient(zypatlist); //?判断病人费用是否为0 IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); icM.PatListID = this.PatListID; PatFee patFee = icM.GetPatFee(); if (patFee.chargeFee != 0 || patFee.costFee != 0) { throw new Exception("该病人产生了费用,不允许取消入院!"); } this.PatType = "6"; BindEntity <ZY_PatList> .CreateInstanceDAL(oleDb).Update(this); } catch (System.Exception e) { throw new Exception(e.Message); } }
//绑定预交金 public void BindDataGrid() { this.tbInpatNo.Text = base.zy_PatList.CureNo; this.tbpatName.Text = base.zy_PatList.patientInfo.PatName; this.tbpatDept.Text = base.zy_PatList.CurrDeptCode.Trim() == "" ? BaseNameFactory.GetName(baseNameType.科室名称, base.zy_PatList.CureDeptCode) : BaseNameFactory.GetName(baseNameType.科室名称, base.zy_PatList.CurrDeptCode);//当前科室代码 this.tbbedno.Text = base.zy_PatList.BedCode; DataTable dt = zy_ChargeList.GetPatChargeList(); decimal dec = 0; for (int i = 0; i < dt.Rows.Count; i++) { dec += Convert.ToDecimal(dt.Rows[i]["Total_Fee"]); } this.label9.Text = dec.ToString(); IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); icM.PatListID = zy_PatList.PatListID; PatFee patFee = icM.GetPatFee(); this.lbChargeTolFee.Text = patFee.chargeFee.ToString(); this.lbCoseTolFee.Text = patFee.costFee.ToString(); this.lbExtFee.Text = patFee.surplusFee.ToString(); this.dgBill.AutoGenerateColumns = false; this.dgBill.DataSource = dt; this.dgBill.SelectRow(dt.Rows.Count - 1); }
//绑定数据 public void BindDataGrid() { this.tbInpatNo.Text = base.zy_PatList.CureNo; this.tbpatName.Text = base.zy_PatList.patientInfo.PatName; PatFee patFee = icM.GetPatFee(); this.lbChargeTolFee.Text = patFee.chargeFee.ToString(); this.lbCoseTolFee.Text = patFee.costFee.ToString(); }
//绑定病人列表 private void BindLvPatList() { string DeptCode = null; string CureNo = null; string PatName = null; DateTime?Bdate = null; DateTime?Edate = null; bool IsIn = true; if (this.chbDept.Checked) { DeptCode = this.cbDept.SelectedValue.ToString().Trim(); } if (this.checkBox3.Checked) { CureNo = this.tbInpatNo.Text; } if (this.checkBox4.Checked) { PatName = this.textBox1.Text.Trim(); } if (this.checkBox2.Checked) { Bdate = this.dtpBdate.Value; Edate = this.dtpEdate.Value; } IsIn = this.cb_pattype.SelectedIndex == 0 ? true : false; this.lvPatList.Items.Clear(); List <ZY_PatList> zypatlist = null; //ZY_PatList zy_Patlist = new ZY_PatList(); BindPatListVal bplv = new BindPatListVal(); bplv.IsIn = IsIn; bplv.DeptCode = DeptCode; bplv.Bdate = Bdate; bplv.Edate = Edate; bplv.CureNo = CureNo; bplv.PatName = PatName; bplv.IsCost = this.cb_pattype.SelectedIndex == 1 ? true : false; zy_PatList.bindPatListVal = bplv; zy_PatList.bindPatListType = BindPatListType.费用清单病人列表; zypatlist = zy_PatList.BindPatList(); if (zypatlist.Count == 0) { MessageBox.Show("未找到任何病人!"); return; } IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); for (int i = 0; i < zypatlist.Count; i++) { bool b = true;//false 欠费病人 ListViewItem lstViewItem = new ListViewItem(); lstViewItem.SubItems.Clear(); lstViewItem.Tag = zypatlist[i]; lstViewItem.SubItems[0].Text = zypatlist[i].CureNo; lstViewItem.SubItems.Add(zypatlist[i].BedCode); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatName); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatSex); if (zypatlist[i].PatType == "4" || zypatlist[i].PatType == "5") { icM = icM.GetCostMaster(zypatlist[i].PatListID); lstViewItem.SubItems.Add(icM.Deptosit_Fee.ToString()); lstViewItem.SubItems.Add(icM.Total_Fee.ToString());//HIS.ZY_BLL.OP_CostManage.GetSumVillage_Fee(zypatlist[i].PatListID).ToString("0.00")); lstViewItem.SubItems.Add(Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee)); } else { icM.PatListID = zypatlist[i].PatListID; PatFee patFee = icM.GetPatFee(); lstViewItem.SubItems.Add(patFee.chargeFee.ToString()); lstViewItem.SubItems.Add(patFee.costFee.ToString()); lstViewItem.SubItems.Add(patFee.surplusFee.ToString()); if (patFee.surplusFee < 0) { b = false;//欠费病人 } } lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatBriDate.ToString("yyyy-MM-dd")); lstViewItem.SubItems.Add(BaseNameFactory.GetName(baseNameType.科室名称, zypatlist[i].CurrDeptCode)); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.ACCOUNTTYPE); lstViewItem.SubItems.Add(zypatlist[i].CureDate.Date.ToString("yyyy-MM-dd")); string strOutDate = zypatlist[i].OutDate.Date.ToString("yyyy-MM-dd"); strOutDate = strOutDate == "0001-01-01" ? "至今" : strOutDate; lstViewItem.SubItems.Add(strOutDate); if (zypatlist[i].OutDate.ToString("yyyy-MM-dd") == "0001-01-01") { //this.tbNum.Text = ts.Days.ToString(); lstViewItem.SubItems.Add("0"); } else { TimeSpan ts = zypatlist[i].OutDate - zypatlist[i].CureDate; lstViewItem.SubItems.Add(ts.Days.ToString()); } //[20100624.1.10] if (this.cbQF.Checked == true)//欠费病人显示 { if (b == false) { this.lvPatList.Items.Add(lstViewItem); } } else { this.lvPatList.Items.Add(lstViewItem); } } }
//打印主功能 private void PrintMain(bool IsPreview, string presdeptcode) { Report = new grproLib.GridppReport(); IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); icM.PatListID = zy_pat.PatListID; PatFee patFee = icM.GetPatFee(this.dtpE.Value.Date); if (this.radioButton1.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总.grf"); } else if (this.radioButton2.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_核算.grf"); } else if (this.radioButton3.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单.grf"); } else if (this.radioButton4.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总分组.grf"); } else if (this.radioButton5.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用一日清单.grf"); } if (checkBox1.Checked == true) { Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss") + "至" + this.dtpE.Value.ToString("yyyy-MM-dd HH:mm:ss"); } else { string date1, date2; if (zy_pat.OutDate.Date.ToString("yyyy-MM-dd") == "0001-01-01") { date2 = "至今"; } else { date2 = zy_pat.OutDate.Date.ToString("yyyy-MM-dd") + " 23:59:59"; } date1 = zy_pat.CureDate.ToString("yyyy-MM-dd HH:mm:ss"); Report.ParameterByName("费用时间").AsString = date1 + "至" + date2; } if (this.radioButton5.Checked) { Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss"); } Report.ParameterByName("CureNo").AsString = zy_pat.CureNo; Report.ParameterByName("PatCaseNo").AsString = zy_pat.patientInfo.PatCaseNo; Report.ParameterByName("PatName").AsString = zy_pat.patientInfo.PatName; string DateStr = zy_pat.OutDate.Date.ToString("yyyy-MM-dd"); if (DateStr == "0001-01-01") { DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd"); } else { DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd") + "至" + DateStr; } Report.ParameterByName("MarkDate").AsString = DateStr; Report.ParameterByName("BedCode").AsString = zy_pat.BedCode; if (presdeptcode == null) { Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, zy_pat.CurrDeptCode); } else { Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, presdeptcode); } Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; if (zy_pat.PatType == "4" || zy_pat.PatType == "5") { //Report.ParameterByName("累计交费").AsString = "0"; //try //{ // ZY_CostMaster zyCM = new ZY_CostMaster(); // Report.ParameterByName("农合医保记账").AsString = zyCM.GetSumVillage_Fee(zy_pat.PatListID).ToString("0.00"); //} //catch { } //Report.ParameterByName("余额").AsString = "0"; icM = icM.GetCostMaster(zy_pat.PatListID); Report.ParameterByName("累计交费").AsString = icM.Deptosit_Fee.ToString(); Report.ParameterByName("累计记账").AsString = icM.Total_Fee.ToString(); Report.ParameterByName("余额").AsString = Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee); } else { Report.ParameterByName("累计交费").AsString = patFee.chargeFee.ToString(); Report.ParameterByName("累计记账").AsString = patFee.costFee.ToString(); Report.ParameterByName("余额").AsString = patFee.surplusFee.ToString(); } //ShowItemData(); 移动在Print()中 try { Report.ParameterByName("甲类总金额").AsString = firstFee.ToString(); Report.ParameterByName("乙类总金额").AsString = secondFee.ToString(); Report.ParameterByName("本次优惠").AsString = AllDec.ToString(); Report.ParameterByName("担保金额").AsString = zy_pat.DbFee.ToString("0.00"); //Report.ParameterByName("自付金额").AsString = Convert.ToString(patFee.costFee - firstFee - secondFee); } catch { } if (this.radioButton5.Checked) { for (int i = 0; i < ItemDt.Rows.Count; i++) { for (int j = 1; j <= Report.Parameters.Count; j++) { if (ItemDt.Rows[i]["itemname"].ToString().Trim() == Report.Parameters[j].Name) { Report.Parameters[j].Value = ItemDt.Rows[i]["Tolal_Fee"].ToString(); } } } } else { Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord); } if (IsPreview) { Report.PrintPreview(false); } else { Report.Print(false); } }