一些功能优化和BUG修复

1.分检查询功能SQL优化
2.分检界面其他报告放大显示
3.个人报告批量预览时的打印功能BUG修复
4.团体报告内容优化和BUG修复
dhzzyy
LiJiaWen 3 weeks ago
parent fbb010d3a7
commit fb36a2efbe
  1. 72
      PEIS/Model/Exam/PartModel.cs
  2. 21
      PEIS/Model/ReportModel.cs
  3. 72
      PEIS/ReportFiles/TReport.frx
  4. 13
      PEIS/Utils/Global.cs
  5. 15
      PEIS/View/EReport/PersonReportForm.cs
  6. 6
      PEIS/View/EReport/TeamReportForm.cs
  7. 36
      PEIS/View/Exam/PartForm.Designer.cs
  8. 50
      PEIS/View/Exam/PartForm.cs
  9. 6
      PEIS/View/Exam/PartForm.resx

@ -73,19 +73,44 @@ namespace PEIS.Model
return new List<EnrollmentPatient>();
}
// Tel1,Tel2,Contactor1,Contactor2,Address1,Address2,Education,Occupation,FinisherCode,Finisher,
// OID,OEID,OrgName,GroupID,GroupName,Sex, Age, AgeClass,Nation, CardType,CardNo,Marriage,Type,
var sql = $@"
SELECT DISTINCT eid AS ID, NAME, ExamDate,SignTime,FinishTime,
CASE WHEN EXISTS ( SELECT 1 FROM vi_EnPart AS sub WHERE sub.eid = main.eid AND sub.STATUS = '' AND sub.isSend=1 ) THEN '' ELSE main.STATUS END AS Status
FROM vi_EnPart AS main
WHERE isSend=1 and WeChatStatus>=0 ";
string whereCondition = "";
if (string.IsNullOrWhiteSpace(team) && string.IsNullOrWhiteSpace(info))
sql += $"AND {dateType} >='{begDate}' AND {dateType} <'{endDate}'";
whereCondition += $" AND {dateType} >='{begDate}' AND {dateType} <'{endDate}' ";
if (!string.IsNullOrWhiteSpace(team))
sql += long.TryParse(team, out _) ? $@" AND OEID ={team}" : $@"AND OrgName LIKE '%{team}%'";
whereCondition += long.TryParse(team, out _) ? $@" AND OEID ={team}" : $@"AND OrgName LIKE '%{team}%'";
if (!string.IsNullOrWhiteSpace(info))
sql += long.TryParse(info, out _) ? $@" AND EID ={info}" : $@"AND ( Name LIKE '%{info}%' or SpellCode like '{info}%' )";
whereCondition += long.TryParse(info, out _) ? $@" AND EID ={info}" : $@"AND ( Name LIKE '%{info}%' or SpellCode like '{info}%' )";
var sql = $@"
WITH StatusData AS (
SELECT
eid AS ID,
NAME,
ExamDate,
SignTime,
FinishTime,
STATUS,
MAX(CASE WHEN STATUS = '' THEN 1 ELSE 0 END)
OVER (PARTITION BY eid) AS HasDeptCheck,
ROW_NUMBER() OVER (
PARTITION BY eid
ORDER BY SignTime DESC
) as rn
FROM vi_EnPart
WHERE isSend = 1 AND WeChatStatus >= 0 {whereCondition}
)
SELECT
ID,
NAME,
ExamDate,
SignTime,
FinishTime,
CASE
WHEN HasDeptCheck = 1 THEN ''
ELSE STATUS -- STATUS
END AS STATUS
FROM StatusData
WHERE rn = 1 -- eid只取最新的一行";
var data = DAOHelp.GetDataBySQL<EnrollmentPatient>(sql).OrderByDescending(o => o.SignTime).ToList();
return data;
@ -99,12 +124,27 @@ namespace PEIS.Model
public EnrollmentPatient GetPatientInfo(long eid)
{
var sql = $@"
SELECT DISTINCT eid AS ID, NAME, Sex, Age, AgeClass,Nation, CardType,CardNo,
Tel1,Tel2,Contactor1,Contactor2,Address1,Address2,Marriage,Education,Occupation,
ExamDate,Type, OID,OEID,OrgName,GroupID,GroupName,SignTime,FinishTime,FinisherCode,Finisher,
CASE WHEN EXISTS ( SELECT 1 FROM vi_EnPart AS sub WHERE sub.eid = main.eid AND sub.STATUS = '' AND sub.isSend=1 ) THEN '' ELSE main.STATUS END AS Status
FROM vi_EnPart AS main
WHERE eid={eid}";
WITH StatusData AS (
SELECT
eid AS ID, NAME, Sex, Age, AgeClass, Nation, CardType, CardNo,
Tel1, Tel2, Contactor1, Contactor2, Address1, Address2, Marriage,
Education, Occupation, ExamDate, Type, OID, OEID, OrgName, GroupID,
GroupName, SignTime, FinishTime, FinisherCode, Finisher, STATUS,
MAX(CASE WHEN STATUS = '' AND isSend = 1 THEN 1 ELSE 0 END)
OVER (PARTITION BY eid) AS HasDeptCheck
FROM vi_EnPart
WHERE eid = {eid}
)
SELECT DISTINCT
ID, NAME, Sex, Age, AgeClass, Nation, CardType, CardNo,
Tel1, Tel2, Contactor1, Contactor2, Address1, Address2, Marriage,
Education, Occupation, ExamDate, Type, OID, OEID, OrgName, GroupID,
GroupName, SignTime, FinishTime, FinisherCode, Finisher,
CASE
WHEN HasDeptCheck = 1 THEN ''
ELSE STATUS
END AS Status
FROM StatusData;";
return DAOHelp.GetDataBySQL<EnrollmentPatient>(sql).FirstOrDefault();
}

@ -205,7 +205,7 @@ namespace PEIS.Model
// pacs原始报告
public List<Report> GetPacsPhoto(Int64 Eid)
{
var pacs = DAOHelp.GetDataBySQL<Report>($"select ReportImage from Report where EID = { Eid } AND ReportImage IS NOT NULL");
var pacs = DAOHelp.GetDataBySQL<Report>($"select ReportImage from Report where EID = { Eid } AND ReportImage IS NOT NULL");
var heart = DAOHelp.GetDataBySQL<Report>($"select ReportData AS ReportImage from Report_GSEXD where PatientNo = {Eid} AND ReportData IS NOT NULL");
if (heart.Count == 0)
@ -314,7 +314,9 @@ namespace PEIS.Model
//根据团体体检号获取收费列表
public List<EnrollmentFeeItem> GetOrgFeeItem(Int64 oEid)
{
return DAOHelp.GetDataBySQL<EnrollmentFeeItem>(@"SELECT
if (Global.UseGroupFeeItemsInTeamReport == "0")
{
return DAOHelp.GetDataBySQL<EnrollmentFeeItem>(@"SELECT
DISTINCT
a.FeeItemName,
a.DeptName,
@ -323,7 +325,16 @@ namespace PEIS.Model
END AS ItemClass
FROM Enrollment_FeeItem a
LEFT JOIN Enrollment_Patient b ON a.EID = b.ID " +
$"WHERE a.OEID = {oEid} ORDER BY ItemClass");
$"WHERE a.OEID = {oEid} ORDER BY ItemClass");
}
else
{
return DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"
SELECT DISTINCT A.FeeItemCode,FeeItemName,DeptName,CASE WHEN Sex = 1 THEN '男' ELSE '女' END AS ItemClass
FROM Enrollment_OrgFeeItem A JOIN Enrollment_OrgGroup B ON A.GroupID=B.ID LEFT JOIN Dict_FeeItem C ON A.FID=C.ID
WHERE OEID={oEid} and Sex<>3 and C.IsHide=0 ORDER BY ItemClass");
}
}
//根据体检号获取异常结果
@ -351,7 +362,7 @@ namespace PEIS.Model
ROUND( SUM ( CASE Sex WHEN 2 THEN 1 ELSE 0 END ) * 100.0 /@SumPerson, 2 ) AS SumFemalePercent,
COUNT ( * ) AS SumWarn,
ROUND( COUNT ( * ) * 100.0 /@SumPerson, 2 ) AS SumWarnPercent,@SumPerson AS SumPerson,
ISNULL(A.Suggestion, '') AS Suggestion,
ISNULL(LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(A.Suggestion,CHAR(09),''),CHAR(10),''),CHAR(13),''))), '') AS Suggestion,
'' AS ResultFlag
FROM
Exam_Conclusion A ( NOLOCK )
@ -360,7 +371,7 @@ namespace PEIS.Model
B.OEID = {oEid}
GROUP BY
A.Conclusion,
A.Suggestion
LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(A.Suggestion,CHAR(09),''),CHAR(10),''),CHAR(13),'')))
HAVING
COUNT ( * ) != 0
ORDER BY SumWarn DESC");

File diff suppressed because one or more lines are too long

@ -36,6 +36,9 @@ namespace PEIS.Utils
return Global._lstConfig.FirstOrDefault(x => x.Key == "HisDBName")?.Value ?? "his.hisdata.dbo";
}
}
/// <summary>
/// 允许重复打开相同页面
/// </summary>
public static string AllowDuplicateTabs
{
get
@ -43,6 +46,16 @@ namespace PEIS.Utils
return Global._lstConfig.FirstOrDefault(x => x.Key == "AllowDuplicateTabs")?.Value ?? "0";
}
}
/// <summary>
/// 在团体报告中展示分组绑定项目而不是实际人员登记项目
/// </summary>
public static string UseGroupFeeItemsInTeamReport
{
get
{
return Global._lstConfig.FirstOrDefault(x => x.Key == "UseGroupFeeItemsInTeamReport")?.Value ?? "0";
}
}
/// <summary>
/// 配置信息

@ -58,9 +58,9 @@ namespace PEIS.View.EReport
private void ReportPreview_OnPrint(object sender, FastReport.Preview.PreviewControl.PrintEventArgs e)
{
if(pReport != null)
if (pReport != null)
{
pReport.Print();
pReport.PrintPrepared();
if (print)
{
foreach (var eid in _idList)
@ -117,7 +117,7 @@ namespace PEIS.View.EReport
Invoke(new Action(() => _regInfo = null));
Invoke(new Action(() => _regInfo = DgvRegItem.GetRow(DgvRegItem.GetSelectedRows()[0]) as EnrollmentPatient));
try
{
pReport = ReportHelper.GetReport(_regInfo.ID);
@ -144,7 +144,7 @@ namespace PEIS.View.EReport
if (_lstRegInfo == null || _lstRegInfo.Count == 0) return;
var idList = new List<Int64>();
for(int i = 0; i < DgvRegItem.RowCount; i++)
for (int i = 0; i < DgvRegItem.RowCount; i++)
{
if (DgvRegItem.GetRowCellValue(i, "IsSelected").ToString() == "1")
{
@ -173,9 +173,10 @@ namespace PEIS.View.EReport
public event EventHandler<Args<dynamic>> GetRegItems;
public void ShowRegItems(List<EnrollmentPatient> items)
{
Invoke(new Action(() => {
items.ForEach(f => f.IsSelected = 0);
_lstRegInfo = items;
Invoke(new Action(() =>
{
items.ForEach(f => f.IsSelected = 0);
_lstRegInfo = items;
}));
Invoke(new Action(() => DgcRegItem.DataSource = null));
Invoke(new Action(() => DgcRegItem.DataSource = _lstRegInfo));

@ -386,19 +386,19 @@ namespace PEIS.View.EReport
tReport.GetDataSource("F").Enabled = true;
//异常结果
tReport.RegisterData(_lstConclusions.Take(10), "C");
tReport.RegisterData(_lstCon.Take(10), "C");
DataBand conclusion = tReport.Report.FindObject("Conclusion") as DataBand;
conclusion.DataSource = tReport.Report.GetDataSource("C");
tReport.GetDataSource("C").Enabled = true;
//男性异常结果
tReport.RegisterData(_lstConclusions.OrderByDescending(o => o.SumMalePercent).ToList().Take(10), "B");
tReport.RegisterData(_lstCon.OrderByDescending(o => o.SumMalePercent).ToList().Take(10), "B");
DataBand SumMale = tReport.Report.FindObject("SumMale") as DataBand;
SumMale.DataSource = tReport.Report.GetDataSource("B");
tReport.GetDataSource("B").Enabled = true;
//女性异常结果
tReport.RegisterData(_lstConclusions.OrderByDescending(o => o.SumFemalePercent).ToList().Take(10), "G");
tReport.RegisterData(_lstCon.OrderByDescending(o => o.SumFemalePercent).ToList().Take(10), "G");
DataBand SumFemale = tReport.Report.FindObject("SumFemale") as DataBand;
SumFemale.DataSource = tReport.Report.GetDataSource("G");
tReport.GetDataSource("G").Enabled = true;

@ -157,6 +157,8 @@
this.OpsPacsImg = new PEIS.View.UControl.OpMenuSimple();
this.panelPacsRptList = new System.Windows.Forms.Panel();
this.dgcRptPacs = new DevExpress.XtraGrid.GridControl();
this.RptPacsMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.PrintRptPacsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DgvRptPacs = new DevExpress.XtraGrid.Views.Grid.GridView();
this.colPacsTime = new DevExpress.XtraGrid.Columns.GridColumn();
this.colPacsImageTitle1 = new DevExpress.XtraGrid.Columns.GridColumn();
@ -244,8 +246,6 @@
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();
@ -310,6 +310,7 @@
this.panel14.SuspendLayout();
this.panelPacsRptList.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgcRptPacs)).BeginInit();
this.RptPacsMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvRptPacs)).BeginInit();
this.tabPageReport.SuspendLayout();
this.panelReportBase.SuspendLayout();
@ -331,7 +332,6 @@
this.panel2.SuspendLayout();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit();
this.RptPacsMenuStrip.SuspendLayout();
this.SuspendLayout();
//
// splitContainerBase
@ -1920,6 +1920,20 @@
this.dgcRptPacs.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvRptPacs});
//
// 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 = "打印报告";
//
// DgvRptPacs
//
this.DgvRptPacs.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke;
@ -3059,20 +3073,6 @@
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);
@ -3152,6 +3152,7 @@
this.panel14.ResumeLayout(false);
this.panelPacsRptList.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgcRptPacs)).EndInit();
this.RptPacsMenuStrip.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DgvRptPacs)).EndInit();
this.tabPageReport.ResumeLayout(false);
this.panelReportBase.ResumeLayout(false);
@ -3177,7 +3178,6 @@
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit();
this.RptPacsMenuStrip.ResumeLayout(false);
this.ResumeLayout(false);
}

@ -1053,30 +1053,54 @@ namespace PEIS.View.Exam
{
Invoke(new Action(() => picReportExt.Image = null));
if (item.ReportImg == null) return;
Image img = null;
Bitmap scaledImage = null;
try
{
if (item.Class == "十二通道心电图检查")
{
var img = ReportHelper.PdfToImg(item.ReportImg);
if (img != null)
img = ReportHelper.PdfToImg(item.ReportImg);
}
else
{
using (var ms = new MemoryStream(item.ReportImg, 0, item.ReportImg.Length))
{
Invoke(new Action(() => { picReportExt.Image = img; picReportExt.Dock = DockStyle.Fill; picReportExt.SizeMode = PictureBoxSizeMode.Zoom; }));
img = Image.FromStream(ms, true);
}
return;
}
Invoke(new Action(() =>
if (img != null)
{
using (var ms = new MemoryStream(item.ReportImg, 0, item.ReportImg.Length))
int availableWidth = panelReport.ClientSize.Width - SystemInformation.VerticalScrollBarWidth;
if (availableWidth > 0)
{
Invoke(new Action(() =>
// 计算缩放比例
var currentScale = (float)availableWidth / img.Width;
// 计算新尺寸
int newWidth = availableWidth;
int newHeight = (int)(img.Height * currentScale);
// 创建缩放后的图片
scaledImage = new Bitmap(newWidth, newHeight);
using (Graphics g = Graphics.FromImage(scaledImage))
{
var img = Image.FromStream(ms, true);
picReportExt.Image = img;
}));
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.DrawImage(img, 0, 0, newWidth, newHeight);
}
}
}));
Invoke(new Action(() =>
{
picReportExt.Image = scaledImage;
panelReport.AutoScrollPosition = new Point(0, 0);
}));
}
}
catch (Exception e)
{

@ -120,6 +120,9 @@
<metadata name="menuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>460, 17</value>
</metadata>
<metadata name="menuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>460, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>175, 17</value>
</metadata>
@ -132,6 +135,9 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>340, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>340, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tsmiCancel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

Loading…
Cancel
Save