/// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive(OpInfo info)
        {
            DataTable dt     = null;
            string    errMsg = "";

            try
            {
                string paratime = GetParams(info);
                _logHelper.AppendMessageToTxt(string.Format("时间范围为:{0}", paratime));
                dt = GetDataTable(paratime, out errMsg);

                //将取得的结果保存到数据库中
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataTableSecondaryTreatment(ref dt);
                    button_save_sys(dt, GetYqType());
                }
                else
                {
                    _logHelper.AppendMessageToTxt(string.Format("{0}:数据不存在", DateHelper.CurrDateTime()));
                }
                if (info.OpType != "0")
                {
                    _needToOperation = false;
                }
            }
            catch (Exception ex)
            {
                Jktj_lis.msgShow(ex.Message);
            }
            return(dt);
        }
Beispiel #2
0
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive(out string error, string operation = "0")
        {
            DataTable dt = null;

            error = "";
            string errMsg = "";

            try
            {
                dt = GetDataTable("", out errMsg);

                //将取得的结果保存到数据库中
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataTableSecondaryTreatment(ref dt);

                    dt_pp(dt);
                    //检查数据保存到T_JK_lis_result_re中
                    //Form_lisBll form_lisbll = new Form_lisBll();
                    //form_lisbll.Add(dt, "sql042");
                    Upd_all(dt);

                    button_save_sys(dt, GetYQType());
                }

                timer_lis.Enabled = true;
            }
            catch (Exception ex)
            {
                timer_lis.Enabled = false;
                error             = ex.Message;
                Jktj_lis.msgShow(ex.Message);

                //throw new Exception(ex.Message );
            }
            return(dt);
        }
Beispiel #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);
        }
Beispiel #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);
        }