ecg图片pdf
This commit is contained in:
parent
244e5e58f4
commit
b6e1900460
@ -1,23 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="ftppath" value="ftp://47.94.80.150:21/"/>
|
<add key="ftppath" value="ftp://47.94.80.150:21/"/>
|
||||||
<add key="username" value="ecg"/>
|
<add key="username" value="ecg"/>
|
||||||
<add key="password" value="ecg"/>
|
<add key="password" value="ecg"/>
|
||||||
<add key="path1" value=""/>
|
<add key="path1" value=""/>
|
||||||
<add key="ecgHttpUrl" value=""/>
|
<add key="ecgHttpUrl" value=""/>
|
||||||
<!--服务启用的ip地址-->
|
<!--服务启用的ip地址-->
|
||||||
<add key="ip" value="0.0.0.0"/>
|
<add key="ip" value="0.0.0.0"/>
|
||||||
<!--服务启用端口-->
|
<!--服务启用端口-->
|
||||||
<add key="port" value="4050"/>
|
<add key="port" value="4050"/>
|
||||||
<!--是否屏幕输出信息-->
|
<!--是否屏幕输出信息-->
|
||||||
<add key="log" value="1"/>
|
<add key="log" value="1"/>
|
||||||
<!--保存心电报告路径-->
|
<!--保存心电报告路径-->
|
||||||
<add key="path" value=""/>
|
<add key="path" value=""/>
|
||||||
<!--HIS相关-->
|
<!--图片型心电报告[诊断结果]位置-->
|
||||||
<add key="flowygtUserName" value="tuguilaEcg" />
|
<add key="printecg_image__diagContent_point" value="1390,134"/>
|
||||||
<add key="flowygtUserPwd" value="Aa123456" />
|
<add key="printecg_image__diagContent_wrap" value="32"/>
|
||||||
<add key="flowygtLoginUrl" value="https://pacs.gw12320.com/flowygt/thirdLogin" />
|
<!--图片型心电报告[签名医生]位置-->
|
||||||
<add key="flowygtReportAddUrl" value="https://pacs.gw12320.com/flowygt/ecg/record/reportAdd" />
|
<add key="printecg_image__doctorName_point" value="3210,144"/>
|
||||||
</appSettings>
|
<add key="printecg_image__doctorNameImg_point" value="3218,148"/>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
|
<!--HIS相关-->
|
||||||
|
<add key="flowygtUserName" value="tuguilaEcg" />
|
||||||
|
<add key="flowygtUserPwd" value="Aa123456" />
|
||||||
|
<add key="flowygtLoginUrl" value="https://pacs.gw12320.com/flowygt/thirdLogin" />
|
||||||
|
<add key="flowygtReportAddUrl" value="https://pacs.gw12320.com/flowygt/ecg/record/reportAdd" />
|
||||||
|
</appSettings>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
|
@ -11,8 +11,8 @@ using System.Reflection.Emit;
|
|||||||
using 心电图绘制;
|
using 心电图绘制;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using 心电图绘制.Properties;
|
using 心电图绘制.Properties;
|
||||||
using 心电图绘制;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace _1200Gxml心电图绘制
|
namespace _1200Gxml心电图绘制
|
||||||
{
|
{
|
||||||
@ -59,19 +59,72 @@ namespace _1200Gxml心电图绘制
|
|||||||
//获取客户端传递的参数
|
//获取客户端传递的参数
|
||||||
// string data = request.Params == null ? "" : string.Join(";", request.Params.Select(x => x.Key + "=" + x.Value).ToArray());
|
// string data = request.Params == null ? "" : string.Join(";", request.Params.Select(x => x.Key + "=" + x.Value).ToArray());
|
||||||
string strMQName = string.Empty;
|
string strMQName = string.Empty;
|
||||||
LogHelper.Info("接收到请求", "");
|
//LogHelper.Info("接收到请求", "");
|
||||||
string data = "";
|
string data = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (request != null && request.Params != null)
|
if (request != null && request.Params != null)
|
||||||
{
|
{
|
||||||
|
//注意调整URL顺序
|
||||||
if (request.URL.Contains("printecg"))
|
if (request.URL.StartsWith(@"/printecg_image"))
|
||||||
|
{
|
||||||
|
JObject paramsObj = null;
|
||||||
|
string[] array = request.Params.Select(x => x.Value).ToArray();
|
||||||
|
if (array.Length > 0 && !string.IsNullOrWhiteSpace(array[0]))
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//LogHelper.Info("请求参数", array[0].Trim());
|
||||||
|
paramsObj = JsonConvert.DeserializeObject<JObject>(array[0].Trim());
|
||||||
|
}
|
||||||
|
catch (Exception ex) { paramsObj = null; }
|
||||||
|
if (paramsObj != null)
|
||||||
|
{
|
||||||
|
if (paramsObj.ContainsKey("filepath") &&
|
||||||
|
!string.IsNullOrWhiteSpace(paramsObj["filepath"] == null ? null : paramsObj["filepath"].ToString().Trim()))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log("开始处理请求:" + paramsObj["regid"].ToString().Trim());
|
||||||
|
print.GetEcgViewDataImage_img(paramsObj);
|
||||||
|
if (paramsObj["type"].ToString().Trim().Equals(@"1"))
|
||||||
|
{
|
||||||
|
data = print.imagebase;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data = print.filename;
|
||||||
|
}
|
||||||
|
Log("请求处理完成:" + paramsObj["regid"].ToString().Trim());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (false)
|
||||||
|
print.FlySubmit3(new PatientInfo()
|
||||||
|
{
|
||||||
|
regid = paramsObj["regid"].ToString().Trim(),
|
||||||
|
examid = paramsObj["examid"].ToString().Trim(),
|
||||||
|
diagContent = paramsObj["diagContent"] == null ? "" : paramsObj["diagContent"].ToString().Trim(),
|
||||||
|
orgid = paramsObj["orgid"] == null ? "" : paramsObj["orgid"].ToString().Trim(),
|
||||||
|
orgname = paramsObj["orgname"] == null ? "" : paramsObj["orgname"].ToString().Trim(),
|
||||||
|
doctorName = paramsObj["doctorName"] == null ? "" : paramsObj["doctorName"].ToString().Trim(),
|
||||||
|
isAbnormal = paramsObj["isAbnormal"] == null ? "" : paramsObj["isAbnormal"].ToString().Trim()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
|
}
|
||||||
|
catch (Exception ex) { data = "生成数据文件异常"; }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
data = "心电数据为空";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
data = "解析数据不正确";
|
||||||
|
}
|
||||||
|
else if (request.URL.StartsWith(@"/printecg"))
|
||||||
{
|
{
|
||||||
string[] array = request.Params.Select(x => x.Value).ToArray();
|
string[] array = request.Params.Select(x => x.Value).ToArray();
|
||||||
if (array.Length > 0)
|
if (array.Length > 0)
|
||||||
{
|
{
|
||||||
LogHelper.Info("请求参数", array[0]);
|
//LogHelper.Info("请求参数", array[0]);
|
||||||
PatientInfo patientInfo = JsonConvert.DeserializeObject<PatientInfo>(array[0]);
|
PatientInfo patientInfo = JsonConvert.DeserializeObject<PatientInfo>(array[0]);
|
||||||
print.cBoxSpeed = cBoxSpeed;
|
print.cBoxSpeed = cBoxSpeed;
|
||||||
print.cBoxAmplitude = cBoxAmplitude;
|
print.cBoxAmplitude = cBoxAmplitude;
|
||||||
@ -80,45 +133,58 @@ namespace _1200Gxml心电图绘制
|
|||||||
|
|
||||||
if (patientInfo != null)
|
if (patientInfo != null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(patientInfo.filepath))
|
if (!string.IsNullOrWhiteSpace(patientInfo.filepath))
|
||||||
{
|
{
|
||||||
Log("开始处理请求:" + patientInfo.regid);
|
try
|
||||||
Image image = null;
|
|
||||||
if (!string.IsNullOrEmpty(patientInfo.image))
|
|
||||||
{
|
{
|
||||||
image = UniversalFun.ConvertFromBase64String(patientInfo.image);
|
Log("开始处理请求:" + patientInfo.regid);
|
||||||
|
Image image = null;
|
||||||
|
if (!string.IsNullOrWhiteSpace(patientInfo.image))
|
||||||
|
{
|
||||||
|
image = UniversalFun.ConvertFromBase64String(patientInfo.image);
|
||||||
|
}
|
||||||
|
string ecgDataJsonStr = UniversalFun.GetTextFileContent(patientInfo.filepath);
|
||||||
|
print.GetEcgViewDataImage(image, "", patientInfo, patientInfo.type, ecgDataJsonStr);
|
||||||
|
if (patientInfo.type == 1)
|
||||||
|
{
|
||||||
|
data = print.imagebase;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data = print.filename;
|
||||||
|
}
|
||||||
|
Log("请求处理完成:" + patientInfo.regid);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (false)
|
||||||
|
{
|
||||||
|
patientInfo.diagContent = patientInfo.diagContent == null ? "" : patientInfo.diagContent.Trim();
|
||||||
|
patientInfo.orgid = patientInfo.orgid == null ? "" : patientInfo.orgid.Trim();
|
||||||
|
patientInfo.orgname = patientInfo.orgname == null ? "" : patientInfo.orgname.Trim();
|
||||||
|
patientInfo.doctorName = patientInfo.doctorName == null ? "" : patientInfo.doctorName.Trim();
|
||||||
|
patientInfo.isAbnormal = patientInfo.isAbnormal == null ? "" : patientInfo.isAbnormal.Trim();
|
||||||
|
print.FlySubmit3(patientInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
}
|
}
|
||||||
string ecgDataJsonStr = UniversalFun.GetTextFileContent(patientInfo.filepath);
|
catch (Exception ex) { data = "生成数据文件异常"; }
|
||||||
print.GetEcgViewDataImage(image, "", patientInfo, patientInfo.type, ecgDataJsonStr);
|
|
||||||
if (patientInfo.type == 1)
|
|
||||||
{
|
|
||||||
data = print.imagebase;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data = print.filename;
|
|
||||||
}
|
|
||||||
Log("请求处理完成:" + patientInfo.regid);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = "心电数据为空";
|
data = "心电数据为空";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = "解析数据不正确";
|
data = "解析数据不正确";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = "非指定请求方法";
|
data = "非指定请求方法";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -127,7 +193,7 @@ namespace _1200Gxml心电图绘制
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LogHelper.Info("OnPost Error:", e.Message);
|
//LogHelper.Info("OnPost Error:", e.Message);
|
||||||
}
|
}
|
||||||
//设置返回信息
|
//设置返回信息
|
||||||
string content = data; //string.Format("<vtma><result>0000</result><desc>Successful!</desc><data><outputXml>{0}</outputXml></data></vtma>", data);
|
string content = data; //string.Format("<vtma><result>0000</result><desc>Successful!</desc><data><outputXml>{0}</outputXml></data></vtma>", data);
|
||||||
@ -146,7 +212,7 @@ namespace _1200Gxml心电图绘制
|
|||||||
public override void OnGet(HttpRequest request, HttpResponse response)
|
public override void OnGet(HttpRequest request, HttpResponse response)
|
||||||
{
|
{
|
||||||
|
|
||||||
LogHelper.Info("请求到接口", "");
|
//LogHelper.Info("请求到接口", "");
|
||||||
|
|
||||||
//当文件不存在时应返回404状态码
|
//当文件不存在时应返回404状态码
|
||||||
string requestURL = request.URL;
|
string requestURL = request.URL;
|
||||||
|
@ -62,11 +62,13 @@ namespace 心电图绘制
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图片转换成PDF
|
/// 图片转换成PDF
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// Margins默认值36
|
||||||
/// <param name="bitmap"></param>
|
/// <param name="bitmap"></param>
|
||||||
/// <param name="pdfPath"></param>
|
/// <param name="pdfPath"></param>
|
||||||
public static void ConvertBitmapToPdf(Bitmap bitmap, string pdfPath)
|
public static void ConvertBitmapToPdf(Bitmap bitmap, string pdfPath,
|
||||||
|
float? width = null, float? height = null,
|
||||||
|
float? marginLeft = null, float? marginRight = null, float? marginTop = null, float? marginBottom = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
string directoryPath = Path.GetDirectoryName(pdfPath);
|
string directoryPath = Path.GetDirectoryName(pdfPath);
|
||||||
if (directoryPath != null && !Directory.Exists(directoryPath))
|
if (directoryPath != null && !Directory.Exists(directoryPath))
|
||||||
{
|
{
|
||||||
@ -74,6 +76,8 @@ namespace 心电图绘制
|
|||||||
}
|
}
|
||||||
// 创建一个文档对象
|
// 创建一个文档对象
|
||||||
Document document = new Document();
|
Document document = new Document();
|
||||||
|
if (marginLeft != null && marginRight != null && marginTop != null && marginBottom != null)
|
||||||
|
document.SetMargins(marginLeft.Value, marginRight.Value, marginTop.Value, marginBottom.Value);
|
||||||
|
|
||||||
// 创建一个PdfWriter实例
|
// 创建一个PdfWriter实例
|
||||||
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pdfPath, FileMode.Create));
|
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pdfPath, FileMode.Create));
|
||||||
@ -81,7 +85,8 @@ namespace 心电图绘制
|
|||||||
// 打开文档以便添加内容
|
// 打开文档以便添加内容
|
||||||
document.Open();
|
document.Open();
|
||||||
// 设置页面尺寸与图像尺寸一致
|
// 设置页面尺寸与图像尺寸一致
|
||||||
iTextSharp.text.Rectangle pageSize = new iTextSharp.text.Rectangle(bitmap.Width, bitmap.Height + 50);
|
iTextSharp.text.Rectangle pageSize = new iTextSharp.text.Rectangle(width != null ? width.Value : bitmap.Width,
|
||||||
|
height != null ? height.Value : (bitmap.Height + 50));
|
||||||
document.SetPageSize(pageSize);
|
document.SetPageSize(pageSize);
|
||||||
// 将Bitmap转换为iTextSharp的Image对象
|
// 将Bitmap转换为iTextSharp的Image对象
|
||||||
iTextSharp.text.Image image = ConvertBitmapToImageSharp(bitmap);
|
iTextSharp.text.Image image = ConvertBitmapToImageSharp(bitmap);
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
using _1200Gxml心电图绘制;
|
using _1200Gxml心电图绘制;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using 心电图绘制;
|
using 心电图绘制;
|
||||||
@ -75,6 +79,101 @@ namespace 心电图绘制
|
|||||||
return quotients;
|
return quotients;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得心电诊断快照数据
|
||||||
|
/// </summary>
|
||||||
|
public void GetEcgViewDataImage_img(JObject paramsObj)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Bitmap bmp = null;
|
||||||
|
Graphics gfx = null;
|
||||||
|
using (HttpClient client_web = new HttpClient(new HttpClientHandler
|
||||||
|
{
|
||||||
|
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
|
||||||
|
}))
|
||||||
|
{
|
||||||
|
byte[] imageData = client_web.GetByteArrayAsync(paramsObj["filepath"].ToString().Trim()).Result;
|
||||||
|
using (MemoryStream stream = new MemoryStream(imageData, false))
|
||||||
|
{
|
||||||
|
using (bmp = new Bitmap(stream))
|
||||||
|
{
|
||||||
|
bmp.SetResolution(_printDpi, _printDpi);
|
||||||
|
using (gfx = Graphics.FromImage(bmp))
|
||||||
|
{
|
||||||
|
gfx.SmoothingMode = SmoothingMode.AntiAlias;//抗锯齿
|
||||||
|
|
||||||
|
Font font = new Font(@"微软雅黑", float.Parse(@"9.8"));
|
||||||
|
Brush brush = Brushes.Black;
|
||||||
|
PointF? point = null;
|
||||||
|
|
||||||
|
//image
|
||||||
|
Image image = null;
|
||||||
|
if (paramsObj["image"] != null && !string.IsNullOrWhiteSpace(paramsObj["image"].ToString().Trim()))
|
||||||
|
{
|
||||||
|
try { image = UniversalFun.ConvertFromBase64String(paramsObj["image"].ToString().Trim()); }
|
||||||
|
catch (Exception ex) { image = null; }
|
||||||
|
}
|
||||||
|
if (true)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (image == null)
|
||||||
|
{
|
||||||
|
point = new PointF(float.Parse(ConfigurationManager.AppSettings["printecg_image__doctorName_point"].Split(',')[0].Trim()),
|
||||||
|
float.Parse(ConfigurationManager.AppSettings["printecg_image__doctorName_point"].Split(',')[1].Trim()));
|
||||||
|
gfx.DrawString(paramsObj["doctorName"] == null ? "" : paramsObj["doctorName"].ToString().Trim(), font, brush, point.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
point = new PointF(float.Parse(ConfigurationManager.AppSettings["printecg_image__doctorNameImg_point"].Split(',')[0].Trim()),
|
||||||
|
float.Parse(ConfigurationManager.AppSettings["printecg_image__doctorNameImg_point"].Split(',')[1].Trim()));
|
||||||
|
using (Bitmap bmpSource = new Bitmap(image, 160, 80))
|
||||||
|
{
|
||||||
|
bmpSource.SetResolution(_printDpi, _printDpi);
|
||||||
|
gfx.DrawImage(bmpSource, point.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
|
|
||||||
|
//diagContent
|
||||||
|
string diagContent = paramsObj["diagContent"] == null ? "" : paramsObj["diagContent"].ToString().Trim();
|
||||||
|
string[] diagArray = diagContent.Split(Environment.NewLine.ToCharArray());
|
||||||
|
diagContent = string.Empty;
|
||||||
|
for (int i = 0; i < diagArray.Length; i++) diagContent += diagArray[i].Trim();
|
||||||
|
int wrap = 0;
|
||||||
|
if (!int.TryParse(ConfigurationManager.AppSettings["printecg_image__diagContent_wrap"], out wrap))
|
||||||
|
wrap = 0;
|
||||||
|
diagContent = stringWrap(diagContent, wrap);
|
||||||
|
point = new PointF(float.Parse(ConfigurationManager.AppSettings["printecg_image__diagContent_point"].Split(',')[0].Trim()),
|
||||||
|
float.Parse(ConfigurationManager.AppSettings["printecg_image__diagContent_point"].Split(',')[1].Trim()));
|
||||||
|
gfx.DrawString(diagContent, font, brush, point.Value);
|
||||||
|
|
||||||
|
switch (paramsObj["type"].ToString().Trim())
|
||||||
|
{
|
||||||
|
case "1"://返回base64
|
||||||
|
imagebase = UniversalFun.ConvertToBase64String(bmp, ImageFormat.Jpeg);
|
||||||
|
break;
|
||||||
|
case "2"://生成pdf
|
||||||
|
string path = string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["path"]) ? Application.StartupPath : ConfigurationManager.AppSettings["path"].Trim();
|
||||||
|
UniversalFun.ConvertBitmapToPdf(bmp, path + @"\" + paramsObj["examid"].ToString().Trim() + @"\" + paramsObj["examid"].ToString().Trim() + ".pdf",
|
||||||
|
bmp.Width + 4, bmp.Height + 4, 2, 0, 2, 0);
|
||||||
|
filename = @"/" + paramsObj["examid"].ToString().Trim() + @"/" + paramsObj["examid"].ToString().Trim() + ".pdf";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得心电诊断快照数据
|
/// 获得心电诊断快照数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -350,7 +449,6 @@ namespace 心电图绘制
|
|||||||
return submitInfoToFLY6(FER);
|
return submitInfoToFLY6(FER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提交诊断结论到福乐云
|
/// 提交诊断结论到福乐云
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -362,5 +460,18 @@ namespace 心电图绘制
|
|||||||
string resultStr = commonOptions.PostByParas(ConfigurationManager.AppSettings["flowygtReportAddUrl"], token, jsonContent);
|
string resultStr = commonOptions.PostByParas(ConfigurationManager.AppSettings["flowygtReportAddUrl"], token, jsonContent);
|
||||||
return resultStr;
|
return resultStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string stringWrap(string input, int maxCharactersPerLine)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(input)) input = "";
|
||||||
|
input = input.Trim().Trim(Environment.NewLine.ToCharArray()).Trim();
|
||||||
|
if (maxCharactersPerLine >= 1)
|
||||||
|
{
|
||||||
|
string pattern = $".{{1,{maxCharactersPerLine}}}";
|
||||||
|
return Regex.Replace(input, pattern, m => $"{m.Value + Environment.NewLine}").Trim(Environment.NewLine.ToCharArray()).TrimEnd();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user