diff --git a/PEIS/Entity/ReportItem.cs b/PEIS/Entity/ReportItem.cs
index 82a2138..97b1833 100644
--- a/PEIS/Entity/ReportItem.cs
+++ b/PEIS/Entity/ReportItem.cs
@@ -10,6 +10,7 @@ namespace PEIS.Entity
{
public override String TableName => "Dict_ReportItem";
+ public String RptItemCode { get; set; }
public String RptItemName { get; set; }
public String SpellCode { get; set; }
public String Unit { get; set; }
diff --git a/PEIS/Entity/Sign.cs b/PEIS/Entity/Sign.cs
index 7622044..ec2264f 100644
--- a/PEIS/Entity/Sign.cs
+++ b/PEIS/Entity/Sign.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using PEIS.Utils;
namespace PEIS.Entity
@@ -19,6 +19,11 @@ namespace PEIS.Entity
public Int32 Seq { get; set; }
public Int64 CID { get; set; }
+ ///
+ /// 包含匹配文本(UnusualFlag包含此文本时匹配,仅检验科使用)
+ ///
+ public String MatchText { get; set; }
+
[RefFlag(true)]
public Boolean IsSelected { get; set; }
diff --git a/PEIS/Model/Exam/PartModel.cs b/PEIS/Model/Exam/PartModel.cs
index 895755d..2769537 100644
--- a/PEIS/Model/Exam/PartModel.cs
+++ b/PEIS/Model/Exam/PartModel.cs
@@ -1,4 +1,4 @@
-#region CopyRight
+#region CopyRight
/****************************************************************
* Project:健康体检信息管理系统(PEIS)
@@ -249,7 +249,7 @@ FROM StatusData;";
}
else
{
- resultStr = $@" SELECT DISTINCT B.FeeItemName, B.RptItemName, B.TextResult, B.Unit, B.UnusualFlag , C.Seq as SeqReport
+ resultStr = $@" SELECT DISTINCT B.FeeItemName, B.RptItemName, B.TextResult, B.Unit, B.UnusualFlag, B.RptItemCode, C.Seq as SeqReport
FROM
Exam_Part A
LEFT JOIN Exam_Result B ON B.PID = A.ID
@@ -264,7 +264,7 @@ FROM StatusData;";
OR (B.ItemClass='检验' AND B.TextResult LIKE '%阳%')
)
UNION ALL
- SELECT DISTINCT A.FeeItemName, B.Title AS RptItemName, B.summary AS TextResult, Unit = '', UnusualFlag = '',0 as SeqReport
+ SELECT DISTINCT A.FeeItemName, B.Title AS RptItemName, B.summary AS TextResult, Unit = '', UnusualFlag = '', RptItemCode = '', 0 as SeqReport
FROM
Enrollment_FeeItem A
LEFT JOIN Report B ON A.ID = B.ReportNo AND A.eid = B.eid
@@ -336,26 +336,33 @@ FROM StatusData;";
}
}
- /*if (!deptCodeList.Contains(deptCode) && deptCode != "0141")
+ // 自动添加异常结论词(仅检验科使用包含匹配规则)
+ if (deptCode == "3001")
{
- summary += string.Join(Environment.NewLine,
- items.Select(s => $@"{s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag};").ToList());
- }
- else if(deptCode == "0141" && Global._hospital.Name == "德宏州中医医院")
- {
- summary += string.Join(Environment.NewLine,
- items.Select(s => $@"{s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag}").ToList());
- }
- else
- {
- summary += string.Join(Environment.NewLine, items.Select(s => $@"{s.TextResult}").ToList());
- var suggestion = items.FirstOrDefault()?.TextResult ?? "";
- if (!string.IsNullOrEmpty(suggestion) && !string.IsNullOrEmpty(items.Key) && part.ID > 0)
+ var abnormalResults = items.Where(r => !string.IsNullOrEmpty(r.UnusualFlag)).ToList();
+ foreach (var result in abnormalResults)
{
- DAOHelp.ExecuteSql(
- $@"INSERT INTO Exam_Conclusion(PID, Conclusion, Suggestion, EID)VALUES({part.ID},'{items.Key}','{suggestion}',{eid})");
+ var conclusion = GetAbnormalConclusion(result.UnusualFlag, result.RptItemCode);
+ if (conclusion != null && part.ID > 0)
+ {
+ // 获取异常项目的FID
+ var feeItem = DAOHelp.GetDataBySQL($@"SELECT TOP 1 FID FROM Enrollment_FeeItem WHERE FID IS NOT NULL AND EID = {eid} AND FeeItemName = '{items.Key}'").FirstOrDefault();
+ var fid = feeItem?.FID ?? 0;
+
+ // 转义SQL特殊字符
+ var conclusionName = (conclusion.ConclusionName ?? "").Replace("'", "''");
+ var instructions = (conclusion.Instructions ?? "").Replace("'", "''");
+ var suggestion = (conclusion.Suggestion ?? "").Replace("'", "''");
+ var advice = (conclusion.Advice ?? "").Replace("'", "''");
+ var dietaryGuidance = (conclusion.DietaryGuidance ?? "").Replace("'", "''");
+
+ DAOHelp.ExecuteSql(
+ $@" INSERT INTO Exam_Conclusion(PID, FID, CID, Conclusion, Instructions, Suggestion, Advice, DietaryGuidance, EID, Seq)
+ VALUES({part.ID}, {fid}, {conclusion.ID}, '{conclusionName}', '{instructions}', '{suggestion}', '{advice}', '{dietaryGuidance}', {eid}, {index})");
+ }
}
- }*/
+ }
+
index += 1;
});
if (string.IsNullOrEmpty(summary))
@@ -407,6 +414,48 @@ FROM StatusData;";
return exits > 0;
}
+ ///
+ /// 根据异常标识获取对应的结论词(包含匹配,仅检验科使用)
+ ///
+ /// 异常标识
+ /// 报告项目编码
+ /// 结论词对象,只返回第一个匹配的结果
+ private Conclusion GetAbnormalConclusion(string unusualFlag, string rptItemCode)
+ {
+ if (string.IsNullOrEmpty(unusualFlag) || string.IsNullOrEmpty(rptItemCode))
+ return null;
+
+ try
+ {
+ // 通过 JOIN Dict_ReportItem 获取 RptItemCode 对应的体征词规则
+ var sql = $@"SELECT S.*
+ FROM Dict_Sign S
+ INNER JOIN Dict_ReportItem R ON S.RID = R.ID
+ WHERE R.RptItemCode = '{rptItemCode}'
+ AND S.MatchText IS NOT NULL
+ AND S.MatchText <> ''
+ ORDER BY S.Seq";
+
+ var rules = DAOHelp.GetDataBySQL(sql);
+
+ // 按顺序匹配,返回第一个匹配的结论词
+ foreach (var rule in rules)
+ {
+ if (!string.IsNullOrEmpty(rule.MatchText) && unusualFlag.Contains(rule.MatchText))
+ {
+ // 获取关联的结论词
+ return DAOHelp.GetDataBySQL($"SELECT * FROM Dict_Conclusion WHERE ID = {rule.CID}").FirstOrDefault();
+ }
+ }
+
+ return null;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
///
///保存结论
///
diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj
index 3f95dca..d523b87 100644
--- a/PEIS/PEIS.csproj
+++ b/PEIS/PEIS.csproj
@@ -1,4 +1,4 @@
-
+
diff --git a/PEIS/View/Setting/FeeItemForm.Designer.cs b/PEIS/View/Setting/FeeItemForm.Designer.cs
index 61c3311..6ba39eb 100644
--- a/PEIS/View/Setting/FeeItemForm.Designer.cs
+++ b/PEIS/View/Setting/FeeItemForm.Designer.cs
@@ -1,4 +1,4 @@
-namespace PEIS.View.Setting
+namespace PEIS.View.Setting
{
partial class FeeItemForm
{
@@ -50,6 +50,7 @@
this.RbPacs = new System.Windows.Forms.RadioButton();
this.RbAll = new System.Windows.Forms.RadioButton();
this.TxtHisFeeItem = new System.Windows.Forms.TextBox();
+ this.gridColumnMatchText = new DevExpress.XtraGrid.Columns.GridColumn();
this.splitterControl1 = new DevExpress.XtraEditors.SplitterControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.DgcFeeItem = new DevExpress.XtraGrid.GridControl();
@@ -80,6 +81,7 @@
this.gridColumn41 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn23 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn25 = new DevExpress.XtraGrid.Columns.GridColumn();
+ this.gridColumnRptItemCode = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemCheckEdit4 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
this.panel1 = new System.Windows.Forms.Panel();
this.MenuRpt = new PEIS.View.UControl.OpMenuSimple();
@@ -156,7 +158,7 @@
this.tabPane1.Controls.Add(this.TbFeeItem4His);
this.tabPane1.Dock = System.Windows.Forms.DockStyle.Right;
this.tabPane1.Location = new System.Drawing.Point(617, 0);
- this.tabPane1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.tabPane1.Margin = new System.Windows.Forms.Padding(4);
this.tabPane1.Name = "tabPane1";
this.tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] {
this.TbFeeItem4His});
@@ -176,7 +178,7 @@
this.TbFeeItem4His.Controls.Add(this.panel3);
this.TbFeeItem4His.Image = global::PEIS.Properties.Resources.收费项目;
this.TbFeeItem4His.ItemShowMode = DevExpress.XtraBars.Navigation.ItemShowMode.ImageAndText;
- this.TbFeeItem4His.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.TbFeeItem4His.Margin = new System.Windows.Forms.Padding(4);
this.TbFeeItem4His.Name = "TbFeeItem4His";
this.TbFeeItem4His.PageText = "HIS收费项目";
this.TbFeeItem4His.Properties.ShowMode = DevExpress.XtraBars.Navigation.ItemShowMode.ImageAndText;
@@ -446,6 +448,17 @@
this.TxtHisFeeItem.Size = new System.Drawing.Size(132, 23);
this.TxtHisFeeItem.TabIndex = 0;
//
+ // gridColumnMatchText
+ //
+ this.gridColumnMatchText.Caption = "检验异常标识";
+ this.gridColumnMatchText.FieldName = "MatchText";
+ this.gridColumnMatchText.Name = "gridColumnMatchText";
+ this.gridColumnMatchText.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
+ this.gridColumnMatchText.OptionsFilter.AllowFilter = false;
+ this.gridColumnMatchText.Visible = true;
+ this.gridColumnMatchText.VisibleIndex = 1;
+ this.gridColumnMatchText.Width = 100;
+ //
// splitterControl1
//
this.splitterControl1.Appearance.BackColor = System.Drawing.Color.White;
@@ -475,7 +488,7 @@
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(612, 582);
- this.splitContainer1.SplitterDistance = 93;
+ this.splitContainer1.SplitterDistance = 92;
this.splitContainer1.SplitterWidth = 5;
this.splitContainer1.TabIndex = 3;
//
@@ -488,7 +501,7 @@
this.DgcFeeItem.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.repositoryItemCheckEdit1,
this.repositoryItemMemoEdit1});
- this.DgcFeeItem.Size = new System.Drawing.Size(610, 50);
+ this.DgcFeeItem.Size = new System.Drawing.Size(610, 49);
this.DgcFeeItem.TabIndex = 121;
this.DgcFeeItem.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvFeeItem});
@@ -753,8 +766,8 @@
this.splitContainer2.Panel2.Controls.Add(this.splitter1);
this.splitContainer2.Panel2.Controls.Add(this.panelControl1);
this.splitContainer2.Panel2.Controls.Add(this.panel2);
- this.splitContainer2.Size = new System.Drawing.Size(612, 484);
- this.splitContainer2.SplitterDistance = 150;
+ this.splitContainer2.Size = new System.Drawing.Size(612, 485);
+ this.splitContainer2.SplitterDistance = 149;
this.splitContainer2.SplitterWidth = 5;
this.splitContainer2.TabIndex = 0;
//
@@ -766,7 +779,7 @@
this.DgcRptItem.Name = "DgcRptItem";
this.DgcRptItem.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.repositoryItemCheckEdit4});
- this.DgcRptItem.Size = new System.Drawing.Size(148, 441);
+ this.DgcRptItem.Size = new System.Drawing.Size(147, 442);
this.DgcRptItem.TabIndex = 122;
this.DgcRptItem.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvRptItem});
@@ -787,6 +800,7 @@
this.gridColumn42,
this.gridColumn21,
this.gridColumn22,
+ this.gridColumnRptItemCode,
this.gridColumn41,
this.gridColumn23,
this.gridColumn25});
@@ -910,6 +924,17 @@
this.gridColumn25.VisibleIndex = 7;
this.gridColumn25.Width = 40;
//
+ // gridColumnRptItemCode
+ //
+ this.gridColumnRptItemCode.Caption = "检验项目编码";
+ this.gridColumnRptItemCode.FieldName = "RptItemCode";
+ this.gridColumnRptItemCode.Name = "gridColumnRptItemCode";
+ this.gridColumnRptItemCode.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
+ this.gridColumnRptItemCode.OptionsFilter.AllowFilter = false;
+ this.gridColumnRptItemCode.Visible = true;
+ this.gridColumnRptItemCode.VisibleIndex = 8;
+ this.gridColumnRptItemCode.Width = 100;
+ //
// repositoryItemCheckEdit4
//
this.repositoryItemCheckEdit4.AutoHeight = false;
@@ -923,7 +948,7 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(148, 41);
+ this.panel1.Size = new System.Drawing.Size(147, 41);
this.panel1.TabIndex = 0;
//
// MenuRpt
@@ -932,7 +957,7 @@
this.MenuRpt.Location = new System.Drawing.Point(74, 0);
this.MenuRpt.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MenuRpt.Name = "MenuRpt";
- this.MenuRpt.Size = new System.Drawing.Size(74, 41);
+ this.MenuRpt.Size = new System.Drawing.Size(73, 41);
this.MenuRpt.TabIndex = 1;
//
// label1
@@ -954,7 +979,7 @@
this.DgcSign.Name = "DgcSign";
this.DgcSign.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.CmbConclusionSearch});
- this.DgcSign.Size = new System.Drawing.Size(455, 338);
+ this.DgcSign.Size = new System.Drawing.Size(456, 339);
this.DgcSign.TabIndex = 123;
this.DgcSign.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.DgvSign});
@@ -971,6 +996,7 @@
this.DgvSign.Appearance.Row.Options.UseFont = true;
this.DgvSign.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn9,
+ this.gridColumnMatchText,
this.gridColumn27,
this.gridColumn13,
this.gridColumn12,
@@ -1015,7 +1041,7 @@
this.gridColumn27.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn27.OptionsFilter.AllowFilter = false;
this.gridColumn27.Visible = true;
- this.gridColumn27.VisibleIndex = 1;
+ this.gridColumn27.VisibleIndex = 2;
this.gridColumn27.Width = 140;
//
// CmbConclusionSearch
@@ -1196,9 +1222,9 @@
// splitter1
//
this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.splitter1.Location = new System.Drawing.Point(0, 379);
+ this.splitter1.Location = new System.Drawing.Point(0, 380);
this.splitter1.Name = "splitter1";
- this.splitter1.Size = new System.Drawing.Size(455, 3);
+ this.splitter1.Size = new System.Drawing.Size(456, 3);
this.splitter1.TabIndex = 126;
this.splitter1.TabStop = false;
//
@@ -1210,9 +1236,9 @@
this.panelControl1.Controls.Add(this.panelSuggestion);
this.panelControl1.Controls.Add(this.label3);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panelControl1.Location = new System.Drawing.Point(0, 382);
+ this.panelControl1.Location = new System.Drawing.Point(0, 383);
this.panelControl1.Name = "panelControl1";
- this.panelControl1.Size = new System.Drawing.Size(455, 100);
+ this.panelControl1.Size = new System.Drawing.Size(456, 100);
this.panelControl1.TabIndex = 124;
//
// panelSuggestion
@@ -1222,7 +1248,7 @@
this.panelSuggestion.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelSuggestion.Location = new System.Drawing.Point(44, 0);
this.panelSuggestion.Name = "panelSuggestion";
- this.panelSuggestion.Size = new System.Drawing.Size(411, 100);
+ this.panelSuggestion.Size = new System.Drawing.Size(412, 100);
this.panelSuggestion.TabIndex = 10;
//
// LblSuggestion
@@ -1234,7 +1260,7 @@
this.LblSuggestion.Name = "LblSuggestion";
this.LblSuggestion.ReadOnly = true;
this.LblSuggestion.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.LblSuggestion.Size = new System.Drawing.Size(411, 100);
+ this.LblSuggestion.Size = new System.Drawing.Size(412, 100);
this.LblSuggestion.TabIndex = 0;
//
// label3
@@ -1256,7 +1282,7 @@
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(455, 41);
+ this.panel2.Size = new System.Drawing.Size(456, 41);
this.panel2.TabIndex = 1;
//
// MenuSign
@@ -1265,7 +1291,7 @@
this.MenuSign.Location = new System.Drawing.Point(58, 0);
this.MenuSign.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
this.MenuSign.Name = "MenuSign";
- this.MenuSign.Size = new System.Drawing.Size(397, 41);
+ this.MenuSign.Size = new System.Drawing.Size(398, 41);
this.MenuSign.TabIndex = 2;
//
// label2
@@ -1326,7 +1352,7 @@
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.splitterControl1);
this.Controls.Add(this.tabPane1);
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FeeItemForm";
this.Text = "收费项目";
((System.ComponentModel.ISupportInitialize)(this.tabPane1)).EndInit();
@@ -1416,6 +1442,7 @@
private UControl.OpMenuSimple MenuSign;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn24;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn25;
+ private DevExpress.XtraGrid.Columns.GridColumn gridColumnRptItemCode;
private DevExpress.XtraGrid.GridControl DgcSign;
private DevExpress.XtraGrid.Views.Grid.GridView DgvSign;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn9;
@@ -1427,6 +1454,7 @@
private DevExpress.XtraGrid.Columns.GridColumn gridColumn15;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn16;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn26;
+ private DevExpress.XtraGrid.Columns.GridColumn gridColumnMatchText;
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn27;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn28;
diff --git a/PEIS/View/Setting/FeeItemForm.cs b/PEIS/View/Setting/FeeItemForm.cs
index 51a1d21..3a35359 100644
--- a/PEIS/View/Setting/FeeItemForm.cs
+++ b/PEIS/View/Setting/FeeItemForm.cs
@@ -1,4 +1,4 @@
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using LIS.Model;
using PEIS.Base;
using PEIS.Entity;
@@ -54,6 +54,15 @@ namespace PEIS.View.Setting
OnGetFeeItem();
};
MenuFee.TsmiDelete.Click += FeeItemDelete_Click;
+
+ // 添加同步检验项目明细按钮
+ var tsmiSync = new ToolStripMenuItem
+ {
+ Text = "同步检验项目明细",
+ Alignment = ToolStripItemAlignment.Right
+ };
+ tsmiSync.Click += (s, e) => SyncLisReportItems();
+ MenuFee.menuStrip1.Items.Insert(0, tsmiSync);
DgvFeeItem.SelectionChanged += DgvFeeItem_SelectionChanged;
DgvFeeItem.CellValueChanged += DgvFeeItem_CellValueChanged;
//报告项目
@@ -394,6 +403,97 @@ namespace PEIS.View.Setting
this.Invoke(() => CmbConclusionSearch.DataSource = _lstConclusion);
}
+ ///
+ /// 同步检验项目明细
+ ///
+ private void SyncLisReportItems()
+ {
+ try
+ {
+ // 获取所有收费项目
+ if (_lstFeeItem == null || _lstFeeItem.Count == 0)
+ {
+ Global.MsgErr("请先加载收费项目数据");
+ return;
+ }
+
+ // 确认同步操作
+ var result = MessageBox.Show(@"确认从LIS系统同步检验项目明细到体检系统?", @"同步确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ if (result != DialogResult.Yes)
+ return;
+
+ // 获取LIS系统的检验项目数据
+ var lisData = DAOHelp.GetDataBySQL(@"
+ SELECT [ReqItemCode], [ReqItemName], [RptItemCode], [RptItemName]
+ FROM [lis].[lisdb].[dbo].[V_PEIS_ReqItem2RptItem]");
+
+ if (lisData == null || lisData.Count == 0)
+ {
+ Global.MsgErr("LIS系统中没有可同步的数据");
+ return;
+ }
+
+ int addedCount = 0;
+ int skippedCount = 0;
+
+ // 遍历收费项目,匹配并添加检验项目
+ foreach (var feeItem in _lstFeeItem.Where(x => x.ItemClass == "检验"))
+ {
+ // 查找该收费项目在LIS中对应的检验项目
+ var matchedItems = lisData.Where(l => l.ReqItemCode == feeItem.FeeItemCode).ToList();
+
+ if (matchedItems.Count == 0)
+ continue;
+
+ // 获取该收费项目现有的最大Seq
+ var maxSeq = DAOHelp.GetDataBySQL(
+ $@"SELECT MAX(Seq) FROM Dict_ReportItem WHERE FID = {feeItem.ID}").FirstOrDefault();
+ int seq = maxSeq?.Seq ?? 0;
+
+ foreach (var matchedItem in matchedItems)
+ {
+ if (matchedItem.RptItemCode == null || matchedItem.RptItemName == null) continue;
+ // 检查是否已存在相同的RptItemCode
+ var exists = DAOHelp.GetDataBySQL(
+ $@"SELECT * FROM Dict_ReportItem WHERE FID = {feeItem.ID} AND RptItemCode = '{matchedItem.RptItemCode}'").FirstOrDefault();
+
+ if (exists != null)
+ {
+ skippedCount++;
+ continue;
+ }
+
+ // 新增检查项目
+ seq++;
+ DAOHelp.ExecuteSql(
+ $@"INSERT INTO Dict_ReportItem(FID, RptItemCode, RptItemName, Seq)
+ VALUES({feeItem.ID}, '{matchedItem.RptItemCode}', '{matchedItem.RptItemName}', {seq})");
+ addedCount++;
+ }
+ }
+
+ // 刷新数据
+ OnGetFeeItem();
+
+ Global.MsgInfo($"同步完成!新增 {addedCount} 项,跳过 {skippedCount} 项(已存在)");
+ }
+ catch (Exception ex)
+ {
+ Global.MsgErr($"同步失败:{ex.Message}");
+ }
+ }
+
#endregion 事件
}
+
+ ///
+ /// LIS检验项目映射
+ ///
+ public class LisRptItem
+ {
+ public string ReqItemCode { get; set; }
+ public string ReqItemName { get; set; }
+ public string RptItemCode { get; set; }
+ public string RptItemName { get; set; }
+ }
}
\ No newline at end of file
diff --git a/PEIS/View/UControl/OpMenu.Designer.cs b/PEIS/View/UControl/OpMenu.Designer.cs
index 3146401..9fa6af3 100644
--- a/PEIS/View/UControl/OpMenu.Designer.cs
+++ b/PEIS/View/UControl/OpMenu.Designer.cs
@@ -41,10 +41,10 @@
this.TsmiDelete = new System.Windows.Forms.ToolStripMenuItem();
this.TsmiAdd = new System.Windows.Forms.ToolStripMenuItem();
this.TsmiRefresh = new System.Windows.Forms.ToolStripMenuItem();
+ this.TsmiExport = new System.Windows.Forms.ToolStripMenuItem();
this.TsmiShowMenu = new System.Windows.Forms.ToolStripMenuItem();
this.TstbKey = new System.Windows.Forms.ToolStripTextBox();
this.TsmiSearch = new System.Windows.Forms.ToolStripMenuItem();
- this.TsmiExport = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -110,6 +110,15 @@
this.TsmiRefresh.Size = new System.Drawing.Size(75, 51);
this.TsmiRefresh.Text = "刷新";
//
+ // TsmiExport
+ //
+ this.TsmiExport.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
+ this.TsmiExport.Image = ((System.Drawing.Image)(resources.GetObject("TsmiExport.Image")));
+ this.TsmiExport.Name = "TsmiExport";
+ this.TsmiExport.Size = new System.Drawing.Size(73, 51);
+ this.TsmiExport.Text = "导出";
+ this.TsmiExport.Visible = false;
+ //
// TsmiShowMenu
//
this.TsmiShowMenu.Image = global::PEIS.Properties.Resources.left;
@@ -134,15 +143,6 @@
this.TsmiSearch.Size = new System.Drawing.Size(79, 51);
this.TsmiSearch.Text = "查找";
//
- // TsmiExport
- //
- this.TsmiExport.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
- this.TsmiExport.Image = ((System.Drawing.Image)(resources.GetObject("TsmiExport.Image")));
- this.TsmiExport.Name = "TsmiExport";
- this.TsmiExport.Size = new System.Drawing.Size(73, 51);
- this.TsmiExport.Text = "导出";
- this.TsmiExport.Visible = false;
- //
// OpMenu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
@@ -163,6 +163,6 @@
#endregion
private System.Windows.Forms.ToolStripMenuItem TsmiShowMenu;
- private System.Windows.Forms.MenuStrip menuStrip1;
+ public System.Windows.Forms.MenuStrip menuStrip1;
}
}