Bläddra i källkod

合单项目调试完毕代码提交

zzh_love 6 månader sedan
förälder
incheckning
6c09fa3ea8

+ 69 - 6
ZLPlugin_LisPacs_MR/LisPacs_MR_Bll.cs

@@ -297,6 +297,7 @@ namespace ZLPlugin_LisPacs_MR
             {
             {
                 zlxmids += list[i].zlxmid + ",";
                 zlxmids += list[i].zlxmid + ",";
             }
             }
+            zlxmids = zlxmids.Length > 0 ? zlxmids.Substring(0, zlxmids.Length - 1) : zlxmids;
             return zlxmids;
             return zlxmids;
         }
         }
 
 
@@ -397,7 +398,7 @@ namespace ZLPlugin_LisPacs_MR
         public static int InsertHuRenBillProject(string computerName, long lngPatientID, string billName,long lngSendID, string ip, string no, string yzXgID, string type, string operatorName)
         public static int InsertHuRenBillProject(string computerName, long lngPatientID, string billName,long lngSendID, string ip, string no, string yzXgID, string type, string operatorName)
         {
         {
             string sql = @"Insert Into 互认开单项目(计算机名,患者id,开单项目,开单时间,发送号,计算机IP,单据号,相关id,类别,开单人) 
             string sql = @"Insert Into 互认开单项目(计算机名,患者id,开单项目,开单时间,发送号,计算机IP,单据号,相关id,类别,开单人) 
-                            Values('{0}','{1}','{2}',to_date('{3}','yyyy/mm/dd hh24:mi:ss'),'{4}','{5}','{6}','{7}','{8}','{9}')";
+                            Values('{0}','{1}','{2}',to_date('{3}','yyyy-mm-dd hh24:mi:ss'),{4},'{5}','{6}','{7}','{8}','{9}')";
             sql = string.Format(sql, computerName, lngPatientID, billName, DateTime.Now, lngSendID, ip, no, yzXgID, type, operatorName);
             sql = string.Format(sql, computerName, lngPatientID, billName, DateTime.Now, lngSendID, ip, no, yzXgID, type, operatorName);
             Log.Info("InsertLis:" + sql);
             Log.Info("InsertLis:" + sql);
             int res = Tools.ExecuteSql(sql);
             int res = Tools.ExecuteSql(sql);
@@ -473,11 +474,6 @@ namespace ZLPlugin_LisPacs_MR
                         }
                         }
                         foreach (var items in listlis)
                         foreach (var items in listlis)
                         {
                         {
-                            //Log.Info("state666");
-                           // if (items.code.Contains(lis[i].ItemList[j].StandardItemId)) 
-                            //{
-                               // Log.Info("items.code:" + items.code);
-                                //Log.Info("items.id:" + items.id);
                                 string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                 string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                 //Log.Info("items.code:" + items.code);
                                 //Log.Info("items.code:" + items.code);
                                 //Log.Info("items.id:" + items.id);
                                 //Log.Info("items.id:" + items.id);
@@ -536,6 +532,73 @@ namespace ZLPlugin_LisPacs_MR
 
 
 
 
         }
         }
+
+        /// <summary>
+        ///  保存互认数据  原来只支持一单 
+        /// </summary>
+        /// <param name="result"></param>
+        /// <param name="lngPatientID"></param>
+        /// <param name="lngClinicID"></param>
+        /// <param name="no"></param>
+        /// <param name="listlis"></param>
+        /// <param name="listpacs"></param>
+        /// <param name="lis_id"></param>
+        /// <param name="pacs_id"></param>
+        public static void SaveDataNew(Results result, long lngPatientID, long lngClinicID, string no, List<Codes> listlis, List<Codes> listpacs, out long lis_id, out long pacs_id)
+        {
+            lis_id = -1;
+            pacs_id = -1;
+            var lis = result.ResultText[0].LIS;
+            var pacs = result.ResultText[0].PACS;
+            if (lis != null)
+            {
+                for (int i = 0; i < lis.Count; i++)
+                {
+                    //insert 互认_lis
+                    string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                    string xgid = listlis[i].id; 
+                    int res = InsertLis(lis[i], lngPatientID, lngClinicID, date, no, long.Parse(xgid));
+                    if (res > 0)
+                    {
+                        if (lis_id == -1)
+                        {
+                            lis_id = long.Parse(xgid);
+                        }
+                        for (int k = 0; k < lis[i].ItemList.Count; k++)
+                        {
+                            InsertLisItem(lis[i].ItemList[k], lis[i].LisCheckReportId, lngPatientID, lngClinicID, date);
+                        }
+                    }
+                }
+            }
+            if (pacs != null)
+            {
+                long id = long.Parse(listpacs[0].id);
+                for (int i = 0; i < pacs.Count; i++)
+                {
+
+                    foreach (var items in listpacs)
+                    {
+                        if (pacs[i].reportTypeCode == items.type)
+                        {
+
+                            id = long.Parse(items.id);
+                            break;
+                        }
+                    }
+                    int res = InsertPacs(pacs[i], lngPatientID, lngClinicID, no, id);
+                    if (res > 0)
+                    {
+                        if (pacs_id == -1)
+                        {
+                            pacs_id = id;
+                        }
+                    }
+                }
+
+            }
+        }
+
         /// <summary>
         /// <summary>
         /// 是否互认
         /// 是否互认
         /// </summary>
         /// </summary>

+ 2 - 2
ZLPlugin_LisPacs_MR/Properties/AssemblyInfo.cs

@@ -4,12 +4,12 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 // associated with an assembly.
-[assembly: AssemblyTitle("互认金额版本和金额默认设置为0,以及医嘱内容引号解决,增加不互认提示")]
+[assembly: AssemblyTitle("互认金额版本和金额默认设置为0,以及医嘱内容引号解决,增加不互认提示,合单项目解决")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("zlsoft")]
 [assembly: AssemblyCompany("zlsoft")]
 [assembly: AssemblyProduct("ZLPlugin_LisPacs_MR")]
 [assembly: AssemblyProduct("ZLPlugin_LisPacs_MR")]
-[assembly: AssemblyCopyright("Copyright ©  2024-1.0.1.4")]
+[assembly: AssemblyCopyright("Copyright ©  2024-1.0.1.5")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: AssemblyCulture("")]
 
 

+ 2 - 3
ZLPlugin_LisPacs_MR/Tools.cs

@@ -71,12 +71,11 @@ namespace ZLPlugin_LisPacs_MR
             catch (Exception ex)
             catch (Exception ex)
             {
             {
                 result = 0;
                 result = 0;
+                Log.Info("ex.Message=" + ex.Message);
+                Log.Info("ex.StackTrace=" + ex.StackTrace);
                 Connection.Close();
                 Connection.Close();
-                Log.Info(ex.Message, true);
-                Log.Info(ex.StackTrace, true);
             }
             }
             return result;
             return result;
-
         }
         }
 
 
         public static int ExecuteStoredProc(long 病人id, long 主医嘱id, string json, int lis, int pacs)
         public static int ExecuteStoredProc(long 病人id, long 主医嘱id, string json, int lis, int pacs)

+ 6 - 8
ZLPlugin_LisPacs_MR/clsPlugin.cs

@@ -273,6 +273,7 @@ namespace ZLPlugin_LisPacs_MR
                 List<Codes> listpacs;
                 List<Codes> listpacs;
                 LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs,out billProjectNames);
                 LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs,out billProjectNames);
                 Log.Info("code=="+code);
                 Log.Info("code=="+code);
+                Log.Info("billProjectNames==" + billProjectNames);
                 Recordset rd = new Recordset();
                 Recordset rd = new Recordset();
                 decimal totalPrice = 0;
                 decimal totalPrice = 0;
                 int hrType = 0;
                 int hrType = 0;
@@ -390,12 +391,10 @@ namespace ZLPlugin_LisPacs_MR
                         //  SocketClient.Message = null;
                         //  SocketClient.Message = null;
                         Log.Info("2:" + SocketClient.Message);
                         Log.Info("2:" + SocketClient.Message);
                         SaveData(waittingdate, lngPatientID, lngClinicID, listlis, listpacs, -1);
                         SaveData(waittingdate, lngPatientID, lngClinicID, listlis, listpacs, -1);
-                        socketClient.Close();
-
                             //保存开单项目
                             //保存开单项目
-                        
-                        int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.编号, code, hrType.ToString(), Infos.UserInfo.用户名);
+                        int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
                         Log.Info("开单状态="+ ii);
                         Log.Info("开单状态="+ ii);
+                        socketClient.Close();
                         return true;
                         return true;
                     }
                     }
                     else if (rex.ResultCode == -1)//互认引用失败
                     else if (rex.ResultCode == -1)//互认引用失败
@@ -407,9 +406,9 @@ namespace ZLPlugin_LisPacs_MR
                     else
                     else
                     {
                     {
                         MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                         MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
-                        socketClient.Close();
-                        int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.编号, code, hrType.ToString(), Infos.UserInfo.用户名);
+                        int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
                         Log.Info("开单状态=" + ii);
                         Log.Info("开单状态=" + ii);
+                        socketClient.Close();
                         return true;//此病人不存在互认信息
                         return true;//此病人不存在互认信息
                     }
                     }
                 }
                 }
@@ -418,7 +417,6 @@ namespace ZLPlugin_LisPacs_MR
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
-                
                 MessageBox.Show(ex.Message, "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                 MessageBox.Show(ex.Message, "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                 Log.Info(ex.Message);
                 Log.Info(ex.Message);
                 Log.Info(ex.StackTrace);
                 Log.Info(ex.StackTrace);
@@ -457,7 +455,7 @@ namespace ZLPlugin_LisPacs_MR
             long lisId;
             long lisId;
             long pacsId;
             long pacsId;
             Log.Info("开始保存数据!");
             Log.Info("开始保存数据!");
-            LisPacs_MR_Bll.SaveData(result, lngPatientID, lngClinicID, Domain.Infos.UserInfo.编号, listlis, listpacs,out lisId,out pacsId);
+            LisPacs_MR_Bll.SaveDataNew(result, lngPatientID, lngClinicID, Domain.Infos.UserInfo.编号, listlis, listpacs,out lisId,out pacsId);
             if (state < 1)
             if (state < 1)
             {
             {
                 return true;
                 return true;