//根据病人id,文书id生成编辑器。 void btnxEmrDoc_Click(object sender, EventArgs e) { Bifrost.GlassButton btnx = (Bifrost.GlassButton)sender; int tid = Convert.ToInt32(btnx.Tag.ToString().Trim()); string sql = "select * from t_patients_doc where tid=" + tid + " and patient_id='" + inPatientInfo.Id + "'"; DataSet dts = App.GetDataSet(sql); if (dts != null) { if (dts.Tables.Count > 0) { DataTable dt = dts.Tables[0]; if (dt != null) { int txtid = Convert.ToInt32(dt.Rows[0]["textkind_id"].ToString()); int belongtosys_id = Convert.ToInt32(dt.Rows[0]["belongtosys_id"].ToString()); int sickkind_id = Convert.ToInt32(dt.Rows[0]["sickkind_id"].ToString()); string txtname = dt.Rows[0]["textName"].ToString(); int Tid = tid; string content = App.DownLoadFtpPatientDoc(Tid.ToString() + ".xml", inPatientInfo.Id.ToString()); if (content == "") { content = App.ReadSqlVal("select * from T_PATIENT_DOC_COLB where tid=" + Tid.ToString() + "", 0, "CONTENT"); } //false //dt.Rows[0]["patients_doc"].ToString() popupView pop = new popupView(txtid, belongtosys_id, sickkind_id, txtname, Tid, inPatientInfo, content, "姓名:" + inPatientInfo.Patient_Name + ",住院号:" + inPatientInfo.Id + " --" + btnx.Text); pop.ShowDialog(); } } } }
void btxPacs_Click(object sender, EventArgs e) { string datetimes = ""; Bifrost.GlassButton btpacs = (Bifrost.GlassButton)sender; datetimes = gettimestr(btpacs.Parent.Name); if (datetimes != "") { string Sqlcondition = " and jclx='" + btpacs.Text + "' and to_char(jcsj,'yyyy-MM-dd')='" + datetimes.Trim() + "'"; Bifrost.HisInStance.frm_Pasc frm = new Bifrost.HisInStance.frm_Pasc(inPatientInfo, Sqlcondition); frm.ShowDialog(); } }
void btxLis_Click(object sender, EventArgs e) { #region Bifrost.GlassButton btlis = (Bifrost.GlassButton)sender; //string datetimes = ""; //datetimes = gettimestr(btlis.Parent.Name); string bblsh = btlis.Tag.ToString(); if (bblsh != "") { string Sqlcondition = " and a.bblsh='" + bblsh + "'";//" and b.yzxmmc='" + btlis.Text + "' and jyrq=to_date('" + datetimes + "','yyyy-MM-dd')"; Bifrost.HisInstance.FrmLis frm = new Bifrost.HisInstance.FrmLis(inPatientInfo.PId, Sqlcondition); frm.ShowDialog(); } #endregion }
/// <summary> /// 画病历文书 /// </summary> /// <param name="start_time">周期开始时间</param> private void drawErmDocument(DateTime start_time) { string sqlErmDoc = "select b.doc_name,b.textname,document_time,b.tid from t_in_patient a inner join t_patients_doc b on a.id=b.patient_id where a.id='" + inPatientInfo.Id + "'"; DataSet ds = App.GetDataSet(sqlErmDoc); string doc_name = string.Empty; int widthpp = 25; int[] pointY = { 0, 0, 0, 0, 0, 0, 0 }; if (ds != null) { if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { doc_name = dt.Rows[i]["doc_name"].ToString(); if (doc_name.Trim().Length != 0) { try { string strTime = Convert.ToDateTime(App.GetTimeString(doc_name)).ToShortDateString();//短时间格式 string starttime = start_time.ToShortDateString(); TimeSpan ts = Convert.ToDateTime(strTime).Subtract(Convert.ToDateTime(starttime)); int day = (int)ts.TotalDays; if (day >= 0 && day < 7) { Bifrost.GlassButton btnxEmrDoc = new Bifrost.GlassButton(); btnxEmrDoc.Name = "病历文书" + Convert.ToString(i + 1); btnxEmrDoc.BackColor = Color.Yellow; btnxEmrDoc.ForeColor = Color.Black; string textname = dt.Rows[i]["textname"].ToString(); if (textname != "病程记录" && textname.Length != 0) { btnxEmrDoc.Text = textname; } else if (textname == "病程记录") { if (doc_name.Replace(App.GetTimeString(doc_name), " ").Trim().Length != 0) { btnxEmrDoc.Text = doc_name.Replace(App.GetTimeString(doc_name), " ").Trim(); //if (btnxEmrDoc.Text.Length > 9) // btnxEmrDoc.Text = btnxEmrDoc.Text.Remove(7); } else { btnxEmrDoc.Text = textname; } } btnxEmrDoc.Width = 106; btnxEmrDoc.Height = 20; btnxEmrDoc.Location = new Point(0, pointY[day] * widthpp); btnxEmrDoc.Click += new EventHandler(btnxEmrDoc_Click); pointY[day]++; btnxEmrDoc.Tag = dt.Rows[i]["tid"].ToString(); if (day == 0) { panel_Bl1.Controls.Add(btnxEmrDoc); } if (day == 1) { panel_Bl2.Controls.Add(btnxEmrDoc); } if (day == 2) { panel_Bl3.Controls.Add(btnxEmrDoc); } if (day == 3) { panel_Bl4.Controls.Add(btnxEmrDoc); } if (day == 4) { panel_Bl5.Controls.Add(btnxEmrDoc); } if (day == 5) { panel_Bl6.Controls.Add(btnxEmrDoc); } if (day == 6) { panel_Bl7.Controls.Add(btnxEmrDoc); } if (day == 7) { panel_Bl1.Controls.Add(btnxEmrDoc); } } } catch { } } } } } } int maxh = MaxHeight(pointY); if (maxh <= 4) { maxh = 4; } int widthp = 21; panel10.Height = (maxh - 1) * 25 + widthp; panel_Bl1.Height = (maxh - 1) * 25 + widthp; panel_Bl2.Height = (maxh - 1) * 25 + widthp; panel_Bl3.Height = (maxh - 1) * 25 + widthp; panel_Bl4.Height = (maxh - 1) * 25 + widthp; panel_Bl5.Height = (maxh - 1) * 25 + widthp; panel_Bl6.Height = (maxh - 1) * 25 + widthp; panel_Bl7.Height = (maxh - 1) * 25 + widthp; }
/// <summary> /// 画pacs映像和检查 /// </summary> private void drawPaseandLis(DateTime start_time, int selectIndex) { string SqlPasc = "select jcsj,jcff as method,jclx from INTERFACEUSER.T_PASC_DATA@DBPACSLINK t inner join t_in_patient b on t.zyh=b.his_id where b.id='" + inPatientInfo.Id + "'"; //string SqlLis = "select bblsh,jyrq,bbmc from t_lis_sample t inner join t_in_patient b on t.mzh=b.pid where b.pid='" + inPatientInfo.PId + "'"; string SqlLis = "select c.*,d.YZMC from hnyz_zxyy.View_LIS_SampleInfo@DBHISLINK t inner join hnyz_zxyy.View_LIS_Result@DBHISLINK c on t.bblsh=c.bblsh inner join hnyz_zxyy.intf_emr_undruginfo@dbhislink d on c.yzxmdm=d.yzdm " + "where t.mzh='" + inPatientInfo.PId + "'"; DateTime paseTime = new DateTime(); DateTime lisTime = new DateTime(); int[] pointY = { 0, 0, 0, 0, 0, 0, 0 }; int widthpp = 25; #region 画pacs DataSet dts = App.GetDataSet(SqlPasc); if (dts != null) { DataTable dt = dts.Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { paseTime = Convert.ToDateTime(Convert.ToDateTime(dt.Rows[i]["jcsj"].ToString()).ToShortDateString()); if (paseTime != referTime) { TimeSpan c = paseTime.Subtract(Convert.ToDateTime(start_time.ToShortDateString()));//inPatientInfo.In_Time int day = (int)c.TotalDays; //day = day + 1; if (day >= 0 && day < 7) { if (dt.Rows[i]["jclx"].ToString() != "") { Bifrost.GlassButton btxPacs = new Bifrost.GlassButton(); //Button btxPacs = new Button(); btxPacs.Name = "Pase" + (1 + i).ToString(); btxPacs.Text = dt.Rows[i]["jclx"].ToString(); btxPacs.BackColor = Color.DarkGreen; btxPacs.Width = 106; btxPacs.Height = 20; btxPacs.Click += new EventHandler(btxPacs_Click); if (day == 0) { if (!isHaveSameVal(btxPacs.Text, panel_C1.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C1.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 1) { if (!isHaveSameVal(btxPacs.Text, panel_C2.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C2.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 2) { if (!isHaveSameVal(btxPacs.Text, panel_C3.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C3.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 3) { if (!isHaveSameVal(btxPacs.Text, panel_C4.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C4.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 4) { if (!isHaveSameVal(btxPacs.Text, panel_C5.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C5.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 5) { if (!isHaveSameVal(btxPacs.Text, panel_C6.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C6.Controls.Add(btxPacs); pointY[day]++; } } else if (day == 6) { if (!isHaveSameVal(btxPacs.Text, panel_C7.Controls)) { btxPacs.Location = new Point(0, pointY[day] * widthpp); panel_C7.Controls.Add(btxPacs); pointY[day]++; } } } } } } } } #endregion #region 画lis DataSet dts1 = App.GetDataSet(SqlLis); if (dts1 != null) { DataTable dt1 = dts1.Tables[0]; if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { if (dt1.Rows[j]["cssj"].ToString() != "") { string Year = dt1.Rows[j]["cssj"].ToString().Substring(0, 4); string Month = dt1.Rows[j]["cssj"].ToString().Substring(4, 2); string Days = dt1.Rows[j]["cssj"].ToString().Substring(6, 2); lisTime = Convert.ToDateTime(Year + "-" + Month + "-" + Days); } if (lisTime != referTime) { TimeSpan c = Convert.ToDateTime(lisTime.ToShortDateString()).Subtract(Convert.ToDateTime(start_time.ToShortDateString())); int day = (int)c.TotalDays; //day = day; if (day >= 0 && day < 7) { if (dt1.Rows[j]["yzxmdm"].ToString() != "") { string yzxmdm = ""; Bifrost.GlassButton btxLis = new Bifrost.GlassButton(); //Button btxLis = new Button(); btxLis.Name = "Lis" + (j + 1).ToString(); btxLis.Text = dt1.Rows[j]["YZMC"].ToString(); if (btxLis.Text.Length > 7) { btxLis.Text = btxLis.Text.Substring(0, 7) + "..."; } yzxmdm = dt1.Rows[j]["yzxmdm"].ToString(); btxLis.Width = 106; btxLis.Height = 20; string strnull = " "; string sqlJgbz = "select c.jgbz,c.cssj from t_lis_sample t " + "inner join hnyz_zxyy.View_LIS_Result@DBHISLINK c on t.bblsh=c.bblsh " + "where t.MZH='" + inPatientInfo.PId + "'and c.yzxmdm='" + yzxmdm + "' and c.jgbz<>'" + strnull + "'"; //and to_char(c.cssj, 'YYYY-MM-DD')='" + lisTime.ToShortDateString() + "' DataSet dtsjgbz = App.GetDataSet(sqlJgbz); if (dtsjgbz != null) { if (dtsjgbz.Tables[0].Rows.Count > 0) { for (int liscount = 0; liscount < dtsjgbz.Tables[0].Rows.Count; liscount++) { string lisTime2 = ""; if (dtsjgbz.Tables[0].Rows[liscount]["cssj"].ToString() != "") { string Year1 = dt1.Rows[j]["cssj"].ToString().Substring(0, 4); string Month1 = dt1.Rows[j]["cssj"].ToString().Substring(4, 2); string Days1 = dt1.Rows[j]["cssj"].ToString().Substring(6, 2); lisTime2 = Year1 + "-" + Month1 + "-" + Days1; } if (lisTime2 == lisTime.ToShortDateString()) { strnull += dtsjgbz.Tables[0].Rows[liscount]["jgbz"].ToString(); } } if (strnull.Contains("H") || strnull.Contains("L") || strnull.Contains("阳")) { btxLis.ForeColor = Color.Red; } else { btxLis.ForeColor = Color.Purple; } } else { btxLis.ForeColor = Color.Purple; } } btxLis.Tag += dt1.Rows[j]["bblsh"].ToString(); btxLis.Click += new EventHandler(btxLis_Click); if (day == 0) { if (!isHaveSameVal(btxLis.Text, panel_C1.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C1.Controls.Add(btxLis); pointY[day]++; } } else if (day == 1) { if (!isHaveSameVal(btxLis.Text, panel_C2.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C2.Controls.Add(btxLis); pointY[day]++; } } else if (day == 2) { if (!isHaveSameVal(btxLis.Text, panel_C3.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C3.Controls.Add(btxLis); pointY[day]++; } } else if (day == 3) { if (!isHaveSameVal(btxLis.Text, panel_C4.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C4.Controls.Add(btxLis); pointY[day]++; } } else if (day == 4) { if (!isHaveSameVal(btxLis.Text, panel_C5.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C5.Controls.Add(btxLis); pointY[day]++; } } else if (day == 5) { if (!isHaveSameVal(btxLis.Text, panel_C6.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C6.Controls.Add(btxLis); pointY[day]++; } } else if (day == 6) { if (!isHaveSameVal(btxLis.Text, panel_C7.Controls)) { btxLis.Location = new Point(0, pointY[day] * widthpp); panel_C7.Controls.Add(btxLis); pointY[day]++; } } } } } } } } #endregion int maxh = MaxHeight(pointY); if (maxh <= 4) { maxh = 4; } int widthp = 21; panel17.Height = (maxh - 1) * 25 + widthp; panel_C1.Height = (maxh - 1) * 25 + widthp; panel_C2.Height = (maxh - 1) * 25 + widthp; panel_C3.Height = (maxh - 1) * 25 + widthp; panel_C4.Height = (maxh - 1) * 25 + widthp; panel_C5.Height = (maxh - 1) * 25 + widthp; panel_C6.Height = (maxh - 1) * 25 + widthp; panel_C7.Height = (maxh - 1) * 25 + widthp; }