public static void DeleteDepartment(int pId) { if (LDepartment.FetchByID(pId) != null) { LDepartment.Delete(pId); } }
/// <summary> /// /// </summary> /// <param name="v_Staff_Id"></param> /// <returns></returns> public static string GetDepartmentName(int v_Department_Id) { LDepartment objDepartment = LDepartment.FetchByID(v_Department_Id); if (objDepartment != null) { return(objDepartment.DepartmentName); } else { return(""); } }
public static void UpdateDepartment(LDepartment pitems) { try { if (LDepartment.FetchByID(pitems.Id) != null) { pitems.IsNew = false; pitems.Save(); } } catch (Exception ex) { throw ex; } }
private void cmdXemBaoCao_Click(object sender, EventArgs e) { try { string sTenKhoa = cboDepartment.Text; dt = new DataTable(); dt.Columns.Add("Barcode"); dt.Columns.Add("Patient_ID"); dt.Columns.Add("Patient_Name"); dt.Columns.Add("AGE"); dt.Columns.Add("Sex"); dt.Columns.Add("Department"); dt.Columns.Add("Insurance_Num"); dt.Columns.Add("ObjectType"); dt.Columns.Add("Diagnostic"); dt.Columns.Add("AllResult"); dt.Columns.Add("AllResult2"); dt.Columns.Add("Test_Date"); LDepartment objDepartment = LDepartment.FetchByID(Utility.Int32Dbnull(cboDepartment.SelectedValue)); if (objDepartment != null) { sTenKhoa = Utility.sDbnull(objDepartment.SName, ""); } dtRawResult = SpRptBaoCaoLuu(dtpFromDate.Value, dtpToDate.Value, Utility.Int32Dbnull(cboDepartment.SelectedValue), Utility.Int32Dbnull(cboObjectType.SelectedValue), chkPrintAll.Checked). GetDataSet().Tables[0]; if (dtRawResult.Rows.Count == 0) { dtRawResult = null; } if (dtRawResult == null || dtRawResult.Rows.Count <= 0) { Utility.ShowMsg("Không tồn tại dữ liệu"); cmdINPHIEU.Enabled = false; gridResult.DataSource = dt; return; } bool forVd = SysPara.BarcodeType.ToUpper() == "VIETDUC"; //Xử lý các giá trị bình thường //Utilities.ProcessNormalResult(ref dtRawResult, "Test_Result", "Normal_Level", "+", // "+", "-", "flag", forVd); //lablinkhelper.Utilities.ProcessNormalResult(ref dtRawResult, "Test_Result", "Normal_Level", "", // "", "", "flag", forVd); var patientResult = new StringBuilder(); var patientResult2 = new StringBuilder(); dtRawResult.Rows.InsertAt(dtRawResult.NewRow(), 0); dtRawResult.Rows[0]["Patient_ID"] = dtRawResult.Rows[1]["Patient_ID"]; dtRawResult.Rows.Add(dtRawResult.NewRow()); for (int i = 1; i <= dtRawResult.Rows.Count - 1; i++) { if (Utility.sDbnull(dtRawResult.Rows[i]["Patient_ID"]) != Utility.sDbnull(dtRawResult.Rows[i - 1]["Patient_ID"])) { //patientResult.Remove(patientResult.Length - 2, 1); var newdr = dt.NewRow(); newdr["Patient_ID"] = dtRawResult.Rows[i - 1]["Patient_ID"]; newdr["Barcode"] = dtRawResult.Rows[i - 1]["Barcode"]; newdr["Patient_Name"] = dtRawResult.Rows[i - 1]["Patient_Name"]; newdr["AGE"] = dtRawResult.Rows[i - 1]["AGE"]; newdr["Sex"] = dtRawResult.Rows[i - 1]["Sex"]; //newdr["Insurance_Num"] = dtRawResult.Rows[i - 1]["Insurance_Num"]; newdr["Department"] = dtRawResult.Rows[i - 1]["Department"]; newdr["Diagnostic"] = dtRawResult.Rows[i - 1]["Diagnostic"]; //newdr["ObjectType"] = dtRawResult.Rows[i - 1]["ObjectType"]; if (dtRawResult.Rows[i - 1]["Test_Date"] != null) { newdr["Test_Date"] = ((DateTime)dtRawResult.Rows[i - 1]["Test_Date"]).ToString("dd/MM/yyyy"); } //newdr["Test_Date"] = DateTime.Parse(dtRawResult.Rows[i - 1]["Test_Date"].ToString()).ToString("dd/MM/yyyy"); newdr["AllResult2"] = patientResult2.ToString(); newdr["AllResult"] = patientResult.ToString(); dt.Rows.Add(newdr); patientResult2 = new StringBuilder(); patientResult = new StringBuilder(); } if ((Utility.sDbnull(dtRawResult.Rows[i]["TestType_Name"]) != Utility.sDbnull(dtRawResult.Rows[i - 1]["TestType_Name"])) | (Utility.sDbnull(dtRawResult.Rows[i]["Patient_ID"]) != Utility.sDbnull(dtRawResult.Rows[i - 1]["Patient_ID"]))) { patientResult2.Append(dtRawResult.Rows[i]["TestType_Name"] + ":"); patientResult.Append("</p>"); patientResult.Append(string.Format("<b>{0}</b>: ", Utility.sDbnull(dtRawResult.Rows[i]["TestType_Name"]).ToUpper ())); } string value, value2; //if (Utility.sDbnull(dtRawResult.Rows[i]["flag"]).Trim() == "+") //{ // value2 = string.Format("{0} ,{1} , {2}; ", // Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), // Utility.sDbnull(dtRawResult.Rows[i]["flag"]), // dtRawResult.Rows[i]["Test_result"]); // value = string.Format("<font color=\"red\"><b>{0}({1}) {2};</b></font> ", // Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), // Utility.sDbnull(dtRawResult.Rows[i]["flag"]), // dtRawResult.Rows[i]["Test_result"]); //} //else if (Utility.sDbnull(dtRawResult.Rows[i]["flag"]).Trim() == "-") //{ // value2 = string.Format("{0}, {1}, {2}; ", // Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), // Utility.sDbnull(dtRawResult.Rows[i]["flag"]), // dtRawResult.Rows[i]["Test_result"]); // value = string.Format("{0}({1}) {2}; ", // Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), // Utility.sDbnull(dtRawResult.Rows[i]["flag"]), // dtRawResult.Rows[i]["Test_result"]); //} //else { value2 = string.Format( Utility.sDbnull(dtRawResult.Rows[i]["Test_result"]).Trim() != "" ? "{0} {1};" : "{0}       ", Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), dtRawResult.Rows[i]["Test_result"]); value = string.Format( Utility.sDbnull(dtRawResult.Rows[i]["Test_result"]).Trim() != "" ? "{0} {1};" : "<i>{0}      </i> ", Utility.sDbnull(dtRawResult.Rows[i]["Test_Name"]), dtRawResult.Rows[i]["Test_result"]); } patientResult.Append(value); patientResult2.Append(value2); } gridResult.DataSource = dt; cmdINPHIEU.Enabled = true; gridResult.AutoSizeColumns(); dt.AcceptChanges(); } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
private void getData() { TPhieuCapphatNoitru objPhieuCapphat = TPhieuCapphatNoitru.FetchByID(Utility.Int32Dbnull(txtID_CAPPHAT.Text)); if (objPhieuCapphat != null) { txtID_CAPPHAT.Text = Utility.sDbnull(objPhieuCapphat.IdCapphat); dtNgayCapPhat.Value = dtNgayCapPhat.Value; txtID_KHOA_LINH.Text = Utility.sDbnull(objPhieuCapphat.IdKhoaLinh); idKhoaLinh = Utility.Int32Dbnull(objPhieuCapphat.IdKhoaLinh); DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objPhieuCapphat.IdKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.TenKhoaphong); } //chkIsBoSung.Checked = Convert.ToBoolean(objPhieuCapphat.LinhBSung); IsPhieuBoSung = Utility.Byte2Bool(objPhieuCapphat.LoaiPhieu); radLinhBoSung.Checked = IsPhieuBoSung; loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; txtID_NVIEN.Text = Utility.sDbnull(objPhieuCapphat.IdNhanviencapphat); DmucNhanvien objStaff = DmucNhanvien.FetchByID(objPhieuCapphat.IdNhanviencapphat); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.TenNhanvien); } txtId_KhoXuat.Text = Utility.sDbnull(objPhieuCapphat.IdKhoXuat); id_khoXuat = Utility.Int32Dbnull(objPhieuCapphat.IdKhoXuat); DKho objKho = DKho.FetchByID(objPhieuCapphat.IdKhoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } madoituong = Utility.sDbnull(objPhieuCapphat.MaDoiTuong); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } txtMOTA_THEM.Text = Utility.sDbnull(objPhieuCapphat.MotaThem); } else { dtNgayCapPhat.Value = BusinessHelper.GetSysDateTime(); txtID_KHOA_LINH.Text = Utility.sDbnull(idKhoaLinh); LDepartment objLDepartment = LDepartment.FetchByID(idKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName); } txtID_NVIEN.Text = Utility.sDbnull(globalVariables.gv_StaffID); LStaff objStaff = LStaff.FetchByID(globalVariables.gv_StaffID); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName); } txtId_KhoXuat.Text = Utility.sDbnull(id_khoXuat); DKho objKho = DKho.FetchByID(id_khoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } //loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; radLinhBoSung.Checked = IsPhieuBoSung; // IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.LinhBSung); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } } LoadPhieuDonThuoc(); }
private void getData() { TPhieuCapphatNoitru objPhieuCapphat = TPhieuCapphatNoitru.FetchByID(Utility.Int32Dbnull(txtID_CAPPHAT.Text)); if (objPhieuCapphat != null) { txtID_CAPPHAT.Text = Utility.sDbnull(objPhieuCapphat.IdCapphat); if (!string.IsNullOrEmpty(Utility.sDbnull(objPhieuCapphat.NgayNhap))) { dtNgayCapPhat.Value = Convert.ToDateTime(objPhieuCapphat.NgayNhap); } else { dtNgayCapPhat.Value = DateTime.Now; } txtID_KHOA_LINH.Text = Utility.sDbnull(objPhieuCapphat.IdKhoaLinh); idKhoaLinh = Utility.Int32Dbnull(objPhieuCapphat.IdKhoaLinh); DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objPhieuCapphat.IdKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName); } //chkIsBoSung.Checked = Convert.ToBoolean(objPhieuCapphat.LinhBSung); IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.loaiPhieu); radLinhBoSung.Checked = IsPhieuBoSung; loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; txtID_NVIEN.Text = Utility.sDbnull(objPhieuCapphat.idn); DmucNhanvien objStaff = DmucNhanvien.FetchByID(objPhieuCapphat.IdNvien); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName); } txtId_KhoXuat.Text = Utility.sDbnull(objPhieuCapphat.IdKhoXuat); id_khoXuat = Utility.Int32Dbnull(objPhieuCapphat.IdKhoXuat); DKho objKho = DKho.FetchByID(objPhieuCapphat.IdKhoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } madoituong = Utility.sDbnull(objPhieuCapphat.MaDoiTuong); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); if (globalVariables.gv_TongHopDonThuocMaDoiTuong) { SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); var objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } } else { txtObjectType_Name.Text = "Tất cả"; } txtMOTA_THEM.Text = Utility.sDbnull(objPhieuCapphat.MotaThem); me_Action = action.Update; } else { dtNgayCapPhat.Value = globalVariables.SysDate; txtID_KHOA_LINH.Text = Utility.sDbnull(idKhoaLinh); LDepartment objLDepartment = LDepartment.FetchByID(idKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName); } txtID_NVIEN.Text = Utility.sDbnull(globalVariables.gv_StaffID); LStaff objStaff = LStaff.FetchByID(globalVariables.gv_StaffID); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName); } txtId_KhoXuat.Text = Utility.sDbnull(id_khoXuat); DKho objKho = DKho.FetchByID(id_khoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } //loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; radLinhBoSung.Checked = IsPhieuBoSung; // IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.LinhBSung); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); if (globalVariables.gv_TongHopDonThuocMaDoiTuong) { SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); var objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } } else { txtObjectType_Name.Text = "Tất cả"; } } LoadDonThuoc(); }
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"); } }