using DevExpress.XtraEditors; using HL_FristAidPlatform_ChestPain.Part; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_DynamicElectrocardiogram; using HL_FristAidPlatform_MultiSystemPublic; using HL_FristAidPlatform_Public; using HL_FristAidPlatform_RealTimeVideo; using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; namespace HL_FristAidPlatform_ChestPain { public partial class Form_ChestPain_Main : XtraForm { #region 变量 /// /// 保存 /// private ISave Save_Main; /// /// 当前病人编号(GUID) /// private string Cur_PatientGuid; /// /// 当前病人所属院区编号(GUID) /// private string Cur_HospitalGuid; /// /// 当前病人标签卡编号 /// private long Cur_WristStrapID = 0; /// /// 当前病人标签卡编码 /// private string Cur_WristStrapCode = string.Empty; /// /// 心电机合同号 /// private string Cur_WardshipId = "1606020346"; /// /// 当前患者病案信息数据源 /// private DataTable Cur_PatientDT; private string _Audit_Refuse_Note = ""; #endregion /// /// 胸痛电子病历系统 /// /// 患者编号(ID) /// 患者编号(GUID) public Form_ChestPain_Main(string _patientGuid = "", string _hospitalGuid = "") { InitializeComponent(); Cur_PatientGuid = _patientGuid; Cur_HospitalGuid = _hospitalGuid; } /// /// 窗体加载 /// /// /// private void Form_ChestPain_Main_Load(object sender, EventArgs e) { BindInfo(Cur_PatientGuid); navBarItem_BasicInfo_LinkClicked(null, null); //toolTip_Show.SetToolTip(this.lbl_Show_TimeAxis, "隐藏时间轴"); string URL = string.Format("api/service/T_Service_Patient/GetModelByIdOrGuid?id={0}&guid={1}", 0, Cur_PatientGuid); Cur_PatientDT = DBHelpClass.Get(URL); barEditItem_Note.EditValue= Cur_PatientDT.Rows[0]["Audit_Refuse_Note"].ToString(); } /// /// 窗体快捷键注册 /// /// /// private void Form_ChestPain_Main_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { //同时按下 Ctrl+S 时执行保存方法 if (e.KeyCode == Keys.S && e.Control) { btn_Save_ItemClick(null, null); } } #region 绑定 /// /// 绑定患者信息 /// /// 患者编号(GUID) private void BindInfo(string _patientGuid) { try { #region 绑定患者信息 string URL = string.Format("api/service/T_Service_Patient/GetModelByIdOrGuid?id={0}&guid={1}", 0, _patientGuid); Cur_PatientDT = DBHelpClass.Get(URL); if (Cur_PatientDT != null && Cur_PatientDT.Rows.Count > 0) { //当前病人标签卡编号 Cur_WristStrapID = PublicClass.ToInt64(Cur_PatientDT.Rows[0]["WristStrapID"], 0); //当前病人标签卡编码 Cur_WristStrapCode = Cur_PatientDT.Rows[0]["WristStrapCode"].ToString(); //心电机合同号 //Cur_WardshipId = Cur_PatientDT.Rows[0]["WardshipId"].ToString(); } else { XtraMessageBox.Show("未获取到有效的病人信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); Close(); } #endregion } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "绑定患者信息:\r\n" + ex); } } #endregion #region 功能菜单 /// /// 保存 /// /// /// private void btn_Save_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Save_Main.Save(); } /// /// 提交审核 /// /// /// private void btn_SubmitForReview_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //提交审核 if (UpdateStatus(Cur_PatientGuid, Enumerate.PatientStatus.提交审核)) { XtraMessageBox.Show("档案状态更新为【提交审核】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("档案状态更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 拒绝审核 /// /// /// private void btn_RejectAudit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_InpuInfo form_InpuInfo = new Form_InpuInfo(); form_InpuInfo.ShowDialog(); _Audit_Refuse_Note = form_InpuInfo.noto; barEditItem_Note.EditValue = _Audit_Refuse_Note; //拒绝审核 if (UpdateStatus(Cur_PatientGuid, Enumerate.PatientStatus.填报中)) { XtraMessageBox.Show("拒绝审核成功!档案状态更新为【填报中】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("档案状态更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 审核通过 /// /// /// private void btn_ApprovedBy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //已审核 if (UpdateStatus(Cur_PatientGuid, Enumerate.PatientStatus.已审核)) { XtraMessageBox.Show("档案状态更新为【已审核】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("档案状态更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 拒绝存档 /// /// /// private void btn_RevocationOfAnArchive_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_InpuInfo form_InpuInfo = new Form_InpuInfo(); form_InpuInfo.ShowDialog(); _Audit_Refuse_Note = form_InpuInfo.noto; barEditItem_Note.EditValue = _Audit_Refuse_Note; //已审核 if (UpdateStatus(Cur_PatientGuid, Enumerate.PatientStatus.已审核)) { XtraMessageBox.Show("拒绝存档成功!档案状态更新为【已审核】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("档案状态更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 存档 /// /// /// private void btn_ArchivingSuccess_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //已存档 if (UpdateStatus(Cur_PatientGuid, Enumerate.PatientStatus.已存档)) { XtraMessageBox.Show("档案状态更新为【已存档】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("档案状态更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 更改填报状态 /// /// 患者编号 /// 填报状态 1:填报中 2:提交审核 3:已审核 4:已存档 /// private bool UpdateStatus(string patientGuid, Enumerate.PatientStatus patientStatus) { bool IsSuccess = false; try { #region 更新上传状态 string UpdateUrl = "api/service/T_Service_Patient/UpdateStatus"; List list = new List(); T_Service_PatientDTO model = new T_Service_PatientDTO(); model.GUID = patientGuid; model.Status = (int)patientStatus; #region 所有需要更新的字段先全部赋值为原来的 string URL = string.Format("api/service/T_Service_Patient/GetModelByIdOrGuid?id={0}&guid={1}", 0, patientGuid); Cur_PatientDT = DBHelpClass.Get(URL); //填报状态更新原因和记录 model.StatusChangeCause = Cur_PatientDT.Rows[0]["StatusChangeCause"].ToString(); //病案操作更新日志 model.Operation_Log = Cur_PatientDT.Rows[0]["Operation_Log"].ToString(); //提交审核时间 model.Submit_Audit_Time = Cur_PatientDT.Rows[0]["Submit_Audit_Time"].ToString(); //提交审核人编号 model.Submit_Audit_Person_ID = PublicClass.ToInt64(Cur_PatientDT.Rows[0]["Submit_Audit_Person_ID"], 0); //提交审核人 model.Submit_Audit_Person = Cur_PatientDT.Rows[0]["Submit_Audit_Person"].ToString(); //审核时间 model.Auditor_Time = Cur_PatientDT.Rows[0]["Auditor_Time"].ToString(); //审核人编号 model.Auditor_ID = PublicClass.ToInt64(Cur_PatientDT.Rows[0]["Auditor_ID"], 0); //审核人 model.Auditor = Cur_PatientDT.Rows[0]["Auditor"].ToString(); //存档时间 model.Archiving_Person_Time = Cur_PatientDT.Rows[0]["Archiving_Person_Time"].ToString(); //存档人编号 model.Archiving_Person_ID = PublicClass.ToInt64(Cur_PatientDT.Rows[0]["Archiving_Person_ID"], 0); //存档人 model.Archiving_Person = Cur_PatientDT.Rows[0]["Archiving_Person"].ToString(); #endregion switch (patientStatus) { case Enumerate.PatientStatus.填报中: //病案操作更新日志 model.Operation_Log = Cur_PatientDT.Rows[0]["Operation_Log"].ToString() + string.Format("{0} 审核由 {1} 拒绝,拒绝原因{2}。填报状态更新为填报中\r\n", DateTime.Now.ToString(PublicClass.TimeToString), Information.User.FullName, _Audit_Refuse_Note); //提交审核人编号 //审核拒绝备注 model.Audit_Refuse_Note = _Audit_Refuse_Note; break; case Enumerate.PatientStatus.提交审核: //病案操作更新日志 model.Operation_Log = Cur_PatientDT.Rows[0]["Operation_Log"].ToString() + string.Format("{0} 由 {1} 将填报状态更新为提交审核\r\n", DateTime.Now.ToString(PublicClass.TimeToString), Information.User.FullName); //提交审核时间 model.Submit_Audit_Time = PublicClass.DateTimeNow(); //提交审核人编号 model.Submit_Audit_Person_ID = Information.User.ID; //提交审核人 model.Submit_Audit_Person = Information.User.FullName; break; case Enumerate.PatientStatus.已审核: //病案操作更新日志 model.Operation_Log = Cur_PatientDT.Rows[0]["Operation_Log"].ToString() + string.Format("{0} 由 {1} 将填报状态更新为已审核\r\n", DateTime.Now.ToString(PublicClass.TimeToString), Information.User.FullName); //审核时间 model.Auditor_Time = PublicClass.DateTimeNow(); //审核人编号 model.Auditor_ID = Information.User.ID; //审核人 model.Auditor = Information.User.FullName; //审核拒绝备注 model.Audit_Refuse_Note = _Audit_Refuse_Note; break; case Enumerate.PatientStatus.已存档: //病案操作更新日志 model.Operation_Log = Cur_PatientDT.Rows[0]["Operation_Log"].ToString() + string.Format("{0} 由 {1} 将填报状态更新为已存档\r\n", DateTime.Now.ToString(PublicClass.TimeToString), Information.User.FullName); //存档时间 model.Archiving_Person_Time = PublicClass.DateTimeNow(); //存档人编号 model.Archiving_Person_ID = Information.User.ID; //存档人 model.Archiving_Person = Information.User.FullName; model.Audit_Refuse_Note = ""; break; default: break; } list.Add(model); //初始化两个工厂 ClientFactory httpClientPatient = new HttpClientFactory(); Client client = httpClientPatient.VisitFactory(); IsSuccess = client.Post(UpdateUrl, list).Success; #endregion } catch (Exception) { throw; } return IsSuccess; } /// /// 动态监护 /// /// /// private void btn_ECGMonitoring_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_DynamicElectrocardiogramDetailed form = new Form_DynamicElectrocardiogramDetailed(Cur_PatientDT.Rows[0]["Name"].ToString(), Cur_PatientDT.Rows[0]["Age"].ToString(), Cur_PatientDT.Rows[0]["GenderName"].ToString(), Cur_WardshipId); form.WindowState = FormWindowState.Maximized; form.Show(); } /// /// 实时监测 /// /// /// private void btn_AmbulatoryMonitoring_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_RealTimeVideo form = new Form_RealTimeVideo(Cur_PatientGuid); form.WindowState = FormWindowState.Maximized; form.Show(); } /// /// 影像信息 /// /// /// private void btn_ImageInformation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_ImageInformation form = new Form_ImageInformation(Cur_PatientGuid, PublicClassForDataBase.Config10001); form.WindowState = FormWindowState.Normal; form.StartPosition = FormStartPosition.CenterScreen; form.Show(); } /// /// 一键通知 /// /// /// private void btn_OneClickNotification_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_OneClickNotification form = new Form_OneClickNotification(Cur_PatientGuid, Cur_PatientDT.Rows[0]["Name"].ToString(), Cur_PatientDT.Rows[0]["GenderName"].ToString(), Cur_PatientDT.Rows[0]["Age"].ToString(),""); form.WindowState = FormWindowState.Normal; form.StartPosition = FormStartPosition.CenterScreen; form.Show(); } /// /// 急救轨迹 /// /// /// private void btn_FirstAidTrack_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { HL_FristAidPlatform_RealTimeVideo.Form_FirstAidTrack form = new HL_FristAidPlatform_RealTimeVideo.Form_FirstAidTrack(Cur_HospitalGuid, Cur_PatientGuid); form.WindowState = FormWindowState.Normal; form.StartPosition = FormStartPosition.CenterScreen; form.Show(); } /// /// 退出 /// /// /// private void btn_Exit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.Close(); this.Dispose(); } #endregion #region 胸痛单元菜单 /// /// 基本信息 /// /// /// private void navBarItem_BasicInfo_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "基本信息 FMC时填写"; UC_BasicInfo uc = new UC_BasicInfo(Cur_PatientGuid); Save_Main = uc; Xsc_Control.Controls.Add(uc); } /// /// 院前系统 /// /// /// private void navBarItem_PreHospitalSystems_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "院前系统及网络医院"; UC_PreHospitalSystems uc = new UC_PreHospitalSystems(Cur_HospitalGuid, Cur_PatientGuid); Save_Main = uc; Xsc_Control.Controls.Add(uc); } /// /// 急诊分诊 /// /// /// private void navBarItem_EmergencyTriage_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "急诊分诊"; UC_EmergencyTriage uc = new UC_EmergencyTriage(Cur_PatientGuid); Save_Main = uc; Xsc_Control.Controls.Add(uc); } /// /// 胸痛诊室/心内科诊疗 /// /// /// private void navBarItem_Treatment_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "急诊科/心内科诊疗"; UC_Treatment uc = new UC_Treatment(Cur_PatientGuid); Save_Main = uc; Xsc_Control.Controls.Add(uc); } /// /// 导管室 /// /// /// private void navBarItem_TreatmentPCI_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "导管室"; UC_TreatmentPCI uc = new UC_TreatmentPCI(Cur_HospitalGuid, Cur_PatientGuid); Save_Main = uc; Xsc_Control.Controls.Add(uc); } /// /// 患者转归 /// /// /// private void navBarItem_Outcome_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Xsc_Control.Controls.Clear(); this.lbl_Title.Text = "患者转归"; UC_Outcome uc = new UC_Outcome(Cur_PatientGuid, Cur_WristStrapID); Save_Main = uc; Xsc_Control.Controls.Add(uc); } #endregion /// /// 显示、隐藏时间轴 /// /// /// //private void lbl_Show_TimeAxis_Click(object sender, EventArgs e) //{ // //本身是显示的 点击后隐藏 // if (panel_TimeAxis.Visible) // { // panel_TimeAxis.Visible = false; // lbl_Show_TimeAxis.Text = "《"; // toolTip_Show.SetToolTip(this.lbl_Show_TimeAxis, "显示时间轴"); // } // else // { // panel_TimeAxis.Visible = true; // lbl_Show_TimeAxis.Text = "》"; // toolTip_Show.SetToolTip(this.lbl_Show_TimeAxis, "隐藏时间轴"); // } //} } }