From 0034524f754e34afac480c83a12333f2d8335831 Mon Sep 17 00:00:00 2001
From: lichuanyang <1176537920@qq.com>
Date: Thu, 23 Jan 2025 09:10:43 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E[URIT-8400]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.config | 5 ++--
deviceAnalysis.cs | 72 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/app.config b/app.config
index 29f44e9..2c78d73 100644
--- a/app.config
+++ b/app.config
@@ -80,9 +80,10 @@
-
-
+
+
+
diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs
index 609a1aa..05d1406 100644
--- a/deviceAnalysis.cs
+++ b/deviceAnalysis.cs
@@ -2296,6 +2296,46 @@ namespace FlyDockTool
else
dataOutPutShow("数据提交失败:" + jsonStr, null);
}
+ if (apiOptions.CurrentDevice == "URIT-8400")//URIT-8400
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ string sampleNo1 = string.Empty;//样本号
+
+ List ermList = new List();
+ string[] itemArray = new string[] { "ALT/AST", "ALT", "AST", "TB", "UREA", "CRE", "GLU", "TG", "CHOL", "HDL_C", "LDL_C" };
+
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ itemStr = @"|" + itemArray[i] + @"|";
+
+ string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"), 30);
+ sampleNo1 = val1.Split('|')[3];
+ if (sampleNo1.Length >= 9)
+ sampleNo1 = sampleNo1.Substring(8, sampleNo1.Length - 8).TrimStart('0');
+ string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = sampleNo1;
+ erm1.testDate = testDate1;
+ erm1.chanelNo = itemArray[i];//项目代号
+ erm1.itemValue = jiexiVal(deviceDataStr.IndexOf(itemStr), itemStr, deviceDataStr).ToString();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据提交失败:" + jsonStr, null);
+ }
if (apiOptions.CurrentDevice == "BS-460")//生化BS-460
{
string MachineCode = apiOptions.MachineCode;
@@ -3282,6 +3322,22 @@ namespace FlyDockTool
}
_tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
}
+ if (apiOptions.CurrentDevice == "URIT-8400")//URIT-8400
+ {
+ // 设置IP地址和端口号
+ string tcp_ip = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[3];
+ string tcp_port = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[4];
+ IPAddress ipAddress = IPAddress.Parse(tcp_ip);
+ // IPAddress ipAddress = IPAddress.Any;
+ //// 创建一个监听Socket
+ if (listener == null)
+ {
+ listener = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+ listener.Bind(new IPEndPoint(ipAddress, int.Parse(tcp_port)));
+ listener.Listen(10000);
+ }
+ _tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
+ }
if (apiOptions.CurrentDevice == "hhh5")//BC-5130
{
// 设置IP地址和端口号
@@ -3538,6 +3594,17 @@ namespace FlyDockTool
if (!string.IsNullOrWhiteSpace(tempData_temp))
deviceAnalysisOption(tempData_temp);
}
+ if (apiOptions.CurrentDevice == "URIT-8400")//URIT-8400
+ {
+ string str_temp = string.IsNullOrWhiteSpace(tempData) ? string.Empty : tempData.Trim().Replace("\r", "").Replace("\n", "");
+ if (str_temp.Contains(@"|LDL_C|"))
+ {
+ string tempData_temp = tempData;
+ tempData = string.Empty;
+ if (!string.IsNullOrWhiteSpace(tempData_temp))
+ deviceAnalysisOption(tempData_temp);
+ }
+ }
if (apiOptions.CurrentDevice == "BS-460")//生化BS-460
{
//File.WriteAllText("deviceDataLog.txt", deviceDataStr, Encoding.GetEncoding("GB18030"));
@@ -3927,6 +3994,11 @@ namespace FlyDockTool
_tcpResult.Change(-1, 10);//停止tcp数据接收
clientSocket.Close();
}
+ if (apiOptions.CurrentDevice == "URIT-8400")//URIT-8400
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
if (apiOptions.CurrentDevice == "BS-460")//生化BS-460
{
_tcpResult.Change(-1, 10);//停止tcp数据接收