|
|
|
@ -1,9 +1,12 @@ |
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Diagnostics; |
|
|
|
|
using System.Drawing; |
|
|
|
|
using System.Globalization; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Reflection; |
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
using System.Windows.Forms; |
|
|
|
|
using DevExpress.XtraEditors; |
|
|
|
|
using DevExpress.XtraGrid.Views.Base; |
|
|
|
@ -87,10 +90,19 @@ namespace PEIS.View.Exam |
|
|
|
|
RbStatus2.Click += RadioButton_Click; |
|
|
|
|
// 输入体检号回车 |
|
|
|
|
//txtId.KeyDown += TxtId_KeyDown; |
|
|
|
|
OpsConclusion.TsmiRefresh.Visible = false; |
|
|
|
|
OpsConclusion.TsmiAdd.Visible = false; |
|
|
|
|
//结论-添加 |
|
|
|
|
//OpsConclusion.TsmiAdd.Click += ConclusionAdd_Click; |
|
|
|
|
OpsConclusion.TsmiRefresh.Text = "上移"; |
|
|
|
|
OpsConclusion.TsmiRefresh.Image = Properties.Resources.shang; |
|
|
|
|
OpsConclusion.TsmiAdd.Text = "下移"; |
|
|
|
|
OpsConclusion.TsmiAdd.Image = Properties.Resources.xia; |
|
|
|
|
//结论-排序 |
|
|
|
|
OpsConclusion.TsmiRefresh.Click += (s, e) => |
|
|
|
|
{ |
|
|
|
|
ConclusionSort(-1); |
|
|
|
|
}; |
|
|
|
|
OpsConclusion.TsmiAdd.Click += (s, e) => |
|
|
|
|
{ |
|
|
|
|
ConclusionSort(1); |
|
|
|
|
}; |
|
|
|
|
//结论-删除 |
|
|
|
|
OpsConclusion.TsmiDelete.Click += ConclusionDelete_Click; |
|
|
|
|
//结论-保存 |
|
|
|
@ -212,22 +224,59 @@ namespace PEIS.View.Exam |
|
|
|
|
{ |
|
|
|
|
SearchAllConclusion(); |
|
|
|
|
}; |
|
|
|
|
DgvExamConclusion.OptionsCustomization.AllowSort = true; |
|
|
|
|
DgvExamConclusion.OptionsCustomization.AllowSort = true; |
|
|
|
|
//DgcAllConclusion.DataSource = Global._lstConclusion; |
|
|
|
|
// DgvAllConclusion.OptionsFind.AlwaysVisible = true; |
|
|
|
|
// DgvAllConclusion.OptionsFind.ShowClearButton = false; |
|
|
|
|
// DgvAllConclusion.OptionsFind.ShowCloseButton = false; |
|
|
|
|
DgvAllConclusion.DoubleClick += DgvAllConclusion_DoubleClick; |
|
|
|
|
DgvExamResultData.CustomDrawCell += DgvExamResultData_CustomDrawCell; |
|
|
|
|
|
|
|
|
|
// 启用行选择 |
|
|
|
|
DgvExamConclusion.OptionsSelection.EnableAppearanceFocusedCell = false; |
|
|
|
|
DgvExamConclusion.OptionsSelection.MultiSelect = false; // 限制单选 |
|
|
|
|
// 启用编辑功能,以便显示勾选框 |
|
|
|
|
DgvExamConclusion.OptionsBehavior.Editable = true; |
|
|
|
|
// 设置行头自动调整高度以显示勾选框 |
|
|
|
|
DgvExamConclusion.OptionsView.RowAutoHeight = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void ConclusionSort(int i) |
|
|
|
|
{ |
|
|
|
|
if (DgvExamConclusion.GetFocusedRow() is ExamConclusion selected) |
|
|
|
|
{ |
|
|
|
|
var current = _examConclusion.IndexOf(selected); |
|
|
|
|
if ((current == 0 && i < 0) || (current == _examConclusion.Count - 1 && i > 0)) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var temp = _examConclusion[current + i]; |
|
|
|
|
var tempSeq = _examConclusion[current + i].Seq; |
|
|
|
|
temp.Seq = selected.Seq; |
|
|
|
|
selected.Seq = tempSeq; |
|
|
|
|
_examConclusion[current + i] = selected; |
|
|
|
|
_examConclusion[current] = temp; |
|
|
|
|
_examConclusion = _examConclusion.OrderBy(o => o.Seq).ToList(); |
|
|
|
|
// for (int j = 0; j < _examConclusion.Count; j++) |
|
|
|
|
// { |
|
|
|
|
// _examConclusion[j].Seq = j + 1; |
|
|
|
|
// } |
|
|
|
|
Invoke(new Action(() => DgcExamConclusion.DataSource = null)); |
|
|
|
|
Invoke(new Action(() => DgcExamConclusion.DataSource = _examConclusion)); |
|
|
|
|
Invoke(new Action(() => DgcExamConclusion.DataSource = _examConclusion)); |
|
|
|
|
Invoke(new Action(() => DgvExamConclusion.FocusedRowHandle = current+i)); |
|
|
|
|
Invoke(new Action(() => DgvExamConclusion.SelectRow(current + i))); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private void SearchAllConclusion() |
|
|
|
|
{ |
|
|
|
|
var query = txtConclusionSerch.Text; |
|
|
|
|
var isId = long.TryParse(query, out var id); |
|
|
|
|
var list=string.IsNullOrEmpty(query) |
|
|
|
|
? Global._lstConclusion |
|
|
|
|
: Global._lstConclusion.Where(p => p.SpellCode.Contains(query) || p.ConclusionName.Contains(query) || (isId && p.ID == id)).ToList(); |
|
|
|
|
var list = string.IsNullOrEmpty(query) |
|
|
|
|
? Global._lstConclusion |
|
|
|
|
: Global._lstConclusion.Where(p => p.SpellCode.Contains(query) || p.ConclusionName.Contains(query) || (isId && p.ID == id)).ToList(); |
|
|
|
|
|
|
|
|
|
Invoke(new Action(() => DgcAllConclusion.DataSource = null)); |
|
|
|
|
Invoke(new Action(() => DgcAllConclusion.DataSource = list)); |
|
|
|
@ -337,12 +386,12 @@ namespace PEIS.View.Exam |
|
|
|
|
if (rowData != null) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
var conclusion = DgvExamConclusion.GetFocusedRow() as ExamConclusion; |
|
|
|
|
if (rowData == null || conclusion == null) return; |
|
|
|
|
var index = _examConclusion.IndexOf(conclusion); |
|
|
|
|
_examConclusion[index].Conclusion = rowData.ConclusionName; |
|
|
|
|
_examConclusion[index].Suggestion = rowData.Suggestion; |
|
|
|
|
ShowExamConclusion(_examConclusion); |
|
|
|
|
var conclusion = DgvExamConclusion.GetFocusedRow() as ExamConclusion; |
|
|
|
|
if (rowData == null || conclusion == null) return; |
|
|
|
|
var index = _examConclusion.IndexOf(conclusion); |
|
|
|
|
_examConclusion[index].Conclusion = rowData.ConclusionName; |
|
|
|
|
_examConclusion[index].Suggestion = rowData.Suggestion; |
|
|
|
|
ShowExamConclusion(_examConclusion); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -472,9 +521,9 @@ namespace PEIS.View.Exam |
|
|
|
|
/// <summary> |
|
|
|
|
/// 3. 获取科室小结 |
|
|
|
|
/// </summary> |
|
|
|
|
public event EventHandler<Args<object>> GetSummary; |
|
|
|
|
public event EventHandler<Args<object>> GetSummary; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ShowSummary(List<ExamPart> items) |
|
|
|
|
{ |
|
|
|
|
Invoke(new Action(() => _examPart = items)); |
|
|
|
@ -504,6 +553,11 @@ namespace PEIS.View.Exam |
|
|
|
|
|
|
|
|
|
public void ShowExamConclusion(List<ExamConclusion> items) |
|
|
|
|
{ |
|
|
|
|
items = items.OrderBy(o => o.Seq).ToList(); |
|
|
|
|
for (int j = 0; j < items.Count; j++) |
|
|
|
|
{ |
|
|
|
|
items[j].Seq = j + 1; |
|
|
|
|
} |
|
|
|
|
Invoke(new Action(() => DgcExamConclusion.DataSource = null)); |
|
|
|
|
Invoke(new Action(() => _examConclusion = items)); |
|
|
|
|
Invoke(new Action(() => DgcExamConclusion.DataSource = _examConclusion)); |
|
|
|
@ -537,8 +591,8 @@ namespace PEIS.View.Exam |
|
|
|
|
{ |
|
|
|
|
GetPatient?.Invoke(this, new Args<object>(selected.ID)); |
|
|
|
|
GetExamResultList?.Invoke(this, new Args<object>(_patient.ID)); |
|
|
|
|
GetSummary?.Invoke(this, new Args<object>(_patient.ID)); |
|
|
|
|
Invoke(new Action(() =>GetExamResultData(_patient.ID))); |
|
|
|
|
GetSummary?.Invoke(this, new Args<object>(_patient.ID)); |
|
|
|
|
Invoke(new Action(() => GetExamResultData(_patient.ID))); |
|
|
|
|
GetExamConclusion?.Invoke(this, new Args<object>(_patient.ID)); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -707,7 +761,7 @@ namespace PEIS.View.Exam |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_examConclusion.Add(new ExamConclusion() { EID = _patient.ID,Seq = _examConclusion.Count+1 }); |
|
|
|
|
_examConclusion.Add(new ExamConclusion() { EID = _patient.ID, Seq = _examConclusion.Count + 1 }); |
|
|
|
|
ShowExamConclusion(_examConclusion); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -731,8 +785,27 @@ namespace PEIS.View.Exam |
|
|
|
|
|
|
|
|
|
if (DgvExamConclusion.GetSelectedRows().Length == 0) return; |
|
|
|
|
var item = DgvExamConclusion.GetRow(DgvExamConclusion.FocusedRowHandle) as ExamConclusion; |
|
|
|
|
if (item==null)return; |
|
|
|
|
if (!Global.MsgDelete()) return; |
|
|
|
|
|
|
|
|
|
_examConclusion.Remove(item); |
|
|
|
|
ShowExamConclusion(_examConclusion); |
|
|
|
|
|
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
var task = new Task(() => item?.Delete()); |
|
|
|
|
task.Start(); |
|
|
|
|
} |
|
|
|
|
catch (AggregateException ae) |
|
|
|
|
{ |
|
|
|
|
Global.MsgErr($@"{item.Conclusion} 结论词删除失败!" + ae.Message); |
|
|
|
|
ae.Handle(ex => |
|
|
|
|
{ |
|
|
|
|
// 处理异常 |
|
|
|
|
return true; // 返回true表示已处理异常 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@ -759,7 +832,7 @@ namespace PEIS.View.Exam |
|
|
|
|
SaveExamConclusion?.Invoke(this, new Args<ExamConclusion>() |
|
|
|
|
{ |
|
|
|
|
ID = _patient.ID, |
|
|
|
|
Items = _examConclusion.Where(p=>!string.IsNullOrEmpty(p.Conclusion)).ToList() |
|
|
|
|
Items = _examConclusion.Where(p => !string.IsNullOrEmpty(p.Conclusion)).ToList() |
|
|
|
|
}); |
|
|
|
|
//MessageBox.Show(@"保存成功!"); |
|
|
|
|
} |
|
|
|
@ -970,7 +1043,7 @@ namespace PEIS.View.Exam |
|
|
|
|
var imageBytes = Convert.FromBase64String(patient.Photo); |
|
|
|
|
using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length)) |
|
|
|
|
{ |
|
|
|
|
Invoke(new Action(() => { picAvatar.Image = Image.FromStream(ms, true); })); |
|
|
|
|
Invoke(new Action(() => { picAvatar.Image = Image.FromStream(ms, true); })); |
|
|
|
|
Invoke(new Action(() => { picAvatar.BorderStyle = BorderStyle.None; })); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -995,7 +1068,7 @@ namespace PEIS.View.Exam |
|
|
|
|
/// <param name="eid"></param> |
|
|
|
|
public void GetExamResultData(long eid) |
|
|
|
|
{ |
|
|
|
|
if (eid==0) |
|
|
|
|
if (eid == 0) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -1020,7 +1093,7 @@ namespace PEIS.View.Exam |
|
|
|
|
Invoke(new Action(() => DgvExamResultData.ExpandAllGroups())); |
|
|
|
|
DgvExamResultData.OptionsView.RowAutoHeight = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DgvExamResultData_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) |
|
|
|
|
{ |
|
|
|
|
var gridView = (GridView)sender; |
|
|
|
|