StableVersion4.3/HL_FristAidPlatform_Emergen.../EMRInfo/Form_NIHSS.cs

419 lines
17 KiB
C#

using DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
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_EmergencyTriage
{
public partial class Form_NIHSS : XtraForm
{
/// <summary>
/// 意识水平
/// </summary>
public int levelScore;
/// <summary>
/// 意识水平提问
/// </summary>
public int questionScore;
/// <summary>
/// 意识水平指令
/// </summary>
public int instructScore;
/// <summary>
/// 凝视
/// </summary>
public int gazeScore;
/// <summary>
/// 视野
/// </summary>
public int viewScore;
/// <summary>
/// 面瘫
/// </summary>
public int pacioplegiaScore;
/// <summary>
/// 左上肢运动
/// </summary>
public int lTopLimbScore;
/// <summary>
/// 右上肢运动
/// </summary>
public int rTopLimbScore;
/// <summary>
/// 左下肢运动
/// </summary>
public int lUpperLimbScore;
/// <summary>
/// 右下肢运动
/// </summary>
public int rUpperLimbScore;
/// <summary>
/// 共济失调
/// </summary>
public int ataxiaScore;
/// <summary>
/// 感觉
/// </summary>
public int senseScore;
/// <summary>
/// 语言
/// </summary>
public int languageScore;
/// <summary>
/// 构音障碍
/// </summary>
public int dysarthriaScore;
/// <summary>
/// 忽视症
/// </summary>
public int neglectScore;
///// <summary>
///// 总分
///// </summary>
public int totalScore;
PatientNIHSSDTO dto;
public string patientGuid;
public Form_NIHSS(string _patientGuid)
{
InitializeComponent();
patientGuid = _patientGuid;
}
private void NIHSS_Load(object sender, EventArgs e)
{
radioGroup1.SelectedIndex = -1;
radioGroup2.SelectedIndex = -1;
radioGroup4.SelectedIndex = -1;
radioGroup3.SelectedIndex = -1;
radioGroup5.SelectedIndex = -1;
radioGroup6.SelectedIndex = -1;
radioGroup7.SelectedIndex = -1;
radioGroup8.SelectedIndex = -1;
radioGroup9.SelectedIndex = -1;
radioGroup10.SelectedIndex = -1;
radioGroup12.SelectedIndex = -1;
radioGroup11.SelectedIndex = -1;
radioGroup13.SelectedIndex = -1;
radioGroup14.SelectedIndex = -1;
radioGroup15.SelectedIndex = -1;
dto = new PatientNIHSSDTO();
string url = string.Format("api/service/T_Service_Patient/GetNIHSS?patientGuid={0}&flag={1}", patientGuid, 1);
dto = DBHelpClass.GetDateModel<PatientNIHSSDTO>(url);
if (dto != null)
{
radioGroup1.EditValue = dto.LevelScore;
radioGroup2.EditValue = dto.QuestionScore;
radioGroup3.EditValue = dto.InstructScore;
radioGroup4.EditValue = dto.GazeScore;
radioGroup5.EditValue = dto.ViewScore;
radioGroup6.EditValue = dto.PacioplegiaScore;
radioGroup7.EditValue = dto.LTopLimbScore;
radioGroup8.EditValue = dto.RTopLimbScore;
radioGroup9.EditValue = dto.LUpperLimbScore;
radioGroup10.EditValue = dto.RUpperLimbScore;
radioGroup11.EditValue = dto.AtaxiaScore;
radioGroup12.EditValue = dto.SenseScore;
radioGroup13.EditValue = dto.LanguageScore;
radioGroup14.EditValue = dto.DysarthriaScore;
radioGroup15.EditValue = dto.NeglectScore;
lbl_TotalScore.Text = dto.TotalScore.ToString();
}
else {
dto = new PatientNIHSSDTO();
}
}
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup1.SelectedIndex != -1)
{
levelScore = radioGroup1.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.LevelScore = levelScore;
}
}
private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup2.SelectedIndex != -1)
{
questionScore = radioGroup2.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.QuestionScore = questionScore;
}
}
private void radioGroup3_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup3.SelectedIndex != -1)
{
instructScore = radioGroup3.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.InstructScore = instructScore;
}
}
private void radioGroup4_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup4.SelectedIndex != -1)
{
gazeScore = radioGroup4.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.GazeScore = gazeScore;
}
}
private void radioGroup5_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup5.SelectedIndex != -1)
{
viewScore = radioGroup5.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.ViewScore = viewScore;
}
}
private void radioGroup6_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup6.SelectedIndex != -1)
{
pacioplegiaScore = radioGroup6.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.PacioplegiaScore = pacioplegiaScore;
}
}
private void radioGroup7_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup7.SelectedIndex != -1)
{
if (radioGroup7.SelectedIndex == 5)
{
lTopLimbScore = 0;
dto.LTopLimbScore = 9;
}
else
{
lTopLimbScore = radioGroup7.SelectedIndex;
dto.LTopLimbScore = lTopLimbScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup8_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup8.SelectedIndex != -1)
{
if (radioGroup8.SelectedIndex == 5)
{
rTopLimbScore = 0;
dto.RTopLimbScore = 9;
}
else
{
rTopLimbScore = radioGroup8.SelectedIndex;
dto.RTopLimbScore = rTopLimbScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup9_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup9.SelectedIndex != -1)
{
if (radioGroup9.SelectedIndex == 5)
{
lUpperLimbScore = 0;
dto.LUpperLimbScore = 9;
}
else
{
lUpperLimbScore = radioGroup9.SelectedIndex;
dto.LUpperLimbScore = lUpperLimbScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup10_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup10.SelectedIndex != -1)
{
if (radioGroup10.SelectedIndex == 5)
{
rUpperLimbScore = 0;
dto.RUpperLimbScore = 9;
}
else
{
rUpperLimbScore = radioGroup10.SelectedIndex;
dto.RUpperLimbScore = rUpperLimbScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup11_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup11.SelectedIndex != -1)
{
if (radioGroup11.SelectedIndex == 3)
{
ataxiaScore = 0;
dto.AtaxiaScore = 9;
}
else
{
ataxiaScore = radioGroup11.SelectedIndex;
dto.AtaxiaScore = ataxiaScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup12_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup12.SelectedIndex != -1)
{
if (radioGroup12.SelectedIndex == 3)
{
senseScore = 0;
}
else
{
senseScore = radioGroup12.SelectedIndex;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.SenseScore = senseScore;
}
}
private void radioGroup13_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup13.SelectedIndex != -1)
{
languageScore = radioGroup13.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.LanguageScore = languageScore;
}
}
private void radioGroup14_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup14.SelectedIndex != -1)
{
if (radioGroup14.SelectedIndex == 3)
{
dysarthriaScore = 0;
dto.DysarthriaScore = 9;
}
else
{
dysarthriaScore = radioGroup14.SelectedIndex;
dto.DysarthriaScore = dysarthriaScore;
}
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
}
}
private void radioGroup15_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup15.SelectedIndex != -1)
{
neglectScore = radioGroup15.SelectedIndex;
lbl_TotalScore.Text = (levelScore + questionScore + instructScore + viewScore + gazeScore + pacioplegiaScore + lTopLimbScore + rTopLimbScore + lUpperLimbScore + rUpperLimbScore + ataxiaScore + senseScore + languageScore + dysarthriaScore + neglectScore).ToString();
dto.NeglectScore = neglectScore;
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
if (radioGroup1.SelectedIndex == -1 || radioGroup2.SelectedIndex == -1 ||
radioGroup4.SelectedIndex == -1 || radioGroup3.SelectedIndex == -1 ||
radioGroup5.SelectedIndex == -1 || radioGroup6.SelectedIndex == -1 ||
radioGroup7.SelectedIndex == -1 || radioGroup8.SelectedIndex == -1 ||
radioGroup9.SelectedIndex == -1 || radioGroup10.SelectedIndex == -1 ||
radioGroup12.SelectedIndex == -1 || radioGroup11.SelectedIndex == -1 ||
radioGroup13.SelectedIndex == -1 || radioGroup14.SelectedIndex == -1 ||
radioGroup15.SelectedIndex == -1)
{
XtraMessageBox.Show("请先完善评分!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
} //初始化两个工厂
ClientFactory<PatientNIHSSDTO> httpClient = new HttpClientFactory<PatientNIHSSDTO>();
Client<PatientNIHSSDTO> client = httpClient.VisitFactory();
List<PatientNIHSSDTO> list = new List<PatientNIHSSDTO>();
dto.PatientGUID = patientGuid;
dto.CreateUser = Information.User.ID;
dto.TotalScore = lbl_TotalScore.Text == "" ? 0 : int.Parse(lbl_TotalScore.Text.Trim());
dto.Flag = 1;
list.Add(dto);
string Url = string.Empty;
Url = "api/service/T_Service_Patient/SaveNIHSS";
ListEntity<PatientNIHSSDTO> t = client.Post(Url, list);
if (t.Success)
{
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
string msg = jo["Msg"].ToString();
if (!string.IsNullOrEmpty(msg))
{
XtraMessageBox.Show(msg);
}
this.Close();
Form_PatientScore Patient;
Patient = (Form_PatientScore)this.Owner;
Patient.GetPatientTriageScoreList();
}
else
{
XtraMessageBox.Show("保存失败");
}
}
catch (Exception)
{
throw;
}
}
}
}