|
@@ -404,19 +404,31 @@ namespace LisPacsDataUpload
|
|
|
int uploaded = 0;
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- //获取标本号 和报表编号
|
|
|
- string reportNumber = dt.Rows[i]["reportNumber"].ToString(); //报告编号
|
|
|
- string bbid = dt.Rows[i]["bbid"].ToString(); // 标本id
|
|
|
//生成pdf
|
|
|
-
|
|
|
-
|
|
|
- string GeneratePdfUrl = PdfUtils.GeneratePdf(lisSource, reportNumber, bbid);
|
|
|
- if (!GeneratePdfUrl.Contains(".pdf") )
|
|
|
+ string GeneratePdfUrl = "未生成pdf成功";
|
|
|
+ if (zlhr == zlhrConstant_true)
|
|
|
{
|
|
|
- LogHelper.Info("生成pdf失败,原因是 = " + GeneratePdfUrl);
|
|
|
- continue ;
|
|
|
+ string requestId = dt.Rows[i]["requestId"].ToString(); // 临生免报告id
|
|
|
+ string sql_zlhr = @"select dr.id as id from specimen_rec sr, diagnosticreport_rec dr where sr.id = dr.specmids::int
|
|
|
+ and dr.status in ('3003', '3004') and sr.id = " + requestId;
|
|
|
+ DataTable dt_lis = OracleHelper<object>.PgQueryDS(sql_zlhr);
|
|
|
+ string reportId = dt_lis.Rows[0]["id"].ToString();
|
|
|
+ GeneratePdfUrl = PdfUtils.GeneratePdf(lisSource, reportId, reportId);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //获取标本号 和报表编号
|
|
|
+ string reportNumber = dt.Rows[i]["reportNumber"].ToString(); //报告编号
|
|
|
+ string bbid = dt.Rows[i]["bbid"].ToString(); // 标本id
|
|
|
+ GeneratePdfUrl = PdfUtils.GeneratePdf(lisSource, reportNumber, bbid);
|
|
|
+ if (!GeneratePdfUrl.Contains(".pdf"))
|
|
|
+ {
|
|
|
+ LogHelper.Info("生成pdf失败,原因是 = " + GeneratePdfUrl);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ LogHelper.Info("生成pdf成功,地址为 = " + GeneratePdfUrl);
|
|
|
}
|
|
|
- LogHelper.Info("生成pdf成功,地址为 = " + GeneratePdfUrl);
|
|
|
/*string orgName = dt.Rows[i]["orgName"].ToString();
|
|
|
string name = dt.Rows[i]["patientName"].ToString();
|
|
|
string sex = dt.Rows[i]["sex"].ToString();
|
|
@@ -485,9 +497,17 @@ namespace LisPacsDataUpload
|
|
|
}
|
|
|
|
|
|
//最新调整 需要获取 原始pdf 文件 存在场景 有三方lis、中联lis 、 以及专业版临生免 的报告 三种
|
|
|
-
|
|
|
+ string attachmentFile = "";
|
|
|
+ if (zlhr == zlhrConstant_true)
|
|
|
+ {
|
|
|
+ attachmentFile = GeneratePdfUrl;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ attachmentFile = Tools.FileToBase64Str(GeneratePdfUrl);
|
|
|
+ }
|
|
|
//上传文件
|
|
|
- string file_json = "{\"attachmentType\":\".pdf\",\"attachmentName\":\"检验报告\",\"businessType\":\"A001\",\"attachmentFile\":\"" + Tools.FileToBase64Str(GeneratePdfUrl) + "\"}";
|
|
|
+ string file_json = "{\"attachmentType\":\".pdf\",\"attachmentName\":\"检验报告\",\"businessType\":\"A001\",\"attachmentFile\":\"" + attachmentFile + "\"}";
|
|
|
string file_vi = Tools.GuidTo16String();
|
|
|
file_json = Tools.AESEncrypt(file_json, Tools.pwd, file_vi);
|
|
|
string file_url = "http://40.26.204.3:8084/phimp-napi/attachMent/upload";
|
|
@@ -1006,7 +1026,35 @@ namespace LisPacsDataUpload
|
|
|
int uploaded = 0;
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- string orgName = dt.Rows[i]["orgName"].ToString();
|
|
|
+
|
|
|
+ //获取标本号 和报表编号
|
|
|
+ string reportNumber = dt.Rows[i]["reportNumber"].ToString(); //报告编号
|
|
|
+ string bbid = dt.Rows[i]["bbid"].ToString(); // 标本id
|
|
|
+ //生成pdf
|
|
|
+ string GeneratePdfUrl = "未生成pdf成功";
|
|
|
+ if (zlhr == zlhrConstant_true)
|
|
|
+ {
|
|
|
+ string requestId = dt.Rows[i]["requestId"].ToString(); // 临生免报告id
|
|
|
+ string sql_zlhr = @"select dr.id from specimen_rec sr, diagnosticreport_rec dr where sr.id = dr.specmids::int
|
|
|
+ dr.status in ('3003', '3004') and and sr.id = " + requestId;
|
|
|
+ DataTable dt_lis = OracleHelper<object>.RunQueryDS(sql_zlhr);
|
|
|
+ string reportId = dt_lis.Rows[0]["id"].ToString();
|
|
|
+
|
|
|
+ GeneratePdfUrl = PdfUtils.GeneratePdf(lisSource, reportId, reportId);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GeneratePdfUrl = PdfUtils.GeneratePdf(lisSource, reportNumber, bbid);
|
|
|
+ if (!GeneratePdfUrl.Contains(".pdf"))
|
|
|
+ {
|
|
|
+ LogHelper.Info("生成pdf失败,原因是 = " + GeneratePdfUrl);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ LogHelper.Info("生成pdf成功,地址为 = " + GeneratePdfUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*string orgName = dt.Rows[i]["orgName"].ToString();
|
|
|
string name = dt.Rows[i]["patientName"].ToString();
|
|
|
string sex = dt.Rows[i]["sex"].ToString();
|
|
|
string ch = dt.Rows[i]["bedNo"].ToString();
|
|
@@ -1066,15 +1114,23 @@ namespace LisPacsDataUpload
|
|
|
this.SetText(ShowLog);
|
|
|
LogHelper.Info(ShowLog);
|
|
|
continue;
|
|
|
- }
|
|
|
+ }*/
|
|
|
//是否授权
|
|
|
if (!isAuthorization())
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+ string attachmentFile = "";
|
|
|
+ if (zlhr==zlhrConstant_true)
|
|
|
+ {
|
|
|
+ attachmentFile = GeneratePdfUrl;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ attachmentFile=Tools.FileToBase64Str(GeneratePdfUrl);
|
|
|
+ }
|
|
|
//上传文件
|
|
|
- string file_json = "{\"attachmentType\":\".pdf\",\"attachmentName\":\"检验报告\",\"businessType\":\"A001\",\"attachmentFile\":\"" + Tools.FileToBase64Str(res) + "\"}";
|
|
|
+ string file_json = "{\"attachmentType\":\".pdf\",\"attachmentName\":\"检验报告\",\"businessType\":\"A001\",\"attachmentFile\":\"" + attachmentFile + "\"}";
|
|
|
string file_vi = Tools.GuidTo16String();
|
|
|
file_json = Tools.AESEncrypt(file_json, Tools.pwd, file_vi);
|
|
|
string file_url = "http://40.26.204.3:8084/phimp-napi/attachMent/upload";
|