新增BS-330E
This commit is contained in:
parent
5c5940913c
commit
bc58e34d40
@ -2127,6 +2127,53 @@ namespace FlyDockTool
|
|||||||
dataOutPutShow("数据提交失败:" + jsonStr, null);
|
dataOutPutShow("数据提交失败:" + jsonStr, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (apiOptions.CurrentDevice == "BS-330E")//BS-330E 他是一次性发一条样本 但一个样本号有多个项目 挨个发其中的项目 生化
|
||||||
|
{
|
||||||
|
string MachineCode = apiOptions.MachineCode;
|
||||||
|
string MachineID = apiOptions.MachineID;
|
||||||
|
List<examResultMode> ermList = new List<examResultMode>();
|
||||||
|
string[] itemArray = new string[10] { "ALT", "AST", "T-Bil", "UA", "UREA", "CREA-S", "TC", "TG", "HDL-C", "LDL-C" };
|
||||||
|
//string[] resulteArray = deviceDataStr.Split('\n');
|
||||||
|
//deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
|
||||||
|
string[] valArray = deviceDataStr.Split('');
|
||||||
|
string sampleNo1 = string.Empty;//样本号
|
||||||
|
string itemStr = string.Empty;
|
||||||
|
string itemValue = string.Empty;
|
||||||
|
for (int i = 0; i < itemArray.Length; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < valArray.Length; j++)
|
||||||
|
{
|
||||||
|
if (itemArray[i] == valArray[j].Substring(valArray[j].IndexOf("OBX|1|NM|")).Split('|')[4])
|
||||||
|
{
|
||||||
|
sampleNo1 = valArray[j].Substring(valArray[j].IndexOf("OBR|1||") + "OBR|1||".Length, valArray[j].IndexOf("|Mindray^BS-330E|") - valArray[j].IndexOf("OBR|1||") - "OBR|1||".Length).Trim();
|
||||||
|
itemStr = valArray[j].Substring(valArray[j].IndexOf("OBX|1|NM|")).Split('|')[4];
|
||||||
|
itemValue = valArray[j].Substring(valArray[j].IndexOf("OBX|1|NM|")).Split('|')[5];
|
||||||
|
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 = itemStr;//项目代号
|
||||||
|
erm1.itemValue = itemValue;
|
||||||
|
erm1.itemUnit = "";
|
||||||
|
ermList.Add(erm1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//将结果提交到LIS系统
|
||||||
|
baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
|
||||||
|
string jsonStr = JsonConvert.SerializeObject(ermList);
|
||||||
|
|
||||||
|
|
||||||
|
if (bmm1.code == 200)
|
||||||
|
dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
|
||||||
|
else
|
||||||
|
dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
return rerultJson;
|
return rerultJson;
|
||||||
}
|
}
|
||||||
@ -2607,6 +2654,22 @@ namespace FlyDockTool
|
|||||||
SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
|
SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
|
||||||
SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
|
SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
|
||||||
}
|
}
|
||||||
|
if (apiOptions.CurrentDevice == "BS-330E")//BS-330E 生化
|
||||||
|
{
|
||||||
|
// 设置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毫秒频率
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2729,6 +2792,14 @@ namespace FlyDockTool
|
|||||||
{
|
{
|
||||||
_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
|
_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
|
||||||
}
|
}
|
||||||
|
if (apiOptions.CurrentDevice == "BS-330E")//BS-330E
|
||||||
|
{
|
||||||
|
if (tempData.Split('').Length>=12&&tempData.Contains("LDL-C"))
|
||||||
|
{
|
||||||
|
deviceAnalysisOption(tempData);
|
||||||
|
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -3052,7 +3123,11 @@ namespace FlyDockTool
|
|||||||
{
|
{
|
||||||
SerialPortOption.CreateInstance().StopDataReadThread();//停止数据接收
|
SerialPortOption.CreateInstance().StopDataReadThread();//停止数据接收
|
||||||
}
|
}
|
||||||
|
if (apiOptions.CurrentDevice == "BS-330E")//BS-330E
|
||||||
|
{
|
||||||
|
_tcpResult.Change(-1, 10);//停止tcp数据接收
|
||||||
|
clientSocket.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user