Esempio n. 1
0
        private DataTable GetDataTable(string paratime, out string errMsg)
        {
            DataTable dt = null;

            errMsg = "";
            if (yqDemo != null)
            {
                if (yqDemo.IsOpen(out errMsg) == false)
                {
                    yqDemo.open(out errMsg);
                }
                dt = yqDemo.YQDataReturn(paratime, out errMsg);
                return(dt);
            }
            else
            {
                if (yqxh.Trim().Length == 0)
                {
                    timer_lis.Enabled = false;
                    return(dt);
                }
                if (yqDemo == null)
                {
                    string yqVersion = xmlrw.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version");
                    yqDemo = LisFactory.LisCreate(yqVersion);
                }

                if (yqDemo.IsOpen(out errMsg) == false)
                {
                    yqDemo.open(out errMsg);
                }
                dt = yqDemo.YQDataReturn(paratime, out errMsg);
                return(dt);
            }
        }
Esempio n. 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            //string outMsg = "";
            //if (yqDemo != null)
            //{
            //    if (yqDemo.IsOpen(out outMsg) == false)
            //    {
            //        yqDemo.open(out outMsg);
            //    }
            //}
            //else
            //{

            //    string yqVersion = XmlRW.GetValueFormXML(System.Configuration.ConfigurationSettings.AppSettings["URT200B"].ToString(), "YQ_Version", "value");
            //    yqDemo = LisFactory.LisCreate(yqVersion);
            //}



            //DataTable dt = yqDemo.YQDataReturn("", out outMsg);
            ////string sss = yqDemo.getDataReceived(out outMsg);
            ////richTextBox1.Text = sss;
            //if (dt!=null)
            //{
            //    timer1.Enabled = false;
            //}
            //DataTable dt = yqDemo.YQDataReturn("", out outMsg);

            string outMsg = "";

            if (yqDemo != null)
            {
                if (yqDemo.IsOpen(out outMsg) == false)
                {
                    yqDemo.open(out outMsg);
                }
            }
            else
            {
                string yqVersion = TJClient.Common.XmlRW.GetValueFormXML(System.Configuration.ConfigurationSettings.AppSettings["US300"].ToString(), "YQ_Version", "value");
                yqDemo = LisFactory.LisCreate(yqVersion);
            }

            DataTable dt = yqDemo.YQDataReturn("", out outMsg);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive()
        {
            DataTable dt     = null;
            string    errMsg = "";

            try
            {
                string paratime = "";

                //开始时间
                if (dateTimePicker_start.Checked == true)
                {
                    paratime = paratime + dateTimePicker_start.Value.ToString("yyyy-MM-dd") + " 00:00:00" + "|";
                }

                //结束时间
                if (dateTimePicker_end.Checked == true)
                {
                    if (paratime.Length > 0)
                    {
                        paratime = paratime + dateTimePicker_end.Value.ToString("yyyy-MM-dd") + " 23:59:59";
                    }
                    else
                    {
                        paratime = paratime + "|" + dateTimePicker_end.Value.ToString("yyyy-MM-dd") + " 23:59:59";
                    }
                }

                if (paratime.Length == 0)
                {
                    paratime = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00" + "|";
                }

                //0:获取新数据  1:获取所有数据
                paratime = paratime + "|" + "0";


                if (yqDemo != null)
                {
                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }
                    dt = yqDemo.YQDataReturn(paratime, out errMsg);
                }
                else
                {
                    if (yqxh.Trim().Length == 0)
                    {
                        timer_lis.Enabled = false;

                        return(null);
                    }

                    if (yqDemo == null)
                    {
                        string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value");
                        yqDemo = LisFactory.LisCreate(yqVersion);
                    }

                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }

                    dt = yqDemo.YQDataReturn(paratime, out errMsg);
                }

                //将取得的结果保存到数据库中
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (!dt.Columns.Contains("yybm"))
                    {
                        DataColumn dtcolumn = new DataColumn("yybm");
                        dtcolumn.DefaultValue = UserInfo.Yybm;
                        dt.Columns.Add(dtcolumn);
                    }

                    if (!dt.Columns.Contains("yq"))
                    {
                        DataColumn dtcolumn = new DataColumn("yq");
                        dtcolumn.DefaultValue = timer_lis;
                        dt.Columns.Add(dtcolumn);
                    }

                    //Form_lisBll form_lisbll = new Form_lisBll();
                    //form_lisbll.Add(dt, "sql042");

                    //string xmlPath = System.Configuration.ConfigurationSettings.AppSettings["MECG200"].ToString();
                    //string YQ_YQtype = XmlRW.GetValueFormXML(xmlPath, "YQ_YQType","value");
                    //button_save_sys(dt, YQ_YQtype);

                    //将获得的结果匹配体检表中的心电图的结果
                    dt = dt_pp(dt);


                    //再次处理
                    DataTable dt_again    = dt.Clone();
                    DataRow[] dtrow_again = dt.Select(" qf='1'");
                    if (dtrow_again.Length > 0)
                    {
                        for (int i = 0; i < dtrow_again.Length; i++)
                        {
                            dt_again.ImportRow(dtrow_again[i]);
                        }
                    }

                    //新数据
                    DataTable dt_new    = dt.Clone();
                    DataRow[] dtrow_new = dt.Select(" qf='2'");
                    if (dtrow_new.Length > 0)
                    {
                        for (int i = 0; i < dtrow_new.Length; i++)
                        {
                            dt_new.ImportRow(dtrow_new[i]);
                            //置变量,以后不再读取此记录
                            MedExSqlHelper DBF = new MedExSqlHelper();
                            DBF.ExecuteNonQuery("update PACS_APPLY set work_status = 1 where PATIENT_ID = '" + dtrow_new[i]["ybh"].ToString() + "'");
                        }
                    }

                    Form_lisBll form_lisbll = new Form_lisBll();

                    if (dt_new != null && dt_new.Rows.Count > 0)
                    {
                        form_lisbll.Add(dt, "sql042");

                        string xmlPath   = Common.getyqPath("MECG200");
                        string YQ_YQtype = XmlRW.GetValueFormXML(xmlPath, "YQ_YQType", "value");
                        button_save_sys(dt, YQ_YQtype);
                    }

                    if (dt_again != null && dt_again.Rows.Count > 0)
                    {
                        //更新数据
                        form_lisbll.Upd_all(dt_again, "sql042_update");
                        string xmlPath   = Common.getyqPath("MECG200");
                        string YQ_YQtype = XmlRW.GetValueFormXML(xmlPath, "YQ_YQType", "value");

                        //更新数据
                        button_save_sys_again(dt_again, YQ_YQtype);
                    }
                }
            }
            catch (Exception ex)
            {
                timer_lis.Enabled = false;
                Jktj_lis.msgShow(ex.Message);
            }
            return(dt);
        }
Esempio n. 4
0
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive()
        {
            DataTable dt     = null;
            string    errMsg = "";

            try
            {
                if (yqDemo != null)
                {
                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }

                    dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg);
                }
                else
                {
                    if (yqxh.Trim().Length == 0)
                    {
                        timer_lis.Enabled = false;
                        //MessageBox.Show("请选择仪器!");

                        return(null);
                    }

                    if (yqDemo == null)
                    {
                        if (Common.getyqPath(yqxh).Length <= 0)
                        {
                            MessageBox.Show("仪器配置文件不存在!");
                            return(null);
                        }
                        string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value");

                        yqDemo = LisFactory.LisCreate(yqVersion);
                    }

                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }
                    dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg);
                }

                //将取得的结果保存到数据库中
                if (dt != null)
                {
                    if (!dt.Columns.Contains("yybm"))
                    {
                        DataColumn dtcolumn = new DataColumn("yybm");
                        dtcolumn.DefaultValue = UserInfo.Yybm;
                        dt.Columns.Add(dtcolumn);
                    }

                    if (!dt.Columns.Contains("yq"))
                    {
                        DataColumn dtcolumn = new DataColumn("yq");
                        dtcolumn.DefaultValue = timer_lis;
                        dt.Columns.Add(dtcolumn);
                    }

                    Form_lisBll form_lisbll = new Form_lisBll();

                    form_lisbll.Add(dt, "sql042");
                }
            }
            catch (Exception ex)
            {
                timer_lis.Enabled = false;
                Jktj_lis.msgShow(ex.Message);
            }
            return(dt);
        }