1048 lines
42 KiB
C#
1048 lines
42 KiB
C#
using DevExpress.XtraEditors;
|
||
using DevExpress.XtraEditors.Controls;
|
||
using HL_FristAidPlatform_DTO;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.IO;
|
||
using System.Text.RegularExpressions;
|
||
using System.Windows.Forms;
|
||
|
||
namespace HL_FristAidPlatform_Public
|
||
{
|
||
public partial class Form_PreTriage : XtraForm
|
||
{
|
||
private string TaskGuid;
|
||
|
||
/// <summary>
|
||
/// 民族
|
||
/// </summary>
|
||
private DataTable NationDT;
|
||
|
||
/// <summary>
|
||
/// 胸痛院前信息 V2.1
|
||
/// </summary>
|
||
private DataTable Cur_FirstAIDInfoDT = new DataTable();
|
||
|
||
/// <summary>
|
||
/// 时间源
|
||
/// </summary>
|
||
private DataTable Cur_TimeAxisDT = new DataTable();
|
||
|
||
public string name;
|
||
public string age;
|
||
public string gender;
|
||
public string phone;
|
||
|
||
public string killip;
|
||
|
||
public string signArea;
|
||
public string triageDepartment;
|
||
|
||
public string ComeHospital;
|
||
|
||
public string diagnosisImpression;
|
||
|
||
public string siteSymptoms;
|
||
|
||
public string category = "0";
|
||
|
||
public string feverRegistration;
|
||
public string IsGreenWay = "0";
|
||
|
||
public Form_PreTriage()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
public Form_PreTriage(string taskGuid, string _name, string _age, string _gender, string _phone)
|
||
{
|
||
InitializeComponent();
|
||
TaskGuid = taskGuid;
|
||
name = _name;
|
||
age = _age;
|
||
gender = _gender;
|
||
phone = _phone;
|
||
}
|
||
|
||
private void Form_PreTriage_Load(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(name)) txt_Name.Text = name;
|
||
if (!string.IsNullOrEmpty(age)) txt_Age.Text = name;
|
||
if (!string.IsNullOrEmpty(gender)) radioGroup_Gender.EditValue = gender;
|
||
if (!string.IsNullOrEmpty(phone)) txt_Phone.Text = phone;
|
||
QueryTaskDetail(TaskGuid);
|
||
BindSystemModule();
|
||
BindNation();
|
||
BindGender();
|
||
BindPathogeny();
|
||
TriageDepartment();
|
||
DiagnosisImpression();
|
||
TriageName();
|
||
BindEvent();
|
||
if (!string.IsNullOrEmpty(TaskGuid))
|
||
{
|
||
panelControl1.Visible = true;
|
||
}
|
||
//职业
|
||
// PublicClass.SetLookUpList(lookUpEdit_Profession, Enumerate.PublicDictionaryType.职业, true, "请选择");
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定所属系统模块
|
||
/// </summary>
|
||
private void BindSystemModule()
|
||
{
|
||
try
|
||
{
|
||
string Url = string.Format("/api/admin/T_SYS_SystemModule/GetRightListByHospitalID?hospitalID={0}&isHaveTimeAxis=0", Information.Hospital.ID);
|
||
DataTable ResultDT = DBHelpClass.Get(Url);
|
||
if (ResultDT != null && ResultDT.Rows.Count > 0)
|
||
{
|
||
DataTable BindData = new DataTable();
|
||
BindData.Columns.Add("ID", Type.GetType("System.String"));
|
||
BindData.Columns.Add("SystemName", Type.GetType("System.String"));
|
||
BindData.Columns.Add("IconData", Type.GetType("System.Byte[]"));
|
||
|
||
foreach (DataRow item in ResultDT.Rows)
|
||
{
|
||
DataRow newRow = BindData.NewRow();
|
||
newRow["ID"] = item["ID"];
|
||
newRow["SystemName"] = item["ShortName"] + "患者";
|
||
if (!string.IsNullOrEmpty(PublicClass.ToString(item["IconData"], "")))
|
||
{
|
||
newRow["IconData"] = Convert.FromBase64String(item["IconData"].ToString());
|
||
}
|
||
else
|
||
{
|
||
newRow["IconData"] = null;
|
||
}
|
||
BindData.Rows.Add(newRow);
|
||
}
|
||
|
||
//listBox_SystemModule.DataSource = BindData;
|
||
//listBox_SystemModule.ValueMember = "ID";
|
||
//listBox_SystemModule.DisplayMember = "SystemName";
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定所属系统模块:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
private void dateEdit_Birthday_TimeValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(dateEdit_Birthday.TimeValue))
|
||
{
|
||
DateTime dateTime = Convert.ToDateTime(dateEdit_Birthday.TimeValue);
|
||
int ageUnit = 1;
|
||
txt_Age.Text = PublicClass.GetAge(dateTime, DateTime.Now, out ageUnit).ToString();
|
||
}
|
||
}
|
||
|
||
public void QueryTaskDetail(string taskGuid)
|
||
{
|
||
string url = string.Format("/api/service/T_Service_FirstAid_AlarmTaskInfo/GetInfoByTaskGuid?guid={0}", taskGuid);
|
||
DataTable dt = DBHelpClass.Get(url);
|
||
if (dt != null)
|
||
{
|
||
if (dt.Rows.Count > 0)
|
||
{
|
||
txt_Name.Text = dt.Rows[0]["Name"].ToString();
|
||
radioGroup_Gender.EditValue = dt.Rows[0]["Gender"].ToString();
|
||
txt_Age.Text = dt.Rows[0]["Age"].ToString();
|
||
txt_Phone.Text = dt.Rows[0]["Phone"].ToString();
|
||
txt_Address.Text = dt.Rows[0]["Address"].ToString();
|
||
txt_Attack_Address.Text = dt.Rows[0]["WaitingAddress"].ToString();
|
||
}
|
||
}
|
||
}
|
||
|
||
public void DiagnosisImpression()
|
||
{
|
||
string url = string.Format("api/base/T_Base_DiagnosisAndTriageGo/GetImpressionDiagnosisList");
|
||
List<T_Base_TriageGoDTO> list = DBHelpClass.GetList<T_Base_TriageGoDTO>(url);
|
||
checkedListBoxControl1.DataSource = list;//显示分页结果
|
||
this.checkedListBoxControl1.DisplayMember = "Name";
|
||
this.checkedListBoxControl1.ValueMember = "ID";
|
||
}
|
||
|
||
public void TriageName()
|
||
{
|
||
string url = string.Format("api/base/T_Base_AccidentInfo/GetAccidentInfoClass");
|
||
List<AccidentInfoClassModel> list = DBHelpClass.GetList<AccidentInfoClassModel>(url);
|
||
foreach (var item in list)
|
||
{
|
||
RadioGroupItem radioButton = new RadioGroupItem();
|
||
radioButton.Value = item.ID.ToString();
|
||
radioButton.Description = item.Name.ToString();
|
||
radioGroup_TriageName.Properties.Items.Add(radioButton);
|
||
}
|
||
}
|
||
|
||
public void TriageDepartment()
|
||
{
|
||
string url = string.Format("api/base/T_Base_DiagnosisAndTriageGo/GetTriageGoList");
|
||
List<T_Base_TriageGoDTO> list = DBHelpClass.GetList<T_Base_TriageGoDTO>(url);
|
||
foreach (var item in list)
|
||
{
|
||
RadioGroupItem radioButton = new RadioGroupItem();
|
||
radioButton.Value = item.ID.ToString();
|
||
radioButton.Description = item.Name.ToString();
|
||
radioGroup_TriageDepartment.Properties.Items.Add(radioButton);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定民族
|
||
/// </summary>
|
||
private void BindNation()
|
||
{
|
||
try
|
||
{
|
||
NationDT = DBHelpClass.Get("/api/base/T_Base_Nation/GetList");
|
||
PublicClass.SetLookUpList(ref lookUpEdit_Nation, NationDT, 1, 2, true, "请选择");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定民族:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定性别
|
||
/// </summary>
|
||
private void BindGender()
|
||
{
|
||
try
|
||
{
|
||
DataTable GenderDT = DBHelpClass.Get("/api/base/T_Base_Gender/GetList");
|
||
PublicClass.BindRadioGroupData(radioGroup_Gender, GenderDT, "GenderName", "GenderCode");
|
||
radioGroup_Gender.EditValue = "0";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定性别:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定病因
|
||
/// </summary>
|
||
private void BindPathogeny()
|
||
{
|
||
try
|
||
{
|
||
DataTable dt = DBHelpClass.Get("/api/base/T_Base_Pathogeny/GetList");
|
||
PublicClass.SetLookUpList(ref lookUpEdit_Pathogeny, dt, 1, 2, true, "请选择");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定民族:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
private void btn_ReadCard_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
#region 读取身份证
|
||
|
||
HL_FristAidPlatform_ReadCard.IDCardData cardData = new HL_FristAidPlatform_ReadCard.IDCardData();
|
||
var status = HL_FristAidPlatform_ReadCard.IdCardReader.Read(ref cardData);
|
||
pictureBox1.Image = null;
|
||
if (status == 0)
|
||
{
|
||
//新中新读卡器
|
||
switch (status)
|
||
{
|
||
case 0:
|
||
txt_Name.Text = cardData.Name;
|
||
radioGroup_Gender.EditValue = cardData.Sex;
|
||
dateEdit_Birthday.TimeValue = dateEdit_Birthday.TimeValue = Convert.ToDateTime(cardData.Born).ToString("yyyy-MM-dd");
|
||
txt_IDNumber.Text = cardData.IDCardNo;
|
||
MemoryStream ms = new MemoryStream(Convert.FromBase64String(cardData.PhotoBase64Str));
|
||
Image img = Image.FromStream(ms);
|
||
pictureBox1.Image = img;
|
||
lookUpEdit_Nation.EditValue = cardData.Nation;
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
var statusJL = HL_FristAidPlatform_ReadCard.IdCardReadOfIDR210.Reader(ref cardData);
|
||
// 精伦 IDR210 读卡
|
||
switch (statusJL)
|
||
{
|
||
case 0:
|
||
txt_Name.Text = cardData.Name;
|
||
switch (cardData.Sex.ToString())
|
||
{
|
||
case "男":
|
||
radioGroup_Gender.EditValue = "1";
|
||
break;
|
||
|
||
case "女":
|
||
radioGroup_Gender.EditValue = "2";
|
||
break;
|
||
}
|
||
dateEdit_Birthday.TimeValue = Convert.ToDateTime(cardData.Born).ToString("yyyy-MM-dd");
|
||
txt_IDNumber.Text = cardData.IDCardNo;
|
||
MemoryStream ms = new MemoryStream(Convert.FromBase64String(cardData.PhotoBase64Str));
|
||
Image img = Image.FromStream(ms);
|
||
break;
|
||
|
||
case -1:
|
||
MessageBox.Show("精伦IDR210:未找到sdtapi.dll文件");
|
||
break;
|
||
|
||
case 1:
|
||
MessageBox.Show("精伦IDR210:连接至读卡器失败!");
|
||
break;
|
||
|
||
case 2:
|
||
MessageBox.Show("精伦IDR210:未找到sdtapi.dll文件");
|
||
break;
|
||
|
||
case 3:
|
||
MessageBox.Show("精伦IDR210:请重新放置身份证!");
|
||
break;
|
||
|
||
case 4:
|
||
MessageBox.Show("精伦IDR210:读取身份证信息失败!");
|
||
break;
|
||
}
|
||
}
|
||
|
||
#endregion 读取身份证
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "读取身份证:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
public bool Save()
|
||
{
|
||
if (string.IsNullOrEmpty(txt_Name.Text))
|
||
{
|
||
XtraMessageBox.Show("患者姓名不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
txt_Name.Focus();
|
||
return false;
|
||
}
|
||
if (string.IsNullOrEmpty(radioGroup_Gender.EditValue.ToString()))
|
||
{
|
||
XtraMessageBox.Show("患者性别不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
radioGroup_Gender.Focus();
|
||
return false;
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(dateEdit_Attack_Time.TimeValue))
|
||
{
|
||
XtraMessageBox.Show("发病时间不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
dateEdit_Attack_Time.Focus();
|
||
return false;
|
||
}
|
||
List<EmergencyTriageDTO> list = new List<EmergencyTriageDTO>();
|
||
EmergencyTriageDTO dto = new EmergencyTriageDTO();
|
||
|
||
#region 基本信息
|
||
|
||
//===== 基本信息 ====
|
||
dto.Name = txt_Name.Text;
|
||
if (radioGroup_Gender.EditValue != null)
|
||
{
|
||
dto.Gender = int.Parse(radioGroup_Gender.EditValue.ToString());
|
||
}
|
||
if (!string.IsNullOrEmpty(txt_Age.Text))
|
||
{
|
||
dto.Age = int.Parse(txt_Age.Text);
|
||
}
|
||
dto.Birthday = dateEdit_Birthday.TimeValue;
|
||
if (lookUpEdit_Nation.EditValue != null)
|
||
{
|
||
dto.Nation = lookUpEdit_Nation.EditValue.ToString();
|
||
}
|
||
dto.IdentityCard = txt_IDNumber.Text;
|
||
dto.Phone = txt_Phone.Text;
|
||
dto.Address = txt_Address.Text;
|
||
dto.Attack_Time = dateEdit_Attack_Time.TimeValue;
|
||
dto.FeverTime = timeControl_FeverTime.TimeValue;
|
||
dto.Attack_Address = txt_Attack_Address.Text;
|
||
dto.HospitalGuid = Information.Hospital.GUID;
|
||
dto.Category = category;
|
||
dto.ArrivalDoorTime = timeControl_ArrivalDoorTime.TimeValue;
|
||
dto.FMCTime = timeControl_FMCTime.TimeValue;
|
||
dto.CallTime = timeControl_CallTime.TimeValue;
|
||
|
||
#endregion 基本信息
|
||
|
||
#region 主诉病史及处置
|
||
|
||
dto.ChiefComplaint = txt_ChiefComplaint.Text;
|
||
dto.MedicalHistory = txt_MedicalHistory.Text;
|
||
dto.AllergyHistory = txt_AllergyHistory.Text;
|
||
dto.DisposalRecord = txt_DiseaseRecord.Text;
|
||
|
||
#endregion 主诉病史及处置
|
||
|
||
#region 生命体征
|
||
|
||
switch (comboBox1.Text)
|
||
{
|
||
case "清醒":
|
||
dto.Conscious = "1";
|
||
break;
|
||
|
||
case "对语音有反应":
|
||
dto.Conscious = "2";
|
||
break;
|
||
|
||
case "对刺激有反应":
|
||
dto.Conscious = "3";
|
||
break;
|
||
|
||
case "对刺激无任何反应":
|
||
dto.Conscious = "4";
|
||
break;
|
||
}
|
||
|
||
dto.Pulse = txt_Pulse.Text;
|
||
dto.HeartRate = txt_Heart_Rate.Text;
|
||
dto.Breathing = txt_Breathe.Text;
|
||
dto.Temperature = txt_Temperature.Text;
|
||
dto.DiastolicPressure = txt_Blood_Pressure1.Text;
|
||
dto.SystolicPressure = txt_SystolicPressure.Text;
|
||
|
||
#endregion 生命体征
|
||
|
||
#region 预检分诊
|
||
|
||
dto.TriageTime = timeControl_TriageTime.TimeValue;
|
||
dto.Killip = killip;
|
||
dto.SignArea = signArea;
|
||
dto.TriageDepartment = triageDepartment;
|
||
string SyndromeNumber = "";
|
||
string Syndrome = "";
|
||
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl1, ",", out SyndromeNumber, out Syndrome);
|
||
dto.DiagnosisImpression = SyndromeNumber;
|
||
dto.ComeHospital = ComeHospital;
|
||
dto.EventName = textEdit_EventName.Text;
|
||
if (!string.IsNullOrEmpty(radioGroup_TriageName.EditValue + ""))
|
||
{
|
||
dto.EventID = int.Parse(radioGroup_TriageName.EditValue + "");
|
||
}
|
||
if (!string.IsNullOrEmpty(siteSymptoms))
|
||
{
|
||
dto.SiteSymptoms = siteSymptoms.Remove(siteSymptoms.Length - 1);
|
||
}
|
||
if (radioGroup_TriageDepartment.SelectedIndex != -1)
|
||
{
|
||
string value = radioGroup_TriageDepartment.Properties.Items[radioGroup_TriageDepartment.SelectedIndex].Description.ToString();
|
||
switch (value.Trim())
|
||
{
|
||
case "胸痛中心":
|
||
dto.SystemModelId = int.Parse(PublicClassForDataBase.Config10001);
|
||
break;
|
||
|
||
case "卒中中心":
|
||
dto.SystemModelId = int.Parse(PublicClassForDataBase.Config10002);
|
||
break;
|
||
|
||
case "创伤中心":
|
||
dto.SystemModelId = int.Parse(PublicClassForDataBase.Config10003);
|
||
break;
|
||
}
|
||
}
|
||
dto.CreatorID = Information.User.ID;
|
||
dto.EmergencyContact = txt_EmergencyContact.Text;
|
||
dto.EmergencyContactPhone = txt_EmergencyContactPhone.Text;
|
||
dto.PathogenyGUID = lookUpEdit_Pathogeny.EditValue.ToString();
|
||
dto.IsGreenWay = IsGreenWay;
|
||
|
||
#endregion 预检分诊
|
||
|
||
list.Add(dto);
|
||
string Url = string.Empty;
|
||
Url = "api/service/FristAidTran/AddEmergencyTriage";
|
||
//初始化两个工厂
|
||
ClientFactory<EmergencyTriageDTO> httpClient = new HttpClientFactory<EmergencyTriageDTO>();
|
||
Client<EmergencyTriageDTO> client = httpClient.VisitFactory();
|
||
ListEntity<EmergencyTriageDTO> t = client.Post(Url, list);
|
||
if (t.Success == true && !string.IsNullOrEmpty(t.DataString))
|
||
{
|
||
string guid = t.DataString.Replace("\"", "");
|
||
if (dto.SystemModelId > 0 && !string.IsNullOrEmpty(guid))
|
||
{
|
||
string url = string.Format("api/service/T_Service_FirstAid_Personnel/GetFristAxisByPatientGuid={0}", guid);
|
||
FristAxisDTO axis = new FristAxisDTO();
|
||
axis = DBHelpClass.GetDateModel<FristAxisDTO>(url);
|
||
if (axis != null)
|
||
{
|
||
if (dto.SystemModelId == 2)
|
||
{
|
||
//发病时间
|
||
if (!string.IsNullOrEmpty(axis.Attack_Time))
|
||
ChestPainPublicClass.UpdateTime_ChestPain(guid, dto.Attack_Time, PublicClassForDataBase.Config1001);
|
||
//首次接触时间--院前没有改时间节点记录
|
||
//呼救时间
|
||
if (!string.IsNullOrEmpty(axis.ArriveHospitalTime))
|
||
ChestPainPublicClass.UpdateTime_ChestPain(guid, axis.ArriveHospitalTime, PublicClassForDataBase.Config1002);
|
||
}
|
||
if (dto.SystemModelId == 3)
|
||
{
|
||
//发病时间
|
||
if (!string.IsNullOrEmpty(axis.Attack_Time))
|
||
PublicClassForDataBase.UpdateTime(guid, axis.CallTime, PublicClassForDataBase.Config6);
|
||
//呼救时间
|
||
if (!string.IsNullOrEmpty(axis.CallTime))
|
||
PublicClassForDataBase.UpdateTime(guid, axis.CallTime, PublicClassForDataBase.Config7);
|
||
//120出车时间
|
||
if (!string.IsNullOrEmpty(axis.DrivingTime))
|
||
PublicClassForDataBase.UpdateTime(guid, axis.DrivingTime, PublicClassForDataBase.Config9);
|
||
//120到达现场时间
|
||
if (!string.IsNullOrEmpty(axis.ArrivalTime))
|
||
PublicClassForDataBase.UpdateTime(guid, axis.ArrivalTime, PublicClassForDataBase.Config10);
|
||
//患者到达医院时间
|
||
if (!string.IsNullOrEmpty(axis.ArriveHospitalTime))
|
||
PublicClassForDataBase.UpdateTime(guid, axis.ArriveHospitalTime, PublicClassForDataBase.Config13);
|
||
}
|
||
}
|
||
}
|
||
XtraMessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return true;
|
||
}
|
||
else
|
||
{
|
||
XtraMessageBox.Show("保存失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||
return false;
|
||
}
|
||
}
|
||
|
||
private void lbl_Killip1_Click(object sender, EventArgs e)
|
||
{
|
||
lbl_Killip1.BackColor = Color.FromArgb(250, 53, 52);
|
||
lbl_Killip1.ForeColor = Color.White;
|
||
lbl_Killip2.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip2.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip3.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip3.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip4.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip4.ForeColor = Color.FromArgb(64, 64, 64);
|
||
killip = "1";
|
||
}
|
||
|
||
private void lbl_Killip2_Click(object sender, EventArgs e)
|
||
{
|
||
lbl_Killip1.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip1.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip2.BackColor = Color.FromArgb(241, 90, 34);
|
||
lbl_Killip2.ForeColor = Color.White;
|
||
lbl_Killip3.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip3.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip4.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip4.ForeColor = Color.FromArgb(64, 64, 64);
|
||
killip = "2";
|
||
}
|
||
|
||
private void lbl_Killip3_Click(object sender, EventArgs e)
|
||
{
|
||
lbl_Killip1.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip1.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip2.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip2.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip3.BackColor = Color.FromArgb(255, 153, 0);
|
||
lbl_Killip3.ForeColor = Color.White;
|
||
lbl_Killip4.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip4.ForeColor = Color.FromArgb(64, 64, 64);
|
||
killip = "3";
|
||
}
|
||
|
||
private void lbl_Killip4_Click(object sender, EventArgs e)
|
||
{
|
||
lbl_Killip1.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip1.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip2.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip2.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip3.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_Killip3.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_Killip4.BackColor = Color.FromArgb(25, 190, 107);
|
||
lbl_Killip4.ForeColor = Color.White;
|
||
killip = "4";
|
||
}
|
||
|
||
private void lbl_signArea1_Click(object sender, EventArgs e)
|
||
{
|
||
signArea = "1";
|
||
lbl_signArea1.ForeColor = Color.White;
|
||
lbl_signArea1.BackColor = Color.FromArgb(250, 53, 52);
|
||
|
||
lbl_signArea2.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea2.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_signArea3.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea3.BackColor = Color.FromArgb(252, 252, 252);
|
||
}
|
||
|
||
private void lbl_signArea2_Click(object sender, EventArgs e)
|
||
{
|
||
signArea = "2";
|
||
lbl_signArea1.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea1.BackColor = Color.FromArgb(252, 252, 252);
|
||
|
||
lbl_signArea2.ForeColor = Color.White;
|
||
lbl_signArea2.BackColor = Color.FromArgb(255, 153, 0);
|
||
lbl_signArea3.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea3.BackColor = Color.FromArgb(252, 252, 252);
|
||
}
|
||
|
||
private void lbl_signArea3_Click(object sender, EventArgs e)
|
||
{
|
||
signArea = "3";
|
||
lbl_signArea1.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea1.BackColor = Color.FromArgb(252, 252, 252);
|
||
|
||
lbl_signArea2.ForeColor = Color.FromArgb(64, 64, 64);
|
||
lbl_signArea2.BackColor = Color.FromArgb(252, 252, 252);
|
||
lbl_signArea3.ForeColor = Color.White;
|
||
lbl_signArea3.BackColor = Color.FromArgb(25, 190, 107);
|
||
}
|
||
|
||
private void checkEdit1_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (checkEdit1.Checked)
|
||
{
|
||
txt_Name.ReadOnly = true;
|
||
//txt_Age.ReadOnly = true;
|
||
//radioGroup_Gender.ReadOnly = true;
|
||
txt_Name.Text = PublicClassForDataBase.CreateCategoryName();
|
||
//txt_Age.Text = "0";
|
||
category = "1";
|
||
}
|
||
else
|
||
{
|
||
txt_Name.ReadOnly = false;
|
||
//txt_Age.ReadOnly = false;
|
||
//radioGroup_Gender.ReadOnly = false;
|
||
txt_Name.Text = "";
|
||
//txt_Age.Text = "";
|
||
category = "0";
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "是否三无人员:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
private void txt_Pulse_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_Pulse.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_Pulse.Text))
|
||
{
|
||
str = txt_Pulse.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_Pulse.Text.Trim());
|
||
if (value < 60 || value > 100)
|
||
{ txt_Pulse.ForeColor = Color.Red; }
|
||
else { txt_Pulse.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 数字带小数点
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
public static bool IsNumber(string input)
|
||
{
|
||
string pattern = "^-?\\d+$|^(-?\\d+)(\\.\\d+)?$";
|
||
Regex regex = new Regex(pattern);
|
||
return regex.IsMatch(input);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 纯数字
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
public static bool IsNumber2(string input)
|
||
{
|
||
Regex regex = new System.Text.RegularExpressions.Regex("^(-?[0-9]*[.]*[0-9]{0,3})$");
|
||
return regex.IsMatch(input);
|
||
}
|
||
|
||
private void labelControl57_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "1";//自行来院
|
||
labelControl57.ForeColor = Color.White;
|
||
labelControl57.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl58.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl58.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl59.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl59.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl14.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl14.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl15.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl15.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl16.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl16.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
private void labelControl58_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "2";//120来院
|
||
labelControl58.ForeColor = Color.White;
|
||
labelControl58.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl57.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl57.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl59.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl59.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl14.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl14.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl15.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl15.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl16.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl16.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
private void labelControl59_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "3";//院内发病
|
||
labelControl59.ForeColor = Color.White;
|
||
labelControl59.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl58.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl58.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl57.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl57.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl14.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl14.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl15.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl15.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl16.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl16.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
private void labelControl14_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "4";//乡镇转诊
|
||
labelControl14.ForeColor = Color.White;
|
||
labelControl14.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl58.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl58.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl59.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl59.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl57.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl57.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl15.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl15.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl16.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl16.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
private void labelControl15_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "5";//乡镇转120
|
||
labelControl15.ForeColor = Color.White;
|
||
labelControl15.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl58.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl58.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl59.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl59.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl14.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl14.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl57.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl57.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl16.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl16.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
private void labelControl16_Click(object sender, EventArgs e)
|
||
{
|
||
ComeHospital = "6";//其他
|
||
labelControl16.ForeColor = Color.White;
|
||
labelControl16.BackColor = Color.FromArgb(0, 132, 204);
|
||
labelControl58.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl58.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl59.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl59.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl14.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl14.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl15.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl15.ForeColor = Color.FromArgb(64, 64, 64);
|
||
labelControl57.BackColor = Color.FromArgb(252, 252, 252);
|
||
labelControl57.ForeColor = Color.FromArgb(64, 64, 64);
|
||
}
|
||
|
||
//private void radioGroup_DiagnosisImpression_SelectedIndexChanged(object sender, EventArgs e)
|
||
//{
|
||
// diagnosisImpression = radioGroup_DiagnosisImpression.Properties.Items[radioGroup_DiagnosisImpression.SelectedIndex].Value.ToString();
|
||
//}
|
||
|
||
private void radioGroup_TriageDepartment_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
triageDepartment = radioGroup_TriageDepartment.Properties.Items[radioGroup_TriageDepartment.SelectedIndex].Value.ToString();
|
||
}
|
||
|
||
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
siteSymptoms = "";
|
||
for (int i = 0; i < checkedListBox1.Items.Count; i++)
|
||
{
|
||
if (checkedListBox1.GetItemChecked(i))
|
||
{
|
||
siteSymptoms += i + 1 + ",";
|
||
}
|
||
}
|
||
}
|
||
|
||
private void checkedListBox2_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
feverRegistration = "";
|
||
for (int i = 0; i < checkedListBox2.Items.Count; i++)
|
||
{
|
||
if (checkedListBox2.GetItemChecked(i))
|
||
{
|
||
feverRegistration += i + 1 + ",";
|
||
}
|
||
}
|
||
}
|
||
|
||
private void BindEvent()
|
||
{
|
||
try
|
||
{
|
||
List<AccidentInfoClassModel> list = DBHelpClass.GetList<AccidentInfoClassModel>("/api/base/T_Base_AccidentInfo/GetAccidentInfoClass");
|
||
foreach (var item in list)
|
||
{
|
||
RadioGroupItem radioButton = new RadioGroupItem();
|
||
radioButton.Value = item.ID.ToString();
|
||
radioButton.Description = item.Name.ToString();
|
||
radioGroup_TriageName.Properties.Items.Add(radioButton);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定事件:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
public void IDnumedit()
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_IDNumber.Text))
|
||
{
|
||
try
|
||
{
|
||
string resulst = txt_IDNumber.Text.ToString().Trim();
|
||
if (resulst.Length == 18)
|
||
{
|
||
long n = 0;
|
||
if (long.TryParse(resulst.Remove(17), out n) == false
|
||
|| n < Math.Pow(10, 16) || long.TryParse(resulst.Replace('x', '0').Replace('X', '0'), out n) == false)
|
||
{
|
||
//lbl_IdentityCard.Visible = true;
|
||
}
|
||
string address = "11x22x35x44x53x12x23x36x45x54x13x31x37x46x61x14x32x41x50x62x15x33x42x51x63x21x34x43x52x64x65x71x81x82x91";
|
||
if (address.IndexOf(resulst.Remove(2)) == -1)
|
||
{
|
||
//lbl_IdentityCard.Visible = true;
|
||
}
|
||
string birth = resulst.Substring(6, 8).Insert(6, "-").Insert(4, "-");
|
||
DateTime time = new DateTime();
|
||
if (DateTime.TryParse(birth, out time) == false)
|
||
{
|
||
//lbl_IdentityCard.Visible = true;
|
||
}
|
||
//string[] arrVarifyCode = ("1,0,x,9,8,7,6,5,4,3,2").Split(',');
|
||
//int y = -1;
|
||
//if (arrVarifyCode[y] != resulst.Substring(17, 1).ToLower())
|
||
//{
|
||
// lbl_IdentityCard.Visible = true;
|
||
//}
|
||
string year = resulst.Substring(6, 4);
|
||
string month = resulst.Substring(10, 2);
|
||
string day = resulst.Substring(12, 2);
|
||
dateEdit_Birthday.TimeValue = year + "-" + month + "-" + day;
|
||
//性别
|
||
int sex = Convert.ToInt32(resulst.Substring(resulst.Length - 2, 1));
|
||
|
||
if (sex % 2 == 0)
|
||
radioGroup_Gender.EditValue = "2";
|
||
else if (sex % 2 == 1)
|
||
radioGroup_Gender.EditValue = "1";
|
||
else
|
||
radioGroup_Gender.EditValue = "0";
|
||
|
||
//lbl_IdentityCard.Visible = false;
|
||
}
|
||
else
|
||
{
|
||
//lbl_IdentityCard.Visible = true;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//lbl_IdentityCard.Visible = true;
|
||
return;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//lbl_IdentityCard.Visible = false;
|
||
dateEdit_Birthday.TimeValue = "";
|
||
radioGroup_Gender.EditValue = -1;
|
||
}
|
||
}
|
||
|
||
private void txt_IDNumber_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
IDnumedit();
|
||
}
|
||
|
||
private void dateEdit_Birthday_TimeValueChanged_1(object sender, EventArgs e)
|
||
{
|
||
if (PublicClass.ToString(dateEdit_Birthday.TimeValue, "") != "")
|
||
{
|
||
DateTime Birthday = Convert.ToDateTime(dateEdit_Birthday.TimeValue);
|
||
int ageUnit = 0;
|
||
int age = PublicClass.GetAge(Birthday, DateTime.Now, out ageUnit);
|
||
|
||
txt_Age.Text = age.ToString();
|
||
}
|
||
}
|
||
|
||
private void btn_PulseOn_Click(object sender, EventArgs e)
|
||
{
|
||
IsGreenWay = "1";
|
||
Save();
|
||
}
|
||
|
||
private void txt_Heart_Rate_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_Heart_Rate.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_Heart_Rate.Text))
|
||
{
|
||
str = txt_Heart_Rate.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_Heart_Rate.Text.Trim());
|
||
if (value < 60 || value > 100)
|
||
{ txt_Heart_Rate.ForeColor = Color.Red; }
|
||
else { txt_Heart_Rate.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
|
||
private void txt_Temperature_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_Temperature.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_Temperature.Text))
|
||
{
|
||
str = txt_Temperature.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_Temperature.Text.Trim());
|
||
if (value < 36 || value > 37)
|
||
{ txt_Temperature.ForeColor = Color.Red; }
|
||
else { txt_Temperature.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
|
||
private void txt_SystolicPressure_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_SystolicPressure.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_SystolicPressure.Text))
|
||
{
|
||
str = txt_SystolicPressure.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_SystolicPressure.Text.Trim());
|
||
if (value < 60 || value > 89)
|
||
{ txt_SystolicPressure.ForeColor = Color.Red; }
|
||
else { txt_SystolicPressure.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
|
||
private void txt_Blood_Pressure1_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_Blood_Pressure1.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_Blood_Pressure1.Text))
|
||
{
|
||
str = txt_Blood_Pressure1.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_Blood_Pressure1.Text.Trim());
|
||
if (value < 90 || value > 139)
|
||
{ txt_Blood_Pressure1.ForeColor = Color.Red; }
|
||
else { txt_Blood_Pressure1.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
|
||
private void txt_Breathe_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(txt_Breathe.Text))
|
||
{
|
||
string str = "";
|
||
if (!IsNumber2(txt_Breathe.Text))
|
||
{
|
||
str = txt_Breathe.Text;
|
||
//str.
|
||
}
|
||
else
|
||
{
|
||
int value = int.Parse(txt_Breathe.Text.Trim());
|
||
if (value < 18 || value > 20)
|
||
{ txt_Breathe.ForeColor = Color.Red; }
|
||
else { txt_Breathe.ForeColor = Color.Black; }
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 事故分类
|
||
/// </summary>
|
||
public class AccidentInfoClassModel
|
||
{
|
||
/// <summary>
|
||
/// 事故ID
|
||
/// </summary>
|
||
public int ID { get; set; }
|
||
|
||
/// <summary>
|
||
/// 事故名称
|
||
/// </summary>
|
||
public string Name { get; set; }
|
||
}
|
||
} |