using DevExpress.XtraEditors; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_Public; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Windows.Forms; namespace HL_FristAidPlatform_EmergencyTriage { public partial class Form_EMR : XtraForm { private string _taskGuid; private string str; private int provideMedical; private int provider; private int allergicHistory; private int fever; public string name; public string age; public string gender; public string phone; /// /// 民族 /// private DataTable NationDT; //1.声明自适应类实例 例 AutoResizeForm asc = new AutoResizeForm(); public Form_EMR(string taskGuid, string _name, string _age, string _gender, string _phone) { InitializeComponent(); _taskGuid = taskGuid; name = _name; age = _age; gender = _gender; phone = _phone; asc.controllInitializeSize(this); } private void simpleButton1_Click(object sender, EventArgs e) { if (ck_WhereAbouts.CheckedItemsCount <= 0) { XtraMessageBox.Show("去向不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); ck_WhereAbouts.Focus(); return; } SaveMedicalRecordDTO dto = new SaveMedicalRecordDTO(); List list = new List(); dto.Patient = new T_Service_Patient(); dto.Patient.Name = txt_Name.Text.ToString(); dto.Patient.Age = int.Parse(txt_Age.Text); dto.Patient.Gender = PublicClass.ToInt32(radioGroup_Gender.EditValue, 0); dto.Patient.Nation = lookUpEdit_Nation.EditValue.ToString(); dto.Patient.IdentityCard = txt_IdentityCard.Text.ToString(); dto.Patient.Birthday = dateEdit_Birthday.TimeValue; dto.Patient.SystemModuleID = 14; dto.Patient.MobilePhone = txt_Phone.Text; //职业 string Profession = PublicClass.ToString(lookUpEdit_Profession.EditValue, "-1"); dto.Patient.Profession = Profession == "-1" ? "" : Profession; ; dto.Patient.Address = txt_Address.Text.ToString(); dto.Patient.Attack_Address = txt_Attack_Address.Text.ToString(); dto.FPInfo = new T_Service_FirstAid_PatientInfo(); dto.FPInfo.PathogenyGUID = lookUpEdit_Pathogeny.EditValue.ToString() == "-1" ? "" : lookUpEdit_Pathogeny.EditValue.ToString(); dto.FPInfo.ChiefComplaint = txt_ChiefComplaint.Text.ToString(); dto.FPInfo.TaskGUID = _taskGuid; if (!string.IsNullOrEmpty(dateEdit_Attack_Time.TimeValue)) { dto.FPInfo.OnsetTime = Convert.ToDateTime(dateEdit_Attack_Time.TimeValue); } if (!string.IsNullOrEmpty(dateEdit_Attack_Time.TimeValue)) { dto.FPInfo.OnsetTime = Convert.ToDateTime(dateEdit_Attack_Time.TimeValue); } dto.FPInfo.MedicalHistory = memo_MedicalHistory.Text.ToString(); dto.FPInfo.AllergyHistory = memo_AllergyHistory.Text.ToString(); dto.FPInfo.WhereAbouts = ck_WhereAbouts.SelectedIndex; //dto.FPInfo.Killip if (!string.IsNullOrEmpty(ck_IllnessLevel.Text)) { dto.FPInfo.Killip = ck_IllnessLevel.Text; } dto.FPInfo.ProvideMedical = provideMedical; dto.FPInfo.Provider = provider; dto.FPInfo.AllergicHistory = allergicHistory; dto.FPInfo.Fever = fever; dto.FPInfo.AllergicHistoryInfo = memo_AllergicHistoryInfo.Text; #region 3.体格检查信息 dto.Health = new T_Service_FirstAid_HealthCheckup(); dto.Health.HeartRate = txt_HeartRate.Text; dto.Health.DisposalRecord = memo_DiseaseRecord.Text.ToString(); dto.Health.Pulse = txt_Pulse.Text; dto.Health.SystolicPressure = txt_SystolicPressure.Text; dto.Health.DiastolicPressure = txt_DiastolicPressure.Text; dto.Health.Temperature = txt_Temperature.Text; dto.Health.Breathing = txt_Breathing.Text; dto.Health.Sonscious = cmb_Sonscious.Text.ToString(); dto.Health.SkinColor = cmb_SkinColor.Text.ToString(); dto.Health.SkinOther = txt_SkinOther.Text.ToString(); dto.Health.HeadAbnormal = radio_HeadAbnormal.SelectedIndex; dto.Health.HeadAbnormalInfo = txt_HeadAbnormalInfo.Text; dto.Health.PupilL = decimal.Parse(txt_PupilL.Text.ToString() == "" ? "0" : txt_PupilL.Text.ToString()); dto.Health.PupilR = decimal.Parse(txt_PupilR.Text.ToString() == "" ? "0" : txt_PupilR.Text.ToString()); dto.Health.ReflexL = cmb_ReflexL.Text.ToString(); dto.Health.ReflexR = cmb_ReflexR.Text.ToString(); dto.Health.IsNeckRigidity = check_NeckRigidity.Checked ? true : false; dto.Health.IsJugularFilling = check_JugularFilling.Checked ? true : false; dto.Health.IsCarotidPulsation = check_CarotidPulsation.Checked ? true : false; dto.Health.IsBreathStop = check_BreathStop.Checked ? true : false; if (dto.Health.IsBreathStop == false) { dto.Health.AirwayOpen = radio_AirwayOpen.SelectedIndex ; dto.Health.AirwayAbnormal = txt_AirwayAbnormal.Text; dto.Health.BreathingState = ck_BreathingState.ItemCount <= 0 ? -1 : ck_BreathingState.SelectedIndex; dto.Health.IsBreathSoundsL = check_IsBreathSoundsL.Checked ? true : false; dto.Health.BreathSoundsL = cmb_BreathSoundsL.Text.ToString(); dto.Health.IsMoistRalesL = check_IsMoistRalesL.Checked ? true : false; dto.Health.IsDryRalesL = check_IsDryRalesL.Checked ? true : false; dto.Health.IsBreathSoundsR = check_IsBreathSoundsR.Checked ? true : false; dto.Health.BreathSoundsR = cmb_BreathSoundsR.Text.ToString(); dto.Health.IsMoistRalesR = check_IsMoistRalesR.Checked ? true : false; dto.Health.IsDryRalesR = check_IsDryRalesR.Checked ? true : false; } dto.Health.Waist = cmb_Waist.Text.ToString(); dto.Health.Liver = cmb_Liver.Text.ToString(); dto.Health.IsBackPain = check_IsBackPain.Checked ? true : false; dto.Health.IsWaistPian = check_IsWaistPian.Checked ? true : false; dto.Health.PainOther = txt_PainOther.Text.ToString(); dto.Health.Spleen = cmb_Spleen.Text.ToString(); dto.Health.BowelSound = cmb_BowelSound.Text.ToString(); dto.Health.MRC = cmb_MRC.Text.ToString(); dto.Health.MRSLT = int.Parse(cmb_MRSLT.Text.ToString() == "" ? "0" : cmb_MRSLT.Text.ToString()); dto.Health.MRSLD = int.Parse(cmb_MRSLD.Text.ToString() == "" ? "0" : cmb_MRSLD.Text.ToString()); dto.Health.MRSRT = cmb_MRSRT.Text.ToString(); dto.Health.MRSRD = cmb_MRSRD.Text.ToString(); dto.Health.IsEdema = check_IsEdema.Checked ? true : false; dto.Health.MRSOther = txt_MRSOther.Text.ToString(); dto.Health.PhysiologicalReflex = cmb_PhysiologicalReflex.Text.ToString(); dto.Health.Babinskisign = radioGroup_Babinskisign.SelectedIndex; dto.Health.NervousPosition = radioGroup_NervousPosition.SelectedIndex; dto.Health.HealthCheckUpOther = txt_HealthCheckUpOther.Text.ToString(); dto.Health.ChestAbnormal = radio_ChestAbnormal.SelectedIndex; dto.Health.ChestAbnormalInfo = txt_ChestAbnormalInfo.Text; #endregion #region 4.专科检查 dto.Speciality = new T_Service_FirstAid_SpecialityCheckUp(); dto.Speciality.BrainType = radioGroup_BrainType.SelectedIndex; dto.Speciality.BranInjury = memo_BrainInjury.Text.ToString(); dto.Speciality.MaxillofacialType = radioGroup_MaxillofacialType.TabIndex; dto.Speciality.MaxillofacialInjury = memo_MaxillofacialInjury.Text.ToString(); dto.Speciality.ChestType = radioGroup_ChestType.SelectedIndex; dto.Speciality.ChestInjury = memo_ChestInjury.Text.ToString(); dto.Speciality.AbdomenType = radioGroup_AbdomenType.SelectedIndex; dto.Speciality.AbdomenInjury = memo_AbdomenInjury.Text.ToString(); dto.Speciality.BackType = radioGroup_BackType.SelectedIndex; dto.Speciality.BackInjury = memo_BackInjury.Text.ToString(); dto.Speciality.SpineType = radioGroup_SpineType.SelectedIndex; dto.Speciality.SpineInjury = memo_SpineInjury.Text.ToString(); dto.Speciality.limbType = radioGroup_limbType.TabIndex; dto.Speciality.limbInjury = memo_limbInjury.Text.ToString(); #endregion #region 5.辅助检查信息 dto.AssistantExamination = new T_Service_FirstAid_AssistantExamination(); dto.AssistantExamination.GLU = decimal.Parse(txt_GLU.Text == "" ? "-1" : txt_GLU.Text); dto.AssistantExamination.SPO2 = txt_SPO2.Text; dto.AssistantExamination.Other = memo_Other.Text.ToString(); dto.AssistantExamination.PrimaryDiagnosis = str; dto.AssistantExamination.Illness = cmb_Illness.Text; dto.AssistantExamination.Measures = checkedcmb_Measures.Text; dto.AssistantExamination.ChangeOnTheWay = memo_WayChange.Text.ToString(); dto.AssistantExamination.FirstAidEffect = cmb_FirstAidEffect.Text; dto.AssistantExamination.DeathCertificate = cmb_DeathCertificate.Text; if (!string.IsNullOrEmpty(time_CDateTime.TimeValue.ToString())) { dto.AssistantExamination.CDatetime = Convert.ToDateTime(time_CDateTime.TimeValue.ToString()); } #endregion list.Add(dto); string Url = string.Empty; Url = "api/service/FristAidTran/SaveMedicalRecordTran"; //初始化两个工厂 ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); if (client.Post(Url, list).Success) { XtraMessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } private void treeList1_AfterCheckNode(object sender, DevExpress.XtraTreeList.NodeEventArgs e) { //if (!string.IsNullOrEmpty(str)) //{ // str += ","; //} //str += e.Node.GetDisplayText(this.treeListColumn1); if (e.Node.CheckState == CheckState.Checked) { if (!string.IsNullOrEmpty(str)) { str += ","; } str += e.Node.GetDisplayText(this.treeListColumn1); //txt_PrimaryDiagnosis.Text = str; } else { if (!string.IsNullOrEmpty(str)) { List strArr = str.Split(',').ToList(); strArr.Remove(e.Node.GetDisplayText(this.treeListColumn1)); str = string.Join(",", strArr.ToArray()); } //txt_PrimaryDiagnosis.Text = str; } } private void Form_EMR_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; BindNation(); BindGender(); BindPathogeny(); //职业 PublicClass.SetLookUpList(lookUpEdit_Profession, Enumerate.PublicDictionaryType.职业, true, "请选择"); QueryTaskDetail(_taskGuid); txt_Informant.Text = Information.User.FullName; radioGroup_BrainType.SelectedIndex = -1; radioGroup_MaxillofacialType.SelectedIndex = -1; radioGroup_ChestType.SelectedIndex = -1; radioGroup_AbdomenType.SelectedIndex = -1; radioGroup_BackType.SelectedIndex = -1; radioGroup_SpineType.SelectedIndex = -1; radioGroup_limbType.SelectedIndex = -1; } 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(); cmb_Sonscious.Text = dt.Rows[0]["Consciousness"].ToString(); if (dt.Rows[0]["IsTransport"].ToString() == "1") { ck_WhereAbouts.SetItemChecked(0, true); } } } } /// /// 绑定民族 /// 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); } } /// /// 绑定性别 /// 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); } } /// /// 绑定病因 /// 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 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(); } } private void check_BreathStop_CheckedChanged(object sender, EventArgs e) { if (check_BreathStop.CheckState == CheckState.Checked) { panelControl10.Enabled = false; radio_AirwayOpen.SelectedIndex = -1; ck_BreathingState.SelectedIndex = -1; } else { panelControl10.Enabled = true; } } private void radio_HeadAbnormal_SelectedIndexChanged(object sender, EventArgs e) { if (radio_HeadAbnormal.SelectedIndex == 1) { txt_HeadAbnormalInfo.Enabled = true; } else { txt_HeadAbnormalInfo.Enabled = false; } } private void radio_ChestAbnormal_SelectedIndexChanged(object sender, EventArgs e) { if (radio_ChestAbnormal.SelectedIndex == 1) { txt_ChestAbnormalInfo.Enabled = true; } else { txt_ChestAbnormalInfo.Enabled = false; } } private void checkEdit8_CheckedChanged(object sender, EventArgs e) { if (checkEdit8.Checked == true) { fever = 1; checkEdit7.Checked = false; } } private void checkEdit7_CheckedChanged(object sender, EventArgs e) { if (checkEdit7.Checked == true) { fever = 0; checkEdit8.Checked = false; } } private void labelControl24_Click(object sender, EventArgs e) { } private void panel_ZhuanKe_Paint(object sender, PaintEventArgs e) { } private void labelControl96_Click(object sender, EventArgs e) { } private void labelControl91_Click(object sender, EventArgs e) { } private void labelControl5_Click(object sender, EventArgs e) { } private void labelControl6_Click(object sender, EventArgs e) { } private void labelControl100_Click(object sender, EventArgs e) { } private void labelControl30_Click(object sender, EventArgs e) { } private void memo_BrainInjury_EditValueChanged(object sender, EventArgs e) { } private void labelControl102_Click(object sender, EventArgs e) { } private void labelControl101_Click(object sender, EventArgs e) { } private void labelControl99_Click(object sender, EventArgs e) { } private void labelControl98_Click(object sender, EventArgs e) { } private void labelControl97_Click(object sender, EventArgs e) { } private void labelControl94_Click(object sender, EventArgs e) { } private void labelControl89_Click(object sender, EventArgs e) { } private void memo_MaxillofacialInjury_EditValueChanged(object sender, EventArgs e) { } private void memo_ChestInjury_EditValueChanged(object sender, EventArgs e) { } private void memo_limbInjury_EditValueChanged(object sender, EventArgs e) { } private void pictureEdit3_EditValueChanged(object sender, EventArgs e) { } private void ck_WhereAbouts_SelectedIndexChanged(object sender, EventArgs e) { } private void pictureEdit1_EditValueChanged(object sender, EventArgs e) { } } }