using DevExpress.XtraEditors; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_Public; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HL_FristAidPlatform_FollowUp { public partial class Form_FollowUpDetail_FollowUpLeaveHospitalManage : DevExpress.XtraEditors.XtraForm { private string patientguid; private string Guid; public Form_FollowUpDetail_FollowUpLeaveHospitalManage(string Guid) { patientguid = Guid; InitializeComponent(); } private void Form_FollowUpDetail_FollowUpLeaveHospitalManage_Load(object sender, EventArgs e) { try { string Url = string.Format("api/service/T_Service_Apoplexy_FollowUpAndHealthInfo/GetByPatientGuid1?PatientGuid={0}", patientguid); DataTable dt = DBHelpClass.Get(Url); if (dt != null && dt.Rows.Count > 0) { Guid = dt.Rows[0]["Guid"].ToString(); radioGroup1.EditValue = dt.Rows[0]["DischargeSituation"].ToString(); textBox1.Text = dt.Rows[0]["GCSScore2"].ToString(); textBox2.Text = dt.Rows[0]["NIHSSScore2"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["TakeDrugs"].ToString())) { string str = dt.Rows[0]["TakeDrugs"].ToString().Remove(0, 1).TrimEnd(';'); string[] arryTakeDrugs = str.Split(new char[] { ';' }); for (int i = 0; i < arryTakeDrugs.Length; i++) { for (int j = 0; j < checkedListBoxControl3.Items.Count; j++) { if (checkedListBoxControl3.Items[j].Value.ToString().Trim().Contains(arryTakeDrugs[i])) { checkedListBoxControl3.SetItemChecked(j, true); } } } if (str.Contains("01")) { textBox3.Text = dt.Rows[0]["ASPLCRPUsage"].ToString(); panel_1.Visible = true; } if (str.Contains("02")) { textBox4.Text = dt.Rows[0]["SSLBGLUsage"].ToString(); panel_2.Visible = true; } if (str.Contains("03")) { textBox5.Text = dt.Rows[0]["ATFTTGUsage"].ToString(); panel_3.Visible = true; } if (str.Contains("04")) { textBox6.Text = dt.Rows[0]["BHSALDPUsage"].ToString(); panel_4.Visible = true; } if (str.Contains("05")) { textBox7.Text = dt.Rows[0]["EBSTUsage"].ToString(); panel_5.Visible = true; } if (str.Contains("06")) { textBox8.Text = dt.Rows[0]["AKBTUsage"].ToString(); panel_6.Visible = true; } if (str.Contains("07")) { textBox9.Text = dt.Rows[0]["EJSGUsage"].ToString(); panel_7.Visible = true; } if (str.Contains("08")) { textBox10.Text = dt.Rows[0]["GLQTHSUsage"].ToString(); panel_8.Visible = true; } if (str.Contains("09")) { textBox11.Text = dt.Rows[0]["XBDPKSUsage"].ToString(); panel_9.Visible = true; } if (str.Contains("10")) { textBox12.Text = dt.Rows[0]["DrugOther"].ToString(); panel_10.Visible = true; } } if (!string.IsNullOrEmpty(dt.Rows[0]["DischargeSymptoms"].ToString())) { string str = dt.Rows[0]["DischargeSymptoms"].ToString().Remove(0, 1).TrimEnd(';'); string[] arryTakeDrugs = str.Split(new char[] { ';' }); for (int i = 0; i < arryTakeDrugs.Length; i++) { for (int j = 0; j < checkedListBoxControl1.Items.Count; j++) { if (checkedListBoxControl1.Items[j].Value.ToString().Trim().Contains(arryTakeDrugs[i])) { checkedListBoxControl1.SetItemChecked(j, true); } } } if (str.Contains("01")) { panel_yd.Visible = true; //运动障碍 textBox13.Text = dt.Rows[0]["DischargeMuscleRT"].ToString(); textBox14.Text = dt.Rows[0]["DischargeMuscleRB"].ToString(); textBox15.Text = dt.Rows[0]["DischargeMuscleLT"].ToString(); textBox16.Text = dt.Rows[0]["DischargeMuscleLB"].ToString(); } } radioGroup4.EditValue = dt.Rows[0]["SelfCareAbility"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["Complication"].ToString())) { string str = dt.Rows[0]["Complication"].ToString().Remove(0, 1).TrimEnd(';'); string[] arryTakeDrugs = str.Split(new char[] { ';' }); for (int i = 0; i < arryTakeDrugs.Length; i++) { for (int j = 0; j < checkedListBoxControl2.Items.Count; j++) { if (checkedListBoxControl2.Items[j].Value.ToString().Trim().Contains(arryTakeDrugs[i])) { checkedListBoxControl2.SetItemChecked(j, true); } } } } radioGroup3.EditValue = dt.Rows[0]["SelfCareAbility"].ToString(); radioGroup5.EditValue = dt.Rows[0]["Mastery120"].ToString(); radioGroup6.EditValue = dt.Rows[0]["ConceptAndRiskLevel"].ToString(); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "卒中健康与随访出院管理页面数据绑定:\r\n" + ex); } } //出院症状显示与隐藏 private void checkedListBoxControl1_SelectedIndexChanged(object sender, EventArgs e) { if (checkedListBoxControl1.SelectedValue.ToString() == "01") { for (int i = 0; i < 9; i++) { checkedListBoxControl1.SetItemCheckState(i, CheckState.Unchecked); label28.Visible = false; radioGroup4.Visible = false; label29.Visible = false; } } if (checkedListBoxControl1.SelectedValue.ToString() == "02") { label29.Visible = true; } if (checkedListBoxControl1.SelectedValue.ToString() == "03") { label28.Visible = true; radioGroup4.Visible = true; } } private void simpleButton1_Click(object sender, EventArgs e) { try { string Url = "api/service/T_Service_Apoplexy_FollowUpAndHealthInfo/UpdateNotNullColumns"; List list = new List(); T_Service_Apoplexy_FollowUpAndHealthInfoDTO af = new T_Service_Apoplexy_FollowUpAndHealthInfoDTO(); #region 保存信息 //出院症状 for (int i = 0; i < checkedListBoxControl1.CheckedItems.Count; i++) { if (checkedListBoxControl1.Items[i].CheckState == CheckState.Checked) { af.DischargeSymptoms += ";" + checkedListBoxControl1.GetItemValue(i); } } if (!string.IsNullOrEmpty(af.DischargeSymptoms)) { af.DischargeSymptoms += ";"; } af.SelfCareAbility = radioGroup4.EditValue.ToString() != null ? radioGroup4.EditValue.ToString() : ""; if (!string.IsNullOrEmpty(af.DischargeSymptoms) && af.DischargeSymptoms.Contains("01")) { af.DischargeMuscleRT = textBox13.Text; af.DischargeMuscleRB = textBox14.Text; af.DischargeMuscleLT = textBox15.Text; af.DischargeMuscleLB = textBox16.Text; } //并发症 String Complication = null; for (int i = 0; i < checkedListBoxControl2.CheckedItems.Count; i++) { Complication += ";"; Complication += checkedListBoxControl2.CheckedItems[i].ToString(); if (i == checkedListBoxControl2.CheckedItems.Count - 1) { Complication += ";"; } } af.Complication = Complication; if (radioGroup1.EditValue != null) { af.DischargeSituation = radioGroup1.EditValue.ToString(); } af.GCSScore2 = textBox1.Text; af.NIHSSScore2 = textBox2.Text; for (int i = 0; i < checkedListBoxControl3.Items.Count; i++) { if (checkedListBoxControl3.Items[i].CheckState == CheckState.Checked) { af.TakeDrugs += ";" + checkedListBoxControl3.GetItemValue(i); } } if (!string.IsNullOrEmpty(af.TakeDrugs)) { af.TakeDrugs += ";"; if (af.TakeDrugs.Contains("01")) af.ASPLCRPUsage = textBox3.Text; if (af.TakeDrugs.Contains("02")) af.SSLBGLUsage = textBox4.Text; if (af.TakeDrugs.Contains("03")) af.ATFTTGUsage = textBox5.Text; if (af.TakeDrugs.Contains("04")) af.BHSALDPUsage = textBox6.Text; if (af.TakeDrugs.Contains("05")) af.EBSTUsage = textBox7.Text; if (af.TakeDrugs.Contains("06")) af.AKBTUsage = textBox8.Text; if (af.TakeDrugs.Contains("07")) af.EJSGUsage = textBox9.Text; if (af.TakeDrugs.Contains("08")) af.GLQTHSUsage = textBox10.Text; if (af.TakeDrugs.Contains("09")) af.XBDPKSUsage = textBox11.Text; if (af.TakeDrugs.Contains("10")) af.DrugOther = textBox12.Text; } if (radioGroup3.EditValue != null) { af.SelfCareAbility = radioGroup3.EditValue.ToString(); } if (radioGroup5.EditValue != null) { af.Mastery120 = radioGroup5.EditValue.ToString(); } if (radioGroup6.EditValue != null) { af.ConceptAndRiskLevel = radioGroup6.EditValue.ToString(); } af.PatientGuid = patientguid; af.GUID = Guid; list.Add(af); #endregion ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); ListEntity s = client.Post(Url, list); if (s.Success) { MessageBox.Show("保存成功!"); } else { MessageBox.Show("保存失败!"); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "卒中健康与随访出院管理页面数据保存:\r\n" + ex); } } private void checkedListBoxControl3_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { string checkState = checkedListBoxControl3.GetItemCheckState(10).ToString(); if (checkState == "Checked") { for (int i = 0; i < checkedListBoxControl3.Items.Count; i++) { if (checkedListBoxControl3.Items[i].Value.ToString() == "98") { } else { checkedListBoxControl3.Items[i].CheckState = CheckState.Unchecked; } } } else { for (int i = 0; i < checkedListBoxControl3.Items.Count; i++) { if (checkedListBoxControl3.Items[i].Value.ToString() == "98") { checkedListBoxControl3.Items[i].CheckState = CheckState.Unchecked; } } } string c1 = checkedListBoxControl3.GetItemCheckState(0).ToString(); if (c1 == "Checked") { panel_1.Visible = true; } else { panel_1.Visible = false; } string c2 = checkedListBoxControl3.GetItemCheckState(1).ToString(); if (c2 == "Checked") { panel_2.Visible = true; } else { panel_2.Visible = false; } string c3 = checkedListBoxControl3.GetItemCheckState(2).ToString(); if (c3 == "Checked") { panel_3.Visible = true; } else { panel_3.Visible = false; } string c4 = checkedListBoxControl3.GetItemCheckState(3).ToString(); if (c4 == "Checked") { panel_4.Visible = true; } else { panel_4.Visible = false; } string c5 = checkedListBoxControl3.GetItemCheckState(4).ToString(); if (c5 == "Checked") { panel_5.Visible = true; } else { panel_5.Visible = false; } string c6 = checkedListBoxControl3.GetItemCheckState(5).ToString(); if (c6 == "Checked") { panel_6.Visible = true; } else { panel_6.Visible = false; } string c7 = checkedListBoxControl3.GetItemCheckState(6).ToString(); if (c7 == "Checked") { panel_7.Visible = true; } else { panel_7.Visible = false; } string c8 = checkedListBoxControl3.GetItemCheckState(7).ToString(); if (c8 == "Checked") { panel_8.Visible = true; } else { panel_8.Visible = false; } string c9 = checkedListBoxControl3.GetItemCheckState(8).ToString(); if (c9 == "Checked") { panel_9.Visible = true; } else { panel_9.Visible = false; } string c10 = checkedListBoxControl3.GetItemCheckState(9).ToString(); if (c10 == "Checked") { panel_10.Visible = true; } else { panel_10.Visible = false; } } private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { string checkState = checkedListBoxControl1.GetItemCheckState(8).ToString(); if (checkState == "Checked") { for (int i = 0; i < checkedListBoxControl1.Items.Count; i++) { if (checkedListBoxControl1.Items[i].Value.ToString() == "09") { } else { checkedListBoxControl1.Items[i].CheckState = CheckState.Unchecked; } } } else { for (int i = 0; i < checkedListBoxControl1.Items.Count; i++) { if (checkedListBoxControl1.Items[i].Value.ToString() == "09") { checkedListBoxControl1.Items[i].CheckState = CheckState.Unchecked; } } } string c1 = checkedListBoxControl1.GetItemCheckState(1).ToString(); if (c1 == "Checked") { panel_ys.Visible = true; } else { panel_ys.Visible = false; } string c2 = checkedListBoxControl1.GetItemCheckState(0).ToString(); if (c2 == "Checked") { panel_yd.Visible = true; } else { panel_yd.Visible = false; } } private void checkedListBoxControl2_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { string checkState = checkedListBoxControl2.GetItemCheckState(5).ToString(); if (checkState == "Checked") { for (int i = 0; i < checkedListBoxControl2.Items.Count; i++) { if (checkedListBoxControl2.Items[i].Value.ToString() == "06") { } else { checkedListBoxControl2.Items[i].CheckState = CheckState.Unchecked; } } } else { for (int i = 0; i < checkedListBoxControl2.Items.Count; i++) { if (checkedListBoxControl2.Items[i].Value.ToString() == "06") { checkedListBoxControl2.Items[i].CheckState = CheckState.Unchecked; } } } } private void simpleButton3_Click(object sender, EventArgs e) { Form_PatientGCS gcs = new Form_PatientGCS(1); gcs.Show(); gcs.Owner = this; } private void simpleButton2_Click(object sender, EventArgs e) { Form_PatientNIHSS nihss = new Form_PatientNIHSS(1); nihss.Show(); nihss.Owner = this; } public void RefreshNIHSS(string text) { textBox2.Text = text; } public void RefreshGCS(string text) { textBox1.Text = text; } } }