StableVersion4.3/HL_FristAidPlatform_EMRS/Form_PatientInfoRTS.cs

157 lines
5.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace HL_FristAidPlatform_EMRS
{
public partial class Form_PatientInfoRTS : XtraForm
{
private string _patientGUID;
private float gcs;
private float systolicPressureScore;
private float breathingScore;
public Form_PatientInfoRTS(string patientGUID)
{
InitializeComponent();
_patientGUID = patientGUID;
}
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (radioGroup1.SelectedIndex)
{
case 0:
gcs = 0;
break;
case 1:
gcs = 1;
break;
case 2:
gcs = 2;
break;
case 3:
gcs = 3;
break;
case 4:
gcs = 4;
break;
}
lbl_TotalScore.Text = (float.Parse((gcs * 0.9368).ToString())+ float.Parse((systolicPressureScore * 0.7326).ToString())+ float.Parse((breathingScore * 7.8408).ToString())).ToString();
}
private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e)
{
switch (radioGroup2.SelectedIndex)
{
case 0:
systolicPressureScore = 0;
break;
case 1:
systolicPressureScore = 1;
break;
case 2:
systolicPressureScore = 2;
break;
case 3:
systolicPressureScore = 3;
break;
case 4:
systolicPressureScore = 4;
break;
}
lbl_TotalScore.Text = (float.Parse((gcs * 0.9368).ToString()) + float.Parse((systolicPressureScore * 0.7326).ToString()) + float.Parse((breathingScore * 7.8408).ToString())).ToString();
}
private void radioGroup3_SelectedIndexChanged(object sender, EventArgs e)
{
switch (radioGroup3.SelectedIndex)
{
case 0:
breathingScore = 0;
break;
case 1:
breathingScore = 1;
break;
case 2:
breathingScore = 2;
break;
case 3:
breathingScore = 3;
break;
case 4:
breathingScore = 4;
break;
}
lbl_TotalScore.Text = (float.Parse((gcs * 0.9368).ToString()) + float.Parse((systolicPressureScore * 0.7326).ToString()) + float.Parse((breathingScore * 7.8408).ToString())).ToString();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
if (radioGroup1.SelectedIndex == -1)
{
XtraMessageBox.Show("GCS选择项为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
radioGroup1.Focus();
return;
}
if (radioGroup2.SelectedIndex == -1)
{
XtraMessageBox.Show("收缩压选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
radioGroup2.Focus();
return;
}
if (radioGroup3.SelectedIndex == -1)
{
XtraMessageBox.Show("呼吸频率选择项为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
radioGroup3.Focus();
return;
}
List<FirstAid_PatientRTSDTO> list = new List<FirstAid_PatientRTSDTO>();
FirstAid_PatientRTSDTO dto = new FirstAid_PatientRTSDTO();
dto.PatientGUID = _patientGUID;
dto.CreateUser = Information.User.ID;
dto.GCS = gcs;
dto.SystolicPressureScore = systolicPressureScore;
dto.BreathingScore = breathingScore;
dto.TotalScore = float.Parse(lbl_TotalScore.Text);
//院前rts flag=0
dto.Flag = 0;
if (dto.TotalScore > 11)
{
dto.RTSLevel = 1;
}
else {
dto.RTSLevel = 2;
}
list.Add(dto);
string Url = string.Empty;
Url = "api/service/FirstAid_PatientScore/AddRTS";
//初始化两个工厂
ClientFactory<FirstAid_PatientRTSDTO> httpClient = new HttpClientFactory<FirstAid_PatientRTSDTO>();
Client<FirstAid_PatientRTSDTO> client = httpClient.VisitFactory();
if (client.Post(Url, list).Success)
{
XtraMessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
Form_EMRInfo info;
info = (Form_EMRInfo)this.Owner;
info.ParentInfo(_patientGUID);
this.Close();
}
}
private void Form_PatientInfoRTS_Load(object sender, EventArgs e)
{
radioGroup1.SelectedIndex = -1;
radioGroup2.SelectedIndex = -1;
radioGroup3.SelectedIndex = -1;
}
}
}