Ejemplo n.º 1
0
        private void frmDoctShemaTemplet_Load(object sender, EventArgs e)
        {
            if (this.Tag == null || this.Tag.ToString() == "" || this.Tag.ToString().ToUpper() == "DEPT")
            {
                this.SchemaType = Neusoft.HISFC.Models.Base.EnumSchemaType.Dept;
                this.Text       = "专科排班";
            }
            else
            {
                this.SchemaType = Neusoft.HISFC.Models.Base.EnumSchemaType.Doct;
                this.Text       = "专家排班";
            }

            this.InitTab();

            this.InitArray();

            this.InitDept();

            this.InitControls();

            this.QueryTodaySchema();
            //
            //			this.treeView1_AfterSelect(new object(),new System.Windows.Forms.TreeViewEventArgs(new TreeNode(),System.Windows.Forms.TreeViewAction.Unknown));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据模板类型和星期、科室查询排班模板
        /// </summary>
        /// <param name="schemaType"></param>
        /// <param name="week"></param>
        /// <param name="DeptID"></param>
        /// <returns></returns>
        public ArrayList Query(Neusoft.HISFC.Models.Base.EnumSchemaType schemaType, DayOfWeek week, string DeptID)
        {
            string sql = "", where = "";

            if (this.Sql.GetSql("Registration.Templet.Query.1", ref sql) == -1)
            {
                return(null);
            }
            if (this.Sql.GetSql("Registration.Templet.Query.2", ref where) == -1)
            {
                return(null);
            }

            sql = sql + " " + where;

            try
            {
                sql = string.Format(sql, (int)schemaType, (int)week, DeptID);
            }
            catch (Exception e)
            {
                this.Err     = "[Registration.Templet.Query.2]格式不匹配!" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }
            return(this.QueryBase(sql));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据星期、模板类别查询是否有效模板信息。
        /// 模板调用
        /// </summary>
        /// <param name="schemaType"></param>
        /// <param name="week"></param>
        /// <param name="IsValid"></param>
        /// <returns></returns>
        public ArrayList Query(Neusoft.HISFC.Models.Base.EnumSchemaType schemaType, DayOfWeek week, bool IsValid)
        {
            string sql = "", where = "";

            if (this.Sql.GetSql("Registration.Templet.Query.1", ref sql) == -1)
            {
                return(null);
            }
            if (this.Sql.GetSql("Registration.Templet.Query.3", ref where) == -1)
            {
                return(null);
            }

            sql = sql + " " + where;

            try
            {
                sql = string.Format(sql, (int)week, (int)schemaType, Neusoft.FrameWork.Function.NConvert.ToInt32(IsValid));
            }
            catch (Exception e)
            {
                this.Err     = "[Registration.Templet.Query.3]格式不匹配!" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }
            return(this.QueryBase(sql));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 根据出诊时间、排班类型检索排班信息
        /// </summary>
        /// <param name="seeDate"></param>
        /// <param name="type"></param>
        /// <param name="deptID"></param>
        /// <returns></returns>
        public ArrayList Query(DateTime seeDate, Neusoft.HISFC.Models.Base.EnumSchemaType type, string deptID)
        {
            string sql = "", where = "";

            if (this.Sql.GetSql("Registration.Schema.Query.1", ref sql) == -1)
            {
                return(null);
            }
            if (this.Sql.GetSql("Registration.Schema.Query.2", ref where) == -1)
            {
                return(null);
            }

            sql = sql + " " + where;

            try
            {
                sql = string.Format(sql, seeDate.ToString(), (int)type, deptID);
            }
            catch (Exception e)
            {
                this.Err     = "[Registration.Schema.Query.2]格式不匹配!" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }
            return(this.QueryBase(sql));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询专科日出诊情况/出诊专家的科室情况
        /// </summary>
        /// <param name="seeDate"></param>
        /// <param name="endDate"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public DataSet QueryDept(DateTime seeDate, DateTime endDate, Neusoft.HISFC.Models.Base.EnumSchemaType type)
        {
            string  sql = "";
            DataSet ds  = new DataSet();

            if (type == Neusoft.HISFC.Models.Base.EnumSchemaType.Dept)
            {
                if (this.Sql.GetSql("Registration.Schema.Query.6", ref sql) == -1)
                {
                    return(null);
                }

                try
                {
                    sql = string.Format(sql, seeDate.Date.ToString(), endDate.ToString());
                }
                catch (Exception e)
                {
                    this.Err     = "[Registration.Schema.Query.6]格式不匹配!" + e.Message;
                    this.ErrCode = e.Message;
                    return(null);
                }

                if (this.ExecQuery(sql, ref ds) == -1)
                {
                    return(null);
                }

                return(ds);
            }
            else
            {
                if (this.Sql.GetSql("Registration.Schema.Query.7", ref sql) == -1)
                {
                    return(null);
                }

                try
                {
                    sql = string.Format(sql, seeDate.Date.ToString(), endDate.ToString());
                }
                catch (Exception e)
                {
                    this.Err     = "[Registration.Schema.Query.7]格式不匹配!" + e.Message;
                    this.ErrCode = e.Message;
                    return(null);
                }

                if (this.ExecQuery(sql, ref ds) == -1)
                {
                    return(null);
                }

                return(ds);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 将专科、专家出诊科室添加到DataSet
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="type"></param>
        private void addDeptToDataSet(DataSet ds, Neusoft.HISFC.Models.Base.EnumSchemaType type)
        {
            dsItems.Tables[0].Rows.Clear();
            //DateTime current = this.regMgr.GetDateTimeFromSysDateTime() ;

            if (type == Neusoft.HISFC.Models.Base.EnumSchemaType.Dept)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    dsItems.Tables["Dept"].Rows.Add(new object[]
                    {
                        row[0],    //科室代码
                        row[1],    //科室名称
                        row[10],   //拼音吗
                        row[11],   //五笔码
                        row[12],   //自定义码
                        row[5],    //挂号限额
                        row[6],    //已挂号数
                        row[7],    //预约限额
                        row[8],    //已预约数
                        row[3],    //开始时间
                        row[4],    //结束时间
                        row[2],    //午别
                        Neusoft.FrameWork.Function.NConvert.ToBoolean(row[9])
                    });
                }
            }
            else
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    dsItems.Tables["Dept"].Rows.Add(new object[]
                    {
                        row[0],            //科室代码
                        row[1],            //科室名称
                        row[2],            //拼音吗
                        row[3],            //五笔码
                        row[4],            //自定义码
                        0,                 //挂号限额
                        0,                 //已挂号数
                        0,                 //预约限额
                        0,                 //已预约数
                        DateTime.MinValue, //开始时间
                        DateTime.MinValue, //结束时间
                        "",                //午别
                        false
                    });
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取出诊科室
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private int GetSchemaDept(Neusoft.HISFC.Models.Base.EnumSchemaType type)
        {
            DataSet ds = new DataSet();

            ds = this.SchemaMgr.QueryDept(this.dtBookingDate.Value.Date,
                                          this.registerManager.GetDateTimeFromSysDateTime(), type);
            if (ds == null)
            {
                MessageBox.Show(this.SchemaMgr.Err, "提示");
                return(-1);
            }

            this.addDeptToDataSet(ds, type);

            return(0);
        }
Ejemplo n.º 8
0
        private void ucTempletForm_Load(object sender, EventArgs e)
        {
            //if (this.Tag == null || this.Tag.ToString() == "" || this.Tag.ToString().ToUpper() == "DEPT")
            //{
            //    this.SchemaType = Neusoft.HISFC.Models.Base.EnumSchemaType.Dept;
            //    this.Text = "专科排班模板维护";
            //    //this.tbFind.Visible = false;
            //}
            //else
            //{
            this.SchemaType = Neusoft.HISFC.Models.Base.EnumSchemaType.Doct;
            this.Text       = "专家排班模板维护";
            //}

            this.InitArray();

            this.InitControls();

            this.InitDept();

            this.treeView1_AfterSelect(new object(), new System.Windows.Forms.TreeViewEventArgs(new TreeNode(), System.Windows.Forms.TreeViewAction.Unknown));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取最近的有效排班信息
        /// </summary>
        /// <param name="schemaType"></param>
        /// <param name="current"></param>
        /// <param name="deptID"></param>
        /// <param name="doctID"></param>
        /// <returns></returns>
        public Neusoft.HISFC.Models.Registration.Schema Query(Neusoft.HISFC.Models.Base.EnumSchemaType schemaType,
                                                              DateTime current, string deptID, string doctID)
        {
            #region 所有情况 太他妈的紧急了,不写sql了, 上线前夜

            /*
             * //预约专家
             * WHERE see_date >= to_date('{0}','yyyy-mm-dd hh24:mi:ss')
             * AND schema_type = '1'
             * AND doct_code = '{1}'
             * AND valid_flag = '1'
             * AND (tel_lmt > tel_reging OR append_flag = '1')
             * ORDER BY noon_code,append_flag,begin_time
             *
             * //预约专科
             * WHERE see_date >= to_date('{0}','yyyy-mm-dd hh24:mi:ss')
             * AND schema_type = '0'
             * AND dept_code = '{1}'
             * AND valid_flag = '1'
             * AND (tel_lmt > tel_reging OR append_flag = '1')
             * ORDER BY noon_code,append_flag,begin_time
             *
             * //专科
             * WHERE see_date >= to_date('{0}','yyyy-mm-dd hh24:mi:ss')
             * AND schema_type = '0'
             * AND dept_code = '{1}'
             * AND valid_flag = '1'
             * AND (reg_lmt > reged OR append_flag = '1')
             * ORDER BY noon_code,append_flag,begin_time
             *
             * //专家
             * WHERE see_date >= to_date('{0}','yyyy-mm-dd hh24:mi:ss')
             * AND schema_type = '1'
             * AND doct_code = '{1}'
             * AND valid_flag = '1'
             * AND (reg_lmt > reged OR append_flag = '1')
             * ORDER BY noon_code,append_flag,begin_time
             *
             * //特诊
             * WHERE see_date >= to_date('{0}','yyyy-mm-dd hh24:mi:ss')
             * AND schema_type = '0'
             * AND doct_code = '{1}'
             * AND valid_flag = '1'
             * AND (spe_lmt > spe_reged OR append_flag = '1')
             * ORDER BY noon_code,append_flag,begin_time*/
            #endregion

            string where = " WHERE see_date >= to_date('" + current.Date.ToString() + "','yyyy-mm-dd hh24:mi:ss')";

            //排班类型
            where = where + " AND schema_type = '" + ((int)schemaType).ToString() + "'";


            if (schemaType == Neusoft.HISFC.Models.Base.EnumSchemaType.Dept)
            {
                where = where + " AND dept_code = '" + deptID + "'" +
                        " AND end_time > to_date('" + current.ToString() + "','yyyy-mm-dd hh24:mi:ss')" +
                        " AND valid_flag = '1'" +
                        " ORDER BY see_date,noon_code,append_flag,begin_time";
            }
            else
            {
                //预约到专家
                where = where + " AND doct_code = '" + doctID + "'" +
                        " AND end_time > to_date('" + current.ToString() + "','yyyy-mm-dd hh24:mi:ss')" +
                        " AND valid_flag = '1'" +
                        " ORDER BY see_date,noon_code,append_flag,begin_time";
            }

            string sql = "";

            if (this.Sql.GetSql("Registration.Schema.Query.1", ref sql) == -1)
            {
                return(null);
            }

            sql = sql + where;

            if (this.QueryBase(sql) == null)
            {
                return(null);
            }

            if (al == null)
            {
                return(null);
            }

            if (al.Count == 0)
            {
                return(new Neusoft.HISFC.Models.Registration.Schema());
            }

            return((Neusoft.HISFC.Models.Registration.Schema)al[0]);
        }