新增[URIT-8400]

This commit is contained in:
旺仔 2025-01-23 09:10:43 +08:00
parent 9d6e83be62
commit 0034524f75
2 changed files with 75 additions and 2 deletions

View File

@ -80,9 +80,10 @@
<add key="URIT-8460" value="PC-202106061449,URIT-8460,121,127.0.0.1,5600,GB18030" />
<!-- 尿常规URIT-500B -->
<add key="URIT-500B" value="wstwsy-PC,MA-4210,90,COM1,9600,NONE,8,1" />
<!-- BH-5380CRP -->
<add key="BH-5380CRP" value="PC-202106061449,BH-5380CRP,121,127.0.0.1,5600,GB18030" />
<add key="CurrentDevice" value="BH-5380CRP"/>
<!-- URIT-8400 -->
<add key="URIT-8400" value="CHINAMI-7VR1TBO,URIT-8400,121,192.169.13.27,5150,UTF-8" />
<add key="CurrentDevice" value="URIT-8400"/>
</appSettings>
</configuration>

View File

@ -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<examResultMode> ermList = new List<examResultMode>();
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数据接收