293 lines
10 KiB
C#
293 lines
10 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_PHI : XtraForm
|
||
{
|
||
private string guid;
|
||
private string _patientGuid;
|
||
private int flag;
|
||
private int systolicPressureScore;
|
||
private int pulseScore;
|
||
private int breathingScore;
|
||
private int sonsciousScore;
|
||
private int injuryScore;
|
||
private int phiLevel;
|
||
public Form_PHI(string patientGuid, int _flag)
|
||
{
|
||
InitializeComponent();
|
||
_patientGuid = patientGuid;
|
||
flag = _flag;
|
||
}
|
||
|
||
private void Form_PatientInfoPHI_Load(object sender, EventArgs e)
|
||
{
|
||
radio_BreathingScore.SelectedIndex = -1;
|
||
|
||
string url = string.Format("api/service/FirstAid_PatientScore/GetPHIByPatientGuid?PatientGuid={0}&flag={1}", _patientGuid, flag);
|
||
FirstAid_PatientPHI dto = DBHelpClass.GetDateModel<FirstAid_PatientPHI>(url);
|
||
if (dto != null)
|
||
{
|
||
radio_SystolicPressureScore.EditValue = dto.SystolicPressureScore;
|
||
radio_PulseScore.EditValue = dto.PulseScore;
|
||
radio_BreathingScore.EditValue = dto.BreathingScore;
|
||
radio_SonsciousScore.EditValue = dto.SonsciousScore;
|
||
radio_InjuryScore.EditValue = dto.InjuryScore;
|
||
lbl_TotalScore.Text = dto.TotalScore.ToString();
|
||
}
|
||
}
|
||
|
||
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_SystolicPressureScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
systolicPressureScore = 0;
|
||
break;
|
||
case 1:
|
||
systolicPressureScore = 1;
|
||
break;
|
||
case 2:
|
||
systolicPressureScore = 3;
|
||
break;
|
||
case 3:
|
||
systolicPressureScore = 5;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (systolicPressureScore + pulseScore + breathingScore + sonsciousScore + injuryScore).ToString();
|
||
}
|
||
|
||
private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_PulseScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
pulseScore = 0;
|
||
break;
|
||
case 1:
|
||
pulseScore = 1;
|
||
break;
|
||
case 2:
|
||
pulseScore = 3;
|
||
break;
|
||
case 3:
|
||
pulseScore = 5;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (systolicPressureScore + pulseScore + breathingScore + sonsciousScore + injuryScore).ToString();
|
||
}
|
||
|
||
private void radioGroup3_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_BreathingScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
breathingScore = 0;
|
||
break;
|
||
case 1:
|
||
breathingScore = 1;
|
||
break;
|
||
case 2:
|
||
breathingScore = 3;
|
||
break;
|
||
case 3:
|
||
breathingScore = 5;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (systolicPressureScore + pulseScore + breathingScore + sonsciousScore + injuryScore).ToString();
|
||
}
|
||
|
||
private void radioGroup4_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_SonsciousScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
sonsciousScore = 0;
|
||
break;
|
||
case 1:
|
||
sonsciousScore = 1;
|
||
break;
|
||
case 2:
|
||
sonsciousScore = 3;
|
||
break;
|
||
case 3:
|
||
sonsciousScore = 5;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (systolicPressureScore + pulseScore + breathingScore + sonsciousScore + injuryScore).ToString();
|
||
}
|
||
|
||
private void radioGroup5_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
switch (radio_InjuryScore.SelectedIndex)
|
||
{
|
||
case 0:
|
||
injuryScore = 0;
|
||
break;
|
||
case 1:
|
||
injuryScore = 4;
|
||
break;
|
||
}
|
||
lbl_TotalScore.Text = (systolicPressureScore + pulseScore + breathingScore + sonsciousScore + injuryScore).ToString();
|
||
}
|
||
|
||
private void lbl_TotalScore_TextChanged(object sender, EventArgs e)
|
||
{
|
||
int scroe = int.Parse(lbl_TotalScore.Text);
|
||
if (scroe <= 3)
|
||
{
|
||
lbl_phiLevel.Text = "轻伤员";
|
||
phiLevel = 1;
|
||
lbl_phiLevel.Visible = true;
|
||
lbl_TotalScore.Visible = true;
|
||
}
|
||
if (scroe >= 4 && scroe <= 6)
|
||
{
|
||
lbl_phiLevel.Text = "重伤员";
|
||
phiLevel = 2;
|
||
lbl_phiLevel.Visible = true;
|
||
lbl_TotalScore.Visible = true;
|
||
}
|
||
if (scroe > 6)
|
||
{
|
||
lbl_phiLevel.Text = "危重伤员";
|
||
phiLevel = 3;
|
||
lbl_phiLevel.Visible = true;
|
||
lbl_TotalScore.Visible = true;
|
||
}
|
||
}
|
||
|
||
private void simpleButton1_Click(object sender, EventArgs e)
|
||
{
|
||
if (radio_SystolicPressureScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("收缩压选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_SystolicPressureScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_PulseScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("脉搏选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_PulseScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_BreathingScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("呼吸选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_BreathingScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_SonsciousScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("神志选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_SonsciousScore.Focus();
|
||
return;
|
||
}
|
||
if (radio_InjuryScore.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("附加伤部及伤型选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radio_InjuryScore.Focus();
|
||
return;
|
||
}
|
||
List<FirstAid_PatientPHIDTO> list = new List<FirstAid_PatientPHIDTO>();
|
||
FirstAid_PatientPHIDTO dto = new FirstAid_PatientPHIDTO();
|
||
dto.PatientGUID = _patientGuid;
|
||
dto.CreateUser = Information.User.ID;
|
||
dto.BreathingScore = breathingScore;
|
||
dto.SonsciousScore = sonsciousScore;
|
||
dto.SystolicPressureScore = systolicPressureScore;
|
||
dto.PulseScore = pulseScore;
|
||
dto.InjuryScore = injuryScore;
|
||
dto.TotalScore = int.Parse(lbl_TotalScore.Text);
|
||
dto.PHILevel = phiLevel;
|
||
//flag=0表示院前PHI评分
|
||
dto.Flag = flag;
|
||
list.Add(dto);
|
||
string Url = string.Empty;
|
||
Url = "api/service/FirstAid_PatientScore/AddPHI";
|
||
|
||
//初始化两个工厂
|
||
ClientFactory<FirstAid_PatientPHIDTO> httpClient = new HttpClientFactory<FirstAid_PatientPHIDTO>();
|
||
Client<FirstAid_PatientPHIDTO> client = httpClient.VisitFactory();
|
||
|
||
|
||
ListEntity<FirstAid_PatientPHIDTO> 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 FirstAid_PatientPHI
|
||
{
|
||
public string GUID { get; set; }
|
||
|
||
// <summary>
|
||
/// 收缩压评分
|
||
/// </summary>
|
||
public int SystolicPressureScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 脉搏评分
|
||
/// </summary>
|
||
public int PulseScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 呼吸评分
|
||
/// </summary>
|
||
public int BreathingScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 神志评分
|
||
/// </summary>
|
||
public int SonsciousScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 附加伤及伤型评分
|
||
/// </summary>
|
||
public int InjuryScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 总分
|
||
/// </summary>
|
||
public int TotalScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 1:0-3分:轻伤员 2:4-6 重伤员:3:6分以上危重伤员
|
||
/// </summary>
|
||
public int PHILevel { get; set; }
|
||
|
||
/// <summary>
|
||
/// 评分时间
|
||
/// </summary>
|
||
public DateTime ScoreTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 创建人
|
||
/// </summary>
|
||
public string CreateUser { get; set; }
|
||
}
|
||
}
|
||
}
|