Просмотр исходного кода

获取lis报告代码封装开发

zzh_love 7 месяцев назад
Родитель
Сommit
2294dd3100
2 измененных файлов с 87 добавлено и 5 удалено
  1. 24 3
      LisPacsDataUpload/Form1.cs
  2. 63 2
      LisPacsDataUpload/business/PdfUtils.cs

+ 24 - 3
LisPacsDataUpload/Form1.cs

@@ -1,6 +1,7 @@
 using Common;
 using iTextSharp.text;
 using iTextSharp.text.pdf;
+using LisPacsDataUpload.business;
 using LisPacsDataUpload.Models;
 using Newtonsoft.Json;
 using System;
@@ -275,6 +276,7 @@ namespace LisPacsDataUpload
 
             if (UploadPacs == 1)//没传影像云的需要上传检查
             {
+                LogHelper.Info("没传影像云的需要上传检查");
                 Thread thp = new Thread(new ThreadStart(PacsUpload));
                 thp.IsBackground = true;
                 thp.Name = "PACS" + Tools.GuidTo16String();
@@ -400,6 +402,10 @@ namespace LisPacsDataUpload
                         int uploaded = 0;
                         for (int i = 0; i < dt.Rows.Count; i++)
                         {
+                            //获取标本号 和报表编号
+                            dt.Rows[i]["bbid"].ToString();
+                            PdfUtils.getPdfParamByLisVersion(lisSource, 111);
+
                             string orgName = dt.Rows[i]["orgName"].ToString();
                             string name = dt.Rows[i]["patientName"].ToString();
                             string sex = dt.Rows[i]["sex"].ToString();
@@ -1480,7 +1486,14 @@ namespace LisPacsDataUpload
                                               a.patientName ,
                                               a.patientSex  ,
                                               a.patientBirthday ,
-                                              a.regionHr
+                                              a.regionHr,
+                                                a.HEALTHNO,  
+                                                a.MEDICARENO ,  
+                                                a.ACCESSNUMBER,  
+                                                a.CONCLUSION,  
+                                                a.BRIEFHISTORY, 
+                                                a.ISIMAGESERVICE,  
+                                                a.STUDYUID  
                                               from pacs_upload a ,已上传PDF b 
                                                 where b.businessnumber = a.BUSINESSNUMBER 
                                                 and b.reportid = a.REPORTID 
@@ -1549,7 +1562,8 @@ namespace LisPacsDataUpload
 
                     #region 2、补传失败数据
                     //上传数据
-
+                    LogHelper.Info("PACS补传失败数据");
+                        
                     string pc_sql = @"select
                                               a.patientAge  ,
                                               a.ageUnit ,
@@ -1621,7 +1635,14 @@ namespace LisPacsDataUpload
                                               a.patientName ,
                                               a.patientSex  ,
                                               a.patientBirthday ,
-                                              a.regionHr
+                                              a.regionHr,
+                                                a.HEALTHNO,  
+                                                a.MEDICARENO ,  
+                                                a.ACCESSNUMBER,  
+                                                a.CONCLUSION,  
+                                                a.BRIEFHISTORY, 
+                                                a.ISIMAGESERVICE,  
+                                                a.STUDYUID  
                                               from pacs_upload a ,已上传PDF b 
                                                 where b.businessnumber = a.BUSINESSNUMBER 
                                                 and b.reportid = a.REPORTID 

+ 63 - 2
LisPacsDataUpload/business/PdfUtils.cs

@@ -1,5 +1,8 @@
-using System;
+using Common;
+using LisPacsDataUpload.Models.Report;
+using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 
@@ -16,26 +19,84 @@ namespace LisPacsDataUpload.business
         /// <returns></returns>
         public static string getPdfParamByLisVersion(int lisVersion,long yzid)
         {
+            Paramater paramter = new Paramater
+            {
+                ZlSysCode = 2500,
+                PdfPath = $"pdf={AppDomain.CurrentDomain.BaseDirectory}PDF\\Report\\LIS{yzid}.pdf"
+            };
+            
             if (lisVersion==0)
             {
+                //老版lis
 
+                /* Select Distinct 'ZLCISBILL' || Trim(To_Char(b.编号, '00000')) || '-2' 报表编号, a.相关id, d.id 标本id
+  From 病人医嘱记录 A,检验标本记录 d, 病历文件列表 B, 病历单据应用 C
+  Where a.诊疗项目id = c.诊疗项目id And a.病人来源 = c.应用场合 And c.病历文件id = b.Id And a.Id = :id and a.相关id = d.医嘱id*/
+                var id = "";  // 标本id
+                paramter.Params.Add(new SubParameter { Param = $"标本id={id}" });
             }
             else if (lisVersion == 1)
             {
+                // 新版lis
+               /* Select distinct 'ZLLISBILL00' || Decode(b.病人来源, 2, c.住院单据, 3, c.体检单据, 4, c.院外单据, c.门诊单据) || '-2' 报表编号, a.Id 标本id
+From 检验报告记录 A, 检验申请组合 B, 检验仪器记录 C
+Where  a.Id = b.标本id And a.仪器id = c.Id And b.医嘱id = :id*/
 
             }
             else if (lisVersion == 2)
             {
+                //专业版临生免
+
 
             }
             else
             {
-                
+                // 三方lis
             }
 
             return null;
         }
 
+        public bool GeneratePdf()
+        {
+            // 定义要启动的外部程序的路径
+            string exePath = @"C:\Path\To\Your\Program.exe";
+
+            // 定义要传递给外部程序的参数
+            string arguments = "strJson value1";
+
+            // 创建一个新的 ProcessStartInfo 对象
+            ProcessStartInfo startInfo = new ProcessStartInfo
+            {
+                FileName = exePath, // 设置要启动的程序路径
+                Arguments = arguments, // 设置传递给程序的参数
+                RedirectStandardOutput = false, // 是否重定向标准输出(根据需要设置)
+                RedirectStandardError = false, // 是否重定向标准错误(根据需要设置)
+                UseShellExecute = true, // 是否使用操作系统的 shell 启动进程(通常设置为 true)
+                CreateNoWindow = true // 是否创建窗口(如果不需要显示窗口,可以设置为 true)
+            };
+            try
+            {
+                // 启动外部程序
+                using (Process process = Process.Start(startInfo))
+                {
+                    // 如果需要等待程序结束,可以使用 process.WaitForExit()
+                    LogHelper.Info("生成lis报告中");
+                    process.WaitForExit();
+                    LogHelper.Info("成功生成lis报告");
+                    // 如果需要读取输出或错误,可以在这里处理
+                    // string output = process.StandardOutput.ReadToEnd();
+                    // string error = process.StandardError.ReadToEnd();
+                }
+            }
+            catch (Exception ex)
+            {
+                // 处理异常,例如文件未找到、路径错误等
+                LogHelper.Info("启动外部程序时出错: " + ex.Message);
+            }
+            return true;
+        }
+
 
     }
 }