199 lines
7.2 KiB
C#
199 lines
7.2 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_RMES : XtraForm
|
||
{
|
||
|
||
string _guid = "";
|
||
int num1 = 0;
|
||
int num2 = 0;
|
||
int num3 = 0;
|
||
int num4 = 0;
|
||
int num5 = 0;
|
||
int num6 = 0;
|
||
int sum = 0;
|
||
|
||
|
||
T_Service_Trauma_EmergencyScoreDTO emergencyScoreDTO = new T_Service_Trauma_EmergencyScoreDTO();
|
||
|
||
public Form_RMES()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
public Form_RMES(string patientGuid)
|
||
{
|
||
InitializeComponent();
|
||
_guid = patientGuid;
|
||
}
|
||
|
||
private void Form_RMES_Load(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
DataTable dt = DBHelpClass.GetDataRow(string.Format("api/service/T_Service_Trauma_EmergencyScore/GetEmergencyScoreByPatientGuid?patientGuid={0}", _guid));
|
||
if (dt != null && dt.Rows.Count > 0)
|
||
{
|
||
rgPulse.EditValue = dt.Rows[0]["Pulse"].ToString();
|
||
|
||
rgSystolicPressure.EditValue = dt.Rows[0]["SystolicPressure"].ToString();
|
||
|
||
rgAge.EditValue = dt.Rows[0]["Age"].ToString();
|
||
|
||
rgRespiratoryRate.EditValue = dt.Rows[0]["RespiratoryRate"].ToString();
|
||
|
||
rgGCSScore.EditValue = dt.Rows[0]["GCSScore"].ToString();
|
||
|
||
rgSPO2.EditValue = dt.Rows[0]["SPO2"].ToString();
|
||
|
||
labelControlSumScore.Text = dt.Rows[0]["SumScore"].ToString();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "加载RMES评分信息:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
private void simpleButton1_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (rgPulse.SelectedIndex == -1 || rgSystolicPressure.SelectedIndex == -1 || rgAge.SelectedIndex == -1 || rgRespiratoryRate.SelectedIndex == -1 || rgGCSScore.SelectedIndex == -1 || rgSPO2.SelectedIndex == -1)
|
||
{
|
||
XtraMessageBox.Show("请检查完善必填项信息!!");
|
||
return;
|
||
}
|
||
|
||
|
||
emergencyScoreDTO.SumScore = labelControlSumScore.Text + "";
|
||
if (emergencyScoreDTO.SumScore.Contains("分"))
|
||
emergencyScoreDTO.SumScore = emergencyScoreDTO.SumScore.Replace("分", "");
|
||
emergencyScoreDTO.PatientGuid = _guid;
|
||
emergencyScoreDTO.CreatorID = Information.User.ID;
|
||
|
||
List<T_Service_Trauma_EmergencyScoreDTO> emergencyScoreDTOs = new List<T_Service_Trauma_EmergencyScoreDTO>();
|
||
|
||
string Url = string.Format("api/service/T_Service_Trauma_EmergencyScore/SaveEmergencyScore");//GetTIScoreByPatientGuid
|
||
|
||
ClientFactory<T_Service_Trauma_EmergencyScoreDTO> httpClient = new HttpClientFactory<T_Service_Trauma_EmergencyScoreDTO>();
|
||
Client<T_Service_Trauma_EmergencyScoreDTO> client = httpClient.VisitFactory();
|
||
|
||
emergencyScoreDTOs.Add(emergencyScoreDTO);
|
||
//访问
|
||
ListEntity<T_Service_Trauma_EmergencyScoreDTO> t = client.Post(Url, emergencyScoreDTOs);
|
||
|
||
|
||
if (t.Success)
|
||
{
|
||
//XtraMessageBox.Show("保存成功");
|
||
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 ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "保存RMES评分信息\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
private void rgPulse_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgPulse.SelectedIndex != -1)
|
||
{
|
||
num1 = int.Parse(rgPulse.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlPulse.Text = num1 + "分";
|
||
emergencyScoreDTO.Pulse = num1 + "";
|
||
}
|
||
}
|
||
|
||
private void rgSystolicPressure_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgSystolicPressure.SelectedIndex != -1)
|
||
{
|
||
num2 = int.Parse(rgSystolicPressure.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlSystolicPressure.Text = num2 + "分";
|
||
emergencyScoreDTO.SystolicPressure = num2 + "";
|
||
}
|
||
}
|
||
|
||
private void rgAge_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgAge.SelectedIndex != -1)
|
||
{
|
||
num3 = int.Parse(rgAge.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlAge.Text = num3 + "分";
|
||
emergencyScoreDTO.Age = num3 + "";
|
||
}
|
||
}
|
||
|
||
private void rgRespiratoryRate_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgRespiratoryRate.SelectedIndex != -1)
|
||
{
|
||
num4 = int.Parse(rgRespiratoryRate.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlRespiratoryRate.Text = num4 + "分";
|
||
emergencyScoreDTO.RespiratoryRate = num4 + "";
|
||
}
|
||
}
|
||
|
||
private void rgGCSScore_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgGCSScore.SelectedIndex != -1)
|
||
{
|
||
num5 = int.Parse(rgGCSScore.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlGCSScore.Text = num5 + "分";
|
||
emergencyScoreDTO.GCSScore = num5 + "";
|
||
}
|
||
}
|
||
|
||
private void rgSPO2_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (rgSPO2.SelectedIndex != -1)
|
||
{
|
||
num6 = int.Parse(rgSPO2.EditValue + "");
|
||
sum = num1 + num2 + num3 + num4 + num5 + num6;
|
||
labelControlSumScore.Text = sum + "分";
|
||
labelControlSPO2.Text = num6 + "分";
|
||
emergencyScoreDTO.SPO2 = num6 + "";
|
||
}
|
||
}
|
||
}
|
||
}
|