using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 尿液分析
{
class COMBI_SCAN500
{
public string SaveData(string Data)
{
if (Data == null || Data.Trim() == "")
throw new ApplicationException("传入的数据为空!");
if (Data.IndexOf((char)0x0D) == -1)
Data = Data.Substring(Data.IndexOf((char)0x0D));
string[] DataArray = Data.Split((char)0x0D);
if (DataArray.Length < 10)
return "此处忽略。";
//string sampleno = DataArray[3].Substring(3, 2).Trim();
string sampleno = int.Parse(DataArray[3].Substring(3, 3).Trim()).ToString();
if (sampleno == "")
throw new ApplicationException("传入的数据中没有样本号!");
sampleno = int.Parse(sampleno).ToString();
string dt = DataArray[2];
DateTime CheckDate = DateTime.Parse(dt);
bool is_type = false;
string strSHH, is_result;
int cN = 1;
//SaveDevice sd = new SaveDevice(this.SqlBase, DeviceID, UserID);
StringBuilder sb = new StringBuilder();
sb.Append("\n\r样本号【" + sampleno + "】 时间【" + CheckDate + "】---\n\r\n\r");
for (int i = 7; i < DataArray.Length; i++)
{
if (DataArray[i].Trim() == "" || DataArray[i].Length < 8)
continue;
strSHH = DataArray[i].Substring(1, 4).Trim();
is_result = DataArray[i].Substring(6, 8).Trim(); // is_result = DataArray[i].Substring(7, 7).Trim();
if (is_result.ToLower() == "neg")
is_result = "阴性";
if (is_result == "+")
is_result = "(+)";
if (is_result == "Normal" || is_result == "norm")
is_result = "正常";
if (is_result == "")
continue;
sb.Append("No: " + cN++ + " 通道->【" + strSHH + "】 结果->【" + is_result + "】\n\r\n\r");
//sd.Save(sampleno, strSHH, CheckDate, is_result, is_type);
}
return sb.ToString();
}
}
}