/// <summary> /// 返回7天的体温 /// </summary> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <returns></returns> public static List <DataTable> GetTempertureCount(string inTime, string startTime, string endTime, string child_id) { List <DataTable> list = new List <DataTable>(); string sql1 = string.Format("select CHILD_ID, " + "MEASURE_TIME, TEMPERATURE_VALUE, " + "RE_MEASURE, DESCRIBE from T_CHILD_VITAL_SIGNS WHERE" + "WHERE MEASURE_TIME " + "BETWEEN to_date('{0}','yyyy-MM-dd') AND to_date('{1}','yyyy-MM-dd') AND pid = '{2}' ORDER BY MEASURE_TIME ", startTime, endTime, child_id); string sql2 = string.Format("select CHILD_ID," + "FEED_STYLE, ICTERUS, STOOL_COUNT," + "STOOL_COLOR, UMBILICALCORD, WEIGHT," + "RECORD_TIME from T_CHILD_TEMPERATURE_INFO WHERE " + "WHERE RECORD_TIME BETWEEN to_date('{0}','yyyy-MM-dd') AND to_date('{1}','yyyy-MM-dd') AND pid = '{2}' ORDER BY record_time", startTime, endTime, child_id); string sql3 = string.Format("select measure_time from t_vital_signs " + "where Describe like '%手术%' " + "and CHILD_ID ='{0}' " + "and MEASURE_TIME BETWEEN to_date('{1}','yyyy-MM-dd') AND to_date('{2}','yyyy-MM-dd') " + "ORDER BY MEASURE_TIME", child_id, DateTime.Parse(inTime).ToString("yyyy-MM-dd"), endTime); Bifrost.WebReference.Class_Table[] table = new Bifrost.WebReference.Class_Table[3]; table[0] = new Bifrost.WebReference.Class_Table(); table[0].Sql = sql1; table[0].Tablename = "sql1"; table[1] = new Bifrost.WebReference.Class_Table(); table[1].Sql = sql2; table[1].Tablename = "sql2"; table[2] = new Bifrost.WebReference.Class_Table(); table[2].Sql = sql3; table[2].Tablename = "sql3"; DataSet dssqls = App.GetDataSet(table); try { list.Add(dssqls.Tables["sql1"]); list.Add(dssqls.Tables["sql2"]); list.Add(dssqls.Tables["sql3"]); } catch (System.Exception ex) { } return(list); }
/// <summary> /// 根据科室显示已经授权的人 /// </summary> private void Show_chaxun() { lstSetionName.Items.Clear(); Bifrost.WebReference.Class_Table[] NTables1 = new Bifrost.WebReference.Class_Table[1]; NTables1[0] = new Bifrost.WebReference.Class_Table(); NTables1[0].Tablename = "Sections_peoples"; NTables1[0].Sql = "select * from T_APPROVE_ACCREDIT tap inner join t_userinfo us on tap.userid=us.user_id "; DataSet ds = App.GetDataSet(NTables1); DataRow[] Rows = ds.Tables["Sections_peoples"].Select("SID='" + Id + "'"); Class_User[] Directionarys = GetDirectionary(Rows); if (Directionarys != null) { for (int i = 0; i < Directionarys.Length; i++) { ListViewItem tm = new ListViewItem(); tm.Tag = Directionarys[i].User_id; tm.Text = Directionarys[i].User_name; lstSetionName.Items.Add(tm); } } }
/// <summary> /// 初始化数据 /// </summary> private void InitCombobox() { Bifrost.WebReference.Class_Table[] cboTables = new Bifrost.WebReference.Class_Table[4]; //初始化文书类型 cboTables[0] = new Bifrost.WebReference.Class_Table(); cboTables[0].Sql = "select * from t_data_code ta where ta.type=18 and ta.name in('体温单','体温单其他')";//,'危重护理记录' cboTables[0].Tablename = "TextKind"; //监控患者类型 cboTables[1] = new Bifrost.WebReference.Class_Table(); cboTables[1].Sql = "select * from t_data_code where type=27"; cboTables[1].Tablename = "MonitorType"; //参考时间 cboTables[2] = new Bifrost.WebReference.Class_Table(); cboTables[2].Sql = "select * from t_data_code where type=28 and enable='Y'"; cboTables[2].Tablename = "CKTime"; //监控子项 cboTables[3] = new Bifrost.WebReference.Class_Table(); cboTables[3].Sql = "select * from t_data_code where type=29 and enable='Y'"; cboTables[3].Tablename = "Monitoring"; CBO_DS = App.GetDataSet(cboTables); //初始化文书类型 dataTable = CBO_DS.Tables["TextKind"]; newrow = dataTable.NewRow(); newrow[1] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); this.cboTextKind.DataSource = CBO_DS.Tables["TextKind"].DefaultView; this.cboTextKind.ValueMember = "ID"; this.cboTextKind.DisplayMember = "Name"; //监控子项 dataTable = CBO_DS.Tables["Monitoring"]; newrow = dataTable.NewRow(); newrow[1] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); this.cboMonitoring.DataSource = CBO_DS.Tables["Monitoring"].DefaultView; this.cboMonitoring.ValueMember = "ID"; this.cboMonitoring.DisplayMember = "Name"; //监控患者类型 dataTable = CBO_DS.Tables["MonitorType"]; newrow = dataTable.NewRow(); newrow[1] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); this.cboMonitorType.DataSource = CBO_DS.Tables["MonitorType"].DefaultView; this.cboMonitorType.ValueMember = "ID"; this.cboMonitorType.DisplayMember = "Name"; //参考时间 dataTable = CBO_DS.Tables["CKTime"]; newrow = dataTable.NewRow(); newrow[1] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); this.cboCKTime.DataSource = CBO_DS.Tables["CKTime"].DefaultView; this.cboCKTime.ValueMember = "ID"; this.cboCKTime.DisplayMember = "Name"; //---------------------------体温监测-------------------------------- int count = dsTemperature.Tables[0].Rows.Count; if (count >= 1) { flagTemperature = true; this.txtTemperatureMax.Text = dsTemperature.Tables[0].Rows[0]["TEMPERATUREMAX"].ToString(); this.txtTemperatureMin.Text = dsTemperature.Tables[0].Rows[0]["TEMPERATUREMIN"].ToString(); this.txtPulseMax.Text = dsTemperature.Tables[0].Rows[0]["PULSEMAX"].ToString(); this.txtPulseMin.Text = dsTemperature.Tables[0].Rows[0]["PULSEMIN"].ToString(); this.txtBreathMax.Text = dsTemperature.Tables[0].Rows[0]["BREATHMAX"].ToString(); this.txtBreathMin.Text = dsTemperature.Tables[0].Rows[0]["BREATHMIN"].ToString(); this.txtSBPMax.Text = dsTemperature.Tables[0].Rows[0]["SBPMAX"].ToString(); this.txtSBPMin.Text = dsTemperature.Tables[0].Rows[0]["SBPMIN"].ToString(); this.txtDBPMax.Text = dsTemperature.Tables[0].Rows[0]["DBPMAX"].ToString(); this.txtDBPMin.Text = dsTemperature.Tables[0].Rows[0]["DBPMIN"].ToString(); this.txtStoolMax.Text = dsTemperature.Tables[0].Rows[0]["STOOLMAX"].ToString(); this.txtStoolMin.Text = dsTemperature.Tables[0].Rows[0]["STOOLMIN"].ToString(); } //ucRecordMonitor hlb = new ucRecordMonitor("护理部",CBO_DS.Tables["TextKind"].DefaultView); //延安妇幼老版质控屏蔽 ////管床医生监控列表 //ucRecordMonitor ucRecord = new ucRecordMonitor("护理部", CBO_DS.Tables["TextKind"].DefaultView,false); //tabControlPanel4.Controls.Add(ucRecord); //ucRecord.Dock = System.Windows.Forms.DockStyle.Fill; }
private void LoadCard() { try { this.panel1.Controls.Clear(); //this.Controls.Clear(); dt = App.GetDataSet(sql).Tables[0] as DataTable; Brush brush = new SolidBrush(Color.Green); //所绘制的文本颜色和纹理 StringFormat stringFormat = new StringFormat(); //用来文本布局 居中对其方式 stringFormat.Alignment = StringAlignment.Center; //垂直面上的文本对其方式 stringFormat.LineAlignment = StringAlignment.Center; //设置水平面上文本对其方式 stringFormat.Trimming = StringTrimming.EllipsisCharacter; //表示如何在這個 StringFormat 物件所繪製的文字超過配置矩形邊緣時修剪該文字 这里是.... Image image = global::Base_Function.Resource.科室选择小卡图标_未选中; int howHeight = 10; //初始化PictureBox 高度的大小 int howWeight = 15; //初始化PictureBox 宽度的大小 //入院人数 string sql_into_area = "select a.SICK_AREA_ID from t_In_Patient a where (select count(id) from t_inhospital_action b where b.patient_id=a.id)>0 and to_char(a.in_time,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')"; //在院人数 string sql_at_area = "select distinct a.id,a.SICK_AREA_ID from t_In_Patient a inner join t_inhospital_action b on a.id=b.patient_id where b.ACTION_TYPE<>'出区' and b.Next_id=0 and b.ACTION_STATE<>3 "; //床位数 string sql_bed = "select said from t_sickbedinfo"; Bifrost.WebReference.Class_Table[] temtables = new Bifrost.WebReference.Class_Table[3]; temtables[0] = new Bifrost.WebReference.Class_Table(); temtables[0].Sql = sql_into_area; temtables[0].Tablename = "in"; temtables[1] = new Bifrost.WebReference.Class_Table(); temtables[1].Sql = sql_at_area; temtables[1].Tablename = "at"; temtables[2] = new Bifrost.WebReference.Class_Table(); temtables[2].Sql = sql_bed; temtables[2].Tablename = "bed"; DataSet ds = App.GetDataSet(temtables); //dt里面有多少行就有多少个PictureBox 第一个PictureBox出来之后,会在宽度+164的基础上在出来第二个,出来6个以后就换行 //高度会在每个 PictureBox 的高度之上加120 for (int i = 0; i < dt.Rows.Count; i++) { if (i != 0) { howWeight += 164; if (howWeight > this.panel1.Width) { howHeight += 100; howWeight = 15; } } saID = dt.Rows[i]["said"].ToString();//得到每个病区ID //当前在院人数 int at_Count = ds.Tables["at"].Select("sick_area_id=" + saID).Length; //今日入院人数 int in_Count = ds.Tables["in"].Select("sick_area_id=" + saID).Length; //今日出院人数 int out_Count = 0; try { out_Count = ds.Tables["bed"].Select("said=" + saID).Length; } catch { } PictureBox pb = new PictureBox(); pb.MouseHover += new EventHandler(pb_MouseHover); //鼠标悬停事件 pb.MouseLeave += new EventHandler(pb_MouseLeave); //鼠标移开事件 pb.DoubleClick += new EventHandler(pb_DoubleClick); //鼠标双击事件 pb.Size = new Size(image.Width + 5, image.Height + 5); //定义PictureBox的大小,这里比图片大5个像素 pb.SizeMode = PictureBoxSizeMode.CenterImage; //设置如何显示PictureBox里面的图像,这里居中 //pb.BorderStyle = BorderStyle.FixedSingle; pb.BackColor = Color.White; //定义PictureBox的背景颜色 pb.Tag = dt.Rows[i][0].ToString(); //与病区ID关联 pb.Name = dt.Rows[i][2].ToString(); //与病区名称关联 Image im = new Bitmap(image.Width - 7, image.Height - 5); //表示要加入PictureBox中的背景图片,并初始化大小 pb.Location = new Point(howWeight, howHeight); //设定PictureBox 对于容器左上角坐标值 Graphics g = Graphics.FromImage(im); //设置要在图片上面画东西 g.Clear(Color.White); //清除要绘画的图面,并用指定的背景色填充 g.DrawImage(image, -4, -2, image.Width, image.Height); //要绘制的图像,并确定他要绘制的左上角的坐标 g.DrawString(dt.Rows[i]["section_name"].ToString(), Control.DefaultFont, brush, new RectangleF(0, 4, im.Width, 22), stringFormat); //把病区名称显示在绘制面板上 g.DrawString(dt.Rows[i][2].ToString(), Control.DefaultFont, brush, new RectangleF(0, 18, im.Width, 22), stringFormat); //把病区名称显示在绘制面板上 //g.DrawString(rows_nowHave.Length.ToString(), Control.DefaultFont, brush, new RectangleF(5, 38, 100, 22), stringFormat);//把医院现有人多少显示在面板上 //g.DrawString("(" + rows_daySQl.Length.ToString() + ")", Control.DefaultFont, brush, new RectangleF(30, 38, 100, 22), stringFormat);//把医院今天的人多少显示在面板上 //g.DrawString(rows_leaveSQl.Length.ToString(), Control.DefaultFont, brush, new RectangleF(18, 58, 100, 22), stringFormat);//把医院出院的人多少显示在面板上 g.DrawString(at_Count.ToString(), Control.DefaultFont, brush, new RectangleF(5, 38, 100, 22), stringFormat); //把医院现有人多少显示在面板上 g.DrawString("(" + in_Count.ToString() + ")", Control.DefaultFont, brush, new RectangleF(30, 38, 100, 22), stringFormat); //把医院今天的人多少显示在面板上 g.DrawString(out_Count.ToString(), Control.DefaultFont, brush, new RectangleF(18, 58, 100, 22), stringFormat); //把医院出院的人多少显示在面板上 pb.Image = im; //确定要在PictureBox里面显示的背景图像 g.Dispose(); //释放资源 this.panel1.Controls.Add(pb); //添加到panel1 } brush.Dispose(); //释放资源 GC.Collect(); //垃圾回收 } catch (Exception ex) { } }
public void InitCombox() { try { Bifrost.WebReference.Class_Table[] cboTables = new Bifrost.WebReference.Class_Table[4]; cboTables[0] = new Bifrost.WebReference.Class_Table(); cboTables[0].Sql = sqlSection_Area; //select distinct(ts.sid),ts.section_name from t_Section_Area tsa inner join t_Sectioninfo ts on tsa.sid=ts.sid order by ts.section_name,ts.sid";//科室 cboTables[0].Tablename = "YWC"; cboTables[1] = new Bifrost.WebReference.Class_Table(); cboTables[1].Sql = sqlSection_Area; //"select SAID,SICK_AREA_NAME from t_sickareainfo order by sick_area_name,said";//病区 cboTables[1].Tablename = "HLB"; cboTables[2] = new Bifrost.WebReference.Class_Table(); cboTables[2].Sql = sqlYellow;//黄灯 cboTables[2].Tablename = "yellow"; cboTables[3] = new Bifrost.WebReference.Class_Table(); cboTables[3].Sql = sqlRed;//红灯 cboTables[3].Tablename = "red"; CBO_DS = App.GetDataSet(cboTables); if (names == "护理部") { label1.Text = "病区:"; dataTable = CBO_DS.Tables["HLB"]; newrow = dataTable.NewRow(); newrow = dataTable.NewRow(); newrow[3] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); //newrow = dataTable.NewRow(); //newrow[1] = "1";//1是北院,221是南院 //newrow[3] = "北院"; //dataTable.Rows.InsertAt(newrow, 1); //newrow = dataTable.NewRow(); //newrow[1] = "221";//1是北院,221是南院 //newrow[3] = "南院"; //dataTable.Rows.InsertAt(newrow, 2); this.cboSickArea.DataSource = CBO_DS.Tables["HLB"].DefaultView; this.cboSickArea.ValueMember = "SAID"; this.cboSickArea.DisplayMember = "SICK_AREA_NAME"; } else { label1.Text = "科室:"; dataTable = CBO_DS.Tables["YWC"]; newrow = dataTable.NewRow(); newrow[2] = "请选择..."; dataTable.Rows.InsertAt(newrow, 0); //newrow = dataTable.NewRow(); //newrow[0] = "1";//1是北院,221是南院 //newrow[2] = "北院"; //dataTable.Rows.InsertAt(newrow, 1); //newrow = dataTable.NewRow(); //newrow[0] = "221";//1是北院,221是南院 //newrow[2] = "南院"; //dataTable.Rows.InsertAt(newrow, 2); this.cboSickArea.DataSource = CBO_DS.Tables["YWC"].DefaultView; this.cboSickArea.ValueMember = "SID"; this.cboSickArea.DisplayMember = "SECTION_NAME"; if (selSickname != "") { this.cboSickArea.Text = selSickname; } } string yellow = CBO_DS.Tables["yellow"].Select()[0]["PV"].ToString(); string red = CBO_DS.Tables["red"].Select()[0]["PV"].ToString(); this.lblyellow.Text = yellow; this.lblred.Text = red; } catch (Exception ex) { string strEx = ex.Message; } }
/// <summary> /// 刷新帐号列表,所有的用户信息刷新到树状控件。 /// </summary> private void IniTrvAccount(string Accountname) { /* * 说明 * 将T_ACCOUNT表的中的所有信息检索出来,然后再根据这些 * 信息检索每个帐号所对应的角色,以及角色所对应的使用范围。 */ string Sql = ""; trvAccount.Nodes.Clear(); if (chkAll.Checked) { Sql = "select * from t_account a inner join t_account_user b on a.account_id=b.account_id inner join t_userinfo c on b.user_id = c.user_id where 1=1"; } else { Sql = "select * from t_account a inner join t_account_user b on a.account_id=b.account_id inner join t_userinfo c on b.user_id = c.user_id where rownum <30"; } if (cboSearchType.Text == "按姓名") { Sql += " and c.user_name like '%" + Accountname + "%'"; } else if (cboSearchType.Text == "按工号") { Sql += " and a.account_name like '%" + Accountname + "%'"; } Sql += " order by a.account_id"; Bifrost.WebReference.Class_Table[] tabSqls = new Bifrost.WebReference.Class_Table[3]; tabSqls[0] = new Bifrost.WebReference.Class_Table(); tabSqls[0].Sql = Sql; tabSqls[0].Tablename = "account"; tabSqls[1] = new Bifrost.WebReference.Class_Table(); tabSqls[1].Sql = "select a.role_id,a.role_name,a.enable_flag,b.account_id,a.role_type from T_ROLE a inner join T_ACC_ROLE b on a.role_id=b.role_id"; tabSqls[1].Tablename = "acc_role"; tabSqls[2] = new Bifrost.WebReference.Class_Table(); tabSqls[2].Sql = "select a.id,b.account_id,a.acc_role_id,a.section_id,a.sickarea_id,a.isbelongto,c.section_name,d.sick_area_name,b.role_id from T_ACC_ROLE_RANGE a left join T_ACC_ROLE b on a.acc_role_id=b.id left join T_SECTIONINFO c on a.section_id=c.sid left join T_SICKAREAINFO d on a.sickarea_id=d.said"; //inner join T_SUB_HOSPITALINFO e on c.shid=e.shid"; tabSqls[2].Tablename = "range"; DataSet ds = App.GetDataSet(tabSqls); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Class_Account account = new Class_Account(); account.Account_id = ds.Tables["account"].Rows[i]["ACCOUNT_ID"].ToString(); account.Account_type = ds.Tables["account"].Rows[i]["ACCOUNT_TYPE"].ToString(); account.Account_name = ds.Tables["account"].Rows[i]["ACCOUNT_NAME"].ToString(); account.Password = ds.Tables["account"].Rows[i]["PASSWORD"].ToString(); account.Enable = ds.Tables["account"].Rows[i]["ENABLE"].ToString(); if (App.isNumval(ds.Tables["account"].Rows[i]["KIND"].ToString())) account.Kind = Convert.ToInt32(ds.Tables["account"].Rows[i]["KIND"].ToString()); DataRow[] rolerows = ds.Tables["acc_role"].Select("ACCOUNT_ID='" + account.Account_id + "'"); account.Roles = new Class_Role[rolerows.Length]; for (int j = 0; j < rolerows.Length; j++) { account.Roles[j] = new Class_Role(); account.Roles[j].Role_id = rolerows[j]["ROLE_ID"].ToString(); account.Roles[j].Role_name = rolerows[j]["ROLE_NAME"].ToString(); account.Roles[j].Enable = rolerows[j]["ENABLE_FLAG"].ToString(); account.Roles[j].Role_type = rolerows[j]["ROLE_TYPE"].ToString(); DataRow[] rows = ds.Tables["range"].Select("account_id='" + account.Account_id + "' and role_id='" + account.Roles[j].Role_id + "'"); account.Roles[j].Rnages = new Class_Rnage[rows.Length]; for (int j1 = 0; j1 < rows.Length; j1++) { account.Roles[j].Rnages[j1] = new Class_Rnage(); account.Roles[j].Rnages[j1].Id = rows[j1]["id"].ToString(); account.Roles[j].Rnages[j1].Section_id = rows[j1]["section_id"].ToString(); account.Roles[j].Rnages[j1].Sickarea_id = rows[j1]["sickarea_id"].ToString(); account.Roles[j].Rnages[j1].Acc_role_id = rows[j1]["acc_role_id"].ToString(); account.Roles[j].Rnages[j1].Isbelonge = rows[j1]["isbelongto"].ToString(); //0科室 1病区 --sub_hospital_name if (account.Roles[j].Rnages[j1].Isbelonge == "0") { string HospitalName = App.ReadSqlVal("select a.sub_hospital_name from t_sub_hospitalinfo a inner join T_SECTIONINFO b on a.shid=b.shid where b.sid=" + rows[j1]["section_id"].ToString() + "", 0, "sub_hospital_name"); account.Roles[j].Rnages[j1].Rnagename = HospitalName + "-" + rows[j1]["section_name"].ToString(); } else { string HospitalName = App.ReadSqlVal("select a.sub_hospital_name from t_sub_hospitalinfo a inner join T_SICKAREAINFO b on a.shid=b.shid where b.said=" + rows[j1]["sickarea_id"].ToString() + "", 0, "sub_hospital_name"); account.Roles[j].Rnages[j1].Rnagename = HospitalName + "-" + rows[j1]["sick_area_name"].ToString(); } } } Node tn = new Node(); tn.Tag = account; tn.Text = account.Account_name; tn.ImageIndex = 0; trvAccount.Nodes.Add(tn); } trvAccount.Refresh(); }