Ver código fonte

互认代码金额版本更新

zackhua 7 meses atrás
pai
commit
eb1431dee4

+ 19 - 1
.gitignore

@@ -8,4 +8,22 @@ obj/
   
 # 还可以选择性地忽略其他文件或目录  
 # 例如,忽略所有 .suo 文件(Visual Studio 用户选项文件)  
-*.suo
+*.suo
+
+.suo
+
+*.lock
+
+*.ide
+
+*.ide-shm
+
+*.ide-wal
+
+.vs/ZLPlugn_GXJK/v16/**
+.vs/ZLPlugn_GXJK/v6/.suo
+*.cache
+
+/obj/Release/**
+
+/bin/Release/**

+ 6 - 9
LisPacsDataUpload/App.config

@@ -5,21 +5,18 @@
   </configSections>
   <appSettings>
     <!--定时轮询时间(单位:分钟)-->
-    <add key="time" value="120"/>
+    <add key="time" value="120" />
     <!--数据上传开始时间点(值域:0-23)-->
-    <add key="start_time" value="9"/>
+    <add key="start_time" value="9" />
     <!--是否上传检查数据,1:上传,0不上传-->
-    <add key="pacs" value="0"/>
+    <add key="pacs" value="0" />
     <!--清除多久以前已上传的数据(单位:月),整数,小于1不删除-->
-    <add key="upload_time" value="1"/>
+    <add key="upload_time" value="1" />
   </appSettings>
   <connectionStrings>
-    <add name="conn" connectionString="data source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.0.1)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = his)));user id=ZLLPMR;password=ZLLPMR;Persist Security Info=True;Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;"/>
+    <add name="conn" connectionString="data source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.0.1)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = his)));user id=ZLLPMR;password=ZLLPMR;Persist Security Info=True;Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;" />
     <!--<add name="conn" connectionString="data source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.181)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = orcl)));user id=ZLDSTX;password=ZLDSTX;Persist Security Info=True;Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;"/>-->
-	  <add name="pgConn"
-			 connectionString="Server=localhost;Port=5432;User Id=your_username;Password=your_password;Database=your_database;"
-			 providerName="Npgsql" />
-  
+    <add name="pgConn" connectionString="Server=localhost;Port=5432;User Id=your_username;Password=your_password;Database=your_database;" providerName="Npgsql" />
   </connectionStrings>
   <system.data>
     <DbProviderFactories>

+ 72 - 11
LisPacsDataUpload/Form1.cs

@@ -12,7 +12,6 @@ using System.Text;
 using System.Threading;
 using System.Windows.Forms;
 using System.Xml;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.ProgressBar;
 
 namespace LisPacsDataUpload
 {
@@ -366,13 +365,13 @@ namespace LisPacsDataUpload
                                                        t.attachmentId Is Null
                                                        Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss')
                                                        ) b 
-                                           ) where rn <= 200 ";
+                                           ) where rn <= 150 ";
                     DataTable dt = new DataTable();
 
                     if (zlhr == zlhrConstant_true)
                     {
                         lis_sql = @"Select t.* from lis_upload t  Where t.attachmentId Is Null
-                                                       Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss') limit 200";
+                                                       Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss') limit 100";
                         dt = OracleHelper<object>.PgQueryDS(lis_sql);
                     }
                     else
@@ -429,7 +428,7 @@ namespace LisPacsDataUpload
                             signature = string.Format(signature, qname, qdate);
                             baseInfo = string.Format(baseInfo, name, sex, age, type, ch, zyh, mzh, dep);
                             string reportId = dt.Rows[i]["reportId"].ToString();
-                            string dt_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + reportId + "'";
+                            string dt_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + reportId+"'";
                             LogHelper.Info("查询LIS项目指标数据执行sql:" + dt_sql);
                             DataTable items = new DataTable();
                             if (zlhr == zlhrConstant_true)
@@ -563,7 +562,18 @@ namespace LisPacsDataUpload
                                                         a.reportorName,
                                                         a.sampleNotes,
                                                         a.checkPrice,
-                                                        a.attachmentId
+                                                        a.attachmentId,
+                                                        a.patientId ,
+                                                        a.healthNo ,
+                                                        a.medicareNo ,
+                                                        a.socialNo ,
+                                                        a.inpatientAreaCode ,
+                                                        a.sampleName ,
+                                                        a.execHospitalCode ,
+                                                        a.execHospitalName,
+                                                        a.sameHospital,
+                                                        a.projectCode,
+                                                        a.projectName
                                                         from lis_upload a ,已上传PDF b 
                                                            where b.businessnumber = a.BUSINESSNUMBER 
                                                            and b.reportid = a.REPORTID 
@@ -594,7 +604,7 @@ namespace LisPacsDataUpload
                             {
                                 dic.Add(property.Name, property.GetValue(list[0], null));
                             }
-                            string lisitems_sql = @"Select* From lis_upload_items t Where t.groupItemCode = '" + list[0].REPORTID + "'";
+                            string lisitems_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + list[0].REPORTID + "'";
                             List<LISITEMS> lisitems = new List<LISITEMS>();
                             if (zlhr == zlhrConstant_true)
                             {
@@ -681,6 +691,10 @@ namespace LisPacsDataUpload
                     #endregion
 
                     #region 2、补传失败lis数据
+                    LogHelper.Info("补传失败lis数据开始");
+                    ShowLog = Thread_name + "补传失败lis数据开始";
+                    this.SetText(ShowLog);
+                    this.SetText("补传失败lis数据开始");
                     int count_pc = 0;
                     string pc_sql = @"select  a.orgCode,
                                                     a.orgName,
@@ -743,14 +757,26 @@ namespace LisPacsDataUpload
                                                     a.reportorName,
                                                     a.sampleNotes,
                                                     a.checkPrice,
-                                                    a.attachmentId
+                                                    a.attachmentId,
+                                                    a.patientId ,
+                                                    a.healthNo ,
+                                                    a.medicareNo ,
+                                                    a.socialNo ,
+                                                    a.inpatientAreaCode ,
+                                                    a.sampleName ,
+                                                    a.execHospitalCode ,
+                                                    a.execHospitalName,
+                                                    a.sameHospital,
+                                                    a.projectCode,
+                                                    a.projectName
                                                     from lis_upload a ,已上传PDF b 
                                                        where b.businessnumber = a.BUSINESSNUMBER 
                                                        and b.reportid = a.REPORTID 
                                                        and b.attachmentid is not null
                                                        and b.uploaded = 0
-                                                       and b.type = 2";
-                    LogHelper.Info("补传失败lis数据执行sql:" + pc_sql);
+                                                       and b.type = 2
+                                                        and b.uploade_time > sysdate -5 ";
+                    LogHelper.Info("补传lis数据执行sql:" + pc_sql);
                     List<LIS> list_pc = new List<LIS>();
                     if (zlhr == zlhrConstant_true)
                     {
@@ -763,7 +789,7 @@ namespace LisPacsDataUpload
 
                     if (list_pc.Count < 1)
                     {
-                        LogHelper.Info("查询补传[LIS]数据为空,等待下一次轮询。");
+                        LogHelper.Info("查询补传[LIS]数据为空,等待下一次轮询。"+ list_pc.Count);
                         return;
                     }
                     for (int i = 0; i < list_pc.Count; i++)
@@ -774,7 +800,7 @@ namespace LisPacsDataUpload
                         {
                             dic_pc.Add(property.Name, property.GetValue(list_pc[i], null));
                         }
-                        string lisitems_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + list_pc[i].REPORTID + "'";
+                        string lisitems_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + list_pc[i].REPORTID +"'";
                         List<LISITEMS> lisitems = OracleHelper<LISITEMS>.RunQueryList(lisitems_sql);
                         if (zlhr == zlhrConstant_true)
                         {
@@ -849,6 +875,8 @@ namespace LisPacsDataUpload
                             }
 
                         }
+                        ShowLog = Thread_name + "补传第"+i+"条数据成功:医嘱id=" + list_pc[i].REPORTID;
+                        this.SetText(ShowLog);
                     }
                     if (count_pc > 0)
                     {
@@ -889,6 +917,21 @@ namespace LisPacsDataUpload
                     //取出诊疗项目id 取获取收费项目的医保编码 并赋值
                     item.STANDARDITEMID = dtYbCode.Rows[0]["医保编码"].ToString();
                 }
+                // 复制  报告id 
+              /*  string ITEMCODE = item.STANDARDITEMID;
+                string sqlhis = @"Select l.医保编码 From 诊疗项目目录 x,诊疗收费关系 y,收费项目目录 z,保险支付项目 m,互认项目清单 l
+                                                  Where y.诊疗项目id = x.id And z.id = y.收费项目id And m.收费细目id = z.Id And l.医保通用编码 = m.项目编码 And Rownum = 1
+                                                   And x.类别 = 'C' And m.险类 = 111
+                                                   And x.编码 ='{0}'";
+                sqlhis = string.Format(sqlhis, ITEMCODE);
+                DataTable dtYbCode = OracleHelper<object>.RunQueryDS(sqlhis);
+                if (dtYbCode.Rows.Count > 0)
+                {
+                    //取出诊疗项目id 取获取收费项目的医保编码 并赋值
+                    item.STANDARDITEMID = dtYbCode.Rows[0]["医保编码"].ToString();
+                }*/
+
+
             }
         }
 
@@ -1830,6 +1873,24 @@ namespace LisPacsDataUpload
             string lis_count = Lis_total + "条";
             this.SetLisText(label_lis);
             this.SetLisCountText(lis_count);
+            //获取待上传的数量
+
+            string waitsql = @"select count(1) listotal from lis_upload a ,已上传PDF b 
+                                                where b.businessnumber = a.BUSINESSNUMBER 
+                                                and b.reportid = a.REPORTID 
+                                                and b.attachmentid is not null
+                                                and b.uploaded = 0
+                                                and b.type = 2";
+            DataTable waitdt = new DataTable();
+            if (zlhr == zlhrConstant_true)
+            {
+                waitdt = OracleHelper<object>.PgQueryDS(waitsql);
+            }
+            else
+            {
+                waitdt = OracleHelper<object>.RunQueryDS(sql);
+            }
+            LogHelper.Info("待上传数量为:" + waitdt.Rows[0]["listotal"].ToString() + "条");
         }
 
         public void GetPacsDefault()

+ 7 - 1
LisPacsDataUpload/Models/Count.cs

@@ -25,6 +25,12 @@ namespace LisPacsDataUpload.Models
 
         public string ITEMNAMES { get; set; }//开单项目名称(多个项目使用英文逗号拼接,如:肝功能,肾功能,血脂六项)
 
-        public string APPLYTIME { get; set; }
+        public string APPLYTIME { get; set; }  //开单时间
+        public string hisApplyCode { get; set; }  //机构开单编号(HIS 开申请单传递给平台的唯一主键)
+        public string patientType { get; set; } //患者类型(1:门诊 2:住院3:体检4:公卫5:其他)
+        public string doctorCode { get; set; } // 是 医生编号
+        public string doctorName { get; set; } //医生名称
+
+
     }
 }

+ 11 - 0
LisPacsDataUpload/Models/LIS.cs

@@ -69,6 +69,17 @@ namespace LisPacsDataUpload.Models
         public string SAMPLENOTES { get; set; }//      标本备注/标本状态
         public string CHECKPRICE { get; set; }// 否   检验费用(元),保留小数点后四位
         public string ATTACHMENTID { get; set; }// 否   PDF报告附件ID(与附件上传接口中ATTACHMENTID关联)
+        public string PATIENTID { get; set; }// 是   患者 id
+        public string HEALTHNO { get; set; }// 否  电子健康卡号
+        public string MEDICARENO { get; set; }// 否    医保卡号
+        public string SOCIALNO { get; set; }// 否   社保卡号
+        public string INPATIENTAREACODE { get; set; }// 否   病区代码
+        public string SAMPLENAME { get; set; }// 样本名称
+        public string EXECHOSPITALCODE { get; set; }// 申请机构组织编码 
+        public string EXECHOSPITALNAME { get; set; }// 申请机构名称
+        public string SAMEHOSPITAL { get; set; }// 否  申请、采样和检测是否同一机构(0-否;1-是)
+        public string PROJECTCODE { get; set; }// 否  检验项目编码(组合编码)
+        public string PROJECTNAME { get; set; }// 否  检验项目名称(组合名称,如:血常规、肝功能等)
 
 
     }

+ 2 - 0
LisPacsDataUpload/Models/LISITEMS.cs

@@ -22,6 +22,8 @@ namespace LisPacsDataUpload.Models
         public string HINT { get; set; }//"2"
         public string RESULT { get; set; }//"检验-结果",
         public string CHECKMETHOD { get; set; }//":"荧光法"
+        public string repeatReminderFlag { get; set; } = "0";//":"是否重复提醒范围(0-否;1-是)"
+        public string ItemCheckPrice { get; set; } //":"检验明细项目费用(元),保留小数点后四位是否互认项目为 1 时必传"
 
     }
 }

+ 10 - 0
LisPacsDataUpload/Models/PACS.cs

@@ -78,6 +78,16 @@ namespace LisPacsDataUpload.Models
         public string PATIENTSEX { get; set; }
         public string PATIENTBIRTHDAY { get; set; }
         public string REGIONHR { get; set; }
+        public string HEALTHNO { get; set; } //电子健康卡号
+        public string MEDICARENO { get; set; }//医保卡号
+        public string ACCESSNUMBER { get; set; }//检查编号(检查流水号)
+        public string CONCLUSION { get; set; }//检查印象,没有填“无”
+        public string BRIEFHISTORY { get; set; }//简要病史
+        public string ISIMAGESERVICE { get; set; } //是否属于数字影像服务(0-否;1-是),当前传0
+        public string STUDYUID { get; set; }  //  检查 UID,DICOM 中协议中影像检查唯一标识
+
+
+
 
         //public string PATIENTAGE  { get; set; }
         //public string ageUnit { get; set; }

+ 0 - 3
LisPacsDataUpload/OracleHelper.cs

@@ -2,13 +2,10 @@
 using Npgsql;
 using Oracle.ManagedDataAccess.Client;
 using System;
-using System.Collections;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
-using System.Linq;
 using System.Reflection;
-using System.Text;
 
 namespace LisPacsDataUpload
 {

+ 2 - 2
LisPacsDataUpload/packages.config

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="iTextSharp" version="5.1.3" targetFramework="net40" />
-  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net40" />
+  <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net40" />
   <package id="Npgsql" version="2.2.7" targetFramework="net40" />
-  <package id="Oracle.ManagedDataAccess" version="19.7.0" targetFramework="net40" />
+  <package id="Oracle.ManagedDataAccess" version="19.18.0" targetFramework="net40" />
 </packages>

+ 0 - 3
ZLPlugin_LisPacs_MR/Domain/Units/DbHelper.cs

@@ -1,8 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Data;
 using ADODB;
 using System.Reflection;

+ 137 - 163
ZLPlugin_LisPacs_MR/LisPacs_MR_Bll.cs

@@ -2,6 +2,7 @@
 using System;
 using System.Collections.Generic;
 using System.Reflection;
+using System.Xml.Linq;
 using ZLPlugin_LisPacs_MR.Domain;
 using ZLPlugin_LisPacs_MR.Domain.Units;
 using ZLPlugin_LisPacs_MR.Model;
@@ -120,6 +121,12 @@ namespace ZLPlugin_LisPacs_MR
                         Codes codes = new Codes();
                         codes.id = list[i].相关ID;  //原先是 取id 不行 
                         codes.code = code;
+                      
+                        codes.yzid = list[i].ID;
+                        codes.zlxmid = list[i].诊疗项目ID;
+
+                        codes.yzContent = list[i].医嘱内容;
+                        codes.doctorName = list[i].开嘱医生;
                         listlis.Add(codes);
                         //lis += list[i].诊疗项目ID + ",";
                         //lis_id += list[i].ID + ",";
@@ -141,6 +148,14 @@ namespace ZLPlugin_LisPacs_MR
                         Codes codes = new Codes();
                         codes.id = list[i].相关ID;
                         codes.type = type;
+                        codes.yzid = list[i].ID;
+                        codes.zlxmid = list[i].诊疗项目ID;
+                        codes.zxksid = list[i].执行科室ID;
+                        codes.part = list[i].标本部位;
+                        codes.method = list[i].检查方法;
+
+                        codes.yzContent = list[i].医嘱内容 + "_" + list[i].标本部位 + "_" + list[i].检查方法;
+                        codes.doctorName = list[i].开嘱医生;
                         listPacs.Add(codes);
                         codeNo += type + "#";
                     }
@@ -160,9 +175,9 @@ namespace ZLPlugin_LisPacs_MR
         /// <param name="ZYID"></param>
         /// <param name="standardItemId"></param>
         /// <returns></returns>
-        public static Recordset GetZYPostJson(long lngPatientID, long ZYID, string no,int type, string xgId)
+        public static Recordset GetZYPostJson(long lngPatientID, long ZYID, string no,int type,string totalPrice, string xgid)
         {
-            string sql = @"Select distinct  a.姓名 ""PatientName"",
+            string sql = @"select * from (Select distinct  a.姓名 ""PatientName"",
                                     b.身份证号 ""PatientIdCard"",
                                     e.机构编码 ""jzOrgCode"",
                                     e.机构名称 ""jzOrgName"",
@@ -177,88 +192,15 @@ namespace ZLPlugin_LisPacs_MR
                                     '{3}' ""hrType"",
                                     sysdate ""applyTime"",
                                     '{4}' ""hisApplyCode"",
-                                    '2'' ""patientType"",
-,
-                                    (Select sum(B.收费数量 *
-                                        Decode(C.是否变价, 1, Sum(D.缺省价格), Sum(D.现价)))   
-                                    From 病人医嘱记录 A,
-                                        (Select *
-                                            From (Select C.诊疗项目ID,
-                                                        C.收费项目ID,
-                                                        C.检查部位,
-                                                        C.检查方法,
-                                                        C.费用性质,
-                                                        C.收费数量,
-                                                        C.固有对照,
-                                                        C.从属项目,
-                                                        C.收费方式,
-                                                        C.适用科室id,
-                                                        Max(Nvl(c.适用科室id, 0)) Over(Partition By c.诊疗项目id, c.检查部位, c.检查方法, c.费用性质) As Top
-                                                    From 诊疗收费关系 C, 病人医嘱记录 A
-                                                    Where (A.ID = {4} Or A.相关ID ={4})
-                                                    And A.诊疗项目ID + 0 = C.诊疗项目ID
-                                                    And (a.相关id Is Null And a.执行标记 In (1, 2) And c.费用性质 = 1 Or
-                                                        a.标本部位 = c.检查部位 And a.检查方法 = c.检查方法 And
-                                                        Nvl(c.费用性质, 0) = 0 Or
-                                                        (a.检查方法 Is Null or a.诊疗类别 = 'E' And Exists
-                                                        (Select 1
-                                                            From 诊疗项目目录 Z
-                                                            Where Z.id = a.诊疗项目ID
-                                                                And Z.操作类型 = '4')) And Nvl(c.费用性质, 0) = 0 And
-                                                        c.检查部位 Is Null And c.检查方法 Is Null)
-                                                    And (C.适用科室ID is Null or
-                                                        C.适用科室ID = A.执行科室ID And C.病人来源 = 1))
-                                            Where Nvl(适用科室id, 0) = Top) B,
-                                        收费项目目录 C,
-                                        收费价目 D
-                                    Where A.诊疗类别 Not IN ('4', '5', '6', '7')
-                                    And A.医嘱状态 IN (-1, 1, 2)
-                                    And A.诊疗项目ID + 0 = B.诊疗项目ID
-                                    And D.价格等级 is Null
-                                    And (A.相关ID is Null And A.执行标记 IN (1, 2) And B.费用性质 = 1 Or
-                                        A.标本部位 = B.检查部位 And A.检查方法 = B.检查方法 And Nvl(B.费用性质, 0) = 0 Or
-                                        (A.检查方法 is Null or a.诊疗类别 = 'E' And Exists
-                                        (Select 1
-                                            From 诊疗项目目录 Z
-                                            Where Z.id = a.诊疗项目ID
-                                                And Z.操作类型 = '4')) And Nvl(B.费用性质, 0) = 0 And B.检查部位 is Null And
-                                        B.检查方法 is Null)
-                                    And Nvl(A.计价特性, 0) = 0
-                                    And Nvl(A.执行性质, 0) Not IN (0, 5)
-                                    And B.收费项目ID = C.ID
-                                    And B.收费项目ID = D.收费细目ID
-                                    And ((Sysdate Between D.执行日期 and D.终止日期) or
-                                        (Sysdate >= D.执行日期 And D.终止日期 is NULL))
-                                    And (C.撤档时间 is NULL Or C.撤档时间 = To_Date('3000-01-01', 'YYYY-MM-DD'))
-                                    And C.服务对象 IN (1, 3)
-                                    And (Nvl(B.收费方式, 0) = 1 And C.类别 = '4' And B.收费项目ID = '0' Or
-                                        Not (Nvl(B.收费方式, 0) = 1 And C.类别 = '4' And '0' <> 0))
-                                    And (C.站点 = '-' Or C.站点 is Null)
-                                    And (A.ID = {4} Or A.相关ID = {4})
-                                    Group by A.ID,
-                                            A.相关ID,
-                                            A.序号,
-                                            A.诊疗类别,
-                                            A.诊疗项目ID,
-                                            A.标本部位,
-                                            A.检查方法,
-                                            A.执行标记,
-                                            Nvl(B.费用性质, 0),
-                                            Nvl(B.收费方式, 0),
-                                            B.收费项目ID,
-                                            C.计算单位,
-                                            B.收费数量,
-                                            C.是否变价,
-                                            A.执行科室ID,
-                                            Nvl(B.从属项目, 0)
-
-                                            ) ""totalAmount""
+                                    '2' ""patientType"",
+                                     '{5}'   ""totalAmount""
                                     From 病案主页 a,病人信息 b, 人员表 c,部门表 d,ZLLPMR.互认配置表 e
                                     Where b.病人id = a.病人id
                                     And c.姓名 = a.住院医师
                                     And d.Id = a.入院科室id
-                                    And a.病人id = {0} And a.主页id = {1}";
-            sql = string.Format(sql, lngPatientID, ZYID, no,type,xgId);
+                                    And a.病人id = {0} And a.主页id = {1} ) ";
+            sql = string.Format(sql, lngPatientID, ZYID, no,type, xgid, totalPrice);
+            Log.Info("GetZYPostJson==" + sql);
             Recordset rd = new Recordset();
             Tools.QueryTable(sql, out rd);
             return rd;
@@ -270,7 +212,7 @@ namespace ZLPlugin_LisPacs_MR
         /// <param name="ZYID"></param>
         /// <param name="standardItemId"></param>
         /// <returns></returns>
-        public static Recordset GetMZPostJson(long ZYID, string no,int type, string xgId)
+        public static Recordset GetMZPostJson(long ZYID, string no,int type, string totalAmount, string xgId)
         {
             string sql = @"Select distinct a.姓名 ""PatientName"",
                                     b.身份证号 ""PatientIdCard"",
@@ -287,92 +229,97 @@ namespace ZLPlugin_LisPacs_MR
                                     '{2}' ""hrType"",
                                     sysdate ""applyTime"",
                                     '{3}' ""hisApplyCode"",
-                                    '1'' ""patientType"",
-,
-                                    (Select sum(B.收费数量 *
-                                        Decode(C.是否变价, 1, Sum(D.缺省价格), Sum(D.现价)))   
-                                    From 病人医嘱记录 A,
-                                        (Select *
-                                            From (Select C.诊疗项目ID,
-                                                        C.收费项目ID,
-                                                        C.检查部位,
-                                                        C.检查方法,
-                                                        C.费用性质,
-                                                        C.收费数量,
-                                                        C.固有对照,
-                                                        C.从属项目,
-                                                        C.收费方式,
-                                                        C.适用科室id,
-                                                        Max(Nvl(c.适用科室id, 0)) Over(Partition By c.诊疗项目id, c.检查部位, c.检查方法, c.费用性质) As Top
-                                                    From 诊疗收费关系 C, 病人医嘱记录 A
-                                                    Where (A.ID = {3} Or A.相关ID = {3})
-                                                    And A.诊疗项目ID + 0 = C.诊疗项目ID
-                                                    And (a.相关id Is Null And a.执行标记 In (1, 2) And c.费用性质 = 1 Or
-                                                        a.标本部位 = c.检查部位 And a.检查方法 = c.检查方法 And
-                                                        Nvl(c.费用性质, 0) = 0 Or
-                                                        (a.检查方法 Is Null or a.诊疗类别 = 'E' And Exists
-                                                        (Select 1
-                                                            From 诊疗项目目录 Z
-                                                            Where Z.id = a.诊疗项目ID
-                                                                And Z.操作类型 = '4')) And Nvl(c.费用性质, 0) = 0 And
-                                                        c.检查部位 Is Null And c.检查方法 Is Null)
-                                                    And (C.适用科室ID is Null or
-                                                        C.适用科室ID = A.执行科室ID And C.病人来源 = 1))
-                                            Where Nvl(适用科室id, 0) = Top) B,
-                                        收费项目目录 C,
-                                        收费价目 D
-                                    Where A.诊疗类别 Not IN ('4', '5', '6', '7')
-                                    And A.医嘱状态 IN (-1, 1, 2)
-                                    And A.诊疗项目ID + 0 = B.诊疗项目ID
-                                    And D.价格等级 is Null
-                                    And (A.相关ID is Null And A.执行标记 IN (1, 2) And B.费用性质 = 1 Or
-                                        A.标本部位 = B.检查部位 And A.检查方法 = B.检查方法 And Nvl(B.费用性质, 0) = 0 Or
-                                        (A.检查方法 is Null or a.诊疗类别 = 'E' And Exists
-                                        (Select 1
-                                            From 诊疗项目目录 Z
-                                            Where Z.id = a.诊疗项目ID
-                                                And Z.操作类型 = '4')) And Nvl(B.费用性质, 0) = 0 And B.检查部位 is Null And
-                                        B.检查方法 is Null)
-                                    And Nvl(A.计价特性, 0) = 0
-                                    And Nvl(A.执行性质, 0) Not IN (0, 5)
-                                    And B.收费项目ID = C.ID
-                                    And B.收费项目ID = D.收费细目ID
-                                    And ((Sysdate Between D.执行日期 and D.终止日期) or
-                                        (Sysdate >= D.执行日期 And D.终止日期 is NULL))
-                                    And (C.撤档时间 is NULL Or C.撤档时间 = To_Date('3000-01-01', 'YYYY-MM-DD'))
-                                    And C.服务对象 IN (1, 3)
-                                    And (Nvl(B.收费方式, 0) = 1 And C.类别 = '4' And B.收费项目ID = '0' Or
-                                        Not (Nvl(B.收费方式, 0) = 1 And C.类别 = '4' And '0' <> 0))
-                                    And (C.站点 = '-' Or C.站点 is Null)
-                                    And (A.ID = {3} Or A.相关ID = {3})
-                                    Group by A.ID,
-                                            A.相关ID,
-                                            A.序号,
-                                            A.诊疗类别,
-                                            A.诊疗项目ID,
-                                            A.标本部位,
-                                            A.检查方法,
-                                            A.执行标记,
-                                            Nvl(B.费用性质, 0),
-                                            Nvl(B.收费方式, 0),
-                                            B.收费项目ID,
-                                            C.计算单位,
-                                            B.收费数量,
-                                            C.是否变价,
-                                            A.执行科室ID,
-                                            Nvl(B.从属项目, 0)
-
-                                            ) ""totalAmount""
+                                    '1' ""patientType"",
+                                    '{4}' ""totalAmount""
                                     From 病人挂号记录 a,病人信息 b, 人员表 c,部门表 d,ZLLPMR.互认配置表 e
                                     Where b.病人id = a.病人id
                                     And c.姓名 = a.执行人
                                     And d.Id = a.执行部门id
                                     And a.id = {0}";
-            sql = string.Format(sql, ZYID, no,type);
+            sql = string.Format(sql, ZYID, no,type, xgId, totalAmount);
+            Log.Info("GetMZPostJson==" + sql);
             Recordset rd = new Recordset();
             Tools.QueryTable(sql, out rd);
             return rd;
         }
+
+        public static string GetMZTotalPrice(long lngPatientID, string YZID)
+        {
+            string sql = @"Select sum(a.实收金额) 金额 from 门诊费用记录 a,病人医嘱记录 b where a.医嘱序号 = b.id and b.病人id ={0} and b.id = {1}";
+            sql = string.Format(sql, lngPatientID, YZID);
+            Log.Info("GetMZTotalPrice==" + sql);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "";
+        }
+
+
+        public static string GetTotalPriceForLisByZLXM(string zlxmid)
+        {
+            string sql = @"Select sum(现价) 金额 from 收费价目 where  终止日期 > sysdate  and 收费细目id in (select 收费项目id from 诊疗收费关系 where 诊疗项目id = {0} )";
+            sql = string.Format(sql, zlxmid);
+            Log.Info("GetTotalPriceForLisByZLXM==" + sql);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "";
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="zlxmid"> 诊疗项目id</param>
+        /// <param name="zlksid"> 执行科室id</param>
+        /// <param name="part"> 部位</param>
+        /// <param name="method"> 方法</param>
+        /// <param name="patientResource"> 病人来源   门诊  1  还是住院  2   0 所有</param>
+        /// <returns></returns>
+        public static string GetTotalPriceForPacsByZLXM(string zlxmid,string zlksid ,string part,string method, int patientResource)
+        {
+            string sql = @"select nvl(sum(a.现价* b.收费数量),'0') 金额 from 收费价目 a,(
+                    select * from 诊疗收费关系  where 诊疗项目id = {0} and ( 适用科室id  is null or  适用科室id = {1} )and 检查部位 = '{2}' and 检查方法 = '{3}'  and 病人来源 <> {4}
+                    union all
+                    select * from 诊疗收费关系  where 诊疗项目id = {0} and 固有对照 = 1 and 适用科室id = {1} and 病人来源 <> {4}
+                    ) b where a.收费细目id = b.收费项目id and   a.终止日期 > sysdate ";
+            sql = string.Format(sql, zlxmid,zlksid, part, method, patientResource);
+            Log.Info("GetTotalPriceForPacsByZLXM==" + sql);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "0";
+        }
+
+
+        
+
+
+        public static string GetZYTotalPrice(string zlxmid)
+        {
+            string sql = @"Select sum(现价) 金额 from 收费价目 where 收费细目id in (select 收费项目id from 诊疗收费关系 where 诊疗项目id = {0} )";
+            sql = string.Format(sql, zlxmid);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "";
+        }
+
         /// <summary>
         /// 判断之前是否开个互认医嘱
         /// </summary>
@@ -405,16 +352,42 @@ namespace ZLPlugin_LisPacs_MR
             }
         }
 
-        public static int InsertLis(LISItem lis, long lngPatientID, long lngClinicID, string date, string no,long yzid)
+
+        /// <summary>
+        /// 插入互认开单项目数据
+        /// </summary>
+        /// <param name="computerName"></param>
+        /// <param name="lngPatientID"></param>
+        /// <param name="billName"></param>
+        /// <param name="lngSendID"></param>
+        /// <param name="ip"></param>
+        /// <param name="no"></param>
+        /// <param name="yzID"></param>
+        /// <param name="type"></param>
+        /// <param name="operatorName"></param>
+        /// <returns></returns>
+        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,类别,开单人) 
+                            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);
+            Log.Info("InsertLis:" + sql);
+            int res = Tools.ExecuteSql(sql);
+            return res;
+        }
+
+        public static int InsertLis(LISItem lis, long lngPatientID, long lngClinicID, string date, string no,long yzXgID)
         {
             string sql = @"Insert Into ZLLPMR.互认_LIS(LISCHECKREPORTID,REPORTNAME,ORGNAME,REPORTTIME,病人ID,主页ID,TIME,OPERATORNO,医嘱id) 
                             Values('{0}','{1}','{2}',to_date('{3}','yyyy/mm/dd hh24:mi:ss'),{4},{5},to_date('{6}','yyyy/mm/dd hh24:mi:ss'),'{7}',{8})";
-            sql = string.Format(sql, lis.LisCheckReportId, lis.ReportName, lis.OrgName, lis.ReportTime, lngPatientID, lngClinicID, date, no, yzid);
+            sql = string.Format(sql, lis.LisCheckReportId, lis.ReportName, lis.OrgName, lis.ReportTime, lngPatientID, lngClinicID, date, no, yzXgID);
             Log.Info("InsertLis:" + sql);
             int res = Tools.ExecuteSql(sql);
             return res;
         }
 
+
+
         public static void InsertLisItem(ItemListItem item, string id, long lngPatientID, long lngClinicID, string date)
         {
             string sql = @"Insert Into ZLLPMR.互认_LISITEMS(LISCHECKREPORTID,ITEMCODE,ITEMNAME,RESULT,UNIT,HINT,RANGE,STANDARDITEMID,TIME) 
@@ -665,7 +638,8 @@ namespace ZLPlugin_LisPacs_MR
                                 to_char(b.摘要) as 摘要
                          from 病人医嘱发送 a,病人医嘱记录 b 
                          where b.id = a.医嘱id and  发送号 = {0} and 诊疗类别 in('D','C')
-                         and NOT EXISTS(select 1 from 病人医嘱记录 where id = b.id and 诊疗类别 = 'D' and 相关id is not null)";
+                         and NOT EXISTS(select 1 from 病人医嘱记录 where id = b.id and 诊疗类别 = 'D' and 相关id is  null)";
+            // and NOT EXISTS(select 1 from 病人医嘱记录 where id = b.id and 诊疗类别 = 'D' and 相关id is not null)
             sql = string.Format(sql, fsh);
             Recordset recordset = new Recordset();
             Tools.QueryTable(sql, out recordset);
@@ -757,7 +731,7 @@ namespace ZLPlugin_LisPacs_MR
 
 
 
-        public List<BillProjectUpload> GetBillProjects(long lngSendID,string hostName,string patientId)
+        /*public List<BillProjectUpload> GetBillProjects(long lngSendID,string hostName,string patientId)
         {
 
             List<BillProjectUpload> billList =   new List<BillProjectUpload>();
@@ -814,6 +788,6 @@ namespace ZLPlugin_LisPacs_MR
             }
 
             return billList;
-        }
+        }*/
     }
 }

+ 13 - 5
ZLPlugin_LisPacs_MR/Model/Codes.cs

@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
+
 namespace ZLPlugin_LisPacs_MR.Model
 {
     public class Codes
@@ -10,5 +6,17 @@ namespace ZLPlugin_LisPacs_MR.Model
         public string id { get; set; }
         public string code { get; set; }
         public string type { get; set; }
+
+        public string yzid { get; set; } // 医嘱id 
+        public string zlxmid { get; set; } //诊疗项目id
+        public string zxksid { get; set; } //执行科室id 
+        public string part { get; set; } //部位 
+        public string method { get; set; } //方法 
+        
+
+        public string yzContent { get; set; }  // 医嘱内容
+        public string doctorName { get; set; }  // 开单医生姓名
+
+
     }
 }

+ 1 - 5
ZLPlugin_LisPacs_MR/Model/UserInfo.cs

@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+
 
 namespace ZLPlugin_LisPacs_MR.Model
 {

+ 5 - 5
ZLPlugin_LisPacs_MR/Properties/AssemblyInfo.cs

@@ -4,10 +4,10 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("ZLPlugin_LisPacs_MR")]
-[assembly: AssemblyDescription("相同互认医嘱提示版本")]
+[assembly: AssemblyTitle("互认新加金额字段和其他三个字段")]
+[assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("zlsoft")]
 [assembly: AssemblyProduct("ZLPlugin_LisPacs_MR")]
 [assembly: AssemblyCopyright("Copyright ©  2024")]
 [assembly: AssemblyTrademark("")]
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.35.144")]
-[assembly: AssemblyFileVersion("1.4.35.144")]
+[assembly: AssemblyVersion("1.4.35.140")]
+[assembly: AssemblyFileVersion("1.0.1.1")]

+ 24 - 1
ZLPlugin_LisPacs_MR/Tools.cs

@@ -1,6 +1,7 @@
 using ADODB;
 using System;
-
+using System.Net;
+using System.Net.Sockets;
 using System.Windows.Forms;
 using ZLPlugin_LisPacs_MR.Domain.Units;
 using ZLPlugin_LisPacs_MR.Model;
@@ -10,6 +11,25 @@ namespace ZLPlugin_LisPacs_MR
     //工具类
     public class Tools
     {
+
+        //获取ip地址
+        public static string GetHostIp()
+        {
+            string hostName = Dns.GetHostName();
+            IPHostEntry ipHostInfo = Dns.GetHostEntry(hostName);
+            IPAddress[] ipAddresses = ipHostInfo.AddressList;
+
+            foreach (IPAddress ip in ipAddresses)
+            {
+                if (ip.AddressFamily == AddressFamily.InterNetwork)
+                {
+                    Console.WriteLine("本机 IP 地址:" + ip);
+                    return ip.ToString();
+                }
+            }
+            return hostName;
+        }
+
         public static string FormatStr(string str)
         {
             return str.Replace("\n", "").Replace("\t", "").Replace("\r", "");
@@ -184,7 +204,10 @@ namespace ZLPlugin_LisPacs_MR
                     value += "{";
                     for (var j = 0; j < rd.Fields.Count; j++)
                     {
+
+                        Log.Info("\"" + rd.Fields[j].Name + "\":\"" + rd.Fields[j].Value + "\",");
                         value += "\"" + rd.Fields[j].Name + "\":\"" + rd.Fields[j].Value + "\",";
+
                         //object obj = rd.Fields[j].Value;
                         //string val = obj.ToString().Trim();
                         //if (val == "")

+ 69 - 21
ZLPlugin_LisPacs_MR/clsPlugin.cs

@@ -81,10 +81,11 @@ namespace ZLPlugin_LisPacs_MR
                 Log.ClearLogAsyn().Start();
                 IsInit = true;
             }
-            Log.Info("  IsInit  end==");
-            Log.Info("Dns.GetHostName();==" + Dns.GetHostName());
-            Log.Info("id==" + Infos.UserInfo.ID);
-            Log.Info("编号==" + Infos.UserInfo.编号);
+          //  Log.Info("  IsInit  end==");
+          //  Log.Info("Dns.GetHostName();==" + Dns.GetHostName());
+           // Log.Info("Dns.GetHostIp();==" + Tools.GetHostIp());
+          //  Log.Info("id==" + Infos.UserInfo.ID);
+            Log.Info("用户名==" + Infos.UserInfo.用户名);
 
         }
         public void LogOutBefore()
@@ -103,13 +104,7 @@ namespace ZLPlugin_LisPacs_MR
             //'参数:lngSys,lngModual=当前调用接口的主程序系统号及模块号(1252=门诊医嘱下达(门诊没有“发送”模块),1254=住院医嘱发送)
             //'      lngPatientID=病人ID,lngClinicID=就诊ID(挂号记录ID)/主页ID(住院调用时)
             //'      lngSendID=发送号(病人医嘱发送.id)
-            Log.Info("AdviceSend   lngModual == "+ lngModual);
-            if (lngModual == 1254)
-            {
-
-                //这里 触发开单记录
-                return true;
-            }
+            Log.Info("AdviceSend   lngModual == "+ lngModual+ "  lngSys = " + lngSys+ " lngSendID = "+ lngSendID);
             SocketClient clientSend = new SocketClient("127.0.0.1", 6061);
             try
             {
@@ -139,7 +134,30 @@ namespace ZLPlugin_LisPacs_MR
                 {
                     hrType = 2;
                 }
-                Recordset rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType);
+                Log.Info("一共几条开单项目:" + listlis.Count);
+                Log.Info("一共几条开单项目:" + listpacs.Count);
+                
+                foreach (var item in listlis)
+                {
+                    //这里 触发开单记录   获取计算机名   患者id  开单项目  开单时间  发送号   计算机ip  单据号   备注(医嘱id)  类别  开单人   是否作废
+                    int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID,item.yzContent,lngSendID, Tools.GetHostIp(),"", item.id,"C",Infos.UserInfo.用户名);
+                }
+                foreach (var item in listpacs)
+                {
+                    //这里 触发开单记录   获取计算机名   患者id  开单项目  开单时间  发送号   计算机ip  单据号   备注(医嘱id)  类别  开单人   是否作废
+                    LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, item.yzContent, lngSendID, Tools.GetHostIp(), "", item.id, "D", Infos.UserInfo.用户名);
+                }
+                // 1254 是住院发送 
+                if (lngModual == 1254  || lngModual == 1252)
+                {
+                    //发送不需要
+                    Log.Info("发送只开单");
+                    return true;
+                }
+                string yzid = listlis[0].yzid;
+                string xgid = listlis[0].id;
+                string totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(yzid);
+                Recordset rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice, xgid);
                 string json = Tools.RecordsetToJson(rd);
                 clientSend.Send(json);
                 //Tools.Delay(10000, 0);
@@ -158,7 +176,7 @@ namespace ZLPlugin_LisPacs_MR
                     }
                     catch (Exception e)
                     {
-                        Log.Info("接收失败!" + e.Message);
+                    Log.Info("接收失败!" + e.Message);
                     }
                     if (timeSpan.TotalSeconds > 10 || !string.IsNullOrWhiteSpace(SocketClient.Message))
                     {
@@ -217,7 +235,7 @@ namespace ZLPlugin_LisPacs_MR
             //'      rsAdvice=当前病人本次新开或修改的所有医嘱记录,字段同AdviceEnter接口的该参数,除此之外,门诊调用时,还包含医嘱对应的诊断的疾病ID
             //'               字段 EditState  '1 - 新增,2-修改
             //'      int场合=0-医生站调用,1-护士站调用,2-医技站调用(PACS/LIS)
-            Log.Info("AdviceSave  lngModual=="+ lngModual);
+            Log.Info("AdviceSave  lngModual=="+ lngModual + "  lngSys = " + lngSys);
             rsAdvice.Filter = "";
             
             string str = Tools.GetAdviceSaveData(rsAdvice);
@@ -255,7 +273,12 @@ namespace ZLPlugin_LisPacs_MR
                 LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs);
                 Log.Info("code=="+code);
                 Recordset rd = new Recordset();
+                string xgid ="";
+                string yzid ="";
+                string zlxmid = "";
+                string totalPrice = "0";
                 int hrType = 0;
+
                 if (listlis.Count == 0 && listpacs.Count == 0)
                 {
                     return true;
@@ -263,25 +286,51 @@ namespace ZLPlugin_LisPacs_MR
                 else if (listlis.Count > 0 && listpacs.Count == 0)//只有检验
                 {
                     hrType = 1;
+                    yzid = listlis[0].yzid;
+                    xgid = listlis[0].id;
+                    zlxmid = listlis[0].zlxmid;
                 }
                 else if (listpacs.Count > 0 && listlis.Count == 0)//只有检查
                 {
                     hrType = 2;
+                    yzid = listpacs[0].yzid;
+                    xgid = listpacs[0].id;
+                    zlxmid = listpacs[0].zlxmid;
                 }
-
-                string xgId = listlis[0].id;
-
+                Log.Info("listpacs.Count"+ listpacs.Count);
+                Log.Info("listlis.Count" + listlis.Count);
+                Log.Info("lngModual=" + lngModual);
                 if (lngModual == 1253)//住院
                 {
-                    rd = LisPacs_MR_Bll.GetZYPostJson(lngPatientID, lngClinicID, code, hrType, xgId);
+                    if (hrType==1)
+                    {
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
+                    }
+                    else
+                    {
+
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method,1);
+                    }
+                     
+                    rd = LisPacs_MR_Bll.GetZYPostJson(lngPatientID, lngClinicID, code, hrType, totalPrice, xgid);
                 }
                 else
                 {
-                    rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, xgId);
+                    if (hrType == 1)
+                    {
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
+                    }
+                    else
+                    {
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method, 2);
+                    }
+                    rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice, xgid);
                 }
                 //SocketClient client = new SocketClient("127.0.0.1", 6061);
                 //Results result = new Results();
                 string json = Tools.RecordsetToJson(rd);
+
+                Log.Info("save发送json ===" + json);
                 socketClient.Send(json);
                 //Tools.Delay(waittingdate, 0);
                 bool status = true; int i = 0;
@@ -308,7 +357,6 @@ namespace ZLPlugin_LisPacs_MR
                     i++;
 
                 }
-                
                 Log.Info("22222"+SocketClient.Message);
 
                 Log.Info("退出循环!");
@@ -336,7 +384,7 @@ namespace ZLPlugin_LisPacs_MR
                     }
                     else
                     {
-                        MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
+                        //MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                         socketClient.Close();
                         return true;//此病人不存在互认信息
                     }

+ 4 - 0
ZLPlugin_LisPacs_MR/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net40" />
+</packages>