Exemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)//保存
        {
            if (ClsResult.DeviceName != "")
            {
                ClsMsgWindow.SendString("硕康智能体检系统", 1, "FromCom:ok");
            }

            btnDrop_Click(null, null);
        }
Exemplo n.º 2
0
        private void clsTrans_SendMsgNt(string msg)
        {
            if (!this.m_IsLogIn)
            {
                if (msg.Contains("TRANSEND") || (msg == "ERROR"))
                {
                    new MessageForm("非会员用户测量数据无效")
                    {
                        StartPosition = FormStartPosition.CenterScreen
                    }.ShowDialog();
                    Thread.Sleep(500);
                }
            }
            else
            {
                bool flag1 = msg == "UNKNOWN";
                if (msg.Contains("CONNECT"))
                {
                    this.g_bt = Guid.NewGuid();
                    this.WriteComPort(string.Format("{0} reading", msg.Substring(msg.Length - 2, 2)));
                }
                if (msg == "ERROR")
                {
                    base.Invoke(new Action <string, string>(this.run_notify_window), new object[] { ClsResult.DeviceName, "接收数据失败!" });
                }
                if ((msg == "TRANSEND") && ClsResult.ResultFlag)
                {
                    try
                    {
                        string str = !(ClsResult.DeviceName == "QCTBE") ? TranslateClsResult.TranslateToStr() : "(查看)";

                        //LogHelper.WriteLog(str);

                        ClsMsgWindow.SendDeviceInfo(ClsResult.DeviceName + ";BT");

                        base.Invoke(new Action <string, string>(this.run_notify_window), new object[] { TranslateClsResult.GetDeviceCName(ClsResult.DeviceName), str });
                        this.notify_save();
                        this.WriteComPort(string.Format("{0} successed", ClsResult.DeviceName.Substring(3, 2)));
                    }
                    catch (Exception ex)
                    {
                        LogHelper.WriteLog(ex.ToString());
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static void set_tj_content(DeviceInfoModel devinfo)
        {
            ClsMsgWindow.MSG_BT bG = ClsMsgWindow.MSG_BT.BG;
            string str             = "";

            switch (ClsResult.DeviceName)
            {
            case "QCTBG":
                bG  = ClsMsgWindow.MSG_BT.BG;
                str = "辅助检查";
                break;

            case "QCTBH":
                bG  = ClsMsgWindow.MSG_BT.BH;
                str = "一般情况";
                break;

            case "QCTBP":
                bG  = ClsMsgWindow.MSG_BT.BP;
                str = "一般情况";
                break;

            case "CHITBP":
                bG  = ClsMsgWindow.MSG_BT.BP;
                str = "一般情况";
                break;

            case "QCTBT":
                bG  = ClsMsgWindow.MSG_BT.BT;
                str = "一般情况";
                break;

            case "QCTBU":
                bG  = ClsMsgWindow.MSG_BT.BU;
                str = "辅助检查";
                break;

            case "QCTBM":
                bG  = ClsMsgWindow.MSG_BT.BW;
                str = "一般情况";
                break;

            case "QCTTF":
                bG  = ClsMsgWindow.MSG_BT.TF;
                str = "一般情况";
                break;

            case "QCTUI":
            case "EMPUI":
                bG  = ClsMsgWindow.MSG_BT.UI;
                str = "辅助检查";
                break;

            case "QCTUR":
                bG  = ClsMsgWindow.MSG_BT.UI;
                str = "辅助检查";
                break;

            case "QCTZQ":
                bG  = ClsMsgWindow.MSG_BT.ZQ;
                str = "辅助检查";
                break;
            }

            if (!string.IsNullOrEmpty(str))
            {
                ClsMsgWindow.postMsgToWnd("体检档案", (int)bG);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 事件处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void comm_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            try
            {
                Thread.Sleep(2000);

                int    n   = comm.BytesToRead;
                byte[] buf = new byte[n];

                while (buf.Length < 325)
                {
                    n   = comm.BytesToRead;
                    buf = new byte[n];
                }

                comm.Read(buf, 0, n);

                string str = System.Text.Encoding.ASCII.GetString(buf);

                byte[] STX   = new byte[] { 0x02 }; // 开始符
                byte[] EXT   = new byte[] { 0x03 }; // 结束符
                string start = System.Text.Encoding.ASCII.GetString(STX);
                string end   = System.Text.Encoding.ASCII.GetString(EXT);

                string[] value = str.Split(new String[] { end }, StringSplitOptions.RemoveEmptyEntries);

                DeviceInfoModel saveDeviceModel = new DeviceInfoModel
                {
                    IDCardNo   = baseInfo.IDCardNo,
                    UpdateData = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                };

                saveDeviceModel.DeviceName = "尿液信息";
                saveDeviceModel.DeviceType = "33";
                saveDeviceModel.FirstName  = "EMPUI";

                for (int i = 0; i < value.Length; i++)
                {
                    string value2 = value[i].Replace(start, "");

                    string[] empValue = value2.Split(new String[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

                    if (empValue.Length > 13)
                    {
                        saveDeviceModel.Value9  = empValue[4].Substring(5, 2).Replace(" ", "");  //  尿白细胞 LEU
                        saveDeviceModel.Value4  = empValue[5].Substring(5, 2).Replace(" ", "");  //  尿酮体 KET
                        saveDeviceModel.Value8  = empValue[6].Substring(5, 2).Replace(" ", "");  //  亚硝酸盐 NIT
                        saveDeviceModel.Value1  = empValue[7].Substring(5, 2).Replace(" ", "");  //  尿胆原 URO
                        saveDeviceModel.Value6  = empValue[8].Substring(5, 2).Replace(" ", "");  // 尿蛋白 PRO
                        saveDeviceModel.Value3  = empValue[9].Substring(5, 2).Replace(" ", "");  //  胆红素 BIL
                        saveDeviceModel.Value5  = empValue[10].Substring(5, 2).Replace(" ", ""); // 尿糖 GLU
                        saveDeviceModel.Value10 = empValue[11].Substring(5).Replace(" ", "");    // 比重 SG
                        saveDeviceModel.Value2  = empValue[12].Substring(5, 2).Replace(" ", ""); // 尿潜血 BLD
                        saveDeviceModel.Value7  = empValue[13].Substring(5).Replace(" ", "");    //  酸碱度 PH
                        saveDeviceModel.Value11 = empValue[14].Substring(5, 2).Replace(" ", ""); //  抗坏血酸 VC
                    }
                }

                if (saveDeviceModel.Value6 == "" || saveDeviceModel.Value5 == "")
                {
                    MessageBox.Show("测量错误,请重新测量!");
                    return;
                }

                string appInfo = string.Format("LEU:白细胞  {0}       BLD:尿潜血  {1}\nNIT:亚硝酸盐  {2}       KET:酮体  {3}\nUBG:尿胆原  {4}       BIL:胆红素  {5}\nPRO:蛋白质  {6}       GLU:葡萄糖  {7}\np H  {8}      V C:维生素C  {9}\nS G:尿比重  {10}\n              {11}"
                                               , saveDeviceModel.Value9.PadLeft(2, ' ')
                                               , saveDeviceModel.Value2.PadLeft(2, ' ')
                                               , saveDeviceModel.Value8.PadLeft(2, ' ')
                                               , saveDeviceModel.Value4.PadLeft(2, ' ')
                                               , saveDeviceModel.Value1.PadLeft(2, ' ')
                                               , saveDeviceModel.Value3.PadLeft(2, ' ')
                                               , saveDeviceModel.Value6.PadLeft(2, ' ')
                                               , saveDeviceModel.Value5.PadLeft(2, ' ')
                                               , saveDeviceModel.Value7.PadLeft(2, ' ')
                                               , saveDeviceModel.Value11.PadLeft(2, ' ')
                                               , saveDeviceModel.Value10, "尚未保存"
                                               );

                ClsMsgWindow.SendDeviceInfo("EMPUI" + ";BT");
                base.Invoke(new Action <string, string>(this.run_notify_window), new object[] { TranslateClsResult.GetDeviceCName("EMPUI"), appInfo });

                DeviceInfoBLL deviceInfo = new DeviceInfoBLL();

                if (deviceInfo.Add(saveDeviceModel) != 0)
                {
                    TranslateClsResult.set_tj_content(saveDeviceModel);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            StopRead();
        }