using AIMS.PublicUI.UI;
using AIMSBLL;
using AIMSModel;
using DevComponents.Editors.DateTimeAdv;
using DrawGraph;
using AIMSExtension;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace AIMS.OperationAanesthesia
{
public partial class frmOperationInfoNew : Form, IMessageFilter
{
#region IMessageFilter 成员
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == 522)
{
return true;
}
else
{
return false;
}
}
#endregion
public frmOperationInfoNew()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.FixedSingle;//无边框
}
///
/// 手术记录
///
public DrawGraph.OperationRecord _record;
///
/// 穿刺及插管
///
public OperationRecordInfo OPInfo;
#region 申请手术窗体加载事件
private void frmOperationInfoNew_Load(object sender, EventArgs e)
{
Application.AddMessageFilter(this);
//初始化各个控件
InitData();
FullPatientInfo();
dtpAnesthesiaByDoctor.MouseDown += new MouseEventHandler(txtDateTime_MouseDown);
dtpTourNurseSucceed.MouseDown += new MouseEventHandler(txtDateTime_MouseDown);
dtpInstrumentNurseSucceed.MouseDown += new MouseEventHandler(txtDateTime_MouseDown);
dtpAnesthesiaByDoctor.LostFocus += new EventHandler(txtDateTime_LostFocus);
dtpTourNurseSucceed.LostFocus += new EventHandler(txtDateTime_LostFocus);
dtpInstrumentNurseSucceed.LostFocus += new EventHandler(txtDateTime_LostFocus);
}
#endregion
public List listNew = new List();
public List listOnit = new List();
public List listNewNur = new List();
public List listOnitNur = new List();
public List listNewexperts = new List();
public List listOnitexperts = new List();
public int _isCompound;
#region 初始化所有控件内容
private void InitData()
{
if (cbocctw.DataSource == null) BindBasicDictionaryToComboBox(cbocctw, "穿刺体位");
if (cboccbw.DataSource == null) BindBasicDictionaryToComboBox(cboccbw, "穿刺部位");
if (cbocctw1.DataSource == null) BindBasicDictionaryToComboBox(cbocctw1, "穿刺体位");
if (cboccbw1.DataSource == null) BindBasicDictionaryToComboBox(cboccbw1, "穿刺部位");
BindBasicDictionaryToComboBox(cbomzpm, "麻醉平面");
BindBasicDictionaryToComboBox(cbomzxg, "麻醉效果");
listOnit = BPerson.GetruleAnesthesiaDoctor("");
this.txtruleAnesthesiaDoctor.Items.AddRange(listOnit.ToArray());
listOnitNur = BPerson.GetruleNurse("");
this.txtruleNurse.Items.AddRange(listOnitNur.ToArray());
listOnitexperts = BPerson.Getexperts("");
this.txtexperts.Items.AddRange(listOnitexperts.ToArray());
cboOperationLevel.DisplayMember = "Name";
cboOperationLevel.ValueMember = "Id";
cboOperationLevel.DataSource = BOperationLevel.GetDataTable("IsValid=1");
cboOperationLevel.SelectedIndex = -1;
if (txtOperationCut.DataSource == null) BindBasicDictionaryToComboBox(txtOperationCut, "手术切口");
}
///
/// 绑定基础表项目数据 到 ComboBox
///
///
///
public static void BindBasicDictionaryToComboBox(ComboBox loadCbo, string setDataName)
{
BasicDictionary basicDictionary = BBasicDictionary.GetBasicDictionaryByName(setDataName);
if (basicDictionary == null) return;
basicDictionary.SubItem.Insert(0, new BasicDictionary() { Id = -1, Name = "" });
loadCbo.DataSource = basicDictionary.SubItem;
loadCbo.DisplayMember = "Name";
loadCbo.ValueMember = "Id";
loadCbo.SelectedIndex = -1;
}
#endregion
#region 填充患者信息
public void FullPatientInfo()
{
try
{
if (_record.OpeRecordInfo != null)
{
OPInfo = _record.OpeRecordInfo;
cboOperationLevel.Text = OPInfo.OperationLevel;
cboOperationLevel.Tag = OPInfo.OperationLevelId;
txtOperationCut.Tag = OPInfo.OperationCutId;
txtOperationCut.Text = OPInfo.OperationCut;
txtOperationSiteId.Text = OPInfo.OperationSite;
txtOperationSiteId.Tag = OPInfo.OperationSiteId;
//麻醉医生 || 麻醉接台 || 巡回护士|| 护士接台||器械护士||器械接台||体外循环
txtAnesthesiaByDoctor.Text = OPInfo.AnesthesiaSucceed;
txtTourNurseSucceed.Text = OPInfo.TourNurseSucceed;
txtInstrumentNurseSucceed.Text = OPInfo.InstrumentNurseSucceed;
if (OPInfo.AnesthesiaSucceedTime != null)
{
dtpAnesthesiaByDoctor.CustomFormat = "MM-dd HH:mm";
dtpAnesthesiaByDoctor.Value = OPInfo.AnesthesiaSucceedTime.Value;
dtpAnesthesiaByDoctor.Tag = OPInfo.AnesthesiaSucceedTime.Value;
}
if (OPInfo.InstrumentNurseSucceedTime != null)
{
dtpInstrumentNurseSucceed.CustomFormat = "MM-dd HH:mm";
dtpInstrumentNurseSucceed.Value = OPInfo.InstrumentNurseSucceedTime.Value;
dtpInstrumentNurseSucceed.Tag = OPInfo.InstrumentNurseSucceedTime.Value;
}
if (OPInfo.TourNurseSucceedTime != null)
{
dtpTourNurseSucceed.CustomFormat = "MM-dd HH:mm";
dtpTourNurseSucceed.Value = OPInfo.TourNurseSucceedTime.Value;
dtpTourNurseSucceed.Tag = OPInfo.TourNurseSucceedTime.Value;
}
if (OPInfo.Experts != null) txtexperts.Text = OPInfo.Experts;
if (OPInfo.RuleAnesthesiaDoctor != null) txtruleAnesthesiaDoctor.Text = OPInfo.RuleAnesthesiaDoctor;
if (OPInfo.RuleNurse != null) txtruleNurse.Text = OPInfo.RuleNurse;
cbocctw.Text = OPInfo.PuncturePosition;
cboccbw.Text = OPInfo.PunctureSite;
cbodgjr.Text = OPInfo.ConduitDepth;
cbozh.Text = OPInfo.NeedleNumber;
cbozx.Text = OPInfo.NeedleDirection;
cbocctw1.Text = OPInfo.PuncturePosition2;
cboccbw1.Text = OPInfo.PunctureSite2;
cbodgjr1.Text = OPInfo.ConduitDepth2;
cbozh1.Text = OPInfo.NeedleNumber2;
cbozx1.Text = OPInfo.NeedleDirection2;
txtOperationCut.Text = OPInfo.OperationCut;
cboOperationLevel.Text = OPInfo.OperationLevel;
txtOperationSiteId.Text = OPInfo.OperationSite;
if (OPInfo.IntubateMode == "单腔插管")
{
radD.Checked = true;
}
else if (OPInfo.IntubateMode == "双腔插管")
{
radS.Checked = true;
}
else if (OPInfo.IntubateMode == "喉罩")
{
radH.Checked = true;
}
else if (OPInfo.IntubateMode == "可调式气管插管")
{
rbokts.Checked = true;
}
if (OPInfo.IntubateType == "异型气管插管")
{
radY.Checked = true;
}
else if (OPInfo.IntubateType == "加强型气管插管")
{
radJ.Checked = true;
}
txtgh.Text = OPInfo.IntubateNumber;
txtsd.Text = OPInfo.IntubateDepth;
if (OPInfo.IntubatePosition != null)
{
if (OPInfo.IntubatePosition.Contains("气管内"))
{
radiTrachea.Checked = true;
}
if (OPInfo.IntubatePosition.Contains("左支气管"))
{
chkleftzqg.Checked = true;
}
if (OPInfo.IntubatePosition.Contains("右支气管"))
{
radiBronchial.Checked = true;
}
}
if (OPInfo.AnaesthesiaMode != null)
{
if (OPInfo.AnaesthesiaMode == "表面麻醉")
{
radBiao.Checked = true;
}
else if (OPInfo.AnaesthesiaMode == "快速麻醉")
{
radKuai.Checked = true;
}
else if (OPInfo.AnaesthesiaMode == "表面麻醉 快速麻醉")
{
radBiao.Checked = true;
radKuai.Checked = true;
}
}
if (OPInfo.AnaesthesiaMode != null)
{
if (OPInfo.IntubatePath == "经口")
{
radM.Checked = true;
}
else if (OPInfo.IntubatePath == "经鼻左")
{
radNL.Checked = true;
}
else if (OPInfo.IntubatePath == "经鼻右")
{
radNR.Checked = true;
}
}
if (OPInfo.IntubateOther != null) chkmingshi.Checked = OPInfo.IntubateOther.Contains(chkmingshi.Text.Trim());
if (OPInfo.IntubateOther != null) chkmangtan.Checked = OPInfo.IntubateOther.Contains(chkmangtan.Text.Trim());
if (OPInfo.IntubateOther != null) chktaonang.Checked = OPInfo.IntubateOther.Contains(chktaonang.Text.Trim());
if (OPInfo.NeuroPlexusAround != null)
{
if (OPInfo.NeuroPlexusAround == rdoNeuroPlexusAroundLeft.Text)
{
rdoNeuroPlexusAroundLeft.Checked = true;
}
if (OPInfo.NeuroPlexusAround == rdoNeuroPlexusAroundright.Text)
{
rdoNeuroPlexusAroundright.Checked = true;
}
if (OPInfo.NeuroPlexusAround == rdoNeuroPlexusAroundall.Text)
{
rdoNeuroPlexusAroundall.Checked = true;
}
}
cmbNerveBlock.Text = OPInfo.BrachialPlexus;
if (OPInfo.NeuroPlexusShallow != null)
{
if (OPInfo.NeuroPlexusShallow == rdoQWZQGJ.Text)
rdoQWZQGJ.Checked = true;
else if (OPInfo.NeuroPlexusShallow == rdoKSHJ.Text)
rdoKSHJ.Checked = true;
else if (OPInfo.NeuroPlexusShallow == rdoGB.Text)
rdoGB.Checked = true;
else if (OPInfo.NeuroPlexusShallow == rdoSKN.Text)
rdoSKN.Checked = true;
else if (OPInfo.NeuroPlexusShallow == rdoKSYJ.Text)
rdoKSYJ.Checked = true;
}
if (OPInfo.VenipunctureType != null)
{
if (OPInfo.VenipunctureType == "0")
{
cmbpuncturePositionId.Text = OPInfo.VenipunctureDeep;
rdoDMCC.Checked = true;
}
if (OPInfo.VenipunctureType == "1")
{
cmbPunctureSiteId.Text = OPInfo.VenipunctureCenter;
rdoZXJMCC.Checked = true;
}
if (OPInfo.VenipunctureType == "2")
{
cmbpuncturePositionId.Text = OPInfo.VenipunctureDeep;
rdoDMCC.Checked = true;
cmbPunctureSiteId.Text = OPInfo.VenipunctureCenter;
rdoZXJMCC.Checked = true;
}
}
cbomzpm.Text = OPInfo.AnesthesiaPlane;
cbomzxg.Text = OPInfo.AnesthesiaEffect;
cmbBRQK.Text = OPInfo.SpecialSituation;
if (OPInfo.Whereabouts != null && OPInfo.Whereabouts.ToString() != "")
{
if (OPInfo.Whereabouts == "复苏室")
{
radioButton2.Checked = true;
}
else if (OPInfo.Whereabouts == "病房")
{
radioButton1.Checked = true;
}
else if (OPInfo.Whereabouts == "计划入ICU")
{
radioButton3.Checked = true;
}
else if (OPInfo.Whereabouts == "非计划入ICU")
{
radioButton6.Checked = true;
}
else if (OPInfo.Whereabouts == "急诊")
{
radioButton4.Checked = true;
}
else if (OPInfo.Whereabouts == "离院")
{
radioButton5.Checked = true;
}
else if (OPInfo.Whereabouts == "死亡")
{
radioButton7.Checked = true;
}
}
if (OPInfo.AnesthesiaMethodFirstName != null)
{
rdoYes.Checked = true;
txtAnaesthesiaMethod.Text = OPInfo.AnesthesiaMethodFirstName;
txtAnaesthesiaMethod.Tag = OPInfo.AnesthesiaMethodLastName;
txtCause.Text = OPInfo.AnesthesiaMethodChangeReason;
if (OPInfo.AnesthesiaMethodChangeTime != null) dtpTime.Value = OPInfo.AnesthesiaMethodChangeTime.Value;
}
cboQXCD.Text = OPInfo.StewardSober;
cboHXDTCCD.Text = OPInfo.StewardBreathing;
cboZTHDD.Text = OPInfo.StewardLimbActivity;
cboSteward.Text = OPInfo.StewardNumber;
}
}
catch (Exception ex)
{
PublicMethod.WriteLog(ex);
}
}
#endregion
#region 关闭保存手术信息
private void btExit_Click(object sender, EventArgs e)
{
try
{
OPInfo.AnesthesiaPlane = cbomzpm.Text;
OPInfo.AnesthesiaEffect = cbomzxg.Text;
OPInfo.SpecialSituation = cmbBRQK.Text;
OPInfo.OperationCut = txtOperationCut.Text;
OPInfo.OperationLevel = cboOperationLevel.Text;
OPInfo.OperationSite = txtOperationSiteId.Text;
SetOPInfo();
if (radioButton2.Checked == true)
{
OPInfo.Whereabouts = "复苏室";
}
else if (radioButton1.Checked == true)
{
OPInfo.Whereabouts = "病房";
}
else if (radioButton3.Checked == true)
{
OPInfo.Whereabouts = "计划入ICU";
}
else if (radioButton6.Checked == true)
{
OPInfo.Whereabouts = "非计划入ICU";
}
else if (radioButton4.Checked == true)
{
OPInfo.Whereabouts = "急诊";
}
else if (radioButton5.Checked == true)
{
OPInfo.Whereabouts = "离院";
}
else if (radioButton7.Checked == true)
{
OPInfo.Whereabouts = "死亡";
}
if (rdoYes.Checked == true && txtAnaesthesiaMethod.Text != "")
{
OPInfo.AnesthesiaMethodFirstName = txtAnaesthesiaMethod.Text;
//OPInfo.AnesthesiaMethodLastName = txtAnaesthesiaMethod.Tag.ToString();
OPInfo.AnesthesiaMethodChangeReason = txtCause.Text.Trim();
OPInfo.AnesthesiaMethodChangeTime = dtpTime.Value;
}
OPInfo.OperatorId = PublicMethod.OperatorName;
if (OPInfo.Id == null)
{
OPInfo.Id = BOperationRecordInfo.Insert(OPInfo);
}
else
{
BOperationRecordInfo.Update(OPInfo);
}
}
catch (Exception exp)
{
PublicMethod.WriteLog(exp, ""); return;
}
}
#endregion
#region 选择医生术者
///
/// 麻醉接台医生
///
///
///
private void txtAnesthesiaByDoctor_TextChanged(object sender, EventArgs e)
{
setDoctor(sender as TextBox, "麻醉医生");
OPInfo.AnesthesiaSucceed = txtAnesthesiaByDoctor.Text;
if (txtAnesthesiaByDoctor.Text != "")
{
txtDateTime_MouseDown(dtpAnesthesiaByDoctor, null);
dtpAnesthesiaByDoctor.Enabled = true;
}
else
{
dtpAnesthesiaByDoctor.CustomFormat = " ";
OPInfo.AnesthesiaSucceedTime = null;
dtpAnesthesiaByDoctor.Tag = null;
dtpAnesthesiaByDoctor.Enabled = false;
}
}
///
/// 巡回接台护士
///
///
///
private void txtTourNurseSucceed_TextChanged(object sender, EventArgs e)
{
setDoctor(sender as TextBox, "护士");
OPInfo.TourNurseSucceed = txtTourNurseSucceed.Text;
if (txtTourNurseSucceed.Text != "")
{
txtDateTime_MouseDown(dtpTourNurseSucceed, null);
dtpTourNurseSucceed.Enabled = true;
}
else
{
dtpTourNurseSucceed.CustomFormat = " ";
OPInfo.TourNurseSucceedTime = null;
dtpTourNurseSucceed.Tag = null;
dtpTourNurseSucceed.Enabled = false;
}
}
///
/// 器械接台护士
///
///
///
private void txtInstrumentNurseSucceed_TextChanged(object sender, EventArgs e)
{
setDoctor(sender as TextBox, "护士"); ;
OPInfo.InstrumentNurseSucceed = txtInstrumentNurseSucceed.Text;
if (txtInstrumentNurseSucceed.Text != "")
{
txtDateTime_MouseDown(dtpInstrumentNurseSucceed, null);
dtpInstrumentNurseSucceed.Enabled = true;
}
else
{
dtpInstrumentNurseSucceed.CustomFormat = " ";
OPInfo.InstrumentNurseSucceedTime = null;
dtpInstrumentNurseSucceed.Tag = null;
dtpInstrumentNurseSucceed.Enabled = false;
}
}
#endregion
#region 修改手术信息
#region 选择手术体位
private void txtOperationPosition_TextChanged(object sender, EventArgs e)
{
frmSelectDictionary fsd = new frmSelectDictionary();
fsd._controlName = sender as TextBox;
fsd._dictionaryName = "手术体位";
fsd.ShowDialog();
}
#endregion
#endregion
#region 公共方法
///
/// 根据工作类型 选择医生术者赋值TextBox
///
/// 医生术者TextBox
/// 工作类型
public void setDoctor(TextBox controlTextBox, string workersType)
{
PublicUI.UI.frmSelectPerson frmOperationDoctor = new PublicUI.UI.frmSelectPerson();
frmOperationDoctor.PersonType = workersType;
frmOperationDoctor.SelectDepartmentName = "手术室";
frmOperationDoctor.SelectPersonData = new List();
frmOperationDoctor.ShowDialog();
foreach (int RowId in frmOperationDoctor.SelectPersonData)
{
controlTextBox.Text += BPerson.GetModel(RowId).Name + " ,";
}
if (controlTextBox.Text != "")
{
int idxStart = controlTextBox.Text.LastIndexOf(" ,");
controlTextBox.Text = controlTextBox.Text.Substring(0, idxStart);
}
}
#endregion
#region 手术信息赋值
private void SetOPInfo()
{
if (OPInfo == null) OPInfo = new OperationRecordInfo();
string intubateOther = string.Empty;
string M;
string T;
string S;
OPInfo.PuncturePosition = cbocctw.Text;
OPInfo.PunctureSite = cboccbw.Text;
OPInfo.ConduitDepth = cbodgjr.Text;
OPInfo.NeedleNumber = cbozh.Text;
OPInfo.NeedleDirection = cbozx.Text;
OPInfo.PuncturePosition2 = cbocctw1.Text;
OPInfo.PunctureSite2 = cboccbw1.Text;
OPInfo.ConduitDepth2 = cbodgjr1.Text;
OPInfo.NeedleNumber2 = cbozh1.Text;
OPInfo.NeedleDirection2 = cbozx1.Text;
if (radD.Checked == true)
{
OPInfo.IntubateMode = radD.Text;
}
else if (radS.Checked == true)
{
OPInfo.IntubateMode = radS.Text;
}
else if (radH.Checked == true)
{
OPInfo.IntubateMode = radH.Text;
}
else if (rbokts.Checked == true)
{
OPInfo.IntubateMode = rbokts.Text;
}
else
{
OPInfo.IntubateMode = "";
}
if (radY.Checked == true)
{
OPInfo.IntubateType = radY.Text;
}
else if (radJ.Checked == true)
{
OPInfo.IntubateType = radJ.Text;
}
else
{
OPInfo.IntubateType = "";
}
OPInfo.IntubateNumber = txtgh.Text;
OPInfo.IntubateDepth = txtsd.Text;
OPInfo.IntubatePosition = "";
if (radiTrachea.Checked == true)
{
OPInfo.IntubatePosition += radiTrachea.Text + " ";
}
if (chkleftzqg.Checked == true)
{
OPInfo.IntubatePosition += chkleftzqg.Text + " ";
}
if (radiBronchial.Checked == true)
{
OPInfo.IntubatePosition += radiBronchial.Text + " ";
}
if (radBiao.Checked == true && radKuai.Checked == true)
{
OPInfo.AnaesthesiaMode = radBiao.Text + " " + radKuai.Text;
}
else if (radBiao.Checked == true)
{
OPInfo.AnaesthesiaMode = radBiao.Text;
}
else if (radKuai.Checked == true)
{
OPInfo.AnaesthesiaMode = radKuai.Text;
}
else
{
OPInfo.AnaesthesiaMode = null;
}
if (radM.Checked == true)
{
OPInfo.IntubatePath = radM.Text;
}
else if (radNL.Checked == true)
{
OPInfo.IntubatePath = radNL.Text;
}
else if (radNR.Checked == true)
{
OPInfo.IntubatePath = radNR.Text;
}
else
{
OPInfo.IntubatePath = null;
}
if (chkmingshi.Checked == true)
{
M = chkmingshi.Text;
}
else if (chkmangtan.Checked == true)
{
M = chkmangtan.Text;
}
else
{
M = null;
}
if (chktaonang.Checked == true)
{
T = chktaonang.Text;
}
else
{
T = null;
}
S = null;
intubateOther += (M + " " + T + " " + S);
OPInfo.IntubateOther = intubateOther;
if (rdoQWZQGJ.Checked == true)
OPInfo.NeuroPlexusShallow = rdoQWZQGJ.Text;
else if (rdoKSHJ.Checked == true)
OPInfo.NeuroPlexusShallow = rdoKSHJ.Text;
else if (rdoGB.Checked == true)
OPInfo.NeuroPlexusShallow = rdoGB.Text;
else if (rdoSKN.Checked == true)
OPInfo.NeuroPlexusShallow = rdoSKN.Text;
else if (rdoKSYJ.Checked == true)
OPInfo.NeuroPlexusShallow = rdoKSYJ.Text;
else OPInfo.NeuroPlexusShallow = null;
//神经阻滞
if (rdoNeuroPlexusAroundLeft.Checked == true)
{
OPInfo.NeuroPlexusAround = rdoNeuroPlexusAroundLeft.Text;
}
if (rdoNeuroPlexusAroundright.Checked == true)
{
OPInfo.NeuroPlexusAround = rdoNeuroPlexusAroundright.Text;
}
if (rdoNeuroPlexusAroundall.Checked == true)
{
OPInfo.NeuroPlexusAround = rdoNeuroPlexusAroundall.Text;
}
OPInfo.BrachialPlexus = cmbNerveBlock.Text;
//动静脉穿刺 穿刺方法
OPInfo.VenipunctureType = null;
OPInfo.VenipunctureDeep = null;
OPInfo.VenipunctureCenter = null;
if (rdoDMCC.Checked == true && rdoZXJMCC.Checked == true)
{
OPInfo.VenipunctureDeep = cmbpuncturePositionId.Text;
OPInfo.VenipunctureCenter = cmbPunctureSiteId.Text;
OPInfo.VenipunctureType = "2";
}
else if (rdoDMCC.Checked == true)
{
OPInfo.VenipunctureCenter = null;
OPInfo.VenipunctureDeep = cmbpuncturePositionId.Text;
OPInfo.VenipunctureType = "0";
}
else if (rdoZXJMCC.Checked == true)
{
OPInfo.VenipunctureDeep = null;
OPInfo.VenipunctureCenter = cmbPunctureSiteId.Text;
OPInfo.VenipunctureType = "1";
}
OPInfo.Experts = txtexperts.Text.Trim();
OPInfo.RuleAnesthesiaDoctor = txtruleAnesthesiaDoctor.Text.Trim();
OPInfo.RuleNurse = txtruleNurse.Text.Trim();
if (cboQXCD.Text.Trim() == "") OPInfo.StewardSober = null; else OPInfo.StewardSober = cboQXCD.Text;
if (cboHXDTCCD.Text.Trim() == "") OPInfo.StewardBreathing = null; else OPInfo.StewardBreathing = cboHXDTCCD.Text;
if (cboZTHDD.Text.Trim() == "") OPInfo.StewardLimbActivity = null; else OPInfo.StewardLimbActivity = cboZTHDD.Text;
if (cboSteward.Text.Trim() == "") OPInfo.StewardNumber = null; else OPInfo.StewardNumber = cboSteward.Text;
OPInfo.OperationRecordId = _record.Id;
OPInfo.PatientId = _record.PatientId;
OPInfo.ApplyId = _record.OperationApplyId;
OPInfo.OperatorTime = DateTime.Now;
}
#endregion
#region 手术特殊事件时间点处理事件
public void txtDateTime_MouseDown(object sender, MouseEventArgs e)
{
DateTimeInput tb = sender as DateTimeInput;
if (tb.Text.Trim() == "" && tb.CustomFormat == " ")
{
tb.BackColor = Color.White;
DateTime curTimeTemp = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
SetPic(0, sender, curTimeTemp);
}
else
{
tb.CustomFormat = "MM-dd HH:mm";
tb.ButtonDropDown.Visible = true;
}
}
private void txtDateTime_LostFocus(object sender, EventArgs e)
{
DateTimeInput tb = sender as DateTimeInput;
if (tb.Text.Trim() != "" && tb.Value.ToString() != tb.Tag.ToString())
{
try
{
SetPic(0, sender, tb.Value);
}
catch (Exception exp)
{
tb.Focus();
PublicMethod.WriteLog(exp, ""); return;
}
}
{
if (tb.Tag != null && tb.Tag.ToString() != "")
tb.Value = DateTime.Parse(tb.Tag.ToString());
}
}
#endregion
#region 特殊事件触发时设置图片
private void SetPic(int state, Object obj, DateTime curTimeTemp)
{
DateTimeInput tb = obj as DateTimeInput;
if (tb.Name == "dtpAnesthesiaByDoctor")
{
if (state == 0)
{
if (txtAnesthesiaByDoctor.Text == "")
{
MessageBox.Show("请选择接台人员!", "系统提示");
return;
}
tb.CustomFormat = "MM-dd HH:mm";
OPInfo.AnesthesiaSucceedTime = curTimeTemp;
tb.Tag = curTimeTemp;
tb.Value = curTimeTemp;
}
else
{
dtpAnesthesiaByDoctor.CustomFormat = " ";
OPInfo.AnesthesiaSucceedTime = null;
tb.Tag = null;
}
}
if (tb.Name == "dtpTourNurseSucceed")
{
if (state == 0)
{
if (txtTourNurseSucceed.Text == "")
{
MessageBox.Show("请选择接台人员!", "系统提示");
return;
}
tb.CustomFormat = "MM-dd HH:mm";
OPInfo.TourNurseSucceedTime = curTimeTemp;
tb.Tag = curTimeTemp;
tb.Value = curTimeTemp;
}
else
{
tb.CustomFormat = " ";
OPInfo.TourNurseSucceedTime = null;
tb.Tag = null;
}
}
if (tb.Name == "dtpInstrumentNurseSucceed")
{
if (state == 0)
{
if (txtInstrumentNurseSucceed.Text == "")
{
MessageBox.Show("请选择接台人员!", "系统提示");
return;
}
tb.CustomFormat = "MM-dd HH:mm";
OPInfo.InstrumentNurseSucceedTime = curTimeTemp;
tb.Tag = curTimeTemp;
tb.Value = curTimeTemp;
}
else
{
tb.CustomFormat = " ";
OPInfo.InstrumentNurseSucceedTime = null;
tb.Tag = null;
}
}
}
#endregion
#region 关闭时触发
private void frmOperationInfoNew_FormClosing(object sender, FormClosingEventArgs e)
{
if (ConnectionVerification() == false)
{
e.Cancel = true;
return;
}
btExit_Click(null, null);
//this.Hide();
//e.Cancel = true;
Application.RemoveMessageFilter(this);
}
#endregion
#region RadioButton
RadioButton radd = null;
private void radD_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (radd == null)
{
rdo.Checked = true;
radd = rdo;
}
else if (radd != rdo)
{
rdo.Checked = true;
radd.Checked = false;
radd = rdo;
}
else
{
rdo.Checked = false;
radd = null;
}
}
RadioButton radz = null;
private void radZ_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (radz == null)
{
rdo.Checked = true;
radz = rdo;
}
else if (radd != rdo)
{
rdo.Checked = true;
radz.Checked = false;
radz = rdo;
}
else
{
rdo.Checked = false;
radz = null;
}
}
CheckBox radb = null;
private void radB_Click(object sender, EventArgs e)
{
CheckBox rdo = (CheckBox)sender;
if (radb == null)
{
rdo.Checked = true;
radb = rdo;
}
else if (radb != rdo)
{
rdo.Checked = true;
radb.Checked = false;
radb = rdo;
}
else
{
rdo.Checked = false;
radb = null;
}
}
RadioButton rady = null;
private void radY_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (rady == null)
{
rdo.Checked = true;
rady = rdo;
}
else if (rady != rdo)
{
rdo.Checked = true;
rady.Checked = false;
rady = rdo;
}
else
{
rdo.Checked = false;
rady = null;
}
}
RadioButton radBM = null;
private void radM_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (radBM == null)
{
rdo.Checked = true;
radBM = rdo;
}
else if (radBM != rdo)
{
rdo.Checked = true;
radBM.Checked = false;
radBM = rdo;
}
else
{
rdo.Checked = false;
radBM = null;
}
}
RadioButton rdoNeuroPlexusAroundLef = null;
private void rdoNeuroPlexusAroundLeft_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (rdoNeuroPlexusAroundLef == null)
{
rdo.Checked = true;
rdoNeuroPlexusAroundLef = rdo;
}
else if (rdoNeuroPlexusAroundLef != rdo)
{
rdo.Checked = true;
rdoNeuroPlexusAroundLef.Checked = false;
rdoNeuroPlexusAroundLef = rdo;
}
else
{
rdo.Checked = false;
rdoNeuroPlexusAroundLef = null;
}
}
RadioButton chkshi = null;
private void radMas_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (chkshi == null)
{
rdo.Checked = true;
chkshi = rdo;
}
else if (chkshi != rdo)
{
rdo.Checked = true;
chkshi.Checked = false;
chkshi = rdo;
}
else
{
rdo.Checked = false;
chkshi = null;
}
}
RadioButton chkkshj = null;
private void radKSHJ_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (chkkshj == null)
{
rdo.Checked = true;
chkkshj = rdo;
}
else if (chkkshj != rdo)
{
rdo.Checked = true;
chkkshj.Checked = false;
chkkshj = rdo;
}
else
{
rdo.Checked = false;
chkkshj = null;
}
}
RadioButton chkdmcc = null;
private void radDMCC_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (chkdmcc == null)
{
rdo.Checked = true;
chkdmcc = rdo;
}
else if (chkdmcc != rdo)
{
rdo.Checked = true;
chkdmcc.Checked = false;
chkdmcc = rdo;
}
else
{
rdo.Checked = false;
chkdmcc = null;
}
}
private void radiTrachea_CheckedChanged(object sender, EventArgs e)
{
if (radiTrachea.Checked == true)
{
chkleftzqg.Checked = false;
radiBronchial.Checked = false;
}
}
private void radiBronchial_CheckedChanged(object sender, EventArgs e)
{
if (chkleftzqg.Checked == true && radiBronchial.Checked == true)
{
radiTrachea.Checked = false;
}
}
RadioButton chkjmcc = null;
private void rdoZXJMCC_Click(object sender, EventArgs e)
{
RadioButton rdo = (RadioButton)sender;
if (chkjmcc == null)
{
rdo.Checked = true;
chkjmcc = rdo;
}
else if (chkjmcc != rdo)
{
rdo.Checked = true;
chkjmcc.Checked = false;
chkjmcc = rdo;
}
else
{
rdo.Checked = false;
chkjmcc = null;
}
}
#endregion
#region 接台验证
private bool ConnectionVerification()
{
bool b = true;
if (cboOperationLevel.Text == "" || cboOperationLevel.Text == "未分级")
{
MessageBox.Show("请填手术分级");
label19.ForeColor = Color.Red;
cboOperationLevel.Focus();
b = false;
}
//if (txtOperationCut.Text == "")
//{
// MessageBox.Show("请填写切口类型");
// label20.ForeColor = Color.Red;
// txtOperationCut.Focus();
// b = false;
//}
if (cbomzxg.Text == "")
{
MessageBox.Show("请填写麻醉效果");
label14.ForeColor = Color.Red;
cbomzxg.Focus();
b = false;
}
return b;
}
#endregion
private void cboODepartment_TextUpdate(object sender, EventArgs e)
{
//清空combobox
this.txtruleAnesthesiaDoctor.Items.Clear();
//清空listNew
listNew.Clear();
//遍历全部备查数据
listNew = BPerson.GetruleAnesthesiaDoctor(txtruleAnesthesiaDoctor.Text);
//combobox添加已经查到的关键词
this.txtruleAnesthesiaDoctor.Items.AddRange(listNew.ToArray());
//设置光标位置,否则光标位置始终保持在第一列,造成输入关键词的倒序排列
this.txtruleAnesthesiaDoctor.SelectionStart = this.txtruleAnesthesiaDoctor.Text.Length;
//保持鼠标指针原来状态,有时候鼠标指针会被下拉框覆盖,所以要进行一次设置。
Cursor = Cursors.Default;
//自动弹出下拉框
this.txtruleAnesthesiaDoctor.DroppedDown = true;
}
private void txtruleNurse_TextUpdate(object sender, EventArgs e)
{
//清空combobox
this.txtruleNurse.Items.Clear();
//清空listNew
listNewNur.Clear();
//遍历全部备查数据
listNewNur = BPerson.GetruleNurse(txtruleNurse.Text);
//combobox添加已经查到的关键词
this.txtruleNurse.Items.AddRange(listNewNur.ToArray());
//设置光标位置,否则光标位置始终保持在第一列,造成输入关键词的倒序排列
this.txtruleNurse.SelectionStart = this.txtruleNurse.Text.Length;
//保持鼠标指针原来状态,有时候鼠标指针会被下拉框覆盖,所以要进行一次设置。
Cursor = Cursors.Default;
//自动弹出下拉框
this.txtruleNurse.DroppedDown = true;
}
private void txtexperts_TextUpdate(object sender, EventArgs e)
{
//清空combobox
this.txtexperts.Items.Clear();
//清空listNew
listNewexperts.Clear();
//遍历全部备查数据
listNewexperts = BPerson.Getexperts(txtexperts.Text);
//combobox添加已经查到的关键词
this.txtexperts.Items.AddRange(listNewexperts.ToArray());
//设置光标位置,否则光标位置始终保持在第一列,造成输入关键词的倒序排列
this.txtexperts.SelectionStart = this.txtexperts.Text.Length;
//保持鼠标指针原来状态,有时候鼠标指针会被下拉框覆盖,所以要进行一次设置。
Cursor = Cursors.Default;
//自动弹出下拉框
this.txtexperts.DroppedDown = true;
}
private void rdoYes_CheckedChanged(object sender, EventArgs e)
{
if (rdoYes.Checked == true)
{
label10.Visible = true;
label15.Visible = true;
label16.Visible = true;
txtAnaesthesiaMethod.Visible = true;
txtCause.Visible = true;
dtpTime.Visible = true;
}
else
{
label10.Visible = false;
label15.Visible = false;
label16.Visible = false;
txtAnaesthesiaMethod.Visible = false;
txtCause.Visible = false;
dtpTime.Visible = false;
}
}
public List SelectAnaesthesiaMethodData = new List();
frmAnaesthesiaMethod frmAnaesthesia;
private void txtAnaesthesiaMethod_Click(object sender, EventArgs e)
{
frmAnaesthesia = new PublicUI.UI.frmAnaesthesiaMethod();
frmAnaesthesia.FormClosed += new FormClosedEventHandler(frmAnaesthesiaMethod_FormClosed);
frmAnaesthesia.SelectAnaesthesiaMethodData = SelectAnaesthesiaMethodData;
frmAnaesthesia.ShowDialog();
}
void frmAnaesthesiaMethod_FormClosed(object sender, FormClosedEventArgs e)
{
txtAnaesthesiaMethod.Text = "";
if (frmAnaesthesia.SelectAnaesthesiaMethodData.Count > 0)
{
SelectAnaesthesiaMethodData = frmAnaesthesia.SelectAnaesthesiaMethodData;
foreach (int RowId in frmAnaesthesia.SelectAnaesthesiaMethodData)
{
txtAnaesthesiaMethod.Text += BAnaesthesiaMethod.GetModel(RowId).Name + " ,";
}
int idxStart = txtAnaesthesiaMethod.Text.LastIndexOf(" ,");
txtAnaesthesiaMethod.Text = txtAnaesthesiaMethod.Text.Substring(0, idxStart);
}
}
private void cmbpuncturePositionId_DoubleClick(object sender, EventArgs e)
{
frmSelectDictionary fsd = new frmSelectDictionary();
fsd._controlName = sender as TextBox;
fsd._dictionaryName = "动脉穿刺";
fsd.ShowDialog();
}
private void cmbPunctureSiteId_DoubleClick(object sender, EventArgs e)
{
frmSelectDictionary fsd = new frmSelectDictionary();
fsd._controlName = sender as TextBox;
fsd._dictionaryName = "中心静脉穿刺";
fsd.ShowDialog();
}
private void cmbNerveBlock_DoubleClick(object sender, EventArgs e)
{
frmSelectDictionary fsd = new frmSelectDictionary();
fsd._controlName = sender as TextBox;
fsd._dictionaryName = "神经阻滞部位";
fsd.ShowDialog();
}
private void rdoDMCC_CheckedChanged(object sender, EventArgs e)
{
if ((sender as RadioButton).Checked == false)
{
cmbpuncturePositionId.Text = "";
}
}
private void rdoZXJMCC_CheckedChanged(object sender, EventArgs e)
{
if ((sender as RadioButton).Checked == false)
{
cmbPunctureSiteId.Text = "";
}
}
///
/// 清醒程度
///
int StewardSober = 0;
///
/// 呼吸道通畅程度
///
int StewardBreathing = 0;
///
/// 肢体活动度
///
int StewardLimbActivity = 0;
///
/// 总评分
///
///
///
private void cboQXCD_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboQXCD.Text != null && cboQXCD.Text.Trim() != "") StewardSober = int.Parse(cboQXCD.Text);
if (cboHXDTCCD.Text != null && cboHXDTCCD.Text.Trim() != "") StewardBreathing = int.Parse(cboHXDTCCD.Text);
if (cboZTHDD.Text != null && cboZTHDD.Text.Trim() != "") StewardLimbActivity = int.Parse(cboZTHDD.Text);
cboSteward.Text = (StewardSober + StewardBreathing + StewardLimbActivity).ToString();
}
}
}