private void OnDisplayKetQuaXetNghiemList() { Result result = XetNghiem_CellDyn3200Bus.GetKetQuaXetNghiemList(_fromDate, _toDate, _tenBenhNhan, _isMaBenhNhan); if (result.IsOK) { MethodInvoker method = delegate { dgXetNghiem.DataSource = result.QueryResult; SetCurrentXetNghiem(_xetNghiemGUID); }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetKetQuaXetNghiemList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetKetQuaXetNghiemList")); } }
private void OnDisplayXetNghiemList() { Result result = XetNghiem_CellDyn3200Bus.GetDanhSachXetNghiem(); if (result.IsOK) { MethodInvoker method = delegate { ClearData(); _dataSource = result.QueryResult as DataTable; OnSearchXetNghiem(); }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetDanhSachXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetDanhSachXetNghiem")); } }
private void OnSaveInfo() { try { _xetNghiem.UpdatedDate = DateTime.Now; _xetNghiem.UpdatedBy = Guid.Parse(Global.UserGUID); MethodInvoker method = delegate { _xetNghiem.TenXetNghiem = txtTenXetNghiem.Text; _xetNghiem.FullName = txtTenXetNghiem.Text; if (chkFromValue_Normal.Checked) { _xetNghiem.FromValue = (double)numFromValue_Normal.Value; } if (chkToValue_Normal.Checked) { _xetNghiem.ToValue = (double)numToValue_Normal.Value; } if (chkFromValue_NormalPercent.Enabled && chkFromValue_NormalPercent.Checked) { _xetNghiem.FromPercent = (double)numFromValue_NormalPercent.Value; } if (chkToValue_NormalPercent.Enabled && chkToValue_NormalPercent.Checked) { _xetNghiem.ToPercent = (double)numToValue_NormalPercent.Value; } Result result = XetNghiem_CellDyn3200Bus.UpdateXetNghiem(_xetNghiem); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateXetNghiem")); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; } }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } catch (Exception e) { MsgBox.Show(this.Text, e.Message, IconType.Error); Utility.WriteToTraceLog(e.Message); } }
private void OnDisplayChiTietKetQuaXetNghiem(string ketQuaXetNghiemGUID) { Result result = XetNghiem_CellDyn3200Bus.GetChiTietKetQuaXetNghiem(ketQuaXetNghiemGUID); if (result.IsOK) { dgChiTietKQXN.DataSource = result.QueryResult; RefreshHighlight(); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetChiTietKetQuaXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.GetChiTietKetQuaXetNghiem")); } }
private void OnSaveInfo() { try { MethodInvoker method = delegate { _chiTietKQXN.TestResult = (double)numKetQua.Value; if (chkFromValue_Normal.Checked) { _chiTietKQXN.FromValue = (double)numFromValue_Normal.Value; } if (chkToValue_Normal.Checked) { _chiTietKQXN.ToValue = (double)numToValue_Normal.Value; } _chiTietKQXN.DonVi = txtDonVi.Text; _chiTietKQXN.LamThem = chkLamThem.Checked; Result result = XetNghiem_CellDyn3200Bus.UpdateChiSoKetQuaXetNghiem(_chiTietKQXN, ref _binhThuong); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateChiSoKetQuaXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateChiSoKetQuaXetNghiem")); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; } }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } catch (Exception e) { MsgBox.Show(this.Text, e.Message, IconType.Error); Utility.WriteToTraceLog(e.Message); } }
private void OnCapNhatBenhNhan() { if (dgXetNghiem.SelectedRows == null || dgXetNghiem.SelectedRows.Count <= 0) { MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 xét nghiệm để cập nhật bệnh nhân.", IconType.Information); return; } DataRow row = (dgXetNghiem.SelectedRows[0].DataBoundItem as DataRowView).Row; if (row == null) { return; } dlgSelectPatient dlg = new dlgSelectPatient(PatientSearchType.BenhNhan); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { DataRow patientRow = dlg.PatientRow; if (patientRow != null) { KetQuaXetNghiem_CellDyn3200 kqxn = new KetQuaXetNghiem_CellDyn3200(); kqxn.KQXN_CellDyn3200GUID = Guid.Parse(row["KQXN_CellDyn3200GUID"].ToString()); kqxn.PatientGUID = Guid.Parse(patientRow["PatientGUID"].ToString()); Result result = XetNghiem_CellDyn3200Bus.UpdatePatient(kqxn); if (result.IsOK) { row["PatientGUID"] = patientRow["PatientGUID"]; row["FileNum"] = patientRow["FileNum"]; row["FullName"] = patientRow["FullName"]; row["DobStr"] = patientRow["DobStr"]; row["GenderAsStr"] = patientRow["GenderAsStr"]; OnDisplayChiTietKetQuaXetNghiem(row["KQXN_CellDyn3200GUID"].ToString()); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdatePatient"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdatePatient")); } } } }
private void port_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { try { SerialPort port = (SerialPort)sender; PortConfig portConfig = Global.PortConfigCollection.GetPortConfigByPortName(port.PortName); if (portConfig == null) { return; } LoadConfig(); string data = port.ReadExisting(); if (portConfig.LoaiMay == LoaiMayXN.Hitachi917) { List <TestResult_Hitachi917> testResults = ParseTestResult_Hitachi917(data, port.PortName); Result result = XetNghiem_Hitachi917Bus.InsertKQXN(testResults); if (!result.IsOK) { Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_Hitachi917Bus.InsertKQXN")); } } else if (portConfig.LoaiMay == LoaiMayXN.CellDyn3200) { List <TestResult_CellDyn3200> testResults = ParseTestResult_CellDyn3200(data, port.PortName); Result result = XetNghiem_CellDyn3200Bus.InsertKQXN(testResults); if (!result.IsOK) { Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.InsertKQXN")); } } } catch (Exception ex) { Utility.WriteToTraceLog(string.Format("Serial Port: {0}", ex.Message)); } }
private void OnDeleteChiTietKetQuaXetNghiem() { List <string> deletedCTKQXNList = new List <string>(); List <DataRow> deletedRows = new List <DataRow>(); DataTable dt = dgChiTietKQXN.DataSource as DataTable; foreach (DataRow row in dt.Rows) { if (Boolean.Parse(row["Checked"].ToString())) { deletedCTKQXNList.Add(row["ChiTietKQXN_CellDyn3200GUID"].ToString()); deletedRows.Add(row); } } if (deletedCTKQXNList.Count > 0) { if (MsgBox.Question(Application.ProductName, "Bạn có muốn xóa những chi tiết kết quả xét nghiệm bạn đã đánh dấu ?") == DialogResult.Yes) { Result result = XetNghiem_CellDyn3200Bus.DeleteChiTietKetQuaXetNghiem(deletedCTKQXNList); if (result.IsOK) { foreach (DataRow row in deletedRows) { dt.Rows.Remove(row); } } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.DeleteChiTietKetQuaXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.DeleteChiTietKetQuaXetNghiem")); } } } else { MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những chi tiết kết quả xét nghiệm cần xóa.", IconType.Information); } }
private void OnSaveInfo() { try { XetNghiem_CellDyn3200 xetNghiem = new XetNghiem_CellDyn3200(); xetNghiem.XetNghiemGUID = Guid.Parse(_row["XetNghiemGUID"].ToString()); xetNghiem.UpdatedDate = DateTime.Now; xetNghiem.UpdatedBy = Guid.Parse(Global.UserGUID); MethodInvoker method = delegate { xetNghiem.TenXetNghiem = _tenXetNghiem; xetNghiem.FullName = _tenXetNghiem; if (chkFromValue_Normal.Checked) { xetNghiem.FromValue = (double)numFromValue_Normal.Value; } if (chkToValue_Normal.Checked) { xetNghiem.ToValue = (double)numToValue_Normal.Value; } //if (chkFromValue_NormalPercent.Enabled && chkFromValue_NormalPercent.Checked) // xetNghiem.FromPercent = (double)numFromValue_NormalPercent.Value; //if (chkToValue_NormalPercent.Enabled && chkToValue_NormalPercent.Checked) // xetNghiem.ToPercent = (double)numToValue_NormalPercent.Value; Result result = XetNghiem_CellDyn3200Bus.UpdateXetNghiem(xetNghiem); if (!result.IsOK) { MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateXetNghiem"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_CellDyn3200Bus.UpdateXetNghiem")); } else { DataRow row = GetDataRow(xetNghiem.XetNghiemGUID.ToString()); if (row != null) { if (chkFromValue_Normal.Checked) { row["FromValue"] = xetNghiem.FromValue.Value; } else { row["FromValue"] = DBNull.Value; } if (chkToValue_Normal.Checked) { row["ToValue"] = xetNghiem.ToValue.Value; } else { row["ToValue"] = DBNull.Value; } //if (chkFromValue_NormalPercent.Enabled && chkFromValue_NormalPercent.Checked) // row["FromPercent"] = xetNghiem.FromPercent.Value; //else // row["FromPercent"] = DBNull.Value; //if (chkToValue_NormalPercent.Enabled && chkToValue_NormalPercent.Checked) // row["ToPercent"] = xetNghiem.ToPercent.Value; //else // row["ToPercent"] = DBNull.Value; MsgBox.Show(Application.ProductName, "Lưu chỉ số xét nghiệm thành công.", IconType.Information); } } }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } catch (Exception e) { MsgBox.Show(Application.ProductName, e.Message, IconType.Error); Utility.WriteToTraceLog(e.Message); } }