/// <summary> /// hàm thực hiện việc tính phần trăm của bảo hiểm y tế /// </summary> /// <param name="objPatientExam"></param> /// <param name="objRegExam"></param> public static void TinhToanKhamPtramBHYT(TPatientExam objPatientExam, TRegExam objRegExam) { decimal PTramBHYT = Utility.DecimaltoDbnull(objPatientExam.DiscountRate, 0); objRegExam.MaKhoaThien = globalVariables.MA_KHOA_THIEN; if (Utility.Int32Dbnull(objRegExam.TrongGoi, 0) == 1) { objRegExam.GiaBhytCt = 0; objRegExam.GiaBnct = 0; } else { objRegExam.GiaBhytCt = Utility.DecimaltoDbnull(objRegExam.RegFee) * Utility.DecimaltoDbnull(PTramBHYT) / 100; objRegExam.GiaBnct = Utility.DecimaltoDbnull(objRegExam.RegFee, 0) - Utility.DecimaltoDbnull(objRegExam.GiaBhytCt, 0); } }
private void cboRegExam_SelectedIndexChanged(object sender, EventArgs e) { try { txtSoLanKham.Text = Utility.sDbnull(cboRegExam.SelectedValue, -1); TRegExam objRegExam = TRegExam.FetchByID(Utility.Int32Dbnull(txtSoLanKham.Text)); if (objRegExam != null) { DataTable m_dtThongTin = SPs.LaokhoaLaythongtinBenhnhanNgoaitruLankham(ObjPatientExam.PatientCode, Utility.Int32Dbnull(ObjPatientExam.PatientId, -1), Utility.Int32Dbnull(txtSoLanKham.Text)).GetDataSet ().Tables[0]; if (m_dtThongTin.Rows.Count > 0) { DataRow dr = m_dtThongTin.Rows[0]; if (dr != null) { dtInput_Date.Value = Convert.ToDateTime(dr[TPatientExam.Columns.InputDate]); txtExam_ID.Text = Utility.sDbnull(objRegExam.RegId); dtpCreatedDate.Value = Convert.ToDateTime(objRegExam.RegDate); txtDepartment_ID.Text = Utility.sDbnull(objRegExam.DepartmentId); LDepartment objDepartment = LDepartment.FetchByID(Utility.Int32Dbnull(txtDepartment_ID.Text)); if (objDepartment != null) { txtDepartment_Name.Text = Utility.sDbnull(objDepartment.DepartmentName); } txtTenKham.Text = Utility.sDbnull(objRegExam.KieuKhambenh); if (objRegExam.UserId == "ADMIN") { txtNguoiTiepNhan.Text = objRegExam.UserId; } else { LStaff lStaff = BusinessHelper.GetStaffByUserName(objRegExam.UserId); if (lStaff != null) { txtNguoiTiepNhan.Text = Utility.sDbnull(lStaff.StaffName); } else { txtNguoiTiepNhan.Text = objRegExam.UserId; } } if (Utility.Int32Dbnull(objRegExam.IdBsyThien, -1) <= 0) { cboDoctorAssign.SelectedValue = Utility.Int32Dbnull(objRegExam.IdBsyThien, -1); } else { cboDoctorAssign.SelectedIndex = 0; } //TExamInfo objExam = TExamInfo.FetchByID(Utility.Int32Dbnull(txtExam_ID.Text)); //if (objExam != null) //{ // txtKet_Luan.Text = Utility.sDbnull(objExam.KetLuan); // txtHuongdieutri.Text = objExam.HuongDieuTri; // nmrSongayDT.Value = Utility.DecimaltoDbnull(objExam.SoNgay, 0); // var objDiagInfo = new Select().From(TDiagInfo.Schema) // .Where(TDiagInfo.Columns.ExamId).IsEqualTo(objExam.ExamId).ExecuteSingle<TDiagInfo>(); // if (objDiagInfo != null) // { // txtChanDoan.Text = Utility.sDbnull(objDiagInfo.DiagInfo); // txtMaBenhChinh.Text = Utility.sDbnull(objDiagInfo.MainDiseaseId); // string dataString = Utility.sDbnull(objDiagInfo.AuxiDiseaseId, ""); // if (!string.IsNullOrEmpty(dataString)) // { // dt_ICD_PHU.Clear(); // string[] rows = dataString.Split(','); // foreach (string row in rows) // { // if (!string.IsNullOrEmpty(row)) // { // DataRow newDr = dt_ICD_PHU.NewRow(); // newDr["MA_ICD"] = row; // newDr["TEN_ICD"] = GetTenBenh(row); // dt_ICD_PHU.Rows.Add(newDr); // dt_ICD_PHU.AcceptChanges(); // } // } // grd_ICD.DataSource = dt_ICD_PHU; // } // else // { // dt_ICD_PHU.Clear(); // } // } //} GetDataChiDinh(); } } } } catch (Exception) { Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin khám chữa bệnh"); } }