StableVersion4.3/HL_FristAidPlatform_FollowUp/Form_FollowUpDetail_HeartFa...

638 lines
26 KiB
C#
Raw Permalink 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 DevExpress.XtraGrid.Views.Grid;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_DynamicElectrocardiogram;
using HL_FristAidPlatform_Public;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace HL_FristAidPlatform_FollowUp
{
public partial class Form_FollowUpDetail_HeartFailure : XtraForm
{
/// <summary>
/// 当前患者信息
/// </summary>
public DataTable Cur_PatientDT;
/// <summary>
/// 当前患者编号(GUID)
/// </summary>
public string Cur_PatientID;
/// <summary>
/// 当前随访计划编号(GUID)
/// </summary>
public string Cur_FollUpID;
/// <summary>
/// 等待窗体
/// </summary>
private Loading loading = new Loading();
public Form_FollowUpDetail_HeartFailure(string _Cur_PatientID)
{
InitializeComponent();
Cur_PatientID = _Cur_PatientID;
}
/// <summary>
/// 窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form_FollowUpDetail_Load(object sender, EventArgs e)
{
BindData();
BindList();
}
/// <summary>
/// 绑定随访计划列表
/// </summary>
private void BindList()
{
try
{
DataTable data = DBHelpClass.Get("api/service/T_Service_FollowUp_ChestPain/?pageIndex=1&pageSize=20&pGuid=" + Cur_PatientID + "");
gridControl_FollowUpVisit.DataSource = data;
gridView_FollowUpVisit.OptionsBehavior.Editable = false;
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "绑定随访计划列表:\r\n" + ex);
}
}
/// <summary>
/// 查询绑定
/// </summary>
private void BindData()
{
BindDoctorList();
BindPatientInfo();
}
/// <summary>
/// 绑定随访医生列表
/// </summary>
private void BindDoctorList()
{
try
{
DataTable dataTableDoctor = DBHelpClass.Get("api/admin/T_SYS_User/GetModelByWhere?where=护士");
PublicClass.SetLookUpList(ref lookUpEdit_FollowUpDoctor, dataTableDoctor, 0, 4, false);
lookUpEdit_FollowUpDoctor.EditValue = Information.User.ID.ToString();
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "绑定随访医生列表:\r\n" + ex);
}
}
/// <summary>
/// 绑定患者信息
/// </summary>
private void BindPatientInfo()
{
try
{
Cur_PatientDT = DBHelpClass.GetDataRow("api/service/T_Service_Patient/" + Cur_PatientID + "");
label_name.Text = Cur_PatientDT.Rows[0]["Name"].ToString();
label_sex.Text = Cur_PatientDT.Rows[0]["GenderString"].ToString();
label_age.Text = Cur_PatientDT.Rows[0]["Age"].ToString();
label_AdmissionNumber.Text= Cur_PatientDT.Rows[0]["AdmissionNumber"]+"";
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "绑定患者信息:\r\n" + ex);
}
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void simpleButton_save_Click(object sender, EventArgs e)
{
try
{
#region 保存
List<T_Service_FollowUp_ChestPainDTO> patientDTOs = new List<T_Service_FollowUp_ChestPainDTO>();
T_Service_FollowUp_ChestPainDTO PrehospitalDTO = new T_Service_FollowUp_ChestPainDTO();
string Url = string.Empty;
ClientFactory<T_Service_FollowUp_ChestPainDTO> httpClient = new HttpClientFactory<T_Service_FollowUp_ChestPainDTO>();
Client<T_Service_FollowUp_ChestPainDTO> client = httpClient.VisitFactory();
DataTable dataTable = new DataTable();
//dataTable = DBHelpClass.Get("api/service/T_Service_FollowUp_ChestPain/GetByPatientGuid?patientGuid=" + Cur_PatientID + "");
if (!string.IsNullOrEmpty(Cur_FollUpID))
{
dataTable = DBHelpClass.GetDataRow("api/service/T_Service_FollowUp_ChestPain/" + Cur_FollUpID + "");
if (dataTable.Rows.Count > 0)
{
Url = "api/service/T_Service_FollowUp_ChestPain/Update";
PrehospitalDTO.ID = Int32.Parse(dataTable.Rows[0]["ID"].ToString());
PrehospitalDTO.GUID = dataTable.Rows[0]["GUID"].ToString();
}
}
else
{
Url = "api/service/T_Service_FollowUp_ChestPain";
PrehospitalDTO.GUID = Guid.NewGuid().ToString();
}
PrehospitalDTO.PatientGuid = Cur_PatientID;
PrehospitalDTO.FollowUpDate = Convert.ToDateTime(dateEdit_FollowUpDate.TimeValue);
PrehospitalDTO.Note = richTextBoxNode.Text;
PrehospitalDTO.FollowUpStatus = "1";
PrehospitalDTO.FollowUpDoctor = lookUpEdit_FollowUpDoctor.Text;
PrehospitalDTO.FollowUpResult = comboBox_FollowUpResult.Text;
PrehospitalDTO.FollowUpType = comboBox_FollowUpType.Text;
PrehospitalDTO.IsChestPain =Convert.ToInt32(radioGroup_IsChestPain.Text);
PrehospitalDTO.EF = PublicClass.ToInt32(textBox_EF.Text, 0);
PrehospitalDTO.LVEDD = PublicClass.ToInt32(textBox_LEVDD.Text, 0);
PrehospitalDTO.WalkingDistance = PublicClass.ToInt32(textBox_WalkingDistance.Text, 0);
PrehospitalDTO.QRS = PublicClass.ToInt32(textBox_QRS.Text, 0);
string ECG = "";
if (checkBox_ECG_DX.Checked)
{
ECG = checkBox_ECG_DX.Text;
}
if (checkBox_ECG_FC.Checked)
{
ECG += ECG=="" ?checkBox_ECG_FC.Text: ";"+checkBox_ECG_FC.Text;
}
if (checkBox_ECG_FP.Checked)
{
ECG += ECG == "" ? checkBox_ECG_FP.Text : ";" + checkBox_ECG_FP.Text;
}
if (checkBox_ECG_QP.Checked)
{
ECG += ECG == "" ? checkBox_ECG_QP.Text : ";" + checkBox_ECG_QP.Text;
}
PrehospitalDTO.ECG = ECG;
string Medication = "";
if (checkBox_ACEI.Checked)
{
Medication = checkBox_ACEI.Text;
}
if (checkBox_ARB.Checked)
{
Medication += Medication == "" ? checkBox_ARB.Text : ";" + checkBox_ARB.Text;
}
if (checkBox_ARNI.Checked)
{
Medication += Medication == "" ? checkBox_ARNI.Text : ";" + checkBox_ARNI.Text;
}
if (checkBox_SJYZJ.Checked)
{
Medication += Medication == "" ? checkBox_SJYZJ.Text : ";" + checkBox_SJYZJ.Text;
}
if (checkBox_TGTJKJ.Checked)
{
Medication += Medication == "" ? checkBox_TGTJKJ.Text : ";" + checkBox_TGTJKJ.Text;
}
if (checkBox_DGX.Checked)
{
Medication += Medication == "" ? checkBox_DGX.Text : ";" + checkBox_DGX.Text;
}
if (checkBox_SLQXJL.Checked)
{
Medication += Medication == "" ? checkBox_SLQXJL.Text : ";" + checkBox_SLQXJL.Text;
}
if (checkBox_BSTZDJ.Checked)
{
Medication += Medication == "" ? checkBox_BSTZDJ.Text : ";" + checkBox_BSTZDJ.Text;
}
if (checkBox_MTLE.Checked)
{
Medication += Medication == "" ? checkBox_MTLE.Text : ";" + checkBox_MTLE.Text;
}
if (checkBox_KWDL.Checked)
{
Medication += Medication == "" ? checkBox_KWDL.Text : ";" + checkBox_KWDL.Text;
}
if (checkBox_BSLE.Checked)
{
Medication += Medication == "" ? checkBox_BSLE.Text : ";" + checkBox_BSLE.Text;
}
if (checkBox_KLY.Checked)
{
Medication += Medication == "" ? checkBox_KLY.Text : ";" + checkBox_KLY.Text;
}
if (checkBox_HFL.Checked)
{
Medication += Medication == "" ? checkBox_HFL.Text : ";" + checkBox_HFL.Text;
}
if (checkBox_LFSB.Checked)
{
Medication += Medication == "" ? checkBox_LFSB.Text : ";" + checkBox_LFSB.Text;
}
if (checkBox_DBJQ.Checked)
{
Medication += Medication == "" ? checkBox_DBJQ.Text : ";" + checkBox_DBJQ.Text;
}
PrehospitalDTO.Medication = Medication;
patientDTOs.Add(PrehospitalDTO);
//访问
ListEntity<T_Service_FollowUp_ChestPainDTO> t = client.Post(Url, patientDTOs);
if (t.Success)
{
XtraMessageBox.Show("保存系统信息成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
XtraMessageBox.Show("保存失败,请稍后重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "保存:\r\n" + ex);
}
}
/// <summary>
/// 绑定详情
/// </summary>
/// <param name="_patientID"></param>
/// <param name="entity"></param>
public void BindDataPrehospital(string _patientID, ListEntity<T_Service_FollowUp_ChestPainDTO> entity)
{
try
{
#region 绑定详情
DataTable dataTable = new DataTable();
if (string.IsNullOrEmpty(_patientID))
{
dataTable = DBHelpClass.JsonToDataRow(entity.DataString);
}
if (entity == null)
{
dataTable = DBHelpClass.GetDataRow("api/service/T_Service_FollowUp_ChestPain/" + _patientID + "");
}
if (dataTable != null)
{
if (dataTable.Rows.Count > 0)
{
dateEdit_FollowUpDate.TimeValue = PublicClass.ToString(dataTable.Rows[0]["FollowUpDate"], "");
comboBox_FollowUpType.Text = dataTable.Rows[0]["FollowUpType"] + "";
comboBox_FollowUpResult.Text = dataTable.Rows[0]["FollowUpResult"] + "";
lookUpEdit_FollowUpDoctor.Text = dataTable.Rows[0]["FollowUpDoctor"] + "";
radioGroup_IsChestPain.SelectedIndex = dataTable.Rows[0]["IsChestPain"]+"" == "0" ? 0 : 1;
richTextBoxNode.Text= dataTable.Rows[0]["Note"] + "";
textBox_EF.Text= dataTable.Rows[0]["EF"] + "";
textBox_LEVDD.Text= dataTable.Rows[0]["LVEDD"] + "";
textBox_WalkingDistance.Text = dataTable.Rows[0]["WalkingDistance"] + "";
textBox_QRS.Text = dataTable.Rows[0]["QRS"] + "";
string[] ECG =PublicClass.ToString(dataTable.Rows[0]["ECG"],"").Split(';');
foreach (var item in ECG)
{
if (item.ToString() == checkBox_ECG_DX.Text)
{
checkBox_ECG_DX.Checked = true;
}
else
{
checkBox_ECG_DX.Checked = false;
}
if (item.ToString() == checkBox_ECG_FC.Text)
{
checkBox_ECG_FC.Checked = true;
}
else
{
checkBox_ECG_FC.Checked = false;
}
if (item.ToString() == checkBox_ECG_FP.Text)
{
checkBox_ECG_FP.Checked = true;
}
else
{
checkBox_ECG_FP.Checked = false;
}
if (item.ToString() == checkBox_ECG_QP.Text)
{
checkBox_ECG_QP.Checked = true;
}
else
{
checkBox_ECG_QP.Checked = false;
}
}
string[] Medication = PublicClass.ToString(dataTable.Rows[0]["Medication"], "").Split(';');
foreach (var item in Medication)
{
if (item.ToString() == checkBox_ACEI.Text)
{
checkBox_ACEI.Checked = true;
}
else
{
checkBox_ACEI.Checked = false;
}
if (item.ToString() == checkBox_ARB.Text)
{
checkBox_ARB.Checked = true;
}
else
{
checkBox_ARB.Checked = false;
}
if (item.ToString() == checkBox_ARNI.Text)
{
checkBox_ARNI.Checked = true;
}
else
{
checkBox_ARNI.Checked = false;
}
if (item.ToString() == checkBox_SJYZJ.Text)
{
checkBox_SJYZJ.Checked = true;
}
else
{
checkBox_SJYZJ.Checked = false;
}
if (item.ToString() == checkBox_TGTJKJ.Text)
{
checkBox_TGTJKJ.Checked = true;
}
else
{
checkBox_TGTJKJ.Checked = false;
}
if (item.ToString() == checkBox_DGX.Text)
{
checkBox_DGX.Checked = true;
}
else
{
checkBox_DGX.Checked = false;
}
if (item.ToString() == checkBox_SLQXJL.Text)
{
checkBox_SLQXJL.Checked = true;
}
else
{
checkBox_SLQXJL.Checked = false;
}
if (item.ToString() == checkBox_BSTZDJ.Text)
{
checkBox_BSTZDJ.Checked = true;
}
else
{
checkBox_BSTZDJ.Checked = false;
}
if (item.ToString() == checkBox_MTLE.Text)
{
checkBox_MTLE.Checked = true;
}
else
{
checkBox_MTLE.Checked = false;
}
if (item.ToString() == checkBox_KWDL.Text)
{
checkBox_KWDL.Checked = true;
}
else
{
checkBox_KWDL.Checked = false;
}
if (item.ToString() == checkBox_BSLE.Text)
{
checkBox_BSLE.Checked = true;
}
else
{
checkBox_BSLE.Checked = false;
}
if (item.ToString() == checkBox_KLY.Text)
{
checkBox_KLY.Checked = true;
}
else
{
checkBox_KLY.Checked = false;
}
if (item.ToString() == checkBox_HFL.Text)
{
checkBox_HFL.Checked = true;
}
else
{
checkBox_HFL.Checked = false;
}
if (item.ToString() == checkBox_LFSB.Text)
{
checkBox_LFSB.Checked = true;
}
else
{
checkBox_LFSB.Checked = false;
}
if (item.ToString() == checkBox_DBJQ.Text)
{
checkBox_DBJQ.Checked = true;
}
else
{
checkBox_DBJQ.Checked = false;
}
}
}
}
#endregion
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "绑定详情:\r\n" + ex);
}
}
/// <summary>
/// 单击绑定详情
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void gridView_FollowUpVisit_RowClick(object sender, RowClickEventArgs e)
{
try
{
DataRow dataRow = gridView_FollowUpVisit.GetDataRow(e.RowHandle);
Cur_FollUpID = dataRow["GUID"].ToString();
BindDataPrehospital(Cur_FollUpID, null);
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "单击绑定详情:\r\n" + ex);
}
}
/// <summary>
/// 新增
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void simpleButton_Add_Click(object sender, EventArgs e)
{
dateEdit_FollowUpDate.TimeValue = "";
comboBox_FollowUpType.Text = "";
comboBox_FollowUpResult.Text = "";
lookUpEdit_FollowUpDoctor.Text = "";
radioGroup_IsChestPain.SelectedIndex = -1;
richTextBoxNode.Text = "";
textBox_EF.Text = "";
textBox_LEVDD.Text = "";
textBox_WalkingDistance.Text = "";
textBox_QRS.Text = "";
checkBox_ECG_DX.Checked = false;
checkBox_ECG_FC.Checked = false;
checkBox_ECG_FP.Checked = false;
checkBox_ECG_QP.Checked = false;
checkBox_ACEI.Checked = false;
checkBox_ARB.Checked = false;
checkBox_ARNI.Checked = false;
checkBox_SJYZJ.Checked = false;
checkBox_TGTJKJ.Checked = false;
checkBox_DGX.Checked = false;
checkBox_SLQXJL.Checked = false;
checkBox_BSTZDJ.Checked = false;
checkBox_MTLE.Checked = false;
checkBox_KWDL.Checked = false;
checkBox_BSLE.Checked = false;
checkBox_KLY.Checked = false;
checkBox_HFL.Checked = false;
checkBox_LFSB.Checked = false;
checkBox_DBJQ.Checked = false;
}
private void gridView_FollowUpVisit_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
GridView View = sender as GridView;
//随访状态
if (e.Column.FieldName == "FollowUpStatus")
{
int value = PublicClass.ToInt32(e.CellValue, 0);
switch (value)
{
case 0:
e.Appearance.BackColor = Color.Red;
e.Appearance.BackColor2 = Color.FromArgb(255, 255, 255);
break;
case 1:
e.Appearance.BackColor = Color.Green;
e.Appearance.BackColor2 = Color.FromArgb(255, 255, 255);
break;
default:
break;
}
}
}
/// <summary>
/// 自定义显示
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void gridView_FollowUpVisit_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
GridView View = sender as GridView;
//随访状态
if (e.Column.FieldName == "FollowUpStatus")
{
int value = PublicClass.ToInt32(e.Value, 0);
switch (value)
{
case 0:
e.DisplayText = "未随访";
break;
case 1:
e.DisplayText = "已随访";
break;
default:
break;
}
}
}
private void simpleButton_ViewDrugs_Click(object sender, EventArgs e)
{
Form form = PublicHelp.GetReflection("HL_FristAidPlatform_ChestPain", "Form_ChestPain_OutDrug", Cur_PatientID);
form.ShowDialog();
}
private void simpleButton_ViewOperation_Click(object sender, EventArgs e)
{
Form form = PublicHelp.GetReflection("HL_FristAidPlatform_ChestPain", "Form_ChestPain_CoronaryAngiographie", Cur_PatientID);
form.ShowDialog();
}
private void simpleButton_ECG_Click(object sender, EventArgs e)
{
MdiChildrenClose();
if (!ShowChildrenForm("HL_FristAidPlatform_DynamicElectrocardiogram"))
{
loading.ShowMessage("请稍候", "正在加载【" + label_name.Text + "】的心电监测...");
Form_DynamicElectrocardiogramDetailed form = new Form_DynamicElectrocardiogramDetailed(label_name.Text, label_age.Text, label_sex.Text, Cur_PatientDT.Rows[0]["WardshipId"]+"");
//form.WindowState = FormWindowState.Maximized;
//form.MdiParent = this;
form.Show();
loading.HideMessage();
}
}
#region 方法
/// <summary>
/// 防止打开多个窗体
/// </summary>
/// <param name="p_ChildrenFormText">窗体名称</param>
/// <returns></returns>
private bool ShowChildrenForm(string p_ChildrenFormText)
{
int i;
//依次检测当前窗体的子窗体
for (i = 0; i < MdiChildren.Length; i++)
{
//判断当前子窗体的Text属性值是否与传入的字符串值相同
if (MdiChildren[i].Name == p_ChildrenFormText)
{
//如果值相同则表示此子窗体为想要调用的子窗体激活此子窗体并返回true值
MdiChildren[i].Activate();
return true;
}
}
//如果没有相同的值则表示要调用的子窗体还没有被打开返回false值
return false;
}
public void MdiChildrenClose()
{
//关闭所有已经打开的子窗体
if (MdiChildren.Length > 0)
{
foreach (Form myForm in this.MdiChildren)
{
myForm.Close();
}
}
}
#endregion
private void simpleButton_EMR_Click(object sender, EventArgs e)
{
loading.ShowMessage();
Form form = PublicHelp.GetReflection("HL_FristAidPlatform_ChestPain", "Form_ChestPain_Main", Cur_PatientID, Information.Hospital.GUID);
form.MdiParent = this.MdiParent;
form.Show();
loading.HideMessage();
}
}
}