From 073f1fd73c03fafb851582aa523f7c466c3f0e17 Mon Sep 17 00:00:00 2001 From: leomon Date: Mon, 5 Jun 2023 11:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BD=E6=89=8B?= =?UTF-8?q?=E6=9C=AF=E8=AF=8A=E6=96=AD=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIMS/AIMS.xml | 2 +- AIMS/DocManager/frmTemplateD.cs | 4 +- AIMS/Extensions/EMRExtension.cs | 28 +- .../frmAanesthesiaPainlessRecord.cs | 9 +- .../frmAanesthesiaRecord.Designer.cs | 204 +++++------ .../frmAanesthesiaRecord.cs | 105 +++--- .../frmAanesthesiaRecover.cs | 7 +- .../frmInstrumentRecord.cs | 7 +- .../frmInstrumentRecord2.cs | 10 +- AIMS/OperationAfter/frmOperationCharg2.cs | 11 +- .../OremrUserControl/EventCodeCompilerBill.cs | 2 +- AIMS/OremrUserControl/ucDocument.cs | 3 +- .../DocumentEntity/DocumentDAL.cs | 262 +++++++------- .../DocumentEntity/DocumentExtension.cs | 188 +++++++++- .../DocumentEntity/EventCodeCompiler.cs | 325 ++++++------------ DrawGraph/AreaManage/BaseInfoBottomManage.cs | 2 + DrawGraph/AreaManage/BaseInfoTopManage.cs | 5 +- DrawGraph/AreaManage/TokenEditorManage.cs | 139 +++++++- DrawGraphManagement/frmTemplateD.cs | 6 +- 19 files changed, 778 insertions(+), 541 deletions(-) diff --git a/AIMS/AIMS.xml b/AIMS/AIMS.xml index 093bb06..8fe8536 100644 --- a/AIMS/AIMS.xml +++ b/AIMS/AIMS.xml @@ -1,6 +1,6 @@  - Data Source=.;Initial Catalog=AIMSDB_QHDSGRYY;User ID=sa;Password=Test2020; + Data Source=.;Initial Catalog=AIMSDB_FJZPTFYY;User ID=sa;Password=Test2020; Data Source=.;Initial Catalog=AIMSDB_DATA;User ID=sa;Password=Test2020; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.7)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl2))));Persist Security Info=True;User ID=smview;Password=i39; diff --git a/AIMS/DocManager/frmTemplateD.cs b/AIMS/DocManager/frmTemplateD.cs index 8be508f..c0c79c7 100644 --- a/AIMS/DocManager/frmTemplateD.cs +++ b/AIMS/DocManager/frmTemplateD.cs @@ -138,7 +138,7 @@ namespace AIMS.DocManager if (temp.model.XmlFile != string.Empty) { myEditControl.LoadDocumentFromString(temp.model.XmlFile, "xml"); - this.codeCompiler = new EventCodeCompiler(ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); + this.codeCompiler = new EventCodeCompiler( ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); } else { @@ -236,7 +236,7 @@ namespace AIMS.DocManager if (temp.model.XmlFile != string.Empty) { myEditControl.LoadDocumentFromString(temp.model.XmlFile, "xml"); - this.codeCompiler = new EventCodeCompiler(ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); + this.codeCompiler = new EventCodeCompiler( ref myEditControl, temp.RTB_Click.Text, temp.RTB_Content.Text); } else { diff --git a/AIMS/Extensions/EMRExtension.cs b/AIMS/Extensions/EMRExtension.cs index f0d0e27..535ccb1 100644 --- a/AIMS/Extensions/EMRExtension.cs +++ b/AIMS/Extensions/EMRExtension.cs @@ -1,6 +1,8 @@ -using AIMSBLL; +using AIMS.PublicUI.UI; +using AIMSBLL; using AIMSExtension; using AIMSModel; +using DrawGraph; using System; using System.Collections.Generic; using System.Diagnostics; @@ -12,6 +14,20 @@ namespace AIMS { public class EMRExtension { + public static void OpenFeesRecord(OperationRecord _record, string type) + { + if (PublicMethod.HospitalName.Contains("漳浦")) + { + string Path = string.Format("http://10.129.130.60:5050/centerweb/"); + System.Diagnostics.Process.Start(Path); + } + else + { + frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "麻醉"); + frmchargRecord.Show(); + frmchargRecord.BringToFront(); + } + } public static void OpenEMRS(int patientid, int applyid) { OperationApply opeapply = new OperationApply(); @@ -39,17 +55,17 @@ namespace AIMS string HisPatientId = pat.HisPatientId; string VisitTimes = pat.VisitTimes; - string Path = string.Format("http://172.16.10.175:5001/?inoutType=2&patiId={0}&visitId={1}&userName=系统管理员", HisPatientId, VisitTimes); - System.Diagnostics.Process.Start(Path); + string Path = string.Format("http://172.16.10.175:5001/?inoutType=2&patiId={0}&visitId={1}&userName=系统管理员", HisPatientId, VisitTimes); + System.Diagnostics.Process.Start(Path); //BrowserHelper.OpenBrowserUrlChrome(Path); } else if (PublicMethod.HospitalName.Contains("天福")) { - string HisPatientId = pat.HisPatientId; + string HisPatientId = pat.HisPatientId; string HisPatientId2 = pat.Extend5; - string Path = string.Format("http://10.129.130.60:5050/osworksweb/operating_externalinformation.jsp?vaa07={0}&vaa01={1}&acf01=2&dbstyle=db2", HisPatientId,HisPatientId2); - System.Diagnostics.Process.Start(Path); + string Path = string.Format("http://10.129.130.60:5050/osworksweb/operating_externalinformation.jsp?vaa07={0}&vaa01={1}&acf01=2&dbstyle=db2", HisPatientId, HisPatientId2); + System.Diagnostics.Process.Start(Path); } } diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs index ac6387e..d255151 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs @@ -2197,9 +2197,10 @@ namespace AIMS.OperationAanesthesia } private void btnChage_Click(object sender, EventArgs e) { - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "麻醉"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record, "麻醉"); + } } private void frmAnasRecordBill2_VisibleChanged(object sender, EventArgs e) { @@ -2273,7 +2274,7 @@ namespace AIMS.OperationAanesthesia _record.AnalgesiaRecord.HeartFunction = "Ⅰ级"; _record.AnalgesiaRecord.Consciousness = "清醒"; - _record.AnalgesiaRecord.NutritionalDevelopment = "中"; + _record.AnalgesiaRecord.NutritionalDevelopment = "良"; _record.AnalgesiaRecord.Pregnancy = "无"; _record.AnalgesiaRecord.LooseDenture = "无"; _record.AnalgesiaRecord.DifficultyOpeningMouth = "无"; diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs index 5f6e3b6..713a852 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs @@ -72,18 +72,18 @@ this.panel1 = new System.Windows.Forms.Panel(); this.panel5 = new System.Windows.Forms.Panel(); this.superTabMain = new DevComponents.DotNetBar.SuperTabControl(); - this.superTabControlPanel2 = new DevComponents.DotNetBar.SuperTabControlPanel(); - this.panelExBLSJ = new DevComponents.DotNetBar.PanelEx(); - this.panel82 = new AIMS.PublicUI.UI.DrawPanel(); - this.circularProgress2 = new DevComponents.DotNetBar.Controls.CircularProgress(); - this.zgcAnaesRecord2 = new DrawGraph.ZedGraphControl(); - this.spTabBM = new DevComponents.DotNetBar.SuperTabItem(); this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel(); this.panelExZKZB = new DevComponents.DotNetBar.PanelEx(); this.panel8 = new AIMS.PublicUI.UI.DrawPanel(); this.circularProgress1 = new DevComponents.DotNetBar.Controls.CircularProgress(); this.zgcAnaesRecord = new DrawGraph.ZedGraphControl(); this.spTabQXQDD = new DevComponents.DotNetBar.SuperTabItem(); + this.superTabControlPanel2 = new DevComponents.DotNetBar.SuperTabControlPanel(); + this.panelExBLSJ = new DevComponents.DotNetBar.PanelEx(); + this.panel82 = new AIMS.PublicUI.UI.DrawPanel(); + this.circularProgress2 = new DevComponents.DotNetBar.Controls.CircularProgress(); + this.zgcAnaesRecord2 = new DrawGraph.ZedGraphControl(); + this.spTabBM = new DevComponents.DotNetBar.SuperTabItem(); this.panel7 = new System.Windows.Forms.Panel(); this.panel21 = new System.Windows.Forms.Panel(); this.PanelSave = new System.Windows.Forms.Panel(); @@ -140,12 +140,12 @@ this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.superTabMain)).BeginInit(); this.superTabMain.SuspendLayout(); - this.superTabControlPanel2.SuspendLayout(); - this.panelExBLSJ.SuspendLayout(); - this.panel82.SuspendLayout(); this.superTabControlPanel1.SuspendLayout(); this.panelExZKZB.SuspendLayout(); this.panel8.SuspendLayout(); + this.superTabControlPanel2.SuspendLayout(); + this.panelExBLSJ.SuspendLayout(); + this.panel82.SuspendLayout(); this.panel7.SuspendLayout(); this.panel21.SuspendLayout(); this.plTitleEventTime.SuspendLayout(); @@ -888,96 +888,6 @@ this.spTabBM}); this.superTabMain.SelectedTabChanged += new System.EventHandler(this.superTabMain_SelectedTabChanged); // - // superTabControlPanel2 - // - this.superTabControlPanel2.Controls.Add(this.panelExBLSJ); - this.superTabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.superTabControlPanel2.Location = new System.Drawing.Point(0, 28); - this.superTabControlPanel2.Name = "superTabControlPanel2"; - this.superTabControlPanel2.Size = new System.Drawing.Size(1389, 803); - this.superTabControlPanel2.TabIndex = 0; - this.superTabControlPanel2.TabItem = this.spTabBM; - // - // panelExBLSJ - // - this.panelExBLSJ.CanvasColor = System.Drawing.SystemColors.Control; - this.panelExBLSJ.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.panelExBLSJ.Controls.Add(this.panel82); - this.panelExBLSJ.DisabledBackColor = System.Drawing.Color.Empty; - this.panelExBLSJ.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelExBLSJ.Location = new System.Drawing.Point(0, 0); - this.panelExBLSJ.Name = "panelExBLSJ"; - this.panelExBLSJ.Size = new System.Drawing.Size(1389, 803); - this.panelExBLSJ.Style.Alignment = System.Drawing.StringAlignment.Center; - this.panelExBLSJ.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.panelExBLSJ.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.panelExBLSJ.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.panelExBLSJ.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.panelExBLSJ.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.panelExBLSJ.Style.GradientAngle = 90; - this.panelExBLSJ.TabIndex = 0; - // - // panel82 - // - this.panel82.AutoScroll = true; - this.panel82.BackColor = System.Drawing.Color.White; - this.panel82.Controls.Add(this.circularProgress2); - this.panel82.Controls.Add(this.zgcAnaesRecord2); - this.panel82.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel82.Location = new System.Drawing.Point(0, 0); - this.panel82.Name = "panel82"; - this.panel82.Size = new System.Drawing.Size(1389, 803); - this.panel82.TabIndex = 3; - this.panel82.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panel82_Scroll); - // - // circularProgress2 - // - this.circularProgress2.AnimationSpeed = 50; - // - // - // - this.circularProgress2.BackgroundStyle.BackgroundImageAlpha = ((byte)(0)); - this.circularProgress2.BackgroundStyle.BackgroundImagePosition = DevComponents.DotNetBar.eStyleBackgroundImage.Zoom; - this.circularProgress2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.circularProgress2.FocusCuesEnabled = false; - this.circularProgress2.Font = new System.Drawing.Font("微软雅黑", 9F); - this.circularProgress2.Location = new System.Drawing.Point(678, 354); - this.circularProgress2.Margin = new System.Windows.Forms.Padding(4); - this.circularProgress2.Name = "circularProgress2"; - this.circularProgress2.ProgressColor = System.Drawing.Color.DodgerBlue; - this.circularProgress2.Size = new System.Drawing.Size(389, 239); - this.circularProgress2.Style = DevComponents.DotNetBar.eDotNetBarStyle.OfficeXP; - this.circularProgress2.TabIndex = 6; - this.circularProgress2.Value = 100; - // - // zgcAnaesRecord2 - // - this.zgcAnaesRecord2.Location = new System.Drawing.Point(416, 41); - this.zgcAnaesRecord2.Name = "zgcAnaesRecord2"; - this.zgcAnaesRecord2.ScrollGrace = 0D; - this.zgcAnaesRecord2.ScrollMaxX = 0D; - this.zgcAnaesRecord2.ScrollMaxY = 0D; - this.zgcAnaesRecord2.ScrollMaxY2 = 0D; - this.zgcAnaesRecord2.ScrollMinX = 0D; - this.zgcAnaesRecord2.ScrollMinY = 0D; - this.zgcAnaesRecord2.ScrollMinY2 = 0D; - this.zgcAnaesRecord2.Size = new System.Drawing.Size(800, 1000); - this.zgcAnaesRecord2.TabIndex = 0; - this.zgcAnaesRecord2.Visible = false; - this.zgcAnaesRecord2.ContextMenuBuilder += new DrawGraph.ZedGraphControl.ContextMenuBuilderEventHandler(this.zgcAnaesRecord2_ContextMenuBuilder); - this.zgcAnaesRecord2.MouseDownEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseDownEvent); - this.zgcAnaesRecord2.MouseUpEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseUpEvent); - this.zgcAnaesRecord2.MouseMoveEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseMoveEvent); - this.zgcAnaesRecord2.KeyUp += new System.Windows.Forms.KeyEventHandler(this.zgcAnaesRecord2_KeyUp); - this.zgcAnaesRecord2.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.zgcAnaesRecord2_MouseDoubleClick); - // - // spTabBM - // - this.spTabBM.AttachedControl = this.superTabControlPanel2; - this.spTabBM.GlobalItem = false; - this.spTabBM.Name = "spTabBM"; - this.spTabBM.Text = "麻醉记录单背面"; - // // superTabControlPanel1 // this.superTabControlPanel1.Controls.Add(this.panelExZKZB); @@ -1068,6 +978,96 @@ this.spTabQXQDD.Name = "spTabQXQDD"; this.spTabQXQDD.Text = "麻醉记录单正面"; // + // superTabControlPanel2 + // + this.superTabControlPanel2.Controls.Add(this.panelExBLSJ); + this.superTabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.superTabControlPanel2.Location = new System.Drawing.Point(0, 28); + this.superTabControlPanel2.Name = "superTabControlPanel2"; + this.superTabControlPanel2.Size = new System.Drawing.Size(1389, 803); + this.superTabControlPanel2.TabIndex = 0; + this.superTabControlPanel2.TabItem = this.spTabBM; + // + // panelExBLSJ + // + this.panelExBLSJ.CanvasColor = System.Drawing.SystemColors.Control; + this.panelExBLSJ.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.panelExBLSJ.Controls.Add(this.panel82); + this.panelExBLSJ.DisabledBackColor = System.Drawing.Color.Empty; + this.panelExBLSJ.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelExBLSJ.Location = new System.Drawing.Point(0, 0); + this.panelExBLSJ.Name = "panelExBLSJ"; + this.panelExBLSJ.Size = new System.Drawing.Size(1389, 803); + this.panelExBLSJ.Style.Alignment = System.Drawing.StringAlignment.Center; + this.panelExBLSJ.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.panelExBLSJ.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.panelExBLSJ.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.panelExBLSJ.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.panelExBLSJ.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.panelExBLSJ.Style.GradientAngle = 90; + this.panelExBLSJ.TabIndex = 0; + // + // panel82 + // + this.panel82.AutoScroll = true; + this.panel82.BackColor = System.Drawing.Color.White; + this.panel82.Controls.Add(this.circularProgress2); + this.panel82.Controls.Add(this.zgcAnaesRecord2); + this.panel82.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel82.Location = new System.Drawing.Point(0, 0); + this.panel82.Name = "panel82"; + this.panel82.Size = new System.Drawing.Size(1389, 803); + this.panel82.TabIndex = 3; + this.panel82.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panel82_Scroll); + // + // circularProgress2 + // + this.circularProgress2.AnimationSpeed = 50; + // + // + // + this.circularProgress2.BackgroundStyle.BackgroundImageAlpha = ((byte)(0)); + this.circularProgress2.BackgroundStyle.BackgroundImagePosition = DevComponents.DotNetBar.eStyleBackgroundImage.Zoom; + this.circularProgress2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.circularProgress2.FocusCuesEnabled = false; + this.circularProgress2.Font = new System.Drawing.Font("微软雅黑", 9F); + this.circularProgress2.Location = new System.Drawing.Point(678, 354); + this.circularProgress2.Margin = new System.Windows.Forms.Padding(4); + this.circularProgress2.Name = "circularProgress2"; + this.circularProgress2.ProgressColor = System.Drawing.Color.DodgerBlue; + this.circularProgress2.Size = new System.Drawing.Size(389, 239); + this.circularProgress2.Style = DevComponents.DotNetBar.eDotNetBarStyle.OfficeXP; + this.circularProgress2.TabIndex = 6; + this.circularProgress2.Value = 100; + // + // zgcAnaesRecord2 + // + this.zgcAnaesRecord2.Location = new System.Drawing.Point(416, 41); + this.zgcAnaesRecord2.Name = "zgcAnaesRecord2"; + this.zgcAnaesRecord2.ScrollGrace = 0D; + this.zgcAnaesRecord2.ScrollMaxX = 0D; + this.zgcAnaesRecord2.ScrollMaxY = 0D; + this.zgcAnaesRecord2.ScrollMaxY2 = 0D; + this.zgcAnaesRecord2.ScrollMinX = 0D; + this.zgcAnaesRecord2.ScrollMinY = 0D; + this.zgcAnaesRecord2.ScrollMinY2 = 0D; + this.zgcAnaesRecord2.Size = new System.Drawing.Size(800, 1000); + this.zgcAnaesRecord2.TabIndex = 0; + this.zgcAnaesRecord2.Visible = false; + this.zgcAnaesRecord2.ContextMenuBuilder += new DrawGraph.ZedGraphControl.ContextMenuBuilderEventHandler(this.zgcAnaesRecord2_ContextMenuBuilder); + this.zgcAnaesRecord2.MouseDownEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseDownEvent); + this.zgcAnaesRecord2.MouseUpEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseUpEvent); + this.zgcAnaesRecord2.MouseMoveEvent += new DrawGraph.ZedGraphControl.ZedMouseEventHandler(this.zgcAnaesRecord2_MouseMoveEvent); + this.zgcAnaesRecord2.KeyUp += new System.Windows.Forms.KeyEventHandler(this.zgcAnaesRecord2_KeyUp); + this.zgcAnaesRecord2.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.zgcAnaesRecord2_MouseDoubleClick); + // + // spTabBM + // + this.spTabBM.AttachedControl = this.superTabControlPanel2; + this.spTabBM.GlobalItem = false; + this.spTabBM.Name = "spTabBM"; + this.spTabBM.Text = "麻醉记录单背面"; + // // panel7 // this.panel7.BackColor = System.Drawing.SystemColors.Control; @@ -2020,12 +2020,12 @@ this.panel5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.superTabMain)).EndInit(); this.superTabMain.ResumeLayout(false); - this.superTabControlPanel2.ResumeLayout(false); - this.panelExBLSJ.ResumeLayout(false); - this.panel82.ResumeLayout(false); this.superTabControlPanel1.ResumeLayout(false); this.panelExZKZB.ResumeLayout(false); this.panel8.ResumeLayout(false); + this.superTabControlPanel2.ResumeLayout(false); + this.panelExBLSJ.ResumeLayout(false); + this.panel82.ResumeLayout(false); this.panel7.ResumeLayout(false); this.panel7.PerformLayout(); this.panel21.ResumeLayout(false); diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs index 1018bcc..97e4eeb 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs @@ -236,6 +236,11 @@ namespace AIMS.OperationAanesthesia ToolStrip toolbar = ctl as ToolStrip; toolbar.Items.RemoveAt(0); ToolStrip tb = ctl as ToolStrip; + ToolStripButton settingBtn4 = new ToolStripButton(); + settingBtn4.ToolTipText = "打印全部正面"; + settingBtn4.Text = "打印全部正面"; + settingBtn4.Click += PageSetting_Click4; + tb.Items.Insert(0, settingBtn4); ToolStripButton settingBtn3 = new ToolStripButton(); settingBtn3.ToolTipText = "打印反面"; settingBtn3.Text = "打印反面"; @@ -295,8 +300,7 @@ namespace AIMS.OperationAanesthesia if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pDoc.Print(); - } - + } } private void PageSetting_Click3(object sender, EventArgs e) @@ -325,8 +329,38 @@ namespace AIMS.OperationAanesthesia if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pDoc.Print(); - } + } + } + private void PageSetting_Click4(object sender, EventArgs e) + { + mPanes = new List(); + UpPanes = new List(); + while (_record.pageCount != 1) + { + btnUpPage_Click(null, null); + } + for (int i = 1; i <= _record.pageCount; i++) + { + PrintDocPane(null, zgcAnaesRecord, templateManage, true); + btnNextPage_Click(null, null); + } + count = 0; + int pylWidth = 3; + System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument(); + pDoc.DefaultPageSettings.Landscape = false; + pDoc.OriginAtMargins = true; + pDoc.DefaultPageSettings.PrinterResolution.Kind = PrinterResolutionKind.High; + pDoc.DefaultPageSettings.Margins = new Margins(pylWidth, 0, 0, 0); + pDoc.PrintPage -= new PrintPageEventHandler(pDoc_PrintPage); + pDoc.PrintPage += new PrintPageEventHandler(pDoc_PrintPage); + + System.Windows.Forms.PrintDialog pDlg = new System.Windows.Forms.PrintDialog(); + pDlg.Document = pDoc; + if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + pDoc.Print(); + } } private void PrintDocPage(object sender, PrintPageEventArgs e) { @@ -453,63 +487,7 @@ namespace AIMS.OperationAanesthesia else { e.HasMorePages = false; - } - - //if (m_startPrintPage == 0 && m_endPrintPage == 0) - //{ - // int printCount = mPanes.Count; - // if (mPanes.Count > 0 && count < printCount) - // { - // mPanes[count].Draw(e.Graphics); - // count++; - // if (count < printCount) - // { - // e.HasMorePages = true; - // } - // } - // else - // { - // e.HasMorePages = false; - // } - //} - //else - //{ - // try - // { - // //如果当前打印页小于打印起始页码,就递增一页,直至等于打印起始页码 - // if (m_startPrintPage > 0) - // { - // while (m_PageIndex < m_startPrintPage) - // { - // m_PageIndex++; - // } - // } - - // mPanes[m_PageIndex - 1].Draw(e.Graphics); - // //当前打印页加1 - // m_PageIndex++; - - // if (m_PageIndex <= m_endPrintPage) - // { - // e.HasMorePages = true; - // } - - // //如果设置了打印页码范围并且当前打印页大于打印终止页码,终止打印,设置e.HasMorePages参数,初始化相关变量 - // if ((m_startPrintPage > 0) && (m_PageIndex > m_endPrintPage)) - // { - // e.HasMorePages = false; - // m_PageIndex = 1; - // return; - // } - - // } - // catch (Exception ex) - // { - // //出错处理,终止打印,设置e.HasMorePages参数,初始化相关变量 - // e.HasMorePages = false; - // m_PageIndex = 1; - // } - //} + } } #endregion @@ -2449,9 +2427,10 @@ namespace AIMS.OperationAanesthesia } private void btnChage_Click(object sender, EventArgs e) { - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "麻醉"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record , "麻醉"); + } } private void frmAnasRecordBill2_VisibleChanged(object sender, EventArgs e) { diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecover.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecover.cs index be31abf..387f74d 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecover.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecover.cs @@ -1649,9 +1649,10 @@ namespace AIMS.OperationAanesthesia } private void btnChage_Click(object sender, EventArgs e) { - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "恢复室"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record, "恢复室"); + } } private void button1_Click(object sender, EventArgs e) { diff --git a/AIMS/OperationAanesthesia/frmInstrumentRecord.cs b/AIMS/OperationAanesthesia/frmInstrumentRecord.cs index 14699d3..d2b7358 100644 --- a/AIMS/OperationAanesthesia/frmInstrumentRecord.cs +++ b/AIMS/OperationAanesthesia/frmInstrumentRecord.cs @@ -2217,9 +2217,10 @@ namespace AIMS.OperationAanesthesia private void btnChage_Click(object sender, EventArgs e) { - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "护士"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record, "护士"); + } } private void frmAnasRecordInstrument_VisibleChanged(object sender, EventArgs e) diff --git a/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs b/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs index 67f4f19..8fb2130 100644 --- a/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs +++ b/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs @@ -938,6 +938,7 @@ namespace AIMS.OperationAanesthesia var value = dr[i].ItemArray[1].ToString(); XTextInputFieldElement element = query.Where(x => x.FieldSettings.ListSource.SourceName == value).FirstOrDefault(); PropertyInfo info = p.Where(px => px.Name == name).FirstOrDefault(); + if (value == "KB20180604142714558" && element.Text!="") continue; if (element != null && info != null) { element.Text = info.GetValue(Patient, null).ToString(); @@ -1879,9 +1880,10 @@ namespace AIMS.OperationAanesthesia private void btnChage_Click(object sender, EventArgs e) { - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, "护士"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record, "护士"); + } } private void button10_Click(object sender, EventArgs e) @@ -1957,6 +1959,7 @@ namespace AIMS.OperationAanesthesia var value = dr[i].ItemArray[1].ToString(); XTextInputFieldElement element = query.Where(x => x.FieldSettings.ListSource.SourceName == value).FirstOrDefault(); PropertyInfo info = p.Where(px => px.Name == name).FirstOrDefault(); + if (value == "KB20180604142714558" && element.Text != "") continue; if (element != null && info != null) { element.Text = info.GetValue(Patient, null).ToString(); @@ -1992,6 +1995,7 @@ namespace AIMS.OperationAanesthesia var value = dr[i].ItemArray[1].ToString(); XTextInputFieldElement element = query.Where(x => x.FieldSettings.ListSource.SourceName == value).FirstOrDefault(); PropertyInfo info = p.Where(px => px.Name == name).FirstOrDefault(); + if (value == "KB20180604142714558" && element.Text != "") continue; if (element != null && info != null) { element.Text = info.GetValue(Patient, null).ToString(); diff --git a/AIMS/OperationAfter/frmOperationCharg2.cs b/AIMS/OperationAfter/frmOperationCharg2.cs index 6c4d569..28aed24 100644 --- a/AIMS/OperationAfter/frmOperationCharg2.cs +++ b/AIMS/OperationAfter/frmOperationCharg2.cs @@ -60,7 +60,7 @@ namespace AIMS.OperationAfter.UI if (CboOperationSite.Visible == true && CboOperationSite.SelectedIndex > 0) { - operationApplys = AIMSExtension.PublicMethod.GetNewDataTable( operationApplys, " OperationSite ='" + CboOperationSite.SelectedValue + "' ", ""); + operationApplys = AIMSExtension.PublicMethod.GetNewDataTable(operationApplys, " OperationSite ='" + CboOperationSite.SelectedValue + "' ", ""); } LoadSelectDate(); dgvtEMPOperationInfos.Rows.Clear(); @@ -138,10 +138,11 @@ namespace AIMS.OperationAfter.UI int PatientId = int.Parse(dgvOperation.CurrentRow.Cells[2].Value.ToString()); OperationRecord _record = new OperationRecord(); BOperationRecord.getRecord(_record, PatientId, 1); - frmFeesRecord frmchargRecord = new frmFeesRecord(_record, rdoZQ.Checked == true ? "麻醉" : "护士"); - frmchargRecord.Show(); - frmchargRecord.BringToFront(); + if (_record != null) + { + EMRExtension.OpenFeesRecord(_record, rdoZQ.Checked == true ? "麻醉" : "护士"); + } dgvtEMPOperationInfos.Rows.Clear(); SetChargDetalie(_record.Id.Value); } @@ -299,7 +300,7 @@ namespace AIMS.OperationAfter.UI private void toolStripButton2_Click(object sender, EventArgs e) { frmOperationCharg3 document = new frmOperationCharg3(); - document.Show(); + document.Show(); } } } diff --git a/AIMS/OremrUserControl/EventCodeCompilerBill.cs b/AIMS/OremrUserControl/EventCodeCompilerBill.cs index 4f957d4..cd54b4d 100644 --- a/AIMS/OremrUserControl/EventCodeCompilerBill.cs +++ b/AIMS/OremrUserControl/EventCodeCompilerBill.cs @@ -42,7 +42,7 @@ namespace AIMS eet.MouseDblClick += Eet_MouseDblClick; eet.ContentChanged += new ContentChangedEventHandler(eet_ContentChanged); myEditControl.GlobalEventTemplate_Element = eet; - QXList = _QXList; + QXList = _QXList; } diff --git a/AIMS/OremrUserControl/ucDocument.cs b/AIMS/OremrUserControl/ucDocument.cs index c13d361..a3d4bf2 100644 --- a/AIMS/OremrUserControl/ucDocument.cs +++ b/AIMS/OremrUserControl/ucDocument.cs @@ -183,6 +183,7 @@ namespace AIMS.OremrUserControl strClick = doc.GetElementsByTagName("ClickEvent")[0].InnerText; strContentChanged = doc.GetElementsByTagName("ContentChangedEnvent")[0].InnerText; } + string XmlFileName = TModel.XmlFileName; codeCompiler = new EventCodeCompiler(ref this.myEditControl, strClick, strContentChanged); //文档用户信息 @@ -192,6 +193,7 @@ namespace AIMS.OremrUserControl AIMSExtension.PublicMethod.PermissionLevel); //隐藏痕迹先 myEditControl.ExecuteCommand(StandardCommandNames.CleanViewMode, false, true); + codeCompiler.IsLoad = true; if (Patient.MedicalRecord != null && Patient.MedicalRecord != "") { @@ -199,7 +201,6 @@ namespace AIMS.OremrUserControl tsbSaveAndPrint.Text = "打印"; } - string XmlFileName = TModel.XmlFileName; if (DModel != null) XmlFileName = DModel.XmlFileName; if (XmlFileName == "压疮风险评估表" || XmlFileName == "不计费耗材使用清单") { diff --git a/DocumentManagement/DocumentEntity/DocumentDAL.cs b/DocumentManagement/DocumentEntity/DocumentDAL.cs index 0fc197f..2725fa3 100644 --- a/DocumentManagement/DocumentEntity/DocumentDAL.cs +++ b/DocumentManagement/DocumentEntity/DocumentDAL.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Data; -using HelperDB; +using AIMSExtension; using DCSoft.Writer.Data; -using System.Threading.Tasks; +using HelperDB; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; using System.Xml; namespace DocumentManagement @@ -185,12 +184,14 @@ namespace DocumentManagement /// public static void LoadKBLibaray() { - //if (Lib != null) - //{ - // return; - //} - Lib = new KBLibrary(); - DataTable dt = DbHelperSQL.GetDataTable(@"Select + try + { + //if (Lib != null) + //{ + // return; + //} + Lib = new KBLibrary(); + DataTable dt = DbHelperSQL.GetDataTable(@"Select KB_SEQ , KB_PARENT , KB_NAME , @@ -202,137 +203,142 @@ namespace DocumentManagement From KB_List where IsValid = 1 Order By KB_PARENT , LISTINDEX , KB_NAME"); - List list = new List(); - for (int i = 0; i < dt.Rows.Count; i++) - { - KBEntry item = new KBEntry(); - item.ID = dt.Rows[i][0].ToString(); - item.ParentID = dt.Rows[i][1].ToString(); - item.Text = dt.Rows[i][2].ToString(); - item.Value = dt.Rows[i][3].ToString().Replace("''", "'"); - item.Text2 = dt.Rows[i][4].ToString(); - if (Enum.IsDefined(typeof(KBEntryStyle), Convert.ToInt32(dt.Rows[i][5]))) + List list = new List(); + for (int i = 0; i < dt.Rows.Count; i++) { - item.Style = (KBEntryStyle)Convert.ToInt32(dt.Rows[i][5]); + KBEntry item = new KBEntry(); + item.ID = dt.Rows[i][0].ToString(); + item.ParentID = dt.Rows[i][1].ToString(); + item.Text = dt.Rows[i][2].ToString(); + item.Value = dt.Rows[i][3].ToString().Replace("''", "'"); + item.Text2 = dt.Rows[i][4].ToString(); + if (Enum.IsDefined(typeof(KBEntryStyle), Convert.ToInt32(dt.Rows[i][5]))) + { + item.Style = (KBEntryStyle)Convert.ToInt32(dt.Rows[i][5]); + } + else + { + item.Style = KBEntryStyle.List; + } + item.SpellCode = dt.Rows[i][7].ToString(); + //if (dt.Rows[i][5].ToString() == KBEntryStyle.ListSQL.ToString()) + //{ + // item.Style = KBEntryStyle.ListSQL; + //} + //else + //{ + // item.Style = KBEntryStyle.List; + //} + list.Add(item); } - else + + using (IDataReader reader = DbHelperSQL.GetDataReader(@" Select * FROM KB_ITEM where IsValid = 1 ORDER BY KB_SEQ , LISTINDEX , ITEM_TEXT ")) { - item.Style = KBEntryStyle.List; - } - item.SpellCode = dt.Rows[i][7].ToString(); - //if (dt.Rows[i][5].ToString() == KBEntryStyle.ListSQL.ToString()) - //{ - // item.Style = KBEntryStyle.ListSQL; - //} - //else - //{ - // item.Style = KBEntryStyle.List; - //} - list.Add(item); - } - - using (IDataReader reader = DbHelperSQL.GetDataReader(@" Select * FROM KB_ITEM where IsValid = 1 ORDER BY KB_SEQ , LISTINDEX , ITEM_TEXT ")) - { - //IDataReader reader = cmd.ExecuteReader(); - KBEntry currentEnty = null; - string bad_kb_seq = null; - while (reader.Read()) - { - string kb_seq = reader.GetString(1); - if (kb_seq == bad_kb_seq) + //IDataReader reader = cmd.ExecuteReader(); + KBEntry currentEnty = null; + string bad_kb_seq = null; + while (reader.Read()) { - // 错误的知识点节点编号,跳过记录 - continue; - } - - if (currentEnty == null || currentEnty.ID != kb_seq) - { - // 查找当前知识点 - currentEnty = null; - bad_kb_seq = null; - foreach (KBEntry entry in list) + string kb_seq = reader.GetString(1); + if (kb_seq == bad_kb_seq) { - if (entry.ID == kb_seq) - { - currentEnty = entry; - break; - } - }//foreach - } - if (currentEnty == null) - { - bad_kb_seq = kb_seq; - continue; - } - - if (reader.IsDBNull(4) == false) - { - int itemStyle = Convert.ToInt32(reader.GetValue(4)); - if (itemStyle == 100) - { - // 遇到模板节点,添加知识库子节点 - if (currentEnty.SubEntries == null) - { - currentEnty.SubEntries = new KBEntryList(); - } - KBEntry subEntry = new KBEntry(); - subEntry.Style = KBEntryStyle.Template; - subEntry.Text = Convert.ToString(reader.GetValue(2)); - subEntry.Value = Convert.ToString(reader.GetValue(3)); - currentEnty.SubEntries.Add(subEntry); + // 错误的知识点节点编号,跳过记录 continue; } - } - if (currentEnty.ListItems == null) - { - currentEnty.ListItems = new ListItemCollection(); - } - DCSoft.Writer.Data.ListItem item = new ListItem(); - item.Text = reader.GetString(2); - item.Value = reader.GetString(3); - currentEnty.ListItems.Add(item); - } - reader.Close(); - - // 对知识点进行排列,达成上下级关系 - KBEntry currentParent = null; - string rootID = null; - Lib.KBEntries = new KBEntryList(); - //this.KBEntries.AddRange(list); - foreach (KBEntry item in list) - { - if (item.ParentID == rootID) - { - Lib.KBEntries.Add(item); - continue; - } - if (currentParent == null || currentParent.ID != item.ParentID) - { - currentParent = null; - // 找到 - foreach (KBEntry item2 in list) + if (currentEnty == null || currentEnty.ID != kb_seq) { - if (item2.ID == item.ParentID) + // 查找当前知识点 + currentEnty = null; + bad_kb_seq = null; + foreach (KBEntry entry in list) { - currentParent = item2; - break; + if (entry.ID == kb_seq) + { + currentEnty = entry; + break; + } + }//foreach + } + if (currentEnty == null) + { + bad_kb_seq = kb_seq; + continue; + } + + if (reader.IsDBNull(4) == false) + { + int itemStyle = Convert.ToInt32(reader.GetValue(4)); + if (itemStyle == 100) + { + // 遇到模板节点,添加知识库子节点 + if (currentEnty.SubEntries == null) + { + currentEnty.SubEntries = new KBEntryList(); + } + KBEntry subEntry = new KBEntry(); + subEntry.Style = KBEntryStyle.Template; + subEntry.Text = Convert.ToString(reader.GetValue(2)); + subEntry.Value = Convert.ToString(reader.GetValue(3)); + currentEnty.SubEntries.Add(subEntry); + continue; } } - if (currentParent == null) + + if (currentEnty.ListItems == null) + { + currentEnty.ListItems = new ListItemCollection(); + } + DCSoft.Writer.Data.ListItem item = new ListItem(); + item.Text = reader.GetString(2); + item.Value = reader.GetString(3); + currentEnty.ListItems.Add(item); + } + reader.Close(); + + // 对知识点进行排列,达成上下级关系 + KBEntry currentParent = null; + string rootID = null; + Lib.KBEntries = new KBEntryList(); + //this.KBEntries.AddRange(list); + foreach (KBEntry item in list) + { + if (item.ParentID == rootID) { - // 没有找到上级节点,则为根节点 - rootID = item.ParentID; Lib.KBEntries.Add(item); continue; } - } - if (currentParent.SubEntries == null) - { - currentParent.SubEntries = new KBEntryList(); - } - currentParent.SubEntries.Add(item); - }//foreach + if (currentParent == null || currentParent.ID != item.ParentID) + { + currentParent = null; + // 找到 + foreach (KBEntry item2 in list) + { + if (item2.ID == item.ParentID) + { + currentParent = item2; + break; + } + } + if (currentParent == null) + { + // 没有找到上级节点,则为根节点 + rootID = item.ParentID; + Lib.KBEntries.Add(item); + continue; + } + } + if (currentParent.SubEntries == null) + { + currentParent.SubEntries = new KBEntryList(); + } + currentParent.SubEntries.Add(item); + }//foreach + } + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); } } diff --git a/DocumentManagement/DocumentEntity/DocumentExtension.cs b/DocumentManagement/DocumentEntity/DocumentExtension.cs index f635485..75811c1 100644 --- a/DocumentManagement/DocumentEntity/DocumentExtension.cs +++ b/DocumentManagement/DocumentEntity/DocumentExtension.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; -using System.Xml.Linq; namespace DocumentManagement { @@ -370,6 +369,193 @@ namespace DocumentManagement } } + public static void SetCocumentValueText(string XmlFileName, XTextDocument Document, XTextInputFieldElement element) + { + try + { + if (XmlFileName == "分娩镇痛麻醉记录单") + { + if (element != null && element.Name == "镇痛开始时间" && element.Text != "") + { + DateTime dt = DateTime.Parse(element.Text); + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement).ToList(); + + foreach (var item in texts) + { + switch (item.ID) + { + case "field24": + item.Text = dt.AddMinutes(5).ToString("MM-dd HH:mm"); + break; + case "field25": + item.Text = dt.AddMinutes(10).ToString("MM-dd HH:mm"); + break; + case "field26": + item.Text = dt.AddMinutes(30).ToString("MM-dd HH:mm"); + break; + case "field27": + item.Text = dt.AddHours(1).ToString("MM-dd HH:mm"); + break; + case "field28": + item.Text = dt.AddHours(2).ToString("MM-dd HH:mm"); + break; + case "field29": + item.Text = dt.AddHours(3).ToString("MM-dd HH:mm"); + break; + case "field30": + item.Text = dt.AddHours(4).ToString("MM-dd HH:mm"); + break; + case "field31": + item.Text = dt.AddHours(5).ToString("MM-dd HH:mm"); + break; + case "field32": + item.Text = dt.AddHours(6).ToString("MM-dd HH:mm"); + break; + case "field33": + item.Text = dt.AddHours(7).ToString("MM-dd HH:mm"); + break; + case "field34": + item.Text = dt.AddHours(8).ToString("MM-dd HH:mm"); + break; + + } + } + } + else if (element != null && element.Name == "BP" && element.Text != "") + { + int bp = 0; + if (int.TryParse(element.Text, out bp)) + { + if (bp > 60) + { + element.Text = bp.ToString() + "/"; + } + } + } + } + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); + } + } + + public static void SetCocumentValueText2(string XmlFileName, XTextDocument Document, XTextInputFieldElement element) + { + try + { + if (XmlFileName == "分娩镇痛麻醉记录单") + { + if (element != null && element.Name == "BP" && element.Text != "") + { + if (element.Text.Contains("/")) + { + List list = element.Text.Split('/').ToList(); + if (list.Count == 2) + { + int bp = 0; + int bp2 = 0; + if (int.TryParse(list[0], out bp) && int.TryParse(list[1], out bp2)) + { + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement && (x as XTextInputFieldElement).Name == "BP").ToList(); + + foreach (var item in texts) + { + if (item.ID == element.ID) continue; + int randomNumber = GenerateRandomNumberWithPercentageRange(bp, 10); + int randomNumber2 = GenerateRandomNumberWithPercentageRange(bp2, 10); + item.Text = randomNumber.ToString() + "/" + randomNumber2.ToString(); + } + } + + } + } + } + else if (element != null && element.Name == "HR" && element.Text != "") + { + int bp = 0; + if (int.TryParse(element.Text, out bp)) + { + if (bp > 0) + { + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement && (x as XTextInputFieldElement).Name == "HR").ToList(); + + foreach (var item in texts) + { + if (item.ID == element.ID) continue; + int randomNumber = GenerateRandomNumberWithPercentageRange(bp, 10); + item.Text = randomNumber.ToString(); + } + } + } + } + else if (element != null && element.Name == "RR" && element.Text != "") + { + int bp = 0; + if (int.TryParse(element.Text, out bp)) + { + if (bp > 0) + { + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement && (x as XTextInputFieldElement).Name == "RR").ToList(); + + foreach (var item in texts) + { + if (item.ID == element.ID) continue; + int randomNumber = GenerateRandomNumberWithPercentageRange(bp, 5); + item.Text = randomNumber.ToString(); + } + } + } + } + else if (element != null && element.Name == "SPO2" && element.Text != "") + { + int bp = 0; + if (int.TryParse(element.Text, out bp)) + { + if (bp > 0) + { + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement && (x as XTextInputFieldElement).Name == "SPO2").ToList(); + + foreach (var item in texts) + { + if (item.ID == element.ID) continue; + item.Text = bp.ToString(); + } + } + } + } + else if (element != null && element.Name == "VAS" && element.Text != "") + { + int bp = 0; + if (int.TryParse(element.Text, out bp)) + { + if (bp > 0) + { + var texts = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement && (x as XTextInputFieldElement).Name == "VAS").ToList(); + + foreach (var item in texts) + { + if (item.ID == element.ID) continue; + item.Text = bp.ToString(); + } + } + } + } + } + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); + } + } + + static int GenerateRandomNumberWithPercentageRange(int number, int percentage) + { + Random random = new Random(); + int min = number - percentage; + int max = number + percentage; + return random.Next(min, max); + } public static int AddApplyOperation(PatientRecord _operationRecord, string Operation) { int i = 0; diff --git a/DocumentManagement/DocumentEntity/EventCodeCompiler.cs b/DocumentManagement/DocumentEntity/EventCodeCompiler.cs index 43ecba3..86f9047 100644 --- a/DocumentManagement/DocumentEntity/EventCodeCompiler.cs +++ b/DocumentManagement/DocumentEntity/EventCodeCompiler.cs @@ -1,21 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.CodeDom.Compiler; -using Microsoft.CSharp; -using System.Reflection; +using DCSoft.Writer; using DCSoft.Writer.Controls; -using DCSoft.Writer; using DCSoft.Writer.Dom; -using System.Windows.Forms; -using System.Runtime.CompilerServices; -using System.Xml; -using HelperDB; -using AxNsoOfficeLib; -using System.Drawing; using DocumentManagement.UI; -using System.Xml.Linq; +using HelperDB; +using System; +using System.CodeDom.Compiler; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; namespace DocumentManagement { @@ -27,9 +19,10 @@ namespace DocumentManagement private ElementEventTemplate eet; - //string strMouseClickEvent = string.Empty; - - //string strContentChangedEvent = string.Empty; + public bool IsLoad = false; + private XTextInputFieldElement SelElement; + private string SelElementName; + private string SelElementValue; public EventCodeCompiler(ref WriterControl myEditControl, string strMouseClickEvent, string strContentChangedEvent) { @@ -39,228 +32,136 @@ namespace DocumentManagement eet.ContentChanged += new ContentChangedEventHandler(eet_ContentChanged); myEditControl.GlobalEventTemplate_Element = eet; - var providerOptions = new Dictionary(); - providerOptions.Add("CompilerVersion", "v4.0"); - CodeDomProvider cdp = new CSharpCodeProvider(providerOptions); - CompilerParameters cp = new CompilerParameters(); - cp.GenerateExecutable = false; - cp.GenerateInMemory = true; - cp.ReferencedAssemblies.Add("mscorlib.dll"); - cp.ReferencedAssemblies.Add("System.dll"); - cp.ReferencedAssemblies.Add("System.Core.dll"); - cp.ReferencedAssemblies.Add("DCSoft.Writer.dll"); - cp.ReferencedAssemblies.Add("System.Data.Linq.dll"); - cp.ReferencedAssemblies.Add("System.Xml.Linq.dll"); - cp.ReferencedAssemblies.Add("System.Windows.Forms.dll"); - string source = @" -namespace DocumentManagement -{ - using System; - using System.Collections.Generic; - using System.Linq; - using DCSoft.Writer; - using DCSoft.Writer.Dom; - using System.Windows.Forms; - using System.Reflection; - public class BindEvents - { - private static XTextDocument doc; - private static XTextContainerElement container; - public BindEvents(DCSoft.Writer.Controls.WriterControl myEditControl) - { - doc = myEditControl.Document; - container = myEditControl.Document; - - } - public static void MouseClickEvent(XTextElement element){ - - " + strMouseClickEvent + @" - } - - public static void ContentChangedEvent(XTextElement element) - { - " + strContentChangedEvent + @" - } - - private static void SetValueById(string Id, string type, object value) - { - var element = doc.GetElementsById(Id).FirstElement; - if (element != null) - { - var pChecked = element.GetType().GetProperty(type); - pChecked.SetValue(element, value, null); - element.EditorRefreshView(); - } - } - - private static void SetValueByName(string name, string type,object value) - { - var element = doc.GetElementsByName(name).FirstElement; - if (element != null) - { - var pChecked = element.GetType().GetProperty(type); - pChecked.SetValue(element, value, null); - element.EditorRefreshView(); - } - } - - private static bool GetCheckedValueByName(string name) - { - bool? result = null; - var element = doc.GetElementsByName(name).FirstElement; - if (element != null) - { - var pChecked = element.GetType().GetProperty(""Checked""); - result = Convert.ToBoolean(pChecked.GetValue(element, null)); - } - return result.Value; - } - } -} -"; - cr = cdp.CompileAssemblyFromSource(cp, source); - if (cr.Errors.HasErrors) - { - MessageBox.Show("加载元素事件失败!"); - } - else - { - Assembly a = cr.CompiledAssembly; - type = a.GetTypes().Where(x => x.IsClass).FirstOrDefault(); - Type[] types = new Type[1]; - types[0] = typeof(WriterControl); - ConstructorInfo ci = type.GetConstructor(types); - if (ci != null) - { - object obj = ci.Invoke(new object[] { myEditControl }); - } - } } public CompilerErrorCollection Errors { get { return cr.Errors; } } void eet_ContentChanged(object eventSender, ContentChangedEventArgs args) { - if (args.Element is XTextInputFieldElement) + if (IsLoad) { - //var element = args.Element as XTextInputFieldElement; - try + if (args.Element is XTextInputFieldElement) { - Object rslt = type.InvokeMember( - "ContentChangedEvent", - BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static, - null, - null, // for static class - new object[] { args.Element }); + var element = args.Element as XTextInputFieldElement; + if (SelElementName != null && SelElementName == element.Name && SelElementValue == element.Text) + return; + SelElement = element; + SelElementName = element.Name; + SelElementValue = element.Text; + DocumentExtension.SetCocumentValueText(element.WriterControl.Document.FileName, element.WriterControl.Document, element); } - catch (Exception exp) + else if (eventSender is XTextRadioBoxElement) { - MessageBox.Show(exp.StackTrace + ":" + exp.Message); + var element = args.Element as XTextRadioBoxElement; + DocumentExtension.SetCocumentValue(element.WriterControl.Document.FileName, element.WriterControl.Document); } - } - if (eventSender is XTextRadioBoxElement) - { - var element = args.Element as XTextRadioBoxElement; - DocumentExtension.SetCocumentValue(element.WriterControl.Document.FileName, element.WriterControl.Document); + } } void eetChk_MouseClick(object eventSender, ElementMouseEventArgs args) { - if (args.Element is XTextCheckBoxElement || args.Element is XTextRadioBoxElement) - { - try - { - Object rslt = type.InvokeMember( - "MouseClickEvent", - BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static, - null, - null, // for static class - new object[] { args.Element }); - } - catch (Exception exp) - { - MessageBox.Show(exp.StackTrace + ":" + exp.Message); - } - //var doc = myEditControl.Document; - //var element = args.Element; + //if (args.Element is XTextCheckBoxElement || args.Element is XTextRadioBoxElement) + //{ + // try + // { + // Object rslt = type.InvokeMember( + // "MouseClickEvent", + // BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static, + // null, + // null, // for static class + // new object[] { args.Element }); + // } + // catch (Exception exp) + // { + // MessageBox.Show(exp.StackTrace + ":" + exp.Message); + // } + // //var doc = myEditControl.Document; + // //var element = args.Element; - } + //} } private void Eet_MouseDblClick(object eventSender, ElementMouseEventArgs args) { - if (args.Element is XTextInputFieldElement) - { - var element = args.Element as XTextInputFieldElement; - if (element != null && element.Name == "Pacs") + eet.MouseDblClick -= Eet_MouseDblClick; + if (IsLoad) + if (args.Element is XTextInputFieldElement) { - var patientId = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement - && (x as XTextInputFieldElement).ID == "KB20180604104209620").FirstOrDefault(); - ShowPacsText showPacsText = new ShowPacsText(); - showPacsText.element = element; - showPacsText.PatientNo = patientId.Text; - showPacsText.ShowDialog(); - //element.WriterControl.Parent as ucDocument. - } - } - else if (eventSender is XTextImageElement) - { - if ((eventSender as XTextImageElement).Alt == "双击选择图片") - { - OpenFileDialog openFileDialogEmpImage = new OpenFileDialog(); - openFileDialogEmpImage.Filter = "*.bmp|*.bmp|*.png|*.png|*.jpg|*.jpg|*.tiff|*.tiff";//图片格式 - if (openFileDialogEmpImage.ShowDialog() == DialogResult.OK) + var element = args.Element as XTextInputFieldElement; + if (element != null && element.Name == "Pacs") { - try - { - string empUpLoadPictureRealPos = openFileDialogEmpImage.FileName;//实际的文件路径+文件名 - String[] empImageData = empUpLoadPictureRealPos.Split('.'); - //empImageData[1]:是上传的图片的后缀名 - string empUpLoadPictureFormat = empImageData[1]; - //赋值图片 - (eventSender as XTextImageElement).Image = new DCSoft.Drawing.XImageValue(Image.FromFile(empUpLoadPictureRealPos)); - (eventSender as XTextImageElement).Title = empImageData[0]; - (eventSender as XTextImageElement).EditorRefreshView(); - } - catch - { - MessageBox.Show("您选择的图片不能被读取或文件类型不对!", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - } - } - else - { - frmSelectPersonDoc personDoc = new frmSelectPersonDoc(); - personDoc.PersonType = (eventSender as XTextImageElement).Alt == "" ? "麻醉医生" : (eventSender as XTextImageElement).Alt; - personDoc.ShowDialog(); - if (personDoc.SelectPersonData > 0) - { - int PersonId = personDoc.SelectPersonData; - string SignatureStr = GetSignatureStr(PersonId); - DCSoft.Drawing.XImageValue img = new DCSoft.Drawing.XImageValue(); - img.ImageDataBase64String = SignatureStr; - (eventSender as XTextImageElement).Image = img; - (eventSender as XTextImageElement).Alt = "麻醉医生"; - (eventSender as XTextImageElement).Title = PersonId.ToString(); - (eventSender as XTextImageElement).EditorRefreshView(); + var patientId = element.WriterControl.Document.Fields.ToArray().Where(x => x is XTextInputFieldElement + && (x as XTextInputFieldElement).ID == "KB20180604104209620").FirstOrDefault(); + ShowPacsText showPacsText = new ShowPacsText(); + showPacsText.element = element; + showPacsText.PatientNo = patientId.Text; + showPacsText.ShowDialog(); + //element.WriterControl.Parent as ucDocument. } else { - //清空图片 - (eventSender as XTextImageElement).Image = null; - (eventSender as XTextImageElement).Alt = "麻醉医生"; - (eventSender as XTextImageElement).Title = ""; - (eventSender as XTextImageElement).EditorRefreshView(); + DocumentExtension.SetCocumentValueText2(element.WriterControl.Document.FileName, element.WriterControl.Document, element); } - - //属性赋值判断 - // (eventSender as XTextImageElement).Image.Value==null 判断是否有图片 是否签名 - // (eventSender as XTextImageElement).Alt =="签名" 改为已签名或签名ID - // (eventSender as XTextImageElement).Title =="标题" 存储对应ca人员介质 - // (eventSender as XTextImageElement).ID =="image3" 标识Id用于定位赋值图片 } - } + else if (eventSender is XTextImageElement) + { + if ((eventSender as XTextImageElement).Alt == "双击选择图片") + { + OpenFileDialog openFileDialogEmpImage = new OpenFileDialog(); + openFileDialogEmpImage.Filter = "*.bmp|*.bmp|*.png|*.png|*.jpg|*.jpg|*.tiff|*.tiff";//图片格式 + if (openFileDialogEmpImage.ShowDialog() == DialogResult.OK) + { + try + { + string empUpLoadPictureRealPos = openFileDialogEmpImage.FileName;//实际的文件路径+文件名 + String[] empImageData = empUpLoadPictureRealPos.Split('.'); + //empImageData[1]:是上传的图片的后缀名 + string empUpLoadPictureFormat = empImageData[1]; + //赋值图片 + (eventSender as XTextImageElement).Image = new DCSoft.Drawing.XImageValue(Image.FromFile(empUpLoadPictureRealPos)); + (eventSender as XTextImageElement).Title = empImageData[0]; + (eventSender as XTextImageElement).EditorRefreshView(); + } + catch + { + MessageBox.Show("您选择的图片不能被读取或文件类型不对!", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + } + else + { + frmSelectPersonDoc personDoc = new frmSelectPersonDoc(); + personDoc.PersonType = (eventSender as XTextImageElement).Alt == "" ? "麻醉医生" : (eventSender as XTextImageElement).Alt; + personDoc.ShowDialog(); + if (personDoc.SelectPersonData > 0) + { + int PersonId = personDoc.SelectPersonData; + string SignatureStr = GetSignatureStr(PersonId); + DCSoft.Drawing.XImageValue img = new DCSoft.Drawing.XImageValue(); + img.ImageDataBase64String = SignatureStr; + (eventSender as XTextImageElement).Image = img; + (eventSender as XTextImageElement).Alt = "麻醉医生"; + (eventSender as XTextImageElement).Title = PersonId.ToString(); + (eventSender as XTextImageElement).EditorRefreshView(); + } + else + { + //清空图片 + (eventSender as XTextImageElement).Image = null; + (eventSender as XTextImageElement).Alt = "麻醉医生"; + (eventSender as XTextImageElement).Title = ""; + (eventSender as XTextImageElement).EditorRefreshView(); + } + + //属性赋值判断 + // (eventSender as XTextImageElement).Image.Value==null 判断是否有图片 是否签名 + // (eventSender as XTextImageElement).Alt =="签名" 改为已签名或签名ID + // (eventSender as XTextImageElement).Title =="标题" 存储对应ca人员介质 + // (eventSender as XTextImageElement).ID =="image3" 标识Id用于定位赋值图片 + } + } + eet.MouseDblClick += Eet_MouseDblClick; } public string GetSignatureStr(int SelectPersonData) { diff --git a/DrawGraph/AreaManage/BaseInfoBottomManage.cs b/DrawGraph/AreaManage/BaseInfoBottomManage.cs index f374901..3be814a 100644 --- a/DrawGraph/AreaManage/BaseInfoBottomManage.cs +++ b/DrawGraph/AreaManage/BaseInfoBottomManage.cs @@ -103,6 +103,8 @@ namespace DrawGraph { text = "无"; } + + TokenEditorManage.SetAutoSizeRowSpan(template,ableEdit, text); //设置属性的值 template.SetObjValue(OpeRecord, ableEdit.ClassDataSourceName, text, value); break; diff --git a/DrawGraph/AreaManage/BaseInfoTopManage.cs b/DrawGraph/AreaManage/BaseInfoTopManage.cs index dd0f66c..56464fc 100644 --- a/DrawGraph/AreaManage/BaseInfoTopManage.cs +++ b/DrawGraph/AreaManage/BaseInfoTopManage.cs @@ -184,6 +184,8 @@ namespace DrawGraph case EControlType.Directorys: value = ableEdit.PackValue; text = DBManage.GetDictionaryValuesById(ableEdit.PackValue, ableEdit.ControlTitleText); + + TokenEditorManage.SetAutoSizeRowSpan(template, ableEdit, text); //设置属性的值 template.SetObjValue(OpeRecord, ableEdit.ClassDataSourceName, text, value); break; @@ -195,7 +197,6 @@ namespace DrawGraph } } - /// /// 初始画的后置方法 /// @@ -741,7 +742,7 @@ namespace DrawGraph if (DataSourceName == "OperationRecord.Height" || DataSourceName == "OperationRecord.Weight") { SetBMI(true); - } + } } ////设置属性的值 //ableEdit.IsVisible = !ableEdit.IsVisible; diff --git a/DrawGraph/AreaManage/TokenEditorManage.cs b/DrawGraph/AreaManage/TokenEditorManage.cs index 25ea553..c49d30c 100644 --- a/DrawGraph/AreaManage/TokenEditorManage.cs +++ b/DrawGraph/AreaManage/TokenEditorManage.cs @@ -4,6 +4,7 @@ using HelperDB; using System.Collections.Generic; using System.Data; using System.Windows.Forms; +using static System.Net.Mime.MediaTypeNames; namespace DrawGraph { @@ -165,6 +166,9 @@ namespace DrawGraph } if (IsVisible == true) aEdit.IsVisible = !aEdit.IsVisible; + + TokenEditorManage.SetAutoSizeRowSpan(_template, aEdit, Value); + if (aEdit.PackValue != Value) //设置属性的值 _template.SetObjValue(OpeRecord, aEdit.ClassDataSourceName, Value, Key, true); @@ -217,7 +221,7 @@ namespace DrawGraph List tagvalue = new List(); foreach (var item in tokenEditor.SelectedTokens) - { + { namevalue.Add(item.Text); idvalue.Add(item.Value); tagvalue.Add(GetWorkerTags(item.Text, item.Value)); @@ -249,5 +253,138 @@ namespace DrawGraph //设置属性的值 _template.SetObjValue(OpeRecord, aEdit.ClassDataSourceName, Value, Key, true); } + + + public static void SetAutoSizeRowSpan(TemplateManage template, AbleEditPackObj ableEdit, string text) + { + if (template.ProjectName == "麻醉记录单" && PublicMethod.HospitalName.Contains("天福")) + { + if (ableEdit.ClassDataSourceName == "OperationRecord.Applydiagnose") + { + ableEdit.FontSize = 9f; + if (text.Length > 57) + { + ableEdit.FontSize = 8f; + ableEdit.Y = 0.055f; + } + if (text.Length > 64) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.055f; + } + if (text.Length > 73) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.051f; + ableEdit.RowSpan = 0.008f; + } + } + else if (ableEdit.ClassDataSourceName == "OperationRecord.Applyoperation") + { + ableEdit.FontSize = 9f; + if (text.Length > 57) + { + ableEdit.FontSize = 8f; + ableEdit.Y = 0.073f; + } + if (text.Length > 64) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.073f; + } + if (text.Length > 73) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.069f; + ableEdit.RowSpan = 0.008f; + } + } + else if (ableEdit.ClassDataSourceName == "OperationRecord.Diagnose") + { + ableEdit.FontSize = 9f; + if (text.Length > 57) + { + ableEdit.FontSize = 8f; + ableEdit.Y = -0.031f; + } + if (text.Length > 64) + { + ableEdit.FontSize = 7f; + ableEdit.Y = -0.031f; + } + if (text.Length > 73) + { + ableEdit.FontSize = 7f; + ableEdit.Y = -0.035f; + ableEdit.RowSpan = 0.008f; + } + } + else if (ableEdit.ClassDataSourceName == "OperationRecord.Operation") + { + ableEdit.FontSize = 9f; + if (text.Length > 43) + { + ableEdit.FontSize = 8f; + ableEdit.Y = -0.0109f; + } + if (text.Length > 48) + { + ableEdit.FontSize = 7f; + ableEdit.Y = -0.0109f; + } + if (text.Length > 63) + { + ableEdit.FontSize = 7f; + ableEdit.Y = -0.015f; + ableEdit.RowSpan = 0.008f; + } + } + + } + else if (template.ProjectName == "恢复记录单" && PublicMethod.HospitalName.Contains("天福")) + { + if (ableEdit.ClassDataSourceName == "OperationRecord.Diagnose") + { + ableEdit.FontSize = 9f; + if (text.Length > 57) + { + ableEdit.FontSize = 8f; + ableEdit.Y = 0.041f; + } + if (text.Length > 64) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.041f; + } + if (text.Length > 73) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.037f; + ableEdit.RowSpan = 0.008f; + } + } + else if (ableEdit.ClassDataSourceName == "OperationRecord.Operation") + { + ableEdit.FontSize = 9f; + if (text.Length > 43) + { + ableEdit.FontSize = 8f; + ableEdit.Y = 0.062f; + } + if (text.Length > 48) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.062f; + } + if (text.Length > 63) + { + ableEdit.FontSize = 7f; + ableEdit.Y = 0.058f; + ableEdit.RowSpan = 0.008f; + } + } + + } + } } } diff --git a/DrawGraphManagement/frmTemplateD.cs b/DrawGraphManagement/frmTemplateD.cs index 9514e6f..9bfb552 100644 --- a/DrawGraphManagement/frmTemplateD.cs +++ b/DrawGraphManagement/frmTemplateD.cs @@ -49,7 +49,7 @@ namespace DrawGraphManagement myEditControl = temp.editControl; //codeCompiler = new EventCodeCompiler(myEditControl,"",""); - + temp.TopLevel = false; temp.Parent = panel2; temp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; @@ -144,7 +144,7 @@ namespace DrawGraphManagement { myEditControl.ExecuteCommand("FileNew", true, null); } - + } catch (Exception ex) { @@ -222,7 +222,7 @@ namespace DrawGraphManagement //} string text1 = "是否删除当前文档[" + node.Text + "]?"; //string text2 = "是否删除当前节点[" + node.Text + "]及其子文档?"; - DialogResult result = MessageBox.Show( text1, "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, + DialogResult result = MessageBox.Show(text1, "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result == System.Windows.Forms.DialogResult.Yes) {