234 lines
7.6 KiB
C#
234 lines
7.6 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.Windows.Forms;
|
||
|
||
namespace HL_FristAidPlatform_EmergencyTriage
|
||
{
|
||
public partial class Form_GCS : XtraForm
|
||
{
|
||
private string _patientGUID;
|
||
|
||
private int eyesOpenScore;
|
||
|
||
private int verbalResponseScore;
|
||
|
||
private int limbExerciseScore;
|
||
|
||
private int gcsLeve;
|
||
public Form_GCS(string patientGUID)
|
||
{
|
||
InitializeComponent();
|
||
_patientGUID = patientGUID;
|
||
}
|
||
|
||
|
||
|
||
private void Form_PatientInfoGCS_Load(object sender, EventArgs e)
|
||
{
|
||
string url = string.Format("api/service/T_Service_Patient/GetGCS?PatientGuid={0}&flag={1}",_patientGUID,1);
|
||
T_Service_PatientGCS dto = DBHelpClass.GetDateModel<T_Service_PatientGCS>(url);
|
||
if (dto != null)
|
||
{
|
||
radio_EyesOpenScore.EditValue = dto.EyesOpenScore;
|
||
radio_VerbalResponseScore.EditValue = dto.VerbalResponseScore;
|
||
radio_LimbExerciseScore.EditValue = dto.LimbExerciseScore;
|
||
lbl_TotalScore.Text = dto.TotalScore.ToString();
|
||
if (dto.GCSLevel == 1)
|
||
lbl_GCSLeve.Text = "轻度昏迷";
|
||
if (dto.GCSLevel == 2)
|
||
lbl_GCSLeve.Text = "中度昏迷";
|
||
if (dto.GCSLevel == 3)
|
||
lbl_GCSLeve.Text = "重度昏迷";
|
||
}
|
||
}
|
||
|
||
private void lbl_TotalScore_TextChanged(object sender, EventArgs e)
|
||
{
|
||
int score = int.Parse(lbl_TotalScore.Text);
|
||
if (score >= 13 && score <= 14)
|
||
{
|
||
lbl_GCSLeve.Text = "轻度昏迷";
|
||
gcsLeve = 1;
|
||
}
|
||
if (score >= 9 && score <= 12)
|
||
{
|
||
lbl_GCSLeve.Text = "中度昏迷";
|
||
gcsLeve = 2;
|
||
}
|
||
if (score >= 3 && score <= 8)
|
||
{
|
||
lbl_GCSLeve.Text = "重度昏迷";
|
||
gcsLeve = 3;
|
||
}
|
||
}
|
||
|
||
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_EyesOpenScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
eyesOpenScore = 4;
|
||
break;
|
||
case 1:
|
||
eyesOpenScore = 3;
|
||
break;
|
||
case 2:
|
||
eyesOpenScore = 2;
|
||
break;
|
||
case 3:
|
||
eyesOpenScore = 1;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (eyesOpenScore + verbalResponseScore + limbExerciseScore).ToString();
|
||
|
||
}
|
||
|
||
private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_VerbalResponseScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
verbalResponseScore = 5;
|
||
break;
|
||
case 1:
|
||
verbalResponseScore = 4;
|
||
break;
|
||
case 2:
|
||
verbalResponseScore = 3;
|
||
break;
|
||
case 3:
|
||
verbalResponseScore = 2;
|
||
break;
|
||
case 4:
|
||
verbalResponseScore = 1;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (eyesOpenScore + verbalResponseScore + limbExerciseScore).ToString();
|
||
}
|
||
|
||
private void radioGroup3_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_LimbExerciseScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
limbExerciseScore = 6;
|
||
break;
|
||
case 1:
|
||
limbExerciseScore = 5;
|
||
break;
|
||
case 2:
|
||
limbExerciseScore = 4;
|
||
break;
|
||
case 3:
|
||
limbExerciseScore = 3;
|
||
break;
|
||
case 4:
|
||
limbExerciseScore = 2;
|
||
break;
|
||
case 5:
|
||
limbExerciseScore = 1;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (eyesOpenScore + verbalResponseScore + limbExerciseScore).ToString();
|
||
}
|
||
|
||
private void simpleButton1_Click(object sender, EventArgs e)
|
||
{
|
||
if (radio_EyesOpenScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("睁眼反应选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_EyesOpenScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_VerbalResponseScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("语言反应选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_VerbalResponseScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_LimbExerciseScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("肢体动作选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_LimbExerciseScore.Focus();
|
||
return;
|
||
}
|
||
List<FirstAid_PatientGCSDTO> list = new List<FirstAid_PatientGCSDTO>();
|
||
FirstAid_PatientGCSDTO dto = new FirstAid_PatientGCSDTO();
|
||
dto.CreateUser = Information.User.ID;
|
||
dto.PatientGUID = _patientGUID;
|
||
dto.EyesOpenScore = eyesOpenScore;
|
||
dto.VerbalResponseScore = verbalResponseScore;
|
||
dto.LimbExerciseScore = limbExerciseScore;
|
||
dto.TotalScore = int.Parse(lbl_TotalScore.Text);
|
||
dto.GCSLevel = gcsLeve;
|
||
dto.Flag = 1;
|
||
list.Add(dto);
|
||
string Url = string.Empty;
|
||
Url = "api/service/T_Service_Patient/SaveGCS";
|
||
|
||
//初始化两个工厂
|
||
ClientFactory<FirstAid_PatientGCSDTO> httpClient = new HttpClientFactory<FirstAid_PatientGCSDTO>();
|
||
Client<FirstAid_PatientGCSDTO> client = httpClient.VisitFactory();
|
||
|
||
ListEntity<FirstAid_PatientGCSDTO> 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("保存失败");
|
||
}
|
||
}
|
||
|
||
private class T_Service_PatientGCS
|
||
{
|
||
|
||
/// <summary>
|
||
/// 患者GUID
|
||
/// </summary>
|
||
public string PatientGUID { get; set; }
|
||
|
||
/// <summary>
|
||
/// 睁眼反应
|
||
/// </summary>
|
||
public int EyesOpenScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 语言反应
|
||
/// </summary>
|
||
public int VerbalResponseScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 肢体运动
|
||
/// </summary>
|
||
public int LimbExerciseScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 总分
|
||
/// </summary>
|
||
public int TotalScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 1:13-14分:轻度昏迷 2:9-12 中度昏迷:3:3-8分:重度昏迷
|
||
/// </summary>
|
||
public int GCSLevel { get; set; }
|
||
}
|
||
}
|
||
}
|