Ejemplo n.º 1
0
        private void btnShowLog_Click(object sender, EventArgs e)
        {
            var f = new UploadLog();

            f.OnImportUploadList += list =>
            {
                var dal      = new T_JCXX_DAL();
                var count    = 0;
                var tempList = new List <string>();
                _lstJcxx = new List <T_JCXX>();

                foreach (string blh in list)
                {
                    tempList.Add(blh);

                    //每次用in查出500条
                    if (tempList.Count == 500 || list[list.Count - 1] == blh)
                    {
                        var blhString = "";
                        tempList.ForEach(o => blhString += $"'{o}',");
                        blhString = blhString.TrimEnd(',');

                        var sqlWhere = $" and f_blh in ({blhString}) ";
                        _lstJcxx.AddRange(dal.GetBySqlWhere(sqlWhere));

                        tempList.Clear();
                    }
                }

                BindData();
                lblStatus.Text = $"等待上传,共{_lstJcxx.Count}条";
            };

            f.ShowDialog();
        }
Ejemplo n.º 2
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            T_JCXX_DAL dal       = new T_JCXX_DAL();
            var        sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var        list1     = new List <T_JCXX>();

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                var sqlWhere = "1 =1 ";
                sqlWhere += $" and f_bz<>'' ";
                if (sqlFilter.Blk != null && (sqlFilter.Blk != "全部" && sqlFilter.Blk != ""))
                {
                    sqlWhere += $" and f_blk='{sqlFilter.Blk}' ";
                }
                if (sqlFilter.Bgrq1.HasValue)
                {
                    //收到日期
                    sqlWhere += $" and CONVERT(datetime,f_bgrq) >= CONVERT(datetime,'{sqlFilter.Bgrq1.Value.Date}') ";
                }
                if (sqlFilter.Bgrq2.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_bgrq) <=CONVERT(datetime,'{sqlFilter.Bgrq2.Value.Date.AddDays(1)}') ";
                }
                if (!string.IsNullOrEmpty(sqlFilter.CrisisText))
                {
                    sqlWhere += $" and f_bz like '%{sqlFilter.CrisisText}%' ";
                }

                list1 = T_JCXX_DAL.GetBySqlWhere(sqlWhere, "f_bgrq");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (list1.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = list1;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 3
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            T_JCXX_DAL dal       = new T_JCXX_DAL();
            var        sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var        list1     = dal.GetJcxxTbsList(sqlFilter);

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                foreach (T_JCXX jcxx in list1)
                {
                    SplashScreenManager.ShowDefaultWaitForm($"分析二次诊断数据 {list1.IndexOf(jcxx)}/{list1.Count}");
                    T_JCXX jcxxPre = dal.GetPreJcxx(jcxx);
                    jcxx.PreJcxx = jcxxPre;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            //去掉没有上次检验的
            list1 = list1.Where(o => o.PreJcxx != null && string.IsNullOrEmpty(o.PreJcxx.F_BLH) == false).ToList();
            //差异值过滤
            if (sqlFilter != null && sqlFilter.ValueDiff > 0)
            {
                list1 = list1.Where(o => Math.Abs(o.TBS_VALUE_DIFF) >= Math.Abs(sqlFilter.ValueDiff)).ToList();
            }

            if (list1.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = list1;
            gridView1.RefreshData();
            gridView1.BestFitColumns();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 如果JCXX状态为已审核,则回传结果
        /// 否则若病人类型为门诊,则进行门诊确费
        /// </summary>
        /// <param name="pathoNo">病理号</param>
        /// <param name="aa"></param>
        public void SendResult(string pathoNo)
        {
            T_JCXX jcxx = null;

            try
            {
                jcxx = new T_JCXX_DAL().GetModel(pathoNo);
            }
            catch (Exception e)
            {
                throw new Exception("没有找到该结果,病理号为:" + pathoNo);
            }

            if (jcxx == null)
            {
                throw new Exception("没有找到该结果,病理号为:" + pathoNo);
            }


            log.WriteMyLog("进入sendResult" + jcxx.F_SJKS);

            try
            {
                if (jcxx.F_BGZT == "已审核") //如果已审核,执行回传结果
                {
                    SendResult(jcxx);
                }
                else if (string.IsNullOrEmpty(jcxx.F_MZH.Trim()) == false) //如果不是已审核且科室为门诊,执行门诊确费
                {
                    log.WriteMyLog("进入OutCheckFee");
                    OutCheckFee(jcxx);
                }
            }
            catch (Exception e)
            {
                //该接口陈程要求所有报错都不弹窗,只记录log
            }
        }
Ejemplo n.º 5
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            T_JCXX_DAL  dal          = new T_JCXX_DAL();
            List <T_YH> yhList       = null;
            var         dataEntities = new List <DataEntity>();

            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                string sqlCg = " select f_bgys bgys,f_fzys fzys from [dbo].[T_JCXX] t where F_BZ like '疑难病例' ";
                string sqlBc =
                    "select f_bc_bgys bgys,F_BC_FZYS fzys from [dbo].[T_BCBG] bc inner join t_jcxx t on t.f_blh=bc.f_blh where F_BC_BZ like  '疑难病例' and F_BC_BGXH='1' ";
                string sqlWhereBc = "";
                string sqlWhereCg = "";

                if (sqlFilter.Blk != null && (sqlFilter.Blk != "全部" && sqlFilter.Blk != ""))
                {
                    sqlWhereCg += $" and t.f_blk='{sqlFilter.Blk}' ";
                    sqlWhereBc += $" and t.f_blk='{sqlFilter.Blk}' ";
                }

                if (sqlFilter.Sdrq1.HasValue)
                {
                    //收到日期
                    sqlWhereBc += $" and CONVERT(datetime,t.f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                    sqlWhereCg += $" and CONVERT(datetime,t.f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                }
                if (sqlFilter.Sdrq2.HasValue)
                {
                    sqlWhereBc += $" and CONVERT(datetime,t.f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                    sqlWhereCg += $" and CONVERT(datetime,t.f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                }
                //如果输入医生姓名,取单一的医生姓名,否则取用户列表
                if (!string.IsNullOrEmpty(sqlFilter.医生姓名))
                {
                    yhList = new List <T_YH>();
                    yhList.Add(new T_YH()
                    {
                        F_YHMC = sqlFilter.医生姓名
                    });
                }
                else
                {
                    yhList = T_YH_DAL.GetList("");
                }

                var dtCg = CommonDAL.GetTableBySql(sqlCg + sqlWhereCg);
                var dtBc = CommonDAL.GetTableBySql(sqlBc + sqlWhereBc);

                var dtCgEnumerable = dtCg.Rows.Cast <DataRow>().ToList();
                var dtBcEnumerable = dtBc.Rows.Cast <DataRow>().ToList();

                foreach (T_YH yh in yhList)
                {
                    DataEntity entity = new DataEntity();
                    entity.医生姓名 = yh.F_YHMC;
                    entity.常规初诊 = dtCgEnumerable.Count(dr => dr["bgys"].ToString().Contains(yh.F_YHMC));
                    entity.常规复诊 = dtCgEnumerable.Count(dr => dr["fzys"].ToString().Contains(yh.F_YHMC) && dr["bgys"].ToString().Contains(yh.F_YHMC) == false);
                    entity.补充初诊 = dtBcEnumerable.Count(dr => dr["bgys"].ToString().Contains(yh.F_YHMC));
                    entity.补充复诊 = dtBcEnumerable.Count(dr => dr["fzys"].ToString().Contains(yh.F_YHMC) && dr["bgys"].ToString().Contains(yh.F_YHMC) == false);

                    if (entity.常规初诊 + entity.常规复诊 + entity.补充初诊 + entity.补充复诊 > 0)
                    {
                        dataEntities.Add(entity);
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (dataEntities.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = dataEntities;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 6
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            var dal       = new T_JCXX_DAL();
            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var list1     = new List <T_JCXX>();

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                var sqlWhere = "1 =1 ";

                //病例库
                if (sqlFilter.Blk != null && sqlFilter.Blk != "全部" && sqlFilter.Blk != "")
                {
                    sqlWhere += $" and f_blk='{sqlFilter.Blk}' ";
                }

                //收到日期
                if (sqlFilter.Sdrq1.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                }
                if (sqlFilter.Sdrq2.HasValue)
                {
                    sqlWhere +=
                        $" and CONVERT(datetime,f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                }

                //报告状态
                if (sqlFilter.Bgzt != Bgzts.全部)
                {
                    sqlWhere += $" and f_bgzt = '{sqlFilter.Bgzt}' ";
                }
                else
                {
                    sqlWhere += $" and f_bgzt in ('已写报告','已审核') ";
                }

                //医嘱项目
                if (string.IsNullOrEmpty(sqlFilter.Yzxm) == false && sqlFilter.Yzxm != "全部")
                {
                    sqlWhere += $" and f_yzxm = '{sqlFilter.Yzxm}' ";
                }

                //项目分类
                if (sqlFilter.Xmfl != null && (sqlFilter.Xmfl != "全部" && sqlFilter.Xmfl.Trim() != ""))
                {
                    sqlWhere += $" and f_bblx='{sqlFilter.Xmfl}' ";
                }

                list1 = T_JCXX_DAL.GetBySqlWhere(sqlWhere);

                //处理报告发放天数
                foreach (T_JCXX jcxx in list1)
                {
                    jcxx.发放天数 = GetDays(jcxx);
                    //去掉项目前面的编号
                    if (jcxx.F_YZXM.Split('^').Length > 1)
                    {
                        jcxx.F_YZXM = jcxx.F_YZXM.Split('^')[1];
                    }
                }

                //获得合计
                var reportCountList = (from o in list1
                                       group o by o.发放天数
                                       into g
                                       orderby Convert.ToInt32(g.Key)
                                       select new
                {
                    工作日 = g.Key.ToString(),
                    数量 = g.Count()
                }
                                       ).ToList();

                var totalCount = reportCountList.Sum(o => o.数量);

                reportCountList.Add(new { 工作日 = "合计", 数量 = totalCount });

                gridControl2.DataSource = reportCountList;
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (list1.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = list1;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 7
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            var dal       = new T_JCXX_DAL();
            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var list      = new List <ReportItem>();

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                var sqlWhere = "1 =1 ";

                //报告日期
                if (sqlFilter.Bgrq1.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_sdrq) >= CONVERT(datetime,'{sqlFilter.Bgrq1.Value.Date}') ";
                }
                if (sqlFilter.Bgrq2.HasValue)
                {
                    sqlWhere +=
                        $" and CONVERT(datetime,f_sdrq) <=CONVERT(datetime,'{sqlFilter.Bgrq2.Value.Date.AddDays(1)}') ";
                }

                sqlWhere += $" and f_blk in ('常规','小标本','细胞学','病理会诊','细针穿刺','肾穿1','肾穿2') ";

                string sql = $" select count(*) c,case when ltrim(rtrim(f_zyh))='' then '0' else '1' end as zy, f_blk,F_SJDW,F_SFFH,f_sjks from t_jcxx" +
                             $" where {sqlWhere} " +
                             $" group by f_blk,f_sjks,F_SJDW,F_SFFH,case when ltrim(rtrim(f_zyh))='' then '0' else '1' end ";
                var dtSource = CommonDAL.GetTableBySql(sql);

                //处理数据
                var queryableSource = from o in dtSource.Rows.Cast <DataRow>()
                                      select new
                {
                    count = Convert.ToInt32(o["c"]),
                    blk   = o["f_blk"].ToString(),
                    sjdw  = o["f_sjdw"].ToString(),
                    sffh  = o["f_sffh"].ToString(),
                    zy    = o["zy"].ToString(),
                    sjks  = o["f_sjks"].ToString().Trim()
                };

                //常规检查
                var commonItem = new ReportItem();
                list.Add(commonItem);
                var queryableCommon = queryableSource.Where(o => o.blk == "常规" || o.blk == "小标本");
                commonItem.序号      = 1;
                commonItem.类别      = "病理检查(常规)";
                commonItem.总人次数    = queryableCommon.Sum(o => o.count);
                commonItem.诊断符合人次数 = queryableCommon.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //常规检查_院外
                var commonItemOutside = new ReportItem();
                list.Add(commonItemOutside);
                var queryableCommonOutSide = queryableSource.Where(o => o.blk == "常规" || o.blk == "小标本").Where(o => o.sjdw != "中山大学附一院");
                commonItemOutside.序号      = 1;
                commonItemOutside.类别      = "院外";
                commonItemOutside.总人次数    = queryableCommonOutSide.Sum(o => o.count);
                commonItemOutside.诊断符合人次数 = queryableCommonOutSide.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //常规检查_院内
                var commonItemInside = new ReportItem();
                list.Add(commonItemInside);
                var queryableCommonInSide = queryableSource.Where(o => o.blk == "常规" || o.blk == "小标本").Where(o => o.sjdw == "中山大学附一院");
                commonItemInside.序号      = 1;
                commonItemInside.类别      = "院内合计";
                commonItemInside.总人次数    = queryableCommonInSide.Sum(o => o.count);
                commonItemInside.诊断符合人次数 = queryableCommonInSide.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //常规检查_院内_门诊
                var commonItemInsideMz = new ReportItem();
                list.Add(commonItemInsideMz);
                var queryableCommonInSideMz = queryableCommonInSide.Where(o => o.zy != "1");
                commonItemInsideMz.序号      = 1;
                commonItemInsideMz.类别      = "院内门诊";
                commonItemInsideMz.总人次数    = queryableCommonInSideMz.Sum(o => o.count);
                commonItemInsideMz.诊断符合人次数 = queryableCommonInSideMz.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //常规检查_院内_门诊
                var commonItemInsideZy = new ReportItem();
                list.Add(commonItemInsideZy);
                var queryableCommonInSideZy = queryableCommonInSide.Where(o => o.zy == "1");
                commonItemInsideZy.序号      = 1;
                commonItemInsideZy.类别      = "院内住院";
                commonItemInsideZy.总人次数    = queryableCommonInSideZy.Sum(o => o.count);
                commonItemInsideZy.诊断符合人次数 = queryableCommonInSideZy.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //非妇科细胞学涂片
                var itemCell = new ReportItem();
                list.Add(itemCell);
                var queryableCell = queryableSource.Where(o => o.blk == "细胞学");
                itemCell.序号      = 2;
                itemCell.类别      = "非妇科细胞学涂片";
                itemCell.总人次数    = queryableCell.Sum(o => o.count);
                itemCell.诊断符合人次数 = queryableCell.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //会诊病例
                var itemHz = new ReportItem();
                list.Add(itemHz);
                var queryableHz = queryableSource.Where(o => o.blk == "病理会诊");
                itemHz.序号      = 6;
                itemHz.类别      = "会诊病例";
                itemHz.总人次数    = queryableHz.Sum(o => o.count);
                itemHz.诊断符合人次数 = queryableHz.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //本院肾穿
                var itemInSc = new ReportItem();
                list.Add(itemInSc);
                var queryableInSc = queryableSource.Where(o => o.blk == "肾穿1" || (o.blk == "肾穿2" && o.sjks.Trim() != ""));
                itemInSc.序号      = 9;
                itemInSc.类别      = "本院肾穿";
                itemInSc.总人次数    = queryableInSc.Sum(o => o.count);
                itemInSc.诊断符合人次数 = queryableInSc.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //外院肾穿
                var itemOutSc = new ReportItem();
                list.Add(itemOutSc);
                var queryableOutSc = queryableSource.Where(o => o.blk == "肾穿2" && o.sjks.Trim() == "");
                itemOutSc.序号      = 9;
                itemOutSc.类别      = "外院肾穿";
                itemOutSc.总人次数    = queryableOutSc.Sum(o => o.count);
                itemOutSc.诊断符合人次数 = queryableOutSc.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //细针穿刺
                var itemCC = new ReportItem();
                list.Add(itemCC);
                var queryableCC = queryableSource.Where(o => o.blk == "细针穿刺");
                itemCC.序号      = 10;
                itemCC.类别      = "细针穿刺";
                itemCC.总人次数    = queryableCC.Sum(o => o.count);
                itemCC.诊断符合人次数 = queryableCC.Where(o => o.sffh != "不符合").Sum(o => o.count);

                //合计
                var itemAll      = new ReportItem();
                var queryableAll = queryableSource;
                var 合计类别         = new string[] { "病理检查(常规)", "细针穿刺", "外院肾穿", "本院肾穿", "会诊病例", "非妇科细胞学涂片" };
                itemAll.序号      = 99;
                itemAll.类别      = "总计";
                itemAll.总人次数    = list.Where(o => 合计类别.Contains(o.类别)).Sum(o => o.总人次数);
                itemAll.诊断符合人次数 = list.Where(o => 合计类别.Contains(o.类别)).Sum(o => o.诊断符合人次数);
                list.Add(itemAll);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (list.Count == 0)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            reportItemBindingSource.DataSource = list;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 8
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            T_JCXX_DAL  dal          = new T_JCXX_DAL();
            List <T_YH> yhList       = null;
            var         dataEntities = new List <DataEntity>();

            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                string sqlCg      = " select f_bgys bgys,f_fzys fzys from [dbo].[T_JCXX] t where F_BZ like '疑难病例' ";
                string sqlWhereCg = "";
                string sqlQC      =
                    "select t.F_QCYS qcys,count(distinct t.f_blh) lishu,count(*) heshu from t_jcxx t left join T_QCMX q on t.F_BLH=q.F_BLH ";
                string sqlWhereQc = " where 1=1 ";
                string sqlGroupQc = " group by t.F_QCYS ";

                if (sqlFilter.Blk != null && (sqlFilter.Blk != "全部" && sqlFilter.Blk != ""))
                {
                    sqlWhereCg += $" and t.f_blk='{sqlFilter.Blk}' ";
                    sqlWhereQc += $" and t.f_blk='{sqlFilter.Blk}' ";
                }

                if (sqlFilter.Sdrq1.HasValue)
                {
                    //收到日期
                    sqlWhereCg += $" and CONVERT(datetime,t.f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                    sqlWhereQc += $" and CONVERT(datetime,t.f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                }
                if (sqlFilter.Sdrq2.HasValue)
                {
                    sqlWhereCg += $" and CONVERT(datetime,t.f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                    sqlWhereQc += $" and CONVERT(datetime,t.f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                }
                //如果输入医生姓名,取单一的医生姓名,否则取用户列表
                if (!string.IsNullOrEmpty(sqlFilter.医生姓名))
                {
                    yhList = new List <T_YH>();
                    yhList.Add(new T_YH()
                    {
                        F_YHMC = sqlFilter.医生姓名
                    });
                }
                else
                {
                    yhList = T_YH_DAL.GetList("");
                }

                var dtCg = CommonDAL.GetTableBySql(sqlCg + sqlWhereCg);
                var dtQc = CommonDAL.GetTableBySql(sqlQC + sqlWhereQc + sqlGroupQc);

                var dtCgEnumerable = dtCg.Rows.Cast <DataRow>().ToList();
                var dtQcEnumerable = dtQc.Rows.Cast <DataRow>().ToList();

                foreach (T_YH yh in yhList)
                {
                    DataEntity entity = new DataEntity();
                    entity.医生姓名 = yh.F_YHMC;
                    entity.常规初诊 = dtCgEnumerable.Count(dr => dr["bgys"].ToString().Contains(yh.F_YHMC));
                    entity.常规复诊 = dtCgEnumerable.Count(dr => dr["fzys"].ToString().Contains(yh.F_YHMC) && dr["bgys"].ToString().Contains(yh.F_YHMC) == false);
                    object lishu = dtQcEnumerable.SingleOrDefault(dr => dr["qcys"].ToString() == yh.F_YHMC)?["lishu"];
                    if (lishu != null)
                    {
                        entity.取材_例 = (int)lishu;
                    }
                    object heshu = dtQcEnumerable.SingleOrDefault(dr => dr["qcys"].ToString() == yh.F_YHMC)?["heshu"];
                    if (heshu != null)
                    {
                        entity.取材_盒 = (int)heshu;
                    }

                    if (entity.常规初诊 + entity.常规复诊 + entity.取材_例 + entity.取材_盒 > 0)
                    {
                        dataEntities.Add(entity);
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (dataEntities.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = dataEntities;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 9
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            var dal       = new T_JCXX_DAL();
            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var list1     = new List <T_JCXX>();

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                var sqlWhere = "1 =1 ";

                //病例库
                if (sqlFilter.Blk != null && sqlFilter.Blk != "全部" && sqlFilter.Blk != "")
                {
                    sqlWhere += $" and f_blk='{sqlFilter.Blk}' ";
                }

                //收到日期
                if (sqlFilter.Sdrq1.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                }
                if (sqlFilter.Sdrq2.HasValue)
                {
                    sqlWhere +=
                        $" and CONVERT(datetime,f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                }

                //报告状态
                if (sqlFilter.Bgzt != Bgzts.全部)
                {
                    sqlWhere += $" and f_bgzt = '{sqlFilter.Bgzt}' ";
                }

                //项目分类
                if (sqlFilter.Xmfl != null && (sqlFilter.Xmfl != "全部" && sqlFilter.Xmfl.Trim() != ""))
                {
                    sqlWhere += $" and f_bblx='{sqlFilter.Xmfl}' ";
                }

                //医嘱项目
                if (string.IsNullOrEmpty(sqlFilter.Yzxm.Trim()) == false && sqlFilter.Yzxm != "全部")
                {
                    sqlWhere += $" and f_yzxm = '{sqlFilter.Yzxm}' ";
                }

                sqlWhere += " and ( ltrim(rtrim(f_WFBGYY))!='' or ltrim(rtrim(f_spare9))!= '' )";

                list1 = T_JCXX_DAL.GetBySqlWhere(sqlWhere);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (list1.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = list1;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }
Ejemplo n.º 10
0
        public static void Send(string[] args)
        {
            Logger.Debug("接口exe被调用,入参:" + args[0]);

            IniFiles   f            = new IniFiles("sz.ini");
            var        blh          = "";
            var        bglx         = ""; //cg/bd/bc
            var        reportNumber = "";
            var        czlb         = ""; //new/old
            var        dz           = ""; //save/qxsh/dy/qxdy
            EditType   editType;
            PisAction  pisAction;
            string     hospName;
            ReportType reportType;

            #region 处理入参

            //处理入参
            try
            {
                string[] aa = args[0].Split('^');
                blh          = aa[0];
                bglx         = aa[1].ToLower(); //cg/bd/bc
                reportNumber = aa[2];
                czlb         = aa[3].ToLower(); //new/old
                dz           = aa[4].ToLower(); //save/qxsh/dy/qxdy

                reportType = ReportType.常规报告;
                switch (bglx)
                {
                case "cg":
                default:
                    reportType = ReportType.常规报告;
                    break;

                case "bd":
                    reportType = ReportType.冰冻报告;
                    break;

                case "bc":
                    reportType = ReportType.补充报告;
                    break;
                }
                editType = czlb == "new" ? EditType.新建 : EditType.修改;
                switch (dz)
                {
                case "save":
                    if (editType == EditType.新建)
                    {
                        pisAction = PisAction.新登记;
                    }
                    else
                    {
                        pisAction = PisAction.保存;
                    }
                    break;

                case "qxsh":
                    pisAction = PisAction.取消审核;
                    break;

                case "dy":
                    pisAction = PisAction.打印;
                    break;

                case "qxdy":
                    pisAction = PisAction.取消打印;
                    break;

                default:
                    pisAction = PisAction.未知;
                    break;
                }

                hospName = f.ReadString("savetohis", "yymc", "123").Replace("\0", "");
            }
            catch (Exception e)
            {
                Logger.Error("传入参数解析出错:" + e);
                MessageBox.Show("回传EXE入参错误:" + e);
                return;
            }

            #endregion

            Logger.Debug("EXE接口查询jcxx,病理号:" + blh);
            T_JCXX jcxx = T_JCXX_DAL.GetModel(blh);

            Logger.Debug("尝试获取接口实例,医院名称:" + hospName);
            var sender = Factory.GetSendToThirdPartyByHisName(hospName);

            if (sender == null)
            {
                Logger.Error("获取接口实例失败!");
            }

            Logger.Info($"开始调用EXE接口,病理号:{blh},操作类型:{pisAction},报告状态:{jcxx.F_BGZT}");
            switch (pisAction)
            {
            case PisAction.新登记:
                sender.OnAddReport(jcxx, reportType);
                break;

            case PisAction.保存:
                if (jcxx.F_BGZT == "已审核")
                {
                    sender.OnCheckReport(jcxx, reportType);
                }
                else
                {
                    sender.OnSaveReport(jcxx, reportType);
                }
                break;

            case PisAction.取消审核:
                sender.OnCancelCheckReport(jcxx, reportType);
                break;

            case PisAction.打印:
                sender.OnPrintReport(jcxx, reportType);
                break;

            case PisAction.取消打印:
                sender.OnCancelPrintReport(jcxx, reportType);
                break;

            default:
                throw new Exception("接口调用失败,无法解析PIS给的入参.");
            }
        }
Ejemplo n.º 11
0
        public void Query()
        {
            dataLayoutControl1.Validate();

            var dal       = new T_JCXX_DAL();
            var sqlFilter = sqlFilterBindingSource.Current as SqlFilter;
            var list1     = new List <T_JCXX>();

            SplashScreenManager.ShowDefaultWaitForm($"正在查询");

            try
            {
                var sqlWhere = "1 =1 ";

                //病例库
                if (sqlFilter.Blk != null && sqlFilter.Blk != "全部" && sqlFilter.Blk != "")
                {
                    sqlWhere += $" and f_blk='{sqlFilter.Blk}' ";
                }

                //报告日期
                if (sqlFilter.Bgrq1.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_bgrq) >= CONVERT(datetime,'{sqlFilter.Bgrq1.Value.Date}') ";
                }
                if (sqlFilter.Bgrq2.HasValue)
                {
                    sqlWhere +=
                        $" and CONVERT(datetime,f_bgrq) <=CONVERT(datetime,'{sqlFilter.Bgrq2.Value.Date.AddDays(1)}') ";
                }

                //收到日期
                if (sqlFilter.Sdrq1.HasValue)
                {
                    sqlWhere += $" and CONVERT(datetime,f_sdrq) >= CONVERT(datetime,'{sqlFilter.Sdrq1.Value.Date}') ";
                }
                if (sqlFilter.Sdrq2.HasValue)
                {
                    sqlWhere +=
                        $" and CONVERT(datetime,f_sdrq) <=CONVERT(datetime,'{sqlFilter.Sdrq2.Value.Date.AddDays(1)}') ";
                }

                //报告状态
                if (sqlFilter.Bgzt != Bgzts.全部)
                {
                    sqlWhere += $" and f_bgzt = '{sqlFilter.Bgzt}' ";
                }

                //项目分类
                if (sqlFilter.Xmfl != null && (sqlFilter.Xmfl != "全部" && sqlFilter.Xmfl.Trim() != ""))
                {
                    sqlWhere += $" and f_bblx='{sqlFilter.Xmfl}' ";
                }

                //检测项目(医嘱项目)
                if (string.IsNullOrEmpty(sqlFilter.Yzxm.Trim()) == false && sqlFilter.Yzxm != "全部")
                {
                    sqlWhere += $" and f_yzxm = '{sqlFilter.Yzxm}' ";
                }

                //临床诊断
                if (string.IsNullOrEmpty(sqlFilter.Lczd.Trim()) == false)
                {
                    sqlWhere += $" and f_lczd like '%{sqlFilter.Lczd}%' ";
                }

                //是否阳性
                if (sqlFilter.IsPositive == false)
                {
                    sqlWhere += "and not";
                }
                else
                {
                    sqlWhere += " and ";
                }
                sqlWhere +=
                    " ((f_fz_blzd like '%突变型%' or F_FZ_BLZD like '%阳性%' or F_FZ_BLZD like '%不稳定%' )and( f_fz_blzd not LIKE '%未见%' and f_fz_blzd not LIKE '%微卫星稳定%')) ";

                string sql =
                    $"select t.*,t2.f_fz_blzd,t2.F_dnazk,t2.F_RNAZK  from t_jcxx t inner join (select f_blh,f_fz_blzd,F_dnazk,F_RNAZK from T_TBS_BG) t2 on t.F_BLH=t2.F_BLH where ";
                sql += sqlWhere;

                var dt1 = CommonDAL.GetTableBySql(sql);
                foreach (DataRow dr in dt1.Rows)
                {
                    var jcxx = T_JCXX_DAL.DataRowToModel(dr);
                    jcxx.F_FZ_BLZD = dr["f_fz_blzd"].ToString();
                    jcxx.F_DNAZK   = dr["F_dnazk"].ToString();
                    jcxx.F_RNAZK   = dr["F_RNAZK"].ToString();
                    list1.Add(jcxx);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                return;
            }
            finally
            {
                try
                {
                    SplashScreenManager.CloseDefaultWaitForm();
                }
                catch
                {
                }
            }

            if (list1.Any() == false)
            {
                XtraMessageBox.Show("没有找到任何结果!");
            }
            tJCXXBindingSource.DataSource = list1;
            gridView1.RefreshData();
            gridView1.ExpandAllGroups();

            gridView1.BestFitColumns();
        }