diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj
index 246a355..49417e0 100644
--- a/PEIS/PEIS.csproj
+++ b/PEIS/PEIS.csproj
@@ -827,6 +827,7 @@
+
Always
diff --git a/PEIS/Properties/Resources.Designer.cs b/PEIS/Properties/Resources.Designer.cs
index baf42c5..10c3353 100644
--- a/PEIS/Properties/Resources.Designer.cs
+++ b/PEIS/Properties/Resources.Designer.cs
@@ -390,6 +390,16 @@ namespace PEIS.Properties {
}
}
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap 打印 {
+ get {
+ object obj = ResourceManager.GetObject("打印", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
///
diff --git a/PEIS/Properties/Resources.resx b/PEIS/Properties/Resources.resx
index ccf5ed8..276a16c 100644
--- a/PEIS/Properties/Resources.resx
+++ b/PEIS/Properties/Resources.resx
@@ -247,4 +247,7 @@
..\Resources\刷新 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\打印.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/PEIS/Resources/打印.png b/PEIS/Resources/打印.png
new file mode 100644
index 0000000..155c0ab
Binary files /dev/null and b/PEIS/Resources/打印.png differ
diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs
index 21ee7d3..eeed30c 100644
--- a/PEIS/Utils/ReportHelper.cs
+++ b/PEIS/Utils/ReportHelper.cs
@@ -113,7 +113,7 @@ namespace PEIS.Utils
///
/// 体检号
///
- public static FastReport.Report GetReport(Int64 eid, String paramFile = null)
+ public static FastReport.Report GetReport(Int64 eid, String paramFile = null, FastReport.Report combineReport = null)
{
try
{
@@ -130,19 +130,19 @@ namespace PEIS.Utils
switch (string.IsNullOrEmpty(paramFile) ? fileName : paramFile)
{
case "Children.frx":
- return EasyReport(patient, eid, filePath);
+ return EasyReport(patient, eid, filePath, combineReport);
case "Student.frx":
- return EasyReport(patient, eid, filePath);
+ return EasyReport(patient, eid, filePath, combineReport);
case "Teacher.frx":
- return EasyReport(patient, eid, filePath);
+ return EasyReport(patient, eid, filePath, combineReport);
case "Work.frx":
- return EasyReport(patient, eid, filePath);
+ return EasyReport(patient, eid, filePath, combineReport);
case "Health.frx":
- return EasyReport(patient, eid, filePath);
+ return EasyReport(patient, eid, filePath, combineReport);
case "CAPReport.frx":
- return CAPReport(patient, eid, filePath);
+ return CAPReport(patient, eid, filePath, combineReport);
default:
- return General(patient, eid, filePath);
+ return General(patient, eid, filePath, combineReport);
}
}
catch (Exception ex)
@@ -239,9 +239,13 @@ namespace PEIS.Utils
///
///
///
- private static FastReport.Report CAPReport(EnrollmentPatient patient, Int64 eid, string filePath)
+ private static FastReport.Report CAPReport(EnrollmentPatient patient, Int64 eid, string filePath, FastReport.Report combineReport)
{
- var rpt = new FastReport.Report(); //实例化一个Report报表
+ var rpt = combineReport;
+ if (rpt == null)
+ {
+ rpt = new FastReport.Report(); //实例化一个Report报表
+ }
rpt.Load(filePath);
var lstEFeeItems = new ReportModel().GetEFeeItem(eid);
@@ -485,7 +489,14 @@ namespace PEIS.Utils
//症状
SetDataSource(ref rpt, symptoms, "CAS", "Symptoms");
- rpt.Prepare(); //准备
+ if (combineReport == null)
+ {
+ rpt.Prepare(); //准备
+ }
+ else
+ {
+ rpt.Prepare(true); //合并报表
+ }
return rpt;
}
@@ -496,9 +507,13 @@ namespace PEIS.Utils
///
///
///
- private static FastReport.Report General(EnrollmentPatient patient, Int64 eid, string filePath)
+ private static FastReport.Report General(EnrollmentPatient patient, Int64 eid, string filePath, FastReport.Report combineReport)
{
- var rpt = new FastReport.Report(); //实例化一个Report报表
+ var rpt = combineReport;
+ if (rpt == null)
+ {
+ rpt = new FastReport.Report(); //实例化一个Report报表
+ }
rpt.Load(filePath);
var lstEFeeItems = new ReportModel().GetEFeeItem(eid);
@@ -574,7 +589,14 @@ namespace PEIS.Utils
SetDataSource(ref rpt, lstPacsPhotos.Concat(lstExts.Where(w => w.ReportImg != null).Select(s => new Entity.Report { ReportImage = s.ReportImg })), "I", "PACSImage");
// 科室小结
SetDataSource(ref rpt, lstExamParts, "D", "DeptSummary");
- rpt.Prepare(); //准备
+ if (combineReport == null)
+ {
+ rpt.Prepare(); //准备
+ }
+ else
+ {
+ rpt.Prepare(true); //合并报表
+ }
return rpt;
}
@@ -585,9 +607,13 @@ namespace PEIS.Utils
///
///
///
- private static FastReport.Report EasyReport(EnrollmentPatient patient, Int64 eid, string filePath)
+ private static FastReport.Report EasyReport(EnrollmentPatient patient, Int64 eid, string filePath, FastReport.Report combineReport)
{
- var rpt = new FastReport.Report(); //实例化一个Report报表
+ var rpt = combineReport;
+ if (rpt == null)
+ {
+ rpt = new FastReport.Report(); //实例化一个Report报表
+ }
rpt.Load(filePath);
var lstExts = new ReportModel().GetReportExt(eid);
var lstChildren = new ReportModel().GetFastResult(eid);
@@ -640,7 +666,14 @@ namespace PEIS.Utils
SetParameter(ref rpt, dict);
// 第三方报告
//SetDataSource(ref rpt, lstExts, "I", "ImageList");
- rpt.Prepare(); //准备
+ if (combineReport == null)
+ {
+ rpt.Prepare(); //准备
+ }
+ else
+ {
+ rpt.Prepare(true); //合并报表
+ }
return rpt;
}
@@ -1056,92 +1089,13 @@ namespace PEIS.Utils
{
try
{
- var rpt = new FastReport.Report();
- var i = 0;
-
+ FastReport.Report report = null;
foreach (var eid in idlist)
{
- var patient = new ReportModel().GetPatientInfo(eid);
- if (patient == null) return null;
- var fileName =
- DAOHelp.GetDataBySQL(
- $"SELECT Description FROM Dict_Config where Value='{patient.Type}'").FirstOrDefault()
- ?.Description ?? "PReport.frx";
- var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles",
- fileName);
- if (!File.Exists(filePath))
- {
- MessageBox.Show($@"未找到报告单模板文件:{fileName}", @"获取报告单失败");
- return null;
- }
-
- if (fileName != "PReport.frx")
- {
- rpt = EasyReport(patient, eid, filePath);
- rpt.Prepare(i > 0);
- }
- else
- {
- rpt.Load(filePath);
- var lstEFeeItems = new ReportModel().GetEFeeItem(eid);
- var lstConclusions = new ReportModel().GetExamConclusions(eid);
- var lstGeneral = new ReportModel().GetGeneralResult(eid);
- var lstLis = new ReportModel().GetLisResult(eid);
- var lstPacs = new ReportModel().GetPacsResult(eid);
- var lstPacsPhotos = new ReportModel().GetPacsPhoto(eid);
- // 登记信息
- rpt.SetParameterValue("PatientName", patient.Name);
- rpt.SetParameterValue("CardNo", patient.CardNo);
- rpt.SetParameterValue("Nation", patient.Nation);
- rpt.SetParameterValue("Age", patient.Age + patient.AgeClass);
- rpt.SetParameterValue("Sex", patient.Sex == "1" ? "男" : patient.Sex == "2" ? "女" : "");
- rpt.SetParameterValue("ExamID", patient.ID.ToString());
- rpt.SetParameterValue("ExamDate", patient.SignTime?.ToShortDateString());
- rpt.SetParameterValue("Marriage", patient.Marriage);
- rpt.SetParameterValue("TeamName", patient.OrgName);
- rpt.SetParameterValue("GroupName", patient.GroupName);
- rpt.SetParameterValue("ExamType", patient.Type);
- rpt.SetParameterValue("Address", patient.Address1);
- rpt.SetParameterValue("Tel", patient.Tel1);
- rpt.SetParameterValue("FinishPerson", patient.Finisher);
- rpt.SetParameterValue("FinishDate", patient.FinishTime?.ToShortDateString());
- rpt.SetParameterValue("HospitalName", Global._hospital.Name);
- if (patient.Photo == null)
- {
- rpt.SetParameterValue("Avatar", patient.Photo);
- }
- else
- {
- byte[] imageBytes = Convert.FromBase64String(patient.Photo);
- using (MemoryStream ms = new MemoryStream(imageBytes))
- {
- Image image = Image.FromStream(ms);
- using (MemoryStream stream = new MemoryStream())
- {
- image.Save(stream, ImageFormat.Png);
- rpt.SetParameterValue("Avatar", Convert.ToBase64String(stream.ToArray()));
- }
- }
- }
- // 收费列表
- SetDataSource(ref rpt, lstEFeeItems, "F", "FeeItems");
- // 总结结论词
- SetDataSource(ref rpt, lstConclusions, "C", "Conclusion");
- //一般检查
- SetDataSource(ref rpt, lstGeneral, "G", "General");
- //PACS
- SetDataSource(ref rpt, lstPacs, "P", "PACS");
- //LIS
- SetDataSource(ref rpt, lstLis, "L", "LIS");
- // PacsImage
- SetDataSource(ref rpt, lstPacsPhotos, "I", "PACSImage");
- rpt.Prepare(i > 0);
- }
-
- i++;
+ report = ReportHelper.GetReport(eid, null, report);
}
- return rpt;
+ return report;
}
catch (Exception ex)
{
diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs
index 4e111d2..4b680c2 100644
--- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs
+++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs
@@ -2355,9 +2355,12 @@ namespace PEIS.View.Enrollment
if (topRowIndex != -1)
{
int rowHandle = DgvEnrollment.LocateByValue("ID", topRowIndex);
- DgvEnrollment.FocusedRowHandle = rowHandle;
- DgvEnrollment.SelectRow(rowHandle);
- DgcEnrollment.Refresh();
+ if (rowHandle > 0)
+ {
+ DgvEnrollment.FocusedRowHandle = rowHandle;
+ DgvEnrollment.SelectRow(rowHandle);
+ DgcEnrollment.Refresh();
+ }
}
}));
DgvEnrollment.BestFitColumns();
diff --git a/PEIS/View/Exam/PartForm.Designer.cs b/PEIS/View/Exam/PartForm.Designer.cs
index 2423923..7166df5 100644
--- a/PEIS/View/Exam/PartForm.Designer.cs
+++ b/PEIS/View/Exam/PartForm.Designer.cs
@@ -167,6 +167,9 @@
this.panelReport = new System.Windows.Forms.Panel();
this.picReportExt = new System.Windows.Forms.PictureBox();
this.dgcRptExt = new DevExpress.XtraGrid.GridControl();
+ this.RptExtMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.PrintRptExtMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.DeleteRptExtMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DgvRptExt = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn24 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn25 = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -241,6 +244,8 @@
this.colRptExtTime = new DevExpress.XtraGrid.Columns.GridColumn();
this.colRptExtDesc = new DevExpress.XtraGrid.Columns.GridColumn();
this.superTabControl1 = new FastReport.DevComponents.DotNetBar.SuperTabControl();
+ this.RptPacsMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.PrintRptPacsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainerBase)).BeginInit();
this.splitContainerBase.Panel1.SuspendLayout();
this.splitContainerBase.Panel2.SuspendLayout();
@@ -311,6 +316,7 @@
this.panelReport.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picReportExt)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).BeginInit();
+ this.RptExtMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).BeginInit();
this.tabPageDept.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).BeginInit();
@@ -325,6 +331,7 @@
this.panel2.SuspendLayout();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit();
+ this.RptPacsMenuStrip.SuspendLayout();
this.SuspendLayout();
//
// splitContainerBase
@@ -1903,6 +1910,7 @@
//
// dgcRptPacs
//
+ this.dgcRptPacs.ContextMenuStrip = this.RptPacsMenuStrip;
this.dgcRptPacs.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgcRptPacs.Location = new System.Drawing.Point(0, 0);
this.dgcRptPacs.MainView = this.DgvRptPacs;
@@ -2011,6 +2019,7 @@
//
// dgcRptExt
//
+ this.dgcRptExt.ContextMenuStrip = this.RptExtMenuStrip;
this.dgcRptExt.Dock = System.Windows.Forms.DockStyle.Left;
this.dgcRptExt.Location = new System.Drawing.Point(0, 0);
this.dgcRptExt.MainView = this.DgvRptExt;
@@ -2020,6 +2029,28 @@
this.dgcRptExt.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvRptExt});
//
+ // RptExtMenuStrip
+ //
+ this.RptExtMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.PrintRptExtMenuItem,
+ this.DeleteRptExtMenuItem});
+ this.RptExtMenuStrip.Name = "contextMenuStrip2";
+ this.RptExtMenuStrip.Size = new System.Drawing.Size(125, 48);
+ //
+ // PrintRptExtMenuItem
+ //
+ this.PrintRptExtMenuItem.Image = global::PEIS.Properties.Resources.打印;
+ this.PrintRptExtMenuItem.Name = "PrintRptExtMenuItem";
+ this.PrintRptExtMenuItem.Size = new System.Drawing.Size(124, 22);
+ this.PrintRptExtMenuItem.Text = "打印报告";
+ //
+ // DeleteRptExtMenuItem
+ //
+ this.DeleteRptExtMenuItem.Image = global::PEIS.Properties.Resources.删除1;
+ this.DeleteRptExtMenuItem.Name = "DeleteRptExtMenuItem";
+ this.DeleteRptExtMenuItem.Size = new System.Drawing.Size(124, 22);
+ this.DeleteRptExtMenuItem.Text = "删除报告";
+ //
// DgvRptExt
//
this.DgvRptExt.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke;
@@ -3028,6 +3059,20 @@
this.superTabControl1.SelectedTabIndex = -1;
this.superTabControl1.TabIndex = 0;
//
+ // RptPacsMenuStrip
+ //
+ this.RptPacsMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.PrintRptPacsMenuItem});
+ this.RptPacsMenuStrip.Name = "RptPacsMenuStrip";
+ this.RptPacsMenuStrip.Size = new System.Drawing.Size(125, 26);
+ //
+ // PrintRptPacsMenuItem
+ //
+ this.PrintRptPacsMenuItem.Image = global::PEIS.Properties.Resources.打印;
+ this.PrintRptPacsMenuItem.Name = "PrintRptPacsMenuItem";
+ this.PrintRptPacsMenuItem.Size = new System.Drawing.Size(124, 22);
+ this.PrintRptPacsMenuItem.Text = "打印报告";
+ //
// PartForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
@@ -3114,6 +3159,7 @@
this.panelReport.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picReportExt)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).EndInit();
+ this.RptExtMenuStrip.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).EndInit();
this.tabPageDept.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).EndInit();
@@ -3131,6 +3177,7 @@
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit();
+ this.RptPacsMenuStrip.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -3348,5 +3395,10 @@
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private System.Windows.Forms.ToolStripMenuItem tsmiPick;
private System.Windows.Forms.ToolStripMenuItem tsmiOccupation;
+ private System.Windows.Forms.ContextMenuStrip RptExtMenuStrip;
+ private System.Windows.Forms.ToolStripMenuItem PrintRptExtMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem DeleteRptExtMenuItem;
+ private System.Windows.Forms.ContextMenuStrip RptPacsMenuStrip;
+ private System.Windows.Forms.ToolStripMenuItem PrintRptPacsMenuItem;
}
}
\ No newline at end of file
diff --git a/PEIS/View/Exam/PartForm.cs b/PEIS/View/Exam/PartForm.cs
index dd6255b..d07ce5b 100644
--- a/PEIS/View/Exam/PartForm.cs
+++ b/PEIS/View/Exam/PartForm.cs
@@ -161,6 +161,7 @@ namespace PEIS.View.Exam
DgvExamResult.KeyUp += DgvExamResult_KeyUp;
//1.2.1.PACS
DgvRptPacs.RowClick += DgvReportPacs_RowClick;
+ PrintRptPacsMenuItem.Click += PrintRptPacsMenuItem_Click;
//1.2.2.PACS图片选择列表-限制选中项数
ListViewPacsImg.ItemCheck += ListViewPacsImg_ItemCheck;
//1.2.3.单击选中
@@ -177,6 +178,8 @@ namespace PEIS.View.Exam
{
if (DgvRptExt.GetFocusedRow() is ReportExt selected) SetPicReportExt(selected);
};
+ PrintRptExtMenuItem.Click += PrintRptExtMenuItem_Click;
+ DeleteRptExtMenuItem.Click += DeleteRptExtMenuItem_Click;
//分科检查 颜色提示
DgvDeptExamResult.CustomDrawCell += DgvExamResult_CustomDrawCell;
DgvLisReport.CustomDrawCell += DgvLisReport_CustomDrawCell;
@@ -582,7 +585,7 @@ namespace PEIS.View.Exam
// 检测体检者的收费项目在HIS中是否还存在
List _feeItem = DAOHelp.GetDataBySQL($"SELECT * FROM Enrollment_FeeItem WHERE EID = {selected.ID} AND FID NOT IN (SELECT ID FROM Dict_FeeItem) AND GiveUpTime is not null").ToList();
string message = "";
- foreach(EnrollmentFeeItem feeItem in _feeItem)
+ foreach (EnrollmentFeeItem feeItem in _feeItem)
{
message += feeItem.FeeItemName + "、";
}
@@ -1081,6 +1084,69 @@ namespace PEIS.View.Exam
}
}
+ private void PrintRptExtMenuItem_Click(object sender, EventArgs e)
+ {
+ if (!(DgvRptExt.GetFocusedRow() is ReportExt selected)) return;
+ if (selected?.ReportImg != null)
+ {
+ try
+ {
+ using (var ms = new MemoryStream(selected.ReportImg))
+ {
+ Image img = Image.FromStream(ms);
+ System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
+ printDialog.Document = new System.Drawing.Printing.PrintDocument();
+ printDialog.Document.PrintPage += (a, b) =>
+ {
+ // 计算图像的宽度和高度
+ int imageWidth = img.Width;
+ int imageHeight = img.Height;
+
+ // 获取打印区域的宽度和高度(考虑到页边距)
+ float marginBoundsWidth = b.MarginBounds.Width;
+ float marginBoundsHeight = b.MarginBounds.Height;
+
+ // 计算绘制起点的坐标,使图像居中
+ float left = (marginBoundsWidth - imageWidth) / 2;
+ float top = (marginBoundsHeight - imageHeight) / 2;
+
+ // 确保坐标值不为负数
+ left = left < 0 ? 0 : left;
+ top = top < 0 ? 0 : top;
+
+
+ b.Graphics.DrawImage(img, left, top, imageWidth, imageHeight);
+ };
+ printDialog.UseEXDialog = true; // 显示增强的打印对话框
+
+ if (printDialog.ShowDialog() == DialogResult.OK)
+ {
+ printDialog.Document.Print(); // 执行打印操作
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Global.MsgWarn(ex.Message);
+ Debug.Write(ex.Message);
+ }
+ }
+ }
+
+ private void DeleteRptExtMenuItem_Click(object sender, EventArgs e)
+ {
+ if (!(DgvRptExt.GetFocusedRow() is ReportExt selected)) return;
+ if (selected != null)
+ {
+ if (DialogResult.OK == MessageBox.Show("即将删除报告, 此操作不可撤销!\r\n确认删除吗?", "删除确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Error))
+ {
+ selected.Delete();
+
+ RefreshTabPageData(TabPart.SelectedTabPage.Text);
+ }
+ }
+ }
+
#endregion IView事件实现
#region 页面控件事件
@@ -1142,7 +1208,7 @@ namespace PEIS.View.Exam
///
///
///
- private void TsmiPick_Click(object sender, EventArgs e)
+ private void TsmiPick_Click(object sender, EventArgs e)
{
if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime != null || _examPart.GiveUpTime != null) return;
DAOHelp.ExecuteSql($@"DELETE FROM Report WHERE ID IN (
@@ -1229,7 +1295,8 @@ namespace PEIS.View.Exam
if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime != null ||
_examPart.GiveUpTime != null || _examPart.ID <= 0) return;
- if (_examPart.CheckTime == null) {
+ if (_examPart.CheckTime == null)
+ {
MessageBox.Show(@"请先保存科室分检的检查结果!", @"审核失败");
return;
}
@@ -1291,7 +1358,7 @@ namespace PEIS.View.Exam
}
}*/
// 检验科判断项目是否完全出结果
- if (_examPart.DeptCode == "3001" && Global._hospital.Name == "德宏州中医医院" &&!string.IsNullOrEmpty(_lisViewName))
+ if (_examPart.DeptCode == "3001" && Global._hospital.Name == "德宏州中医医院" && !string.IsNullOrEmpty(_lisViewName))
{
List _noResultItem = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where ItemClass = '检验' and GiveUpTime is null and EID = {_patient.ID} and NOT exists (select * from {_lisViewName} where req_id = id)");
string message = "";
@@ -1304,14 +1371,14 @@ namespace PEIS.View.Exam
}
if (!string.IsNullOrEmpty(message))
{
- DialogResult dr =Global.Msg("warn", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!\r\n如果核查无误仍要审核,请点击确定按钮。否则点击取消!");
+ DialogResult dr = Global.Msg("warn", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!\r\n如果核查无误仍要审核,请点击确定按钮。否则点击取消!");
if (dr != DialogResult.Yes)
{
return;
}
}
}
-
+
Review?.Invoke(this, new Args
{
ID = _examPart.ID,
@@ -1501,11 +1568,12 @@ namespace PEIS.View.Exam
{
if (_examPart.VerifyTime != null || _examPart.GiveUpTime != null || _examPart.ID <= 0) return;
if (_patient.FinishTime != null || _patient.ID <= 0) return;
- _conclusion.Add(new ExamConclusion()
+ _conclusion.ForEach(x => x.Seq++);
+ _conclusion.Insert(0, new ExamConclusion()
{
PID = _examPart.ID,
EID = _examPart.EID,
- Seq = _conclusion.Count() + 1
+ Seq = 1
});
ShowConclusion(_conclusion);
}
@@ -1675,7 +1743,7 @@ namespace PEIS.View.Exam
///
private void RefreshPatient(EnrollmentPatient item = null)
{
- Invoke(new Action(() => _patient = item ?? _patient ));
+ Invoke(new Action(() => _patient = item ?? _patient));
Invoke(new Action(() => stripTxtEid.Text = _patient?.ID.ToString()));
// Invoke(new Action(() => patientInfo.Values = item ?? _patient));
SetPatientInfo(item ?? _patient);
@@ -1899,7 +1967,7 @@ namespace PEIS.View.Exam
_examResultList.Add(rowData);
}
-
+
ShowExamResultList(null, DgvExamResult.TopRowIndex);
if (rowHandle >= DgvExamResult.RowCount)
{
@@ -1981,11 +2049,11 @@ namespace PEIS.View.Exam
///
private void DgvExamResult_KeyUp(object sender, KeyEventArgs e)
{
- if(e.KeyCode == Keys.Enter)
+ if (e.KeyCode == Keys.Enter)
{
int rowHandle = DgvExamResult.FocusedRowHandle;
rowHandle = rowHandle + 1;
- if(rowHandle >= DgvExamResult.RowCount)
+ if (rowHandle >= DgvExamResult.RowCount)
{
SetFocuse(DgvExamResult, 0, "colExamTextResult");
}
@@ -2259,12 +2327,58 @@ namespace PEIS.View.Exam
}
///
- /// 其他报告双击
+ /// 打印PACS报告
///
///
///
- private void DgcRptExt_RowClick(object sender, EventArgs e)
+ private void PrintRptPacsMenuItem_Click(object sender, EventArgs e)
{
+ if (!(DgvRptPacs.GetFocusedRow() is Report selected)) return;
+ selected.GetById();
+ if (selected?.ReportImage != null)
+ {
+ try
+ {
+ using (var ms = new MemoryStream(selected.ReportImage))
+ {
+ Image img = Image.FromStream(ms);
+ System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
+ printDialog.Document = new System.Drawing.Printing.PrintDocument();
+ printDialog.Document.PrintPage += (a, b) =>
+ {
+ // 计算图像的宽度和高度
+ int imageWidth = img.Width;
+ int imageHeight = img.Height;
+
+ // 获取打印区域的宽度和高度(考虑到页边距)
+ float marginBoundsWidth = b.MarginBounds.Width;
+ float marginBoundsHeight = b.MarginBounds.Height;
+
+ // 计算绘制起点的坐标,使图像居中
+ float left = (marginBoundsWidth - imageWidth) / 2;
+ float top = (marginBoundsHeight - imageHeight) / 2;
+
+ // 确保坐标值不为负数
+ left = left < 0 ? 0 : left;
+ top = top < 0 ? 0 : top;
+
+
+ b.Graphics.DrawImage(img, left, top, imageWidth, imageHeight);
+ };
+ printDialog.UseEXDialog = true; // 显示增强的打印对话框
+
+ if (printDialog.ShowDialog() == DialogResult.OK)
+ {
+ printDialog.Document.Print(); // 执行打印操作
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Global.MsgWarn(ex.Message);
+ Debug.Write(ex.Message);
+ }
+ }
}
#endregion PACS
diff --git a/PEIS/View/Exam/PartForm.resx b/PEIS/View/Exam/PartForm.resx
index 920c9f3..465fe2f 100644
--- a/PEIS/View/Exam/PartForm.resx
+++ b/PEIS/View/Exam/PartForm.resx
@@ -123,6 +123,12 @@
175, 17
+
+ 732, 17
+
+
+ 580, 17
+
340, 17