From b1b0483d41715fc187f6fe822c505844c23ea317 Mon Sep 17 00:00:00 2001
From: lishuang <43914504@qq.com>
Date: Fri, 13 Dec 2024 09:47:28 +0800
Subject: [PATCH 1/6] 67
---
Program.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Program.cs b/Program.cs
index e5e2143..ced15e7 100644
--- a/Program.cs
+++ b/Program.cs
@@ -14,7 +14,7 @@ namespace FlyDockTool
//测试11111 都是对的收到大大大
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new mainForm()); ;//gitceshi
+ Application.Run(new mainForm()); ;//gitceshi88
}
}
}
From 174d7c6be19682a6fe19556e51fff6a3273636a2 Mon Sep 17 00:00:00 2001
From: lxd <1004405501@qq.com>
Date: Fri, 13 Dec 2024 14:17:21 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B0=BF=E5=B8=B8?=
=?UTF-8?q?=E8=A7=84U120=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.config | 4 +-
deviceAnalysis.cs | 159 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 161 insertions(+), 2 deletions(-)
diff --git a/app.config b/app.config
index d9f2b23..a07c10f 100644
--- a/app.config
+++ b/app.config
@@ -58,8 +58,10 @@
+
+
-
+
diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs
index 4b7c3d3..49a738e 100644
--- a/deviceAnalysis.cs
+++ b/deviceAnalysis.cs
@@ -1985,7 +1985,149 @@ namespace FlyDockTool
}
+ if (apiOptions.CurrentDevice == "U120")//尿常规U120
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] resulteArray = deviceDataStr.Split('\n');
+ // File.WriteAllText("BT-200.TXT", deviceDataStr);
+ for (int i = 0; i < resulteArray.Length; i += 15)
+ {
+ //这里需要判断一下数据是否超过了 当前数据的长度
+ ermList.Clear();
+ if (i + 15 > resulteArray.Length)
+ break;
+ string[] spArray = resulteArray[3].Trim().Split(' ');
+ string sampleNo1 = spArray[2].Substring(0,1).TrimStart('0');
+ // string sampleNo1 = resulteArray[2].Trim().Split(' ')[1]; .Replace("-", "0").TrimStart('0')
+ //string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]);
+ string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ examResultMode erm = new examResultMode();
+ erm.machineCode = MachineCode;
+ erm.machineID = MachineID;
+ erm.sampleNo = sampleNo1;
+ erm.testDate = testDate1;
+ erm.chanelNo = "LEU";//项目代号
+ erm.itemValue = resulteArray[i + 4].Substring(4, 15).Trim();//项目结果//项目结果
+ erm.itemUnit = "";
+ ermList.Add(erm);
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = sampleNo1;
+ erm1.testDate = testDate1;
+ erm1.chanelNo = "NIT";//项目代号
+ erm1.itemValue = resulteArray[i + 5].Substring(4, 11).Trim();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+
+ examResultMode erm2 = new examResultMode();
+ erm2.machineCode = MachineCode;
+ erm2.machineID = MachineID;
+ erm2.sampleNo = sampleNo1;
+ erm2.testDate = testDate1;
+ erm2.chanelNo = "URO";//项目代号
+ erm2.itemValue = resulteArray[i + 6].Substring(4, 13).Trim();//项目结果
+ erm2.itemUnit = "";
+ ermList.Add(erm2);
+
+ examResultMode erm3 = new examResultMode();
+ erm3.machineCode = MachineCode;
+ erm3.machineID = MachineID;
+ erm3.sampleNo = sampleNo1;
+ erm3.testDate = testDate1;
+ erm3.chanelNo = "PRO";//项目代号
+ erm3.itemValue = resulteArray[i + 7].Substring(4, 15).Trim();//项目结果
+ erm3.itemUnit = "";
+ ermList.Add(erm3);
+
+ examResultMode erm4 = new examResultMode();
+ erm4.machineCode = MachineCode;
+ erm4.machineID = MachineID;
+ erm4.sampleNo = sampleNo1;
+ erm4.testDate = testDate1;
+ erm4.chanelNo = "pH";//项目代号
+ erm4.itemValue = resulteArray[i + 8].Substring(4, 12).Trim();//项目结果
+ erm4.itemUnit = "";
+ ermList.Add(erm4);
+
+
+ examResultMode erm5 = new examResultMode();
+ erm5.machineCode = MachineCode;
+ erm5.machineID = MachineID;
+ erm5.sampleNo = sampleNo1;
+ erm5.testDate = testDate1;
+ erm5.chanelNo = "BLO";//项目代号
+ erm5.itemValue = resulteArray[i + 9].Substring(4, 15).Trim();//项目结果
+ erm5.itemUnit = "";
+ ermList.Add(erm5);
+
+
+ examResultMode erm6 = new examResultMode();
+ erm6.machineCode = MachineCode;
+ erm6.machineID = MachineID;
+ erm6.sampleNo = sampleNo1;
+ erm6.testDate = testDate1;
+ erm6.chanelNo = "SG";//项目代号
+ erm6.itemValue = resulteArray[i + 10].Substring(4, 13).Trim();//项目结果
+ erm6.itemUnit = "";
+ ermList.Add(erm6);
+
+ examResultMode erm10 = new examResultMode();
+ erm10.machineCode = MachineCode;
+ erm10.machineID = MachineID;
+ erm10.sampleNo = sampleNo1;
+ erm10.testDate = testDate1;
+ erm10.chanelNo = "KET";//项目代号
+ erm10.itemValue = resulteArray[i + 11].Substring(4, 15).Trim();//项目结果
+ erm10.itemUnit = "";
+ ermList.Add(erm10);
+
+
+ examResultMode erm7 = new examResultMode();
+ erm7.machineCode = MachineCode;
+ erm7.machineID = MachineID;
+ erm7.sampleNo = sampleNo1;
+ erm7.testDate = testDate1;
+ erm7.chanelNo = "BIL";//项目代号
+ erm7.itemValue = resulteArray[i + 12].Substring(4, 13).Trim();//项目结果
+ erm7.itemUnit = "";
+ ermList.Add(erm7);
+
+ examResultMode erm8 = new examResultMode();
+ erm8.machineCode = MachineCode;
+ erm8.machineID = MachineID;
+ erm8.sampleNo = sampleNo1;
+ erm8.testDate = testDate1;
+ erm8.chanelNo = "GLU";//项目代号
+ erm8.itemValue = resulteArray[i + 13].Substring(4, 14).Trim();//项目结果
+ erm8.itemUnit = "";
+ ermList.Add(erm8);
+
+ examResultMode erm9 = new examResultMode();
+ erm9.machineCode = MachineCode;
+ erm9.machineID = MachineID;
+ erm9.sampleNo = sampleNo1;
+ erm9.testDate = testDate1;
+ erm9.chanelNo = "ASC";//项目代号
+ erm9.itemValue = resulteArray[i + 14].Substring(4, 12).Trim();//项目结果
+ erm9.itemUnit = "";
+ ermList.Add(erm9);
+
+
+
+ //将结果提交到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;
}
@@ -2459,6 +2601,13 @@ namespace FlyDockTool
SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
}
+ if (apiOptions.CurrentDevice == "U120")//尿常规U120
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+
}
///
@@ -2575,6 +2724,11 @@ namespace FlyDockTool
}
if (apiOptions.CurrentDevice == "MA-4210")//MA-4210
_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+
+ if (apiOptions.CurrentDevice == "U120")//尿常规U120
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
}
///
@@ -2894,7 +3048,10 @@ namespace FlyDockTool
{
SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
}
-
+ if (apiOptions.CurrentDevice == "U120")//尿常规U120
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//停止数据接收
+ }
}
From 5c5940913c1ad39ab1c6c15e152e4eaf8c185e6f Mon Sep 17 00:00:00 2001
From: lxd <1004405501@qq.com>
Date: Fri, 13 Dec 2024 15:17:18 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9U120=E5=B0=BF=E5=B8=B8?=
=?UTF-8?q?=E8=A7=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.config | 3 ++-
deviceAnalysis.cs | 24 ++++++++++++------------
mainForm.cs | 8 +++++---
3 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/app.config b/app.config
index a07c10f..b4f6fa7 100644
--- a/app.config
+++ b/app.config
@@ -59,7 +59,8 @@
-
+
+
diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs
index 49a738e..c8ca486 100644
--- a/deviceAnalysis.cs
+++ b/deviceAnalysis.cs
@@ -1998,7 +1998,7 @@ namespace FlyDockTool
ermList.Clear();
if (i + 15 > resulteArray.Length)
break;
- string[] spArray = resulteArray[3].Trim().Split(' ');
+ string[] spArray = resulteArray[2].Trim().Split(' ');
string sampleNo1 = spArray[2].Substring(0,1).TrimStart('0');
// string sampleNo1 = resulteArray[2].Trim().Split(' ')[1]; .Replace("-", "0").TrimStart('0')
//string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]);
@@ -2009,7 +2009,7 @@ namespace FlyDockTool
erm.sampleNo = sampleNo1;
erm.testDate = testDate1;
erm.chanelNo = "LEU";//项目代号
- erm.itemValue = resulteArray[i + 4].Substring(4, 15).Trim();//项目结果//项目结果
+ erm.itemValue = resulteArray[i + 3].Substring(4, 15).Trim();//项目结果//项目结果
erm.itemUnit = "";
ermList.Add(erm);
@@ -2019,7 +2019,7 @@ namespace FlyDockTool
erm1.sampleNo = sampleNo1;
erm1.testDate = testDate1;
erm1.chanelNo = "NIT";//项目代号
- erm1.itemValue = resulteArray[i + 5].Substring(4, 11).Trim();//项目结果
+ erm1.itemValue = resulteArray[i + 4].Substring(4, 11).Trim();//项目结果
erm1.itemUnit = "";
ermList.Add(erm1);
@@ -2029,7 +2029,7 @@ namespace FlyDockTool
erm2.sampleNo = sampleNo1;
erm2.testDate = testDate1;
erm2.chanelNo = "URO";//项目代号
- erm2.itemValue = resulteArray[i + 6].Substring(4, 13).Trim();//项目结果
+ erm2.itemValue = resulteArray[i + 5].Substring(4, 13).Trim();//项目结果
erm2.itemUnit = "";
ermList.Add(erm2);
@@ -2039,7 +2039,7 @@ namespace FlyDockTool
erm3.sampleNo = sampleNo1;
erm3.testDate = testDate1;
erm3.chanelNo = "PRO";//项目代号
- erm3.itemValue = resulteArray[i + 7].Substring(4, 15).Trim();//项目结果
+ erm3.itemValue = resulteArray[i + 6].Substring(5, 15).Trim();//项目结果
erm3.itemUnit = "";
ermList.Add(erm3);
@@ -2049,7 +2049,7 @@ namespace FlyDockTool
erm4.sampleNo = sampleNo1;
erm4.testDate = testDate1;
erm4.chanelNo = "pH";//项目代号
- erm4.itemValue = resulteArray[i + 8].Substring(4, 12).Trim();//项目结果
+ erm4.itemValue = resulteArray[i + 7].Substring(4, 12).Trim();//项目结果
erm4.itemUnit = "";
ermList.Add(erm4);
@@ -2060,7 +2060,7 @@ namespace FlyDockTool
erm5.sampleNo = sampleNo1;
erm5.testDate = testDate1;
erm5.chanelNo = "BLO";//项目代号
- erm5.itemValue = resulteArray[i + 9].Substring(4, 15).Trim();//项目结果
+ erm5.itemValue = resulteArray[i + 8].Substring(4, 15).Trim();//项目结果
erm5.itemUnit = "";
ermList.Add(erm5);
@@ -2071,7 +2071,7 @@ namespace FlyDockTool
erm6.sampleNo = sampleNo1;
erm6.testDate = testDate1;
erm6.chanelNo = "SG";//项目代号
- erm6.itemValue = resulteArray[i + 10].Substring(4, 13).Trim();//项目结果
+ erm6.itemValue = resulteArray[i + 9].Substring(4, 13).Trim();//项目结果
erm6.itemUnit = "";
ermList.Add(erm6);
@@ -2081,7 +2081,7 @@ namespace FlyDockTool
erm10.sampleNo = sampleNo1;
erm10.testDate = testDate1;
erm10.chanelNo = "KET";//项目代号
- erm10.itemValue = resulteArray[i + 11].Substring(4, 15).Trim();//项目结果
+ erm10.itemValue = resulteArray[i + 10].Substring(4, 15).Trim();//项目结果
erm10.itemUnit = "";
ermList.Add(erm10);
@@ -2092,7 +2092,7 @@ namespace FlyDockTool
erm7.sampleNo = sampleNo1;
erm7.testDate = testDate1;
erm7.chanelNo = "BIL";//项目代号
- erm7.itemValue = resulteArray[i + 12].Substring(4, 13).Trim();//项目结果
+ erm7.itemValue = resulteArray[i + 11].Substring(4, 13).Trim();//项目结果
erm7.itemUnit = "";
ermList.Add(erm7);
@@ -2102,7 +2102,7 @@ namespace FlyDockTool
erm8.sampleNo = sampleNo1;
erm8.testDate = testDate1;
erm8.chanelNo = "GLU";//项目代号
- erm8.itemValue = resulteArray[i + 13].Substring(4, 14).Trim();//项目结果
+ erm8.itemValue = resulteArray[i + 12].Substring(4, 14).Trim();//项目结果
erm8.itemUnit = "";
ermList.Add(erm8);
@@ -2112,7 +2112,7 @@ namespace FlyDockTool
erm9.sampleNo = sampleNo1;
erm9.testDate = testDate1;
erm9.chanelNo = "ASC";//项目代号
- erm9.itemValue = resulteArray[i + 14].Substring(4, 12).Trim();//项目结果
+ erm9.itemValue = resulteArray[i + 13].Substring(4, 12).Trim();//项目结果
erm9.itemUnit = "";
ermList.Add(erm9);
diff --git a/mainForm.cs b/mainForm.cs
index 2092d94..5483232 100644
--- a/mainForm.cs
+++ b/mainForm.cs
@@ -24,6 +24,8 @@ namespace FlyDockTool
private void Form1_Load(object sender, EventArgs e)
{
+
+
string CurrentDevice= ConfigurationManager.AppSettings["CurrentDevice"];
apiOptions.CurrentDevice = CurrentDevice;
apiOptions.MacAddress = ConfigurationManager.AppSettings[CurrentDevice].Split(',')[0];
@@ -32,11 +34,11 @@ namespace FlyDockTool
lb_currentDeviceInfo.Text = CurrentDevice;
btn_start_or_stop_Click(null,null);//启动数据接收
- ////测试代码 测试完毕后注释调一下两行代码
- //string resultDataStr = File.ReadAllText(@"C:\Users\Administrator\Desktop\察哈尔右翼中旗\黄羊城\尿常规MA-4210\尿常规MA-4210.txt", Encoding.GetEncoding("GB18030"));
+ //测试代码 测试完毕后注释调一下两行代码
+ //string resultDataStr = File.ReadAllText(@"D:\工作\接受数据工具 list\尿常规U120\尿常规U120.txt", Encoding.GetEncoding("GB18030"));
//deviceAnalysis.CreateInstance().deviceAnalysisOption(resultDataStr);
-
+
}
private void btn_start_or_stop_Click(object sender, EventArgs e)
From bc58e34d40ffc21727c6198cb2360fee786921b6 Mon Sep 17 00:00:00 2001
From: lxd <1004405501@qq.com>
Date: Mon, 16 Dec 2024 10:00:55 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=A2=9EBS-330E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deviceAnalysis.cs | 181 ++++++++++++++++++++++++++++++++--------------
1 file changed, 128 insertions(+), 53 deletions(-)
diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs
index c8ca486..b0941ed 100644
--- a/deviceAnalysis.cs
+++ b/deviceAnalysis.cs
@@ -17,9 +17,9 @@ using System.Runtime.InteropServices.ComTypes;
namespace FlyDockTool
{
- public class deviceAnalysis
+ public class deviceAnalysis
{
- public EventHandler dataOutPutShow;
+ public EventHandler dataOutPutShow;
public static deviceAnalysis Instance; //申明一个EcgDrawing对象,复制Null
private static readonly object LockHelper = new object();
string tempData = string.Empty;//存储串口和TCP接收到的 累计数据
@@ -37,7 +37,7 @@ namespace FlyDockTool
return Instance;
}
- deviceAnalysis()
+ deviceAnalysis()
{
_tResult = new System.Threading.Timer(obj => TResultTick(), null, -1, 5000);//调用方法TResultTick 作为定时执行的方法 处于暂停状态
_tcpResult = new System.Threading.Timer(obj => tcpResultTick(), null, -1, 10);//调用方法TResultTick 作为定时执行的方法 处于暂停状态
@@ -50,7 +50,7 @@ namespace FlyDockTool
///
///
///
- int[] strCount(string keyWords,string stringStr)
+ int[] strCount(string keyWords, string stringStr)
{
List posList = new List();
for (int i = 0; (i + keyWords.Length) < stringStr.Length; i++)
@@ -1472,7 +1472,7 @@ namespace FlyDockTool
ermList.Clear();
if (i + 20 > resulteArray.Length)
break;
- string[] spArray =resulteArray[3].Trim().Split(' ');
+ string[] spArray = resulteArray[3].Trim().Split(' ');
string sampleNo1 = resulteArray[3].Trim().Split(' ')[2].Replace("-", "0").TrimStart('0');
//string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]);
string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -1492,7 +1492,7 @@ namespace FlyDockTool
erm1.sampleNo = sampleNo1;
erm1.testDate = testDate1;
erm1.chanelNo = "URO";//项目代号
- erm1.itemValue = resulteArray[i + 5].Substring(4,11).Trim();//项目结果
+ erm1.itemValue = resulteArray[i + 5].Substring(4, 11).Trim();//项目结果
erm1.itemUnit = "mg/dL";
ermList.Add(erm1);
@@ -1522,7 +1522,7 @@ namespace FlyDockTool
erm4.sampleNo = sampleNo1;
erm4.testDate = testDate1;
erm4.chanelNo = "BIL";//项目代号
- erm4.itemValue = resulteArray[i + 8].Substring(5,13).Trim();//项目结果
+ erm4.itemValue = resulteArray[i + 8].Substring(5, 13).Trim();//项目结果
erm4.itemUnit = "";
ermList.Add(erm4);
@@ -1644,11 +1644,11 @@ namespace FlyDockTool
if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
{
-
+
string MachineCode = apiOptions.MachineCode;
string MachineID = apiOptions.MachineID;
List ermList = new List();
- string[] itemArray = new string[26] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "RDW-CV", "PLCC", "PLCR" , "Lymphocytosis" };
+ string[] itemArray = new string[26] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "RDW-CV", "PLCC", "PLCR", "Lymphocytosis" };
//string[] resulteArray = deviceDataStr.Split('\n');
deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
string sampleNo1 = string.Empty;//样本号
@@ -1660,7 +1660,7 @@ namespace FlyDockTool
else
itemStr = itemArray[i] + "^LN||";
- string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"),30);
+ string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"), 30);
sampleNo1 = val1.Split('|')[3];
string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
examResultMode erm1 = new examResultMode();
@@ -1722,16 +1722,16 @@ namespace FlyDockTool
string[] itemArray = new string[22] { "ALT", "AST", "ALP", "GGT", "IBIL", "TP", "ALB", "Crea", "UA", "GLU", "TG", "HDL", "LDL", "TB|TB", "TC", "DB", "CHE", "BUN|BUN", "TBA", "A/G", "BUN/CREA", "GLOB" };
deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
deviceDataStr = deviceDataStr.Replace("OBX", "。");
-
+
string[] valArray = deviceDataStr.Split('。');
string sampleNo1 = string.Empty;//样本号
for (int A = 0; A < valArray.Length; A++)
{
if (valArray[A].Contains("OBR|"))
{
- int index1 = valArray[A].Substring(valArray[A].IndexOf("OBR|"), 20).IndexOf("||")+2;
- sampleNo1 = jiexisampleNo8(index1, valArray[A].Substring(valArray[A].IndexOf("OBR|"),18)).ToString();
-
+ int index1 = valArray[A].Substring(valArray[A].IndexOf("OBR|"), 20).IndexOf("||") + 2;
+ sampleNo1 = jiexisampleNo8(index1, valArray[A].Substring(valArray[A].IndexOf("OBR|"), 18)).ToString();
+
}
for (int i = 0; i < itemArray.Length; i++)
{
@@ -1778,9 +1778,9 @@ namespace FlyDockTool
itemStr = itemArray[i] + "^99MRC||";
else
itemStr = itemArray[i] + "^LN||";
-
- int index1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 20).IndexOf("||") + 2;
- sampleNo1 = jiexisampleNo8(index1, deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 18)).ToString();
+
+ int index1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 20).IndexOf("||") + 2;
+ sampleNo1 = jiexisampleNo8(index1, deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 18)).ToString();
@@ -1859,7 +1859,7 @@ namespace FlyDockTool
erm.sampleNo = sampleNo1;
erm.testDate = testDate1;
erm.chanelNo = "GLU";//项目代号
- erm.itemValue = resulteArray[i + 4].Substring(4,6).Trim();//项目结果
+ erm.itemValue = resulteArray[i + 4].Substring(4, 6).Trim();//项目结果
erm.itemUnit = "cells/uL";
ermList.Add(erm);
@@ -1971,7 +1971,7 @@ namespace FlyDockTool
erm11.sampleNo = sampleNo1;
erm11.testDate = testDate1;
erm11.chanelNo = "Color";//项目代号
- erm11.itemValue = resulteArray[i + 15].Replace("Color:","").Trim();//项目结果
+ erm11.itemValue = resulteArray[i + 15].Replace("Color:", "").Trim();//项目结果
erm11.itemUnit = "mmol/L";
ermList.Add(erm11);
//将结果提交到LIS系统
@@ -1999,8 +1999,8 @@ namespace FlyDockTool
if (i + 15 > resulteArray.Length)
break;
string[] spArray = resulteArray[2].Trim().Split(' ');
- string sampleNo1 = spArray[2].Substring(0,1).TrimStart('0');
- // string sampleNo1 = resulteArray[2].Trim().Split(' ')[1]; .Replace("-", "0").TrimStart('0')
+ string sampleNo1 = spArray[2].Substring(0, 1).TrimStart('0');
+ // string sampleNo1 = resulteArray[2].Trim().Split(' ')[1]; .Replace("-", "0").TrimStart('0')
//string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]);
string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
examResultMode erm = new examResultMode();
@@ -2116,7 +2116,7 @@ namespace FlyDockTool
erm9.itemUnit = "";
ermList.Add(erm9);
-
+
//将结果提交到LIS系统
baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
@@ -2127,13 +2127,60 @@ namespace FlyDockTool
dataOutPutShow("数据提交失败:" + jsonStr, null);
}
+ }
+ if (apiOptions.CurrentDevice == "BS-330E")//BS-330E 他是一次性发一条样本 但一个样本号有多个项目 挨个发其中的项目 生化
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ 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;
}
-
+
///
@@ -2147,7 +2194,7 @@ namespace FlyDockTool
string ItemValueStr = "";
string Str1 = deviceDataStr.Substring(deviceDataStr.IndexOf(itemStr) + itemStr.Length, 30);
int firstIndex = Str1.IndexOf('|');
- ItemValueStr= Str1.Substring(0, firstIndex);
+ ItemValueStr = Str1.Substring(0, firstIndex);
return ItemValueStr;
}
@@ -2161,7 +2208,7 @@ namespace FlyDockTool
string jiexiItemValueLast(string itemStr, string deviceDataStr)
{
string ItemValueStr = "";
- string Str1 = deviceDataStr.Substring(deviceDataStr.LastIndexOf(itemStr) + itemStr.Length+1, 10);
+ string Str1 = deviceDataStr.Substring(deviceDataStr.LastIndexOf(itemStr) + itemStr.Length + 1, 10);
int firstIndex = Str1.IndexOf('|');
ItemValueStr = Str1.Substring(0, firstIndex);
return ItemValueStr;
@@ -2217,14 +2264,14 @@ namespace FlyDockTool
///
///
///
- string jiexiVal(int index1,string keyStr, string dataStr)
+ string jiexiVal(int index1, string keyStr, string dataStr)
{
- string val1 ="";
+ string val1 = "";
for (int i = 1; i < 100; i++)
{
try
{
- string str1 = dataStr.Substring(index1+ keyStr.Length, i);
+ string str1 = dataStr.Substring(index1 + keyStr.Length, i);
double valx = double.Parse(str1);
val1 = str1;
}
@@ -2234,7 +2281,7 @@ namespace FlyDockTool
return val1;
}
-
+
///
/// 从字符串中 解析出 jiexiBase64 图像
///
@@ -2243,28 +2290,28 @@ namespace FlyDockTool
///
List jiexiBase64(int[] array1, string keyStr, string dataStr)
{
- List imageBase64List=new List();
+ List imageBase64List = new List();
for (int i = 0; i < array1.Length; i++)
{
- for (int b = array1[i]; b< dataStr.Length; b++)
+ for (int b = array1[i]; b < dataStr.Length; b++)
{
string str1 = dataStr.Substring(b, keyStr.Length);
- if(str1== keyStr)
- {
- string ImgBase64Str = dataStr.Substring(array1[i]+ 8, b- array1[i]- 8);
+ if (str1 == keyStr)
+ {
+ string ImgBase64Str = dataStr.Substring(array1[i] + 8, b - array1[i] - 8);
imageBase64List.Add(ImgBase64Str);
- break;
+ break;
}
}
}
return imageBase64List;
}
- static string jiexiDate(string dateStr,string TimeStr)
+ static string jiexiDate(string dateStr, string TimeStr)
{
string[] spArray = dateStr.Trim().Split(' ');
- string[] varArray= spArray[2].Trim().Trim('\r').Split('-');
- return varArray[2]+"-"+ varArray[0]+"-"+ varArray[1]+" "+ TimeStr.Trim().Trim('\r');
+ string[] varArray = spArray[2].Trim().Trim('\r').Split('-');
+ return varArray[2] + "-" + varArray[0] + "-" + varArray[1] + " " + TimeStr.Trim().Trim('\r');
}
@@ -2607,6 +2654,22 @@ namespace FlyDockTool
SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
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毫秒频率
+ }
}
@@ -2624,7 +2687,7 @@ namespace FlyDockTool
dataOutPutShow(o, null);//把数据显示到屏幕上
}
-
+
if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号:H-II
_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规
@@ -2656,7 +2719,7 @@ namespace FlyDockTool
if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
{
//File.WriteAllText("deviceDataLog.txt", deviceDataStr, Encoding.GetEncoding("GB18030"));
-
+
deviceAnalysisOption(tempData);
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
// _tResult.Change(10000, 10000);// 数据处理:延迟5秒开始 5秒计时
@@ -2692,9 +2755,9 @@ namespace FlyDockTool
if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
{
// _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
- if (tempData.Contains("OBX|30|")|| tempData.Contains("OBX|29|"))//OBX|12|ST| 为结束符 说明字符串完整了
+ if (tempData.Contains("OBX|30|") || tempData.Contains("OBX|29|"))//OBX|12|ST| 为结束符 说明字符串完整了
{
- // MessageBox.Show(tempData);
+ // MessageBox.Show(tempData);
deviceAnalysisOption(tempData);
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
}
@@ -2729,6 +2792,14 @@ namespace FlyDockTool
{
_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;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ }
+ }
}
///
@@ -2757,12 +2828,12 @@ namespace FlyDockTool
if (clientSocket == null)
clientSocket = listener.Accept(); //一旦接受连接,创建一个客户端
}
-
+
int recv = clientSocket.Receive(data);
if (recv > 0)
{
- byte[] data1=new byte[recv];
- for (int i = 0;iMSA|AA|"+ msgId + "||||0|";
+ string responseMsg = "MSH|^~\\&|1|1|11|1|" + dateTimeNowStr + "||ACK^R01|" + msgId + "|P|2.3.1||||0||UNICODE|||MSA|AA|" + msgId + "||||0|";
byte[] sendBytes = Encoding.Unicode.GetBytes(responseMsg);
clientSocket.Send(sendBytes);
- onReData("应答消息:"+responseMsg, null);//数据处理 并将数据显示在软件界面上
+ onReData("应答消息:" + responseMsg, null);//数据处理 并将数据显示在软件界面上
}
}
-
+
}
onReData(stringData, null);//数据处理 并将数据显示在软件界面上
}
@@ -2801,13 +2872,13 @@ namespace FlyDockTool
accessDbPath = DateTime.Now.ToString("yyyy-MM-dd") + ".mdb";
//string sql = "select a.sampleProgramID,b.SampleNo,a.ResultValue as ItemValue,a.EName as ItemCode from sampleProgram a inner join sampleInfo b on a.SampleInfoID=b.SampleInfoID where a.stateS is NULL ";
string sql = "select a.sampleProgramID,b.SampleNo,a.ResultValue as ItemValue,a.EName as ItemCode from sampleProgram a inner join sampleInfo b on a.SampleInfoID=b.SampleInfoID";
- DataTable dt_2=new DataTable();
+ DataTable dt_2 = new DataTable();
try
{
dt_2 = accessOptions.CreateInstance(accessDbPath).ExcuteSql(sql);
}
catch { dt_2 = null; }
- if(dt_2==null)
+ if (dt_2 == null)
return;
List ermList = new List();
string MachineCode = apiOptions.MachineCode;
@@ -3052,7 +3123,11 @@ namespace FlyDockTool
{
SerialPortOption.CreateInstance().StopDataReadThread();//停止数据接收
}
-
+ if (apiOptions.CurrentDevice == "BS-330E")//BS-330E
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
}
/////
From 733a00ca82497fa7162005d949be9a311ea462af Mon Sep 17 00:00:00 2001
From: lxd <1004405501@qq.com>
Date: Mon, 16 Dec 2024 10:04:03 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E6=96=B0=E5=A2=9EBS-330E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.config | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app.config b/app.config
index b4f6fa7..cbf8617 100644
--- a/app.config
+++ b/app.config
@@ -61,8 +61,11 @@
+
+
+
-
+
From 7d22089afbd9337af760146f279cc26237daca14 Mon Sep 17 00:00:00 2001
From: lichuanyang <1176537920@qq.com>
Date: Mon, 16 Dec 2024 11:06:38 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E5=9E=8B=E5=8F=B7:BC-5120?=
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 cbf8617..04e4706 100644
--- a/app.config
+++ b/app.config
@@ -63,9 +63,12 @@
+
+
+
-
+
diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs
index b0941ed..672f62a 100644
--- a/deviceAnalysis.cs
+++ b/deviceAnalysis.cs
@@ -2174,6 +2174,52 @@ namespace FlyDockTool
else
dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+ }
+ if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
+ {
+ 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[] { "WBC", "BAS#", "BAS%", "NEU#", "NEU%", "EOS#", "EOS%", "LYM#", "LYM%", "MON#", "MON%", "RBC", "HGB", "MCV", "MCH", "MCHC", "RDW-CV", "RDW-SD", "HCT", "PLT", "MPV", "PDW", "PCT", "PLCC", "PLCR" };
+ string[] itemArray_2 = new string[] { "PCT", "PLCC", "PLCR" };
+
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ if (itemArray_2.Contains(itemArray[i]))
+ itemStr = itemArray[i] + "^99MRC||";
+ else
+ itemStr = itemArray[i] + "^LN||";
+
+ string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"), 30);
+ sampleNo1 = val1.Split('|')[3];
+ 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);
+
}
return rerultJson;
}
@@ -2670,7 +2716,22 @@ namespace FlyDockTool
}
_tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
}
-
+ if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
+ {
+ // 设置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毫秒频率
+ }
}
///
@@ -2800,6 +2861,10 @@ namespace FlyDockTool
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
}
}
+ if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
}
///
@@ -3128,6 +3193,11 @@ namespace FlyDockTool
_tcpResult.Change(-1, 10);//停止tcp数据接收
clientSocket.Close();
}
+ if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
}
/////