From e42d535d71d2a221f0c0227db3d3971a12228e7a Mon Sep 17 00:00:00 2001 From: leomon Date: Fri, 30 Jun 2023 09:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=AF=E6=B8=85=E7=82=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=9C=AF=E5=89=8D=E8=AF=8A=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frmInstrumentRecord2.cs | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs b/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs index 8fb2130..2695183 100644 --- a/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs +++ b/AIMS/OperationAanesthesia/frmInstrumentRecord2.cs @@ -1623,6 +1623,12 @@ namespace AIMS.OperationAanesthesia _record.InstrumentList.TagPicture = "";// Convert.ToBase64String(PublicToDoument.ImageToBytes(pictureBox1.Image)); _record.InstrumentList.JsonTextData = "";// PublicToDoument.SerializeControl(panel18, _record, new List ()); + var diagnose = myEditControl.Document.Fields.ToArray().Where(x => x.ID == "KB20180604142254986").FirstOrDefault(); + if (diagnose != null && diagnose.Text != "" && diagnose.Text != Patient.ApplyDiagnoseInfoName) + { + //_record.InstrumentList.Remark = diagnose.Text; + DBManage.AddApplyDiagnose(_record, GetDiagnoseId(diagnose.Text)); + } var operation = myEditControl.Document.Fields.ToArray().Where(x => x.ID == "KB20180604142607822").FirstOrDefault(); if (operation != null && operation.Text != "" && operation.Text != Patient.OperationInfoName) { @@ -1708,6 +1714,45 @@ namespace AIMS.OperationAanesthesia } return string.Join(",", result.ToArray()); } + private string GetDiagnoseId(string namestr) + { + List result = new List(); + List names = new List(); + if (namestr.Contains(",")) + { + names = namestr.Split(',').ToList(); + } + else if (namestr.Contains(",")) + { + names = namestr.Split(',').ToList(); + } + else if (namestr.Contains("+")) + { + names = namestr.Split('+').ToList(); + } + else + { + names.Add(namestr); + } + foreach (var name in names) + { + DataTable dt = DBHelper.GetDataTable("select * from Disease where Name ='" + name + "'"); + if (dt.Rows.Count == 0) + { + DBHelper.ExecNonQuery(string.Concat(new Object[]{ + "insert into Disease(ICDCode,Name,[HelpCode],UseRate,IsValid,[OperatorNo],[OperatorName],OperateDate) values('','"+name+"','"+PublicMethod.GetFirstLetter(name)+"',1,1,'admin','系统管理员','"+DateTime.Now+"')"})); + } + dt = DBHelper.GetDataTable("select * from Disease where Name ='" + name + "'"); + if (dt.Rows.Count > 0) + { + for (int j = 0; j < dt.Rows.Count; j++) + { + result.Add(dt.Rows[0]["Id"].ToString()); + } + } + } + return string.Join(",", result.ToArray()); + } private string GetOperationSiteId(string namestr) { List result = new List();