/// <summary> /// 构造 /// </summary> public frmPatchDayAccount(clsBihPatient_VO Patient_VO) { InitializeComponent(); BihPatient_VO = Patient_VO; objSvc = new clsDcl_Charge(); }
private void GetPatienFeeInfo(string registerId, out clsBihPatient_VO patient_VO) { patient_VO = new clsBihPatient_VO(); //Prepay view DataView dvPrepay = new DataView(this.m_dtPrepay); dvPrepay.RowFilter = "registerid_chr = '" + registerId + "'"; if (dvPrepay.Count > 0) { patient_VO.PrepayMoney = Convert.ToDecimal(dvPrepay[0]["balancetotal"].ToString()); } else { patient_VO.PrepayMoney = 0; } //Fee view DataView dvFee = new DataView(this.m_dtFee); dvFee.RowFilter = "REGISTERID_CHR = '" + registerId + "'"; //if (dvFee.Count == 0) // return; //获取总费用、待结、待清、直接收费、已清、结余 decimal TotalFee = 0; decimal WaitChargeFee = 0; decimal WaitClearFee = 0; decimal DirectorFee = 0; decimal CompleteClearFee = 0; //string ClearFeeDate = ""; //int NoChargeDays = 0; for (int i = 0; i < dvFee.Count; i++) { //单项总费用 //decimal d = clsPublic.Round(clsPublic.ConvertObjToDecimal(dvFee[i]["UNITPRICE_DEC"]) * clsPublic.ConvertObjToDecimal(dvFee[i]["AMOUNT_DEC"]), 2); decimal d = clsPublic.ConvertObjToDecimal(dvFee[i]["Money"]) + clsPublic.Round(clsPublic.ConvertObjToDecimal(dvFee[i]["totaldiffcostmoney_dec"]), 2); //费用状态 0 待确认 1 待结 2 待清 3 已清 4 直收 int pstatus = Convert.ToInt32(dvFee[i]["PSTATUS_INT"].ToString()); if (pstatus == 1) { if (this.m_objViewer.m_ckbWaitCharge.Checked == true) { WaitChargeFee += d; } else { continue; } } else if (pstatus == 2) { WaitClearFee += d; } else if (pstatus == 3) { CompleteClearFee += d; } else if (pstatus == 4) { DirectorFee += d; } //总费用 TotalFee += d; } //WaitChargeFee = decimal.Round(WaitChargeFee, 2); //WaitClearFee = decimal.Round(WaitClearFee, 2); //结余 = 可用预交金 - 待结 - 待清 decimal BalanceFee = patient_VO.PrepayMoney - WaitChargeFee - WaitClearFee; //decimal BalanceFee = patient_VO.PrepayMoney - WaitClearFee; patient_VO.TotalFee = TotalFee; patient_VO.WaitChargeFee = WaitChargeFee; patient_VO.WaitClearFee = WaitClearFee; patient_VO.DirectorFee = DirectorFee; patient_VO.CompleteClearFee = CompleteClearFee; patient_VO.BalanceMoney = BalanceFee; //patient_VO.ClearFeeDate = ClearFeeDate; //patient_VO.NoChargeDays = NoChargeDays; //Pat view DataView dvPat = new DataView(this.m_dtPatient); dvPat.RowFilter = "REGISTERID_CHR = '" + registerId + "'"; if (dvPat.Count > 0) { patient_VO.LimtRate = clsPublic.ConvertObjToDecimal(dvPat[0]["LIMITRATE_MNY"]); } }
/// <summary> /// 查找并赋值 /// </summary> /// <param name="no">号码</param> /// <param name="type">1 诊疗卡号 2 住院号 3 入院登记流水号</param> public void m_mthFind(string no, int type) { this.IsChanged = false; this.parm_zyh = ""; if (Patient_VO != null) { Patient_VO = null; } Patient_VO = new clsBihPatient_VO(); DataTable dt = new DataTable(); long l = this.objSvc.m_lngGetPatientinfoByNO(no, out dt, status, type); if (l > 0 && dt.Rows.Count == 1) { DataRow dr = dt.Rows[0]; string RegID = dr["registerid_chr"].ToString().Trim(); Patient_VO.RegisterID = RegID; Patient_VO.CardNO = dr["patientcardid_chr"].ToString().Trim(); Patient_VO.PatientID = dr["patientid_chr"].ToString().Trim(); Patient_VO.Zyh = dr["inpatientid_chr"].ToString().Trim(); Patient_VO.Zycs = int.Parse(dr["inpatientcount_int"].ToString()); Patient_VO.Name = dr["lastname_vchr"].ToString().Trim(); Patient_VO.Sex = dr["sex_chr"].ToString().Trim(); // 1-22日修改 与登记的方法保持一致 yunjie.xie //Patient_VO.Age = clsPublic.CalcAge(Convert.ToDateTime(dr["birth_dat"].ToString())); Patient_VO.Age = (new clsBrithdayToAge().m_strGetAge(Convert.ToDateTime(dr["birth_dat"]))).TrimEnd('岁'); Patient_VO.m_dtmBirthDay = Convert.ToDateTime(dr["birth_dat"]); Patient_VO.IdCard = dr["idcard_chr"].ToString().Trim(); Patient_VO.PayTypeID = dr["paytypeid_chr"].ToString().Trim(); Patient_VO.IdNo = dr["idno_vchr"].ToString(); Patient_VO.Fee = dr["paytypename_vchr"].ToString().Trim(); Patient_VO.InType = dr["inpatientnotype_int"].ToString().Trim(); Patient_VO.InHospitalDate = dr["rysj"].ToString(); Patient_VO.AreaID = dr["areaid_chr"].ToString().Trim(); Patient_VO.AreaName = dr["deptname_vchr"].ToString().Trim(); Patient_VO.BedNO = dr["code_chr"].ToString().Trim(); Patient_VO.OutHospitalDate = dr["cysj"].ToString(); Patient_VO.Days = Convert.ToInt32(dr["indays"].ToString()); Patient_VO.Status = Convert.ToInt32(dr["pstatus_int"].ToString()); Patient_VO.FeeStatus = Convert.ToInt32(dr["feestatus_int"].ToString()); Patient_VO.SpecialInfo = dr["remarkname_vchr"].ToString().Trim(); Patient_VO.Diagnose = dr["diagnose_vchr"].ToString().Trim(); Patient_VO.Note = dr["note"].ToString().Trim(); //当前医保统筹金额 YBSum = clsPublic.ConvertObjToDecimal(dr["ybsum"]); this.m_mthGetPatientFeeInfo(RegID); this.m_mthSetValue(); Patient_VO.BedID = dr["bedid_chr"].ToString().Trim(); Patient_VO.SpecChargeCtrl = Convert.ToInt32(dr["SpecChargeCtrl"].ToString()); this.parm_areaid = Patient_VO.AreaID; /***主治医生信息***/ Patient_VO.DoctorID = dr["doctorid"].ToString().Trim(); Patient_VO.DoctorName = dr["doctorname"].ToString().Trim(); DataTable dtDoct; l = this.objSvc.m_lngGetGroupEmp(this.BihPatient_VO.DoctorID, out dtDoct); if (l > 0 && dtDoct.Rows.Count > 0) { Patient_VO.DoctorGroupID = dtDoct.Rows[0]["groupid_chr"].ToString(); } /*****************/ /***医保信息***/ Patient_VO.InsuredTotalMoney = clsPublic.ConvertObjToDecimal(dr["insuredtotalmoney_mny"]); Patient_VO.InsuredZycs = int.Parse(clsPublic.ConvertObjToDecimal(dr["insuredpaytime_int"]).ToString()) + 1; /**************/ //费用核对状态 this.FeeCheckStatus = int.Parse(dr["checkstatus_int"].ToString()); this.m_mthShowFeeCheckStatus(); clsPublic.m_mthWriteParm(Patient_VO.RegisterID, Patient_VO.Zyh, Patient_VO.CardNO); this.IsChanged = true; } else { string msg = ""; switch (status) { case 2: msg = "没有满足条件的病人信息(提示:病人出院前请办理预出院手续)。"; break; default: msg = "没有满足条件的病人信息。"; break; } MessageBox.Show(msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }