StableVersion4.3/HL_FristAidPlatform_FollowUp/Form_FollowUpDetail_FollowU...

334 lines
13 KiB
C#

using DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace HL_FristAidPlatform_FollowUp
{
public partial class Form_FollowUpDetail_FollowUpEvaluation : XtraForm
{
private string patientguid;
private string Guid;
public Form_FollowUpDetail_FollowUpEvaluation(string Guid)
{
patientguid = Guid;
InitializeComponent();
}
private void Form_FollowUpDetail_FollowUpEvaluation_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();
if (!string.IsNullOrEmpty(dt.Rows[0]["Consciousness"].ToString()))
{
rgConsciousness.EditValue = int.Parse(dt.Rows[0]["Consciousness"].ToString());
}
txtTemperature.Text = dt.Rows[0]["Temperature"].ToString();
txtPulse.Text = dt.Rows[0]["Pulse"].ToString();
txtBreathe.Text = dt.Rows[0]["Breathe"].ToString();
BloodPressure.Text = dt.Rows[0]["SBP"].ToString();
BloodPressure1.Text = dt.Rows[0]["DBP"].ToString();
txtPupilLSize.Text = dt.Rows[0]["PupilLSize"].ToString();
txtPupilRSize.Text = dt.Rows[0]["PupilRSize"].ToString();
txtReflectionToLightL.Text = dt.Rows[0]["ReflectionToLightL"].ToString();
txtReflectionToLightR.Text = dt.Rows[0]["ReflectionToLightR"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[0]["Muscle"].ToString()))
{
rgMuscle.EditValue = dt.Rows[0]["Muscle"].ToString();
}
txtMuscleRT.Text = dt.Rows[0]["MuscleRT"].ToString();
txtMuscleRB.Text = dt.Rows[0]["MuscleRB"].ToString();
txtMuscleLT.Text = dt.Rows[0]["MuscleLT"].ToString();
txtMuscleLB.Text = dt.Rows[0]["MuscleLB"].ToString();
txtGCSScore1.Text = dt.Rows[0]["GCSScore1"].ToString();
txtNHISSScore1.Text = dt.Rows[0]["NIHSSScore1"].ToString();
ADLScore.Text = dt.Rows[0]["ADLScore"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[0]["ADLLevel"].ToString()))
{
rgADLLevel.EditValue = int.Parse(dt.Rows[0]["ADLLevel"].ToString());
}
}
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "卒中健康与随访基础评估页面数据绑定:\r\n" + ex);
}
}
//private void button1_Click(object sender, EventArgs e)
//{
// try
// {
// string Url = "api/service/T_Service_Apoplexy_FollowUpAndHealthInfo/UpdateNotNullColumns";
// List<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> list = new List<T_Service_Apoplexy_FollowUpAndHealthInfoDTO>();
// T_Service_Apoplexy_FollowUpAndHealthInfoDTO af = new T_Service_Apoplexy_FollowUpAndHealthInfoDTO();
// #region 保存信息
// af.GUID = Guid;
// af.PatientGuid = patientguid;
// if (!(rgConsciousness.EditValue==null))
// {
// af.Consciousness = rgConsciousness.EditValue.ToString();
// }
// af.Temperature = txtTemperature.Text;
// af.Pulse = txtPulse.Text;
// af.Breathe = txtBreathe.Text;
// af.SBP = BloodPressure.Text;
// af.DBP= BloodPressure1.Text;
// af.PupilLSize = txtPupilLSize.Text;
// af.PupilRSize=txtPupilRSize.Text ;
// af.ReflectionToLightL = txtReflectionToLightL.Text;
// af.ReflectionToLightR = txtReflectionToLightR.Text;
// if (!(rgMuscle.EditValue == null))
// {
// af.Muscle = rgMuscle.EditValue.ToString();
// }
// af.MuscleRT = txtMuscleRT.Text;
// af.MuscleRB = txtMuscleRB.Text;
// af.MuscleLT = txtMuscleLT.Text ;
// af.MuscleLB = txtMuscleLB.Text;
// af.GCSScore1 = txtGCSScore1.Text;
// af.NIHSSScore1 = txtNHISSScore1.Text ;
// if (!(rgADLLevel.EditValue == null))
// {
// af.ADLLevel = rgADLLevel.EditValue.ToString();
// }
// af.ADLScore = ADLScore.Text;
// af.PatientGuid = patientguid;
// af.GUID = Guid;
// list.Add(af);
// #endregion
// ClientFactory<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> httpClient = new HttpClientFactory<T_Service_Apoplexy_FollowUpAndHealthInfoDTO>();
// Client<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> client = httpClient.VisitFactory();
// ListEntity<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> 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 rgMuscle_SelectedIndexChanged(object sender, EventArgs e)
{
string Muscle = PublicClass.ToString(rgMuscle.EditValue, "");
if (!string.IsNullOrEmpty(Muscle))
{
if (Muscle == "1")
{
panelControl7.Visible = true;
}
else
{
panelControl7.Visible = false;
}
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
string Url = "api/service/T_Service_Apoplexy_FollowUpAndHealthInfo/UpdateNotNullColumns";
List<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> list = new List<T_Service_Apoplexy_FollowUpAndHealthInfoDTO>();
T_Service_Apoplexy_FollowUpAndHealthInfoDTO af = new T_Service_Apoplexy_FollowUpAndHealthInfoDTO();
#region 保存信息
af.GUID = Guid;
af.PatientGuid = patientguid;
if (!(rgConsciousness.EditValue == null))
{
af.Consciousness = rgConsciousness.EditValue.ToString();
}
af.Temperature = txtTemperature.Text;
af.Pulse = txtPulse.Text;
af.Breathe = txtBreathe.Text;
af.SBP = BloodPressure.Text;
af.DBP = BloodPressure1.Text;
af.PupilLSize = txtPupilLSize.Text;
af.PupilRSize = txtPupilRSize.Text;
af.ReflectionToLightL = txtReflectionToLightL.Text;
af.ReflectionToLightR = txtReflectionToLightR.Text;
if (!(rgMuscle.EditValue == null))
{
af.Muscle = rgMuscle.EditValue.ToString();
}
af.MuscleRT = txtMuscleRT.Text;
af.MuscleRB = txtMuscleRB.Text;
af.MuscleLT = txtMuscleLT.Text;
af.MuscleLB = txtMuscleLB.Text;
af.GCSScore1 = txtGCSScore1.Text;
af.NIHSSScore1 = txtNHISSScore1.Text;
if (!(rgADLLevel.EditValue == null))
{
af.ADLLevel = rgADLLevel.EditValue.ToString();
}
af.ADLScore = ADLScore.Text;
af.PatientGuid = patientguid;
af.GUID = Guid;
list.Add(af);
#endregion
ClientFactory<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> httpClient = new HttpClientFactory<T_Service_Apoplexy_FollowUpAndHealthInfoDTO>();
Client<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> client = httpClient.VisitFactory();
ListEntity<T_Service_Apoplexy_FollowUpAndHealthInfoDTO> s = client.Post(Url, list);
if (s.Success)
{
MessageBox.Show("保存成功!");
}
else
{
MessageBox.Show("保存失败!");
}
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "卒中健康与随访基础评估页面数据保存:\r\n" + ex);
}
}
/// <summary>
///
/// </summary>
/// <param name="text"></param>
public void RefreshADL(string text)
{
ADLScore.Text = text;
int score = Convert.ToInt32(text);
if (score > 100)
{
rgADLLevel.SelectedIndex = 3;
}
else if (score >= 61 && score <= 99)
{
rgADLLevel.SelectedIndex = 2;
}
else if (score >= 41 && score <= 60)
{
rgADLLevel.SelectedIndex = 1;
}
rgADLLevel.SelectedIndex = 0;
}
public void RefreshNIHSS(string text)
{
txtNHISSScore1.Text = text;
}
public void RefreshGCS(string text)
{
txtGCSScore1.Text = text;
}
private void simpleButton4_Click(object sender, EventArgs e)
{
Form_ADL adl = new Form_ADL(patientguid);
adl.Owner = this;
adl.Show();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
Form_PatientNIHSS nihss = new Form_PatientNIHSS(0);
nihss.Show();
nihss.Owner = this;
}
private void simpleButton3_Click(object sender, EventArgs e)
{
Form_PatientGCS gcs = new Form_PatientGCS(0);
gcs.Show();
gcs.Owner = this;
}
private void BloodPressure_EditValueChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(BloodPressure.Text + ""))
{
if (int.Parse(BloodPressure.Text.ToString()) > 139 || int.Parse(BloodPressure.Text.ToString()) < 90)
{
BloodPressure.ForeColor = Color.Red;
}
else
{
BloodPressure.ForeColor = Color.Black;
}
}
}
private void BloodPressure1_EditValueChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(BloodPressure1.Text + ""))
{
if (int.Parse(BloodPressure1.Text.ToString()) > 89 || int.Parse(BloodPressure1.Text.ToString()) < 60)
{
BloodPressure1.ForeColor = Color.Red;
}
else
{
BloodPressure1.ForeColor = Color.Black;
}
}
}
private void txtBreathe_EditValueChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtBreathe.Text.Trim() + ""))
{
if (int.Parse(txtBreathe.Text.Trim() + "") > 20 || int.Parse(txtBreathe.Text.Trim() + "") < 18)
{
txtBreathe.ForeColor = Color.Red;
}
else
{
txtBreathe.ForeColor = Color.Black;
}
}
}
private void txtPulse_EditValueChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtPulse.Text.Trim() + ""))
{
if (int.Parse(txtPulse.Text.Trim() + "") > 100 || int.Parse(txtPulse.Text.Trim() + "") < 60)
{
txtPulse.ForeColor = Color.Red;
}
else
{
txtPulse.ForeColor = Color.Black;
}
}
}
private void txtTemperature_EditValueChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtTemperature.Text.Trim() + ""))
{
if (double.Parse(txtTemperature.Text.Trim() + "") > 37 || double.Parse(txtTemperature.Text.Trim() + "") < 36)
{
txtTemperature.ForeColor = Color.Red;
}
else
{
txtTemperature.ForeColor = Color.Black;
}
}
}
}
}