增加项目报告打印功能和一些优化

1.检查报告增加右键菜单打印功能
2.其他报告增加右键菜单打印和删除功能
3.修复个人报告的批量预览功能
4.团队登记人员列表刷新逻辑优化
5.分检添加结论词逻辑优化
dhzzyy
LiJiaWen 2 weeks ago
parent 9e2e95a0eb
commit fbb010d3a7
  1. 1
      PEIS/PEIS.csproj
  2. 10
      PEIS/Properties/Resources.Designer.cs
  3. 3
      PEIS/Properties/Resources.resx
  4. BIN
      PEIS/Resources/打印.png
  5. 146
      PEIS/Utils/ReportHelper.cs
  6. 3
      PEIS/View/Enrollment/EnrollmentOrgForm.cs
  7. 52
      PEIS/View/Exam/PartForm.Designer.cs
  8. 124
      PEIS/View/Exam/PartForm.cs
  9. 6
      PEIS/View/Exam/PartForm.resx

@ -827,6 +827,7 @@
<None Include="Resources\团队报告.png" /> <None Include="Resources\团队报告.png" />
<None Include="Resources\删除1.png" /> <None Include="Resources\删除1.png" />
<None Include="Resources\刷新 %281%29.png" /> <None Include="Resources\刷新 %281%29.png" />
<None Include="Resources\打印.png" />
<Content Include="Update\Update.exe"> <Content Include="Update\Update.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>

@ -390,6 +390,16 @@ namespace PEIS.Properties {
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("打印", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary> /// </summary>

@ -247,4 +247,7 @@
<data name="刷新 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="刷新 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\刷新 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\刷新 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="打印" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\打印.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -113,7 +113,7 @@ namespace PEIS.Utils
/// </summary> /// </summary>
/// <param name="eid">体检号</param> /// <param name="eid">体检号</param>
/// <returns></returns> /// <returns></returns>
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 try
{ {
@ -130,19 +130,19 @@ namespace PEIS.Utils
switch (string.IsNullOrEmpty(paramFile) ? fileName : paramFile) switch (string.IsNullOrEmpty(paramFile) ? fileName : paramFile)
{ {
case "Children.frx": case "Children.frx":
return EasyReport(patient, eid, filePath); return EasyReport(patient, eid, filePath, combineReport);
case "Student.frx": case "Student.frx":
return EasyReport(patient, eid, filePath); return EasyReport(patient, eid, filePath, combineReport);
case "Teacher.frx": case "Teacher.frx":
return EasyReport(patient, eid, filePath); return EasyReport(patient, eid, filePath, combineReport);
case "Work.frx": case "Work.frx":
return EasyReport(patient, eid, filePath); return EasyReport(patient, eid, filePath, combineReport);
case "Health.frx": case "Health.frx":
return EasyReport(patient, eid, filePath); return EasyReport(patient, eid, filePath, combineReport);
case "CAPReport.frx": case "CAPReport.frx":
return CAPReport(patient, eid, filePath); return CAPReport(patient, eid, filePath, combineReport);
default: default:
return General(patient, eid, filePath); return General(patient, eid, filePath, combineReport);
} }
} }
catch (Exception ex) catch (Exception ex)
@ -239,9 +239,13 @@ namespace PEIS.Utils
/// <param name="eid"></param> /// <param name="eid"></param>
/// <param name="filePath"></param> /// <param name="filePath"></param>
/// <returns></returns> /// <returns></returns>
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); rpt.Load(filePath);
var lstEFeeItems = new ReportModel().GetEFeeItem(eid); var lstEFeeItems = new ReportModel().GetEFeeItem(eid);
@ -485,7 +489,14 @@ namespace PEIS.Utils
//症状 //症状
SetDataSource(ref rpt, symptoms, "CAS", "Symptoms"); SetDataSource(ref rpt, symptoms, "CAS", "Symptoms");
if (combineReport == null)
{
rpt.Prepare(); //准备 rpt.Prepare(); //准备
}
else
{
rpt.Prepare(true); //合并报表
}
return rpt; return rpt;
} }
@ -496,9 +507,13 @@ namespace PEIS.Utils
/// <param name="eid"></param> /// <param name="eid"></param>
/// <param name="filePath"></param> /// <param name="filePath"></param>
/// <returns></returns> /// <returns></returns>
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); rpt.Load(filePath);
var lstEFeeItems = new ReportModel().GetEFeeItem(eid); 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, lstPacsPhotos.Concat(lstExts.Where(w => w.ReportImg != null).Select(s => new Entity.Report { ReportImage = s.ReportImg })), "I", "PACSImage");
// 科室小结 // 科室小结
SetDataSource(ref rpt, lstExamParts, "D", "DeptSummary"); SetDataSource(ref rpt, lstExamParts, "D", "DeptSummary");
if (combineReport == null)
{
rpt.Prepare(); //准备 rpt.Prepare(); //准备
}
else
{
rpt.Prepare(true); //合并报表
}
return rpt; return rpt;
} }
@ -585,9 +607,13 @@ namespace PEIS.Utils
/// <param name="eid"></param> /// <param name="eid"></param>
/// <param name="filePath"></param> /// <param name="filePath"></param>
/// <returns></returns> /// <returns></returns>
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); rpt.Load(filePath);
var lstExts = new ReportModel().GetReportExt(eid); var lstExts = new ReportModel().GetReportExt(eid);
var lstChildren = new ReportModel().GetFastResult(eid); var lstChildren = new ReportModel().GetFastResult(eid);
@ -640,7 +666,14 @@ namespace PEIS.Utils
SetParameter(ref rpt, dict); SetParameter(ref rpt, dict);
// 第三方报告 // 第三方报告
//SetDataSource(ref rpt, lstExts, "I", "ImageList"); //SetDataSource(ref rpt, lstExts, "I", "ImageList");
if (combineReport == null)
{
rpt.Prepare(); //准备 rpt.Prepare(); //准备
}
else
{
rpt.Prepare(true); //合并报表
}
return rpt; return rpt;
} }
@ -1056,92 +1089,13 @@ namespace PEIS.Utils
{ {
try try
{ {
var rpt = new FastReport.Report(); FastReport.Report report = null;
var i = 0;
foreach (var eid in idlist) foreach (var eid in idlist)
{ {
var patient = new ReportModel().GetPatientInfo(eid); report = ReportHelper.GetReport(eid, null, report);
if (patient == null) return null;
var fileName =
DAOHelp.GetDataBySQL<Config>(
$"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++; return report;
}
return rpt;
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -2355,10 +2355,13 @@ namespace PEIS.View.Enrollment
if (topRowIndex != -1) if (topRowIndex != -1)
{ {
int rowHandle = DgvEnrollment.LocateByValue("ID", topRowIndex); int rowHandle = DgvEnrollment.LocateByValue("ID", topRowIndex);
if (rowHandle > 0)
{
DgvEnrollment.FocusedRowHandle = rowHandle; DgvEnrollment.FocusedRowHandle = rowHandle;
DgvEnrollment.SelectRow(rowHandle); DgvEnrollment.SelectRow(rowHandle);
DgcEnrollment.Refresh(); DgcEnrollment.Refresh();
} }
}
})); }));
DgvEnrollment.BestFitColumns(); DgvEnrollment.BestFitColumns();
} }

@ -167,6 +167,9 @@
this.panelReport = new System.Windows.Forms.Panel(); this.panelReport = new System.Windows.Forms.Panel();
this.picReportExt = new System.Windows.Forms.PictureBox(); this.picReportExt = new System.Windows.Forms.PictureBox();
this.dgcRptExt = new DevExpress.XtraGrid.GridControl(); 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.DgvRptExt = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn24 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn24 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn25 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn25 = new DevExpress.XtraGrid.Columns.GridColumn();
@ -241,6 +244,8 @@
this.colRptExtTime = new DevExpress.XtraGrid.Columns.GridColumn(); this.colRptExtTime = new DevExpress.XtraGrid.Columns.GridColumn();
this.colRptExtDesc = new DevExpress.XtraGrid.Columns.GridColumn(); this.colRptExtDesc = new DevExpress.XtraGrid.Columns.GridColumn();
this.superTabControl1 = new FastReport.DevComponents.DotNetBar.SuperTabControl(); 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerBase)).BeginInit();
this.splitContainerBase.Panel1.SuspendLayout(); this.splitContainerBase.Panel1.SuspendLayout();
this.splitContainerBase.Panel2.SuspendLayout(); this.splitContainerBase.Panel2.SuspendLayout();
@ -311,6 +316,7 @@
this.panelReport.SuspendLayout(); this.panelReport.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picReportExt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picReportExt)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).BeginInit();
this.RptExtMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).BeginInit();
this.tabPageDept.SuspendLayout(); this.tabPageDept.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).BeginInit();
@ -325,6 +331,7 @@
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit();
this.RptPacsMenuStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// splitContainerBase // splitContainerBase
@ -1903,6 +1910,7 @@
// //
// dgcRptPacs // dgcRptPacs
// //
this.dgcRptPacs.ContextMenuStrip = this.RptPacsMenuStrip;
this.dgcRptPacs.Dock = System.Windows.Forms.DockStyle.Fill; this.dgcRptPacs.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgcRptPacs.Location = new System.Drawing.Point(0, 0); this.dgcRptPacs.Location = new System.Drawing.Point(0, 0);
this.dgcRptPacs.MainView = this.DgvRptPacs; this.dgcRptPacs.MainView = this.DgvRptPacs;
@ -2011,6 +2019,7 @@
// //
// dgcRptExt // dgcRptExt
// //
this.dgcRptExt.ContextMenuStrip = this.RptExtMenuStrip;
this.dgcRptExt.Dock = System.Windows.Forms.DockStyle.Left; this.dgcRptExt.Dock = System.Windows.Forms.DockStyle.Left;
this.dgcRptExt.Location = new System.Drawing.Point(0, 0); this.dgcRptExt.Location = new System.Drawing.Point(0, 0);
this.dgcRptExt.MainView = this.DgvRptExt; this.dgcRptExt.MainView = this.DgvRptExt;
@ -2020,6 +2029,28 @@
this.dgcRptExt.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.dgcRptExt.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvRptExt}); 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 // DgvRptExt
// //
this.DgvRptExt.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke; this.DgvRptExt.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke;
@ -3028,6 +3059,20 @@
this.superTabControl1.SelectedTabIndex = -1; this.superTabControl1.SelectedTabIndex = -1;
this.superTabControl1.TabIndex = 0; 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 // PartForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
@ -3114,6 +3159,7 @@
this.panelReport.PerformLayout(); this.panelReport.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picReportExt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picReportExt)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgcRptExt)).EndInit();
this.RptExtMenuStrip.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).EndInit();
this.tabPageDept.ResumeLayout(false); this.tabPageDept.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgcDeptResult)).EndInit();
@ -3131,6 +3177,7 @@
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit();
this.RptPacsMenuStrip.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -3348,5 +3395,10 @@
private DevExpress.XtraGrid.Views.Grid.GridView gridView1; private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private System.Windows.Forms.ToolStripMenuItem tsmiPick; private System.Windows.Forms.ToolStripMenuItem tsmiPick;
private System.Windows.Forms.ToolStripMenuItem tsmiOccupation; 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;
} }
} }

@ -161,6 +161,7 @@ namespace PEIS.View.Exam
DgvExamResult.KeyUp += DgvExamResult_KeyUp; DgvExamResult.KeyUp += DgvExamResult_KeyUp;
//1.2.1.PACS //1.2.1.PACS
DgvRptPacs.RowClick += DgvReportPacs_RowClick; DgvRptPacs.RowClick += DgvReportPacs_RowClick;
PrintRptPacsMenuItem.Click += PrintRptPacsMenuItem_Click;
//1.2.2.PACS图片选择列表-限制选中项数 //1.2.2.PACS图片选择列表-限制选中项数
ListViewPacsImg.ItemCheck += ListViewPacsImg_ItemCheck; ListViewPacsImg.ItemCheck += ListViewPacsImg_ItemCheck;
//1.2.3.单击选中 //1.2.3.单击选中
@ -177,6 +178,8 @@ namespace PEIS.View.Exam
{ {
if (DgvRptExt.GetFocusedRow() is ReportExt selected) SetPicReportExt(selected); if (DgvRptExt.GetFocusedRow() is ReportExt selected) SetPicReportExt(selected);
}; };
PrintRptExtMenuItem.Click += PrintRptExtMenuItem_Click;
DeleteRptExtMenuItem.Click += DeleteRptExtMenuItem_Click;
//分科检查 颜色提示 //分科检查 颜色提示
DgvDeptExamResult.CustomDrawCell += DgvExamResult_CustomDrawCell; DgvDeptExamResult.CustomDrawCell += DgvExamResult_CustomDrawCell;
DgvLisReport.CustomDrawCell += DgvLisReport_CustomDrawCell; DgvLisReport.CustomDrawCell += DgvLisReport_CustomDrawCell;
@ -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事件实现 #endregion IView事件实现
#region 页面控件事件 #region 页面控件事件
@ -1229,7 +1295,8 @@ namespace PEIS.View.Exam
if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime != null || if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime != null ||
_examPart.GiveUpTime != null || _examPart.ID <= 0) return; _examPart.GiveUpTime != null || _examPart.ID <= 0) return;
if (_examPart.CheckTime == null) { if (_examPart.CheckTime == null)
{
MessageBox.Show(@"请先保存科室分检的检查结果!", @"审核失败"); MessageBox.Show(@"请先保存科室分检的检查结果!", @"审核失败");
return; return;
} }
@ -1501,11 +1568,12 @@ namespace PEIS.View.Exam
{ {
if (_examPart.VerifyTime != null || _examPart.GiveUpTime != null || _examPart.ID <= 0) return; if (_examPart.VerifyTime != null || _examPart.GiveUpTime != null || _examPart.ID <= 0) return;
if (_patient.FinishTime != null || _patient.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, PID = _examPart.ID,
EID = _examPart.EID, EID = _examPart.EID,
Seq = _conclusion.Count() + 1 Seq = 1
}); });
ShowConclusion(_conclusion); ShowConclusion(_conclusion);
} }
@ -2259,12 +2327,58 @@ namespace PEIS.View.Exam
} }
/// <summary> /// <summary>
/// 其他报告双击 /// 打印PACS报告
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
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 #endregion PACS

@ -123,6 +123,12 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>175, 17</value> <value>175, 17</value>
</metadata> </metadata>
<metadata name="RptPacsMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>732, 17</value>
</metadata>
<metadata name="RptExtMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>580, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>340, 17</value> <value>340, 17</value>
</metadata> </metadata>

Loading…
Cancel
Save