AIMS/AIMS.UI/OperationFront/frmOperationApplyDetail.cs
2023-08-13 21:05:09 +08:00

1394 lines
66 KiB
C#

using AIMSBLL;
using AIMSExtension;
using AIMSModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace AIMS.OperationFront.UI
{
public partial class frmOperationApplyDetail : Form
{
public AIMSExtension.EditState State = new AIMSExtension.EditState();
public int EditApplyId = 0;
private PublicUI.UI.frmSelectDisease frmSelectDisease;
private PublicUI.UI.frmSelectOperationOne frmSelectOperation;
private PublicUI.UI.frmOperationCutType frmOperationCutType;
private PublicUI.UI.frmOperationPosition frmOperationPosition;
private PublicUI.UI.frmAnaesthesiaMethod frmAnaesthesiaMethod;
private PublicUI.UI.frmContagion frmContagion;
private PublicUI.UI.frmSelectPerson frmOperationDoctor;
private PublicUI.UI.frmSelectPerson frmAssistant1;
private PublicUI.UI.frmSelectPerson frmAssistant2;
private PublicUI.UI.frmSelectPerson frmAssistant3;
private List<int> SelectDiseaseData = new List<int>(); //选择后的诊断信息
private List<ApplyOperationInfo> SelectOperationData = new List<ApplyOperationInfo>();//选择后的手术信息
private List<int> SelectOperationCutTypeData = new List<int>(); //切口类型
private List<int> SelectOperationPositionData = new List<int>(); //手术部位
private List<int> SelectAnaesthesiaMethodData = new List<int>(); //拟施麻醉
private List<int> SelectContagionData = new List<int>(); //术前感染筛查
private List<int> SelectOperationDoctor = new List<int>(); //主刀医生
private List<int> SelectAssistant1Data = new List<int>(); //一助
private List<int> SelectAssistant2Data = new List<int>(); //二助
private List<int> SelectAssistant3Data = new List<int>(); //三助
private List<int> SelectAnesthesiaDoctorData = new List<int>(); //麻醉医生
private List<int> SelectInstrumentNurseData = new List<int>(); //器械护士
private List<int> SelectTourNurseData = new List<int>(); //巡回护士
private List<int> SelectAnesthesiaDoctorSucceedData = new List<int>(); //麻醉接台
private List<int> SelectInstrumentNurseSucceedData = new List<int>(); //器械接台
private List<int> SelectTourNurseSucceedData = new List<int>(); //巡回接台
private PublicUI.UI.frmSelectPerson frmAnesthesiaDoctor = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmInstrumentNurse = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmTourNurse = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmAnesthesiaDoctorSucceed = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmInstrumentNurseSucceed = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmTourNurseSucceed = new PublicUI.UI.frmSelectPerson();
public SysConfig sysPass = BSysConfig.SelectSingle(" name='手术申请审核功能' ", null);
private DateTime OrderOperationTime;
public frmOperationApplyDetail()
{
InitializeComponent();
}
OperationApply EditOperationApplyObj = new OperationApply();
OrisPatient EditOris_PatientObj = new OrisPatient();
private void frmOperationApplyDetail_Load(object sender, EventArgs e)
{
Initial();
chbIsReturnOperation_CheckedChanged(null, null);
txtMdrecNo.Select();
if (State == AIMSExtension.EditState.EDIT)
{
#region
EditOperationApplyObj = BOperationApply.GetModel(EditApplyId);
EditOris_PatientObj = BOrisPatient.GetModel(EditOperationApplyObj.OrisPatientId.Value);
cboPatientType.Text = EditOris_PatientObj.PatientType;
txtMdrecNo.Text = EditOris_PatientObj.MdrecNo;
txtArchivesNo.Text = EditOris_PatientObj.ArchivesNo;
txtName.Text = EditOris_PatientObj.Name;
cboSex.Text = EditOris_PatientObj.Sex;
dtpBirthDay.Value = EditOris_PatientObj.BirthDay.Value;
txtHeight.Text = EditOris_PatientObj.Height;
txtWeight.Text = EditOris_PatientObj.Weight;
cboDepartment.SelectedValue = EditOris_PatientObj.DepId;
txtIlldistrict.Text = EditOris_PatientObj.Illdistrict;
txtSickBed.Text = EditOris_PatientObj.SickBed;
cboBloodType.Text = EditOris_PatientObj.BloodType;
cboRHBloodType.Text = EditOris_PatientObj.RHBloodType;
cboPatientKind.Text = EditOris_PatientObj.PatientKind;
dtpInHosDate.Value = EditOris_PatientObj.InHosDate.Value;
txtIdentityCard.Text = EditOris_PatientObj.IdentityCard;
txtContacts.Text = EditOris_PatientObj.Contacts;
txtContactsPhone.Text = EditOris_PatientObj.ContactsPhone;
cboApplyDepId.SelectedValue = EditOperationApplyObj.ApplyDepId;
if (EditOperationApplyObj.OperationType == "择期")
rboZQ.Checked = true;
if (EditOperationApplyObj.OperationType == "急诊")
rboJZ.Checked = true;
if (EditOperationApplyObj.OperationType == "日间")
rboRJ.Checked = true;
dtpOrderOperationTime.Value = EditOperationApplyObj.OrderOperationTime.Value;
OrderOperationTime = dtpOrderOperationTime.Value;
if (EditOperationApplyObj.IsReturnOperation == 1)
{
chbIsReturnOperation.Checked = true;
}
else
{
chbIsReturnOperation.Checked = false;
}
if (EditOperationApplyObj.IsPlanReturnOperation == 1)
{
rdbIsPlanReturnOperation.Checked = true;
}
else
{
rdbIsPlanReturnOperation.Checked = false;
}
if (EditOperationApplyObj.IsNotPlanReturnOperation == 1)
{
rdbIsNotPlanReturnOperation.Checked = true;
}
else
{
rdbIsNotPlanReturnOperation.Checked = false;
}
//诊断
SelectDiseaseData = BApplyDiagnoseInfo.GetApplyDiagnoseIdList(EditApplyId);
foreach (int RowId in SelectDiseaseData)
{
txtDisease.Text += BDisease.SelectSingle(RowId).Name + " ,";
}
if (txtDisease.Text != "") txtDisease.Text = txtDisease.Text.Substring(0, txtDisease.Text.LastIndexOf(" ,"));
//手术
SelectOperationData = BApplyOperationInfo.GetApplyOperationIdList(EditApplyId);
for (int i = 0; i < SelectOperationData.Count; i++)
{
ApplyOperationInfo info = SelectOperationData[i];
if (i == 0)
{
txtOperation.Text = BOperation.SelectSingle(info.OperationId).Name;
txtOperation.Tag = info.OperationId;
txtLeft.Text = info.LeftRemark;
txtRight.Text = info.RightRemark;
txtLeft.Enabled = true;
txtRight.Enabled = true;
}
if (i == 1)
{
txtOperation2.Text = BOperation.SelectSingle(info.OperationId).Name;
txtOperation2.Tag = info.OperationId;
txtLeft2.Text = info.LeftRemark;
txtRight2.Text = info.RightRemark;
txtLeft2.Enabled = true;
txtRight2.Enabled = true;
}
if (i == 2)
{
txtOperation3.Text = BOperation.SelectSingle(info.OperationId).Name;
txtOperation3.Tag = info.OperationId;
txtLeft3.Text = info.LeftRemark;
txtRight3.Text = info.RightRemark;
txtLeft3.Enabled = true;
txtRight3.Enabled = true;
}
if (i == 3)
{
txtOperation4.Text = BOperation.SelectSingle(info.OperationId).Name;
txtOperation4.Tag = info.OperationId;
txtLeft4.Text = info.LeftRemark;
txtRight4.Text = info.RightRemark;
txtLeft4.Enabled = true;
txtRight4.Enabled = true;
}
if (i == 4)
{
txtOperation5.Text = BOperation.SelectSingle(info.OperationId).Name;
txtOperation5.Tag = info.OperationId;
txtLeft5.Text = info.LeftRemark;
txtRight5.Text = info.RightRemark;
txtLeft5.Enabled = true;
txtRight5.Enabled = true;
}
}
//foreach (int RowId in SelectOperationData)
//{
// string name = BOperation.SelectSingle(RowId).Name;
// // Create one token and select it for keywords TokenEditor
// //tokenEditor1.Tokens.Add(new DevComponents.DotNetBar.Controls.EditToken(name));
// tokenEditor1.SelectedTokens.Add(new DevComponents.DotNetBar.Controls.EditToken(name));
//}
txtOperationRemark.Text = EditOperationApplyObj.OperationRemark;
cboOperationLevel.SelectedValue = EditOperationApplyObj.OperationLevelId;
//切口类型
SelectOperationCutTypeData = BApplyOperationCutType.GetApplyOperationCutTypeIdList(EditApplyId);
foreach (int RowId in SelectOperationCutTypeData)
{
txtOperationCutType.Text += BOperationCutType.SelectSingle(RowId).Name + " ,";
}
if (txtOperationCutType.Text != "") txtOperationCutType.Text = txtOperationCutType.Text.Substring(0, txtOperationCutType.Text.LastIndexOf(" ,"));
//手术部位
SelectOperationPositionData = BApplyOperationPosition.GetApplyOperationPositionIdList(EditApplyId);
foreach (int RowId in SelectOperationPositionData)
{
txtOperationPosition.Text += BOperationPosition.SelectSingle(RowId).Name + " ,";
}
if (txtOperationPosition.Text != "") txtOperationPosition.Text = txtOperationPosition.Text.Substring(0, txtOperationPosition.Text.LastIndexOf(" ,"));
//麻醉方式
SelectAnaesthesiaMethodData = BApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethodList(EditApplyId);
foreach (int RowId in SelectAnaesthesiaMethodData)
{
txtAnaesthesiaMethod.Text += BAnaesthesiaMethod.SelectSingle(RowId).Name + " ,";
}
if (txtAnaesthesiaMethod.Text != "") txtAnaesthesiaMethod.Text = txtAnaesthesiaMethod.Text.Substring(0, txtAnaesthesiaMethod.Text.LastIndexOf(" ,"));
//术前感染筛查
txtContagion.Text = EditOperationApplyObj.Contagion;
//术者
SelectOperationDoctor = BApplyPersonDuty.GetPersonIdList(EditApplyId, 1);
foreach (int RowId in SelectOperationDoctor)
{
string name = BPerson.SelectSingle(RowId).Name;
txtOperationDoctor.Text += name + " ,";
}
if (txtOperationDoctor.Text != "") txtOperationDoctor.Text = txtOperationDoctor.Text.Substring(0, txtOperationDoctor.Text.LastIndexOf(" ,"));
//一助
SelectAssistant1Data = BApplyPersonDuty.GetPersonIdList(EditApplyId, 2);
foreach (int RowId in SelectAssistant1Data)
{
txtAssistant1.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
if (SelectAssistant1Data.Count > 0)
{
txtAssistant1.Text = txtAssistant1.Text.Substring(0, txtAssistant1.Text.LastIndexOf(" ,"));
}
//二助
SelectAssistant2Data = BApplyPersonDuty.GetPersonIdList(EditApplyId, 3);
foreach (int RowId in SelectAssistant2Data)
{
txtAssistant2.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
if (SelectAssistant2Data.Count > 0)
{
txtAssistant2.Text = txtAssistant2.Text.Substring(0, txtAssistant2.Text.LastIndexOf(" ,"));
}
//三助
SelectAssistant3Data = BApplyPersonDuty.GetPersonIdList(EditApplyId, 4);
foreach (int RowId in SelectAssistant3Data)
{
txtAssistant3.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
if (SelectAssistant3Data.Count > 0)
{
txtAssistant3.Text = txtAssistant3.Text.Substring(0, txtAssistant3.Text.LastIndexOf(" ,"));
}
txtIntern.Text = EditOperationApplyObj.Intern;
//txtOther.Text = EditOperationApplyObj.Other;
#endregion
}
}
#region
private void btnCurrentTime_Click(object sender, EventArgs e)
{
dtpOrderOperationTime.Value = DateTime.Now;
}
private void chbIsReturnOperation_CheckedChanged(object sender, EventArgs e)
{
if (chbIsReturnOperation.Checked == true)
{
rdbIsPlanReturnOperation.Enabled = true;
rdbIsNotPlanReturnOperation.Enabled = true;
rdbIsPlanReturnOperation.Checked = false;
rdbIsNotPlanReturnOperation.Checked = false;
}
else
{
rdbIsPlanReturnOperation.Enabled = false;
rdbIsNotPlanReturnOperation.Enabled = false;
rdbIsPlanReturnOperation.Checked = false;
rdbIsNotPlanReturnOperation.Checked = false;
}
}
private void Initial()
{
cboDepartment.DisplayMember = "Name";
cboDepartment.ValueMember = "Id";
cboDepartment.DataSource = BDepartment.GetDepartmentDataTable("IsValid=1 ");
cboDepartment.SelectedIndex = -1;
cboApplyDepId.DisplayMember = "Name";
cboApplyDepId.ValueMember = "Id";
cboApplyDepId.DataSource = BDepartment.GetDepartmentDataTable("IsValid=1 ");
cboApplyDepId.SelectedIndex = -1;
cboPatientKind.DisplayMember = "Name";
cboPatientKind.ValueMember = "Id";
cboPatientKind.DataSource = BPatientKind.GetDataTable("IsValid=1");
cboPatientKind.SelectedIndex = -1;
cboOperationLevel.DisplayMember = "Name";
cboOperationLevel.ValueMember = "Id";
cboOperationLevel.DataSource = BOperationLevel.GetDataTable("IsValid=1");
cboOperationLevel.SelectedIndex = -1;
if (State == AIMSExtension.EditState.ADD)
{
Text = Text + " 增加";
cboApplyDepId.Text = BDepartment.SelectSingle(AIMSExtension.PublicMethod.DepId).Name;
cboApplyDepId.SelectedValue = AIMSExtension.PublicMethod.DepId;
}
if (State == AIMSExtension.EditState.EDIT)
{
Text = Text + " 修改";
}
}
private void txtDisease_Click(object sender, EventArgs e)
{
frmSelectDisease = new PublicUI.UI.frmSelectDisease();
frmSelectDisease.FormClosed += new FormClosedEventHandler(frmSelectDisease_FormClosed);
frmSelectDisease.SelectRightData = SelectDiseaseData;
frmSelectDisease.ShowDialog();
}
void frmSelectDisease_FormClosed(object sender, FormClosedEventArgs e)
{
txtDisease.Text = "";
if (frmSelectDisease.SelectRightData.Count > 0)
{
SelectDiseaseData = frmSelectDisease.SelectRightData;
foreach (int RowId in frmSelectDisease.SelectRightData)
{
txtDisease.Text += BDisease.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtDisease.Text.LastIndexOf(" ,");
txtDisease.Text = txtDisease.Text.Substring(0, idxStart);
}
}
private void txtOperation_Click(object sender, EventArgs e)
{
List<int> data = new List<int>();
if (((TextBox)sender).Tag != null)
data.Add(int.Parse(((TextBox)sender).Tag.ToString()));
frmSelectOperation = new PublicUI.UI.frmSelectOperationOne();
frmSelectOperation.FormClosed += new FormClosedEventHandler(frmSelectOperation_FormClosed);
frmSelectOperation.SelectRightData = data;
frmSelectOperation.ShowDialog();
}
void frmSelectOperation_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperation.Text = "";
if (frmSelectOperation.SelectRightData.Count > 0)
{
txtOperation.Text = BOperation.SelectSingle(frmSelectOperation.SelectRightData[0]).Name;
txtOperation.Tag = frmSelectOperation.SelectRightData[0];
txtLeft.Enabled = true;
txtRight.Enabled = true;
}
else
{
txtOperation.Text = "";
txtOperation.Tag = null;
txtLeft.Enabled = false;
txtRight.Enabled = false;
}
}
private void txtOperation2_Click(object sender, EventArgs e)
{
List<int> data = new List<int>();
if (((TextBox)sender).Tag != null)
data.Add(int.Parse(((TextBox)sender).Tag.ToString()));
frmSelectOperation = new PublicUI.UI.frmSelectOperationOne();
frmSelectOperation.FormClosed += new FormClosedEventHandler(frmSelectOperation2_FormClosed);
frmSelectOperation.SelectRightData = data;
frmSelectOperation.ShowDialog();
}
void frmSelectOperation2_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperation2.Text = "";
if (frmSelectOperation.SelectRightData.Count > 0)
{
txtOperation2.Text = BOperation.SelectSingle(frmSelectOperation.SelectRightData[0]).Name;
txtOperation2.Tag = frmSelectOperation.SelectRightData[0];
txtLeft2.Enabled = true;
txtRight2.Enabled = true;
}
else
{
txtOperation2.Text = "";
txtOperation2.Tag = null;
txtLeft2.Enabled = false;
txtLeft2.Enabled = false;
}
}
private void txtOperation3_Click(object sender, EventArgs e)
{
List<int> data = new List<int>();
if (((TextBox)sender).Tag != null)
data.Add(int.Parse(((TextBox)sender).Tag.ToString()));
frmSelectOperation = new PublicUI.UI.frmSelectOperationOne();
frmSelectOperation.FormClosed += new FormClosedEventHandler(frmSelectOperation3_FormClosed);
frmSelectOperation.SelectRightData = data;
frmSelectOperation.ShowDialog();
}
void frmSelectOperation3_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperation3.Text = "";
if (frmSelectOperation.SelectRightData.Count > 0)
{
txtOperation3.Text = BOperation.SelectSingle(frmSelectOperation.SelectRightData[0]).Name;
txtOperation3.Tag = frmSelectOperation.SelectRightData[0];
txtLeft3.Enabled = true;
txtRight3.Enabled = true;
}
else
{
txtOperation3.Text = "";
txtOperation3.Tag = null;
txtLeft3.Enabled = false;
txtRight3.Enabled = false;
}
}
private void txtOperation4_Click(object sender, EventArgs e)
{
List<int> data = new List<int>();
if (((TextBox)sender).Tag != null)
data.Add(int.Parse(((TextBox)sender).Tag.ToString()));
frmSelectOperation = new PublicUI.UI.frmSelectOperationOne();
frmSelectOperation.FormClosed += new FormClosedEventHandler(frmSelectOperation4_FormClosed);
frmSelectOperation.SelectRightData = data;
frmSelectOperation.ShowDialog();
}
void frmSelectOperation4_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperation4.Text = "";
if (frmSelectOperation.SelectRightData.Count > 0)
{
txtOperation4.Text = BOperation.SelectSingle(frmSelectOperation.SelectRightData[0]).Name;
txtOperation4.Tag = frmSelectOperation.SelectRightData[0];
txtLeft4.Enabled = true;
txtRight4.Enabled = true;
}
else
{
txtOperation4.Text = "";
txtOperation4.Tag = null;
txtLeft4.Enabled = false;
txtRight4.Enabled = false;
}
}
private void txtOperation5_Click(object sender, EventArgs e)
{
List<int> data = new List<int>();
if (((TextBox)sender).Tag != null)
data.Add(int.Parse(((TextBox)sender).Tag.ToString()));
frmSelectOperation = new PublicUI.UI.frmSelectOperationOne();
frmSelectOperation.FormClosed += new FormClosedEventHandler(frmSelectOperation5_FormClosed);
frmSelectOperation.SelectRightData = data;
frmSelectOperation.ShowDialog();
}
void frmSelectOperation5_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperation5.Text = "";
if (frmSelectOperation.SelectRightData.Count > 0)
{
txtOperation5.Text = BOperation.SelectSingle(frmSelectOperation.SelectRightData[0]).Name;
txtOperation5.Tag = frmSelectOperation.SelectRightData[0];
txtLeft5.Enabled = true;
txtRight5.Enabled = true;
}
else
{
txtOperation5.Text = "";
txtOperation5.Tag = null;
txtLeft5.Enabled = false;
txtRight5.Enabled = false;
}
}
private void txtOperationCutType_Click(object sender, EventArgs e)
{
frmOperationCutType = new PublicUI.UI.frmOperationCutType();
frmOperationCutType.FormClosed += new FormClosedEventHandler(frmOperationCutType_FormClosed);
frmOperationCutType.SelectOperationCutTypeData = SelectOperationCutTypeData;
frmOperationCutType.ShowDialog();
}
void frmOperationCutType_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperationCutType.Text = "";
if (frmOperationCutType.SelectOperationCutTypeData.Count > 0)
{
SelectOperationCutTypeData = frmOperationCutType.SelectOperationCutTypeData;
foreach (int RowId in frmOperationCutType.SelectOperationCutTypeData)
{
txtOperationCutType.Text += BOperationCutType.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtOperationCutType.Text.LastIndexOf(" ,");
txtOperationCutType.Text = txtOperationCutType.Text.Substring(0, idxStart);
}
}
private void txtOperationPosition_Click(object sender, EventArgs e)
{
frmOperationPosition = new PublicUI.UI.frmOperationPosition();
frmOperationPosition.FormClosed += new FormClosedEventHandler(frmOperationPosition_FormClosed);
frmOperationPosition.SelectOperationPositionData = SelectOperationPositionData;
frmOperationPosition.ShowDialog();
}
void frmOperationPosition_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperationPosition.Text = "";
if (frmOperationPosition.SelectOperationPositionData.Count > 0)
{
SelectOperationPositionData = frmOperationPosition.SelectOperationPositionData;
foreach (int RowId in frmOperationPosition.SelectOperationPositionData)
{
txtOperationPosition.Text += BOperationPosition.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtOperationPosition.Text.LastIndexOf(" ,");
txtOperationPosition.Text = txtOperationPosition.Text.Substring(0, idxStart);
}
}
private void txtAnaesthesiaMethod_Click(object sender, EventArgs e)
{
frmAnaesthesiaMethod = new PublicUI.UI.frmAnaesthesiaMethod();
frmAnaesthesiaMethod.FormClosed += new FormClosedEventHandler(frmAnaesthesiaMethod_FormClosed);
frmAnaesthesiaMethod.SelectAnaesthesiaMethodData = SelectAnaesthesiaMethodData;
frmAnaesthesiaMethod.ShowDialog();
}
void frmAnaesthesiaMethod_FormClosed(object sender, FormClosedEventArgs e)
{
txtAnaesthesiaMethod.Text = "";
if (frmAnaesthesiaMethod.SelectAnaesthesiaMethodData.Count > 0)
{
SelectAnaesthesiaMethodData = frmAnaesthesiaMethod.SelectAnaesthesiaMethodData;
foreach (int RowId in frmAnaesthesiaMethod.SelectAnaesthesiaMethodData)
{
txtAnaesthesiaMethod.Text += BAnaesthesiaMethod.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtAnaesthesiaMethod.Text.LastIndexOf(" ,");
txtAnaesthesiaMethod.Text = txtAnaesthesiaMethod.Text.Substring(0, idxStart);
}
}
private void txtContagion_Click(object sender, EventArgs e)
{
frmContagion = new PublicUI.UI.frmContagion();
frmContagion.FormClosed += new FormClosedEventHandler(frmContagion_FormClosed);
frmContagion.SelectContagionData = SelectContagionData;
frmContagion.ShowDialog();
}
void frmContagion_FormClosed(object sender, FormClosedEventArgs e)
{
txtContagion.Text = "";
if (frmContagion.SelectContagionData.Count > 0)
{
SelectContagionData = frmContagion.SelectContagionData;
foreach (int RowId in frmContagion.SelectContagionData)
{
txtContagion.Text += BBasicDictionary.GetModel(RowId).Name + " ,";
}
int idxStart = txtContagion.Text.LastIndexOf(" ,");
txtContagion.Text = txtContagion.Text.Substring(0, idxStart);
}
}
private void OperationDoctor_Click(object sender, EventArgs e)
{
frmOperationDoctor = new PublicUI.UI.frmSelectPerson();
frmOperationDoctor.PersonType = "医生";
frmOperationDoctor.SelectDepartmentName = cboApplyDepId.Text;
frmOperationDoctor.SelectPersonData = SelectOperationDoctor;
frmOperationDoctor.FormClosed += new FormClosedEventHandler(frmSelectPerson_FormClosed);
frmOperationDoctor.ShowDialog();
}
void frmSelectPerson_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperationDoctor.Text = "";
if (frmOperationDoctor.SelectPersonData.Count > 0)
{
SelectOperationDoctor = frmOperationDoctor.SelectPersonData;
foreach (int RowId in frmOperationDoctor.SelectPersonData)
{
txtOperationDoctor.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtOperationDoctor.Text.LastIndexOf(" ,");
txtOperationDoctor.Text = txtOperationDoctor.Text.Substring(0, idxStart);
}
}
private void txtAssistant1_Click(object sender, EventArgs e)
{
frmAssistant1 = new PublicUI.UI.frmSelectPerson();
frmAssistant1.PersonType = "医生";
frmAssistant1.SelectDepartmentName = cboApplyDepId.Text;
frmAssistant1.SelectPersonData = SelectAssistant1Data;
frmAssistant1.FormClosed += new FormClosedEventHandler(frmAssistant1_FormClosed);
frmAssistant1.ShowDialog();
}
void frmAssistant1_FormClosed(object sender, FormClosedEventArgs e)
{
txtAssistant1.Text = "";
if (frmAssistant1.SelectPersonData.Count > 0)
{
SelectAssistant1Data = frmAssistant1.SelectPersonData;
foreach (int RowId in frmAssistant1.SelectPersonData)
{
txtAssistant1.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtAssistant1.Text.LastIndexOf(" ,");
txtAssistant1.Text = txtAssistant1.Text.Substring(0, idxStart);
}
}
private void txtAssistant2_Click(object sender, EventArgs e)
{
frmAssistant2 = new PublicUI.UI.frmSelectPerson();
frmAssistant2.PersonType = "医生";
frmAssistant2.SelectDepartmentName = cboApplyDepId.Text;
frmAssistant2.SelectPersonData = SelectAssistant2Data;
frmAssistant2.FormClosed += new FormClosedEventHandler(frmAssistant2_FormClosed);
frmAssistant2.ShowDialog();
}
void frmAssistant2_FormClosed(object sender, FormClosedEventArgs e)
{
txtAssistant2.Text = "";
if (frmAssistant2.SelectPersonData.Count > 0)
{
SelectAssistant2Data = frmAssistant2.SelectPersonData;
foreach (int RowId in frmAssistant2.SelectPersonData)
{
txtAssistant2.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtAssistant2.Text.LastIndexOf(" ,");
txtAssistant2.Text = txtAssistant2.Text.Substring(0, idxStart);
}
}
private void txtAssistant3_Click(object sender, EventArgs e)
{
frmAssistant3 = new PublicUI.UI.frmSelectPerson();
frmAssistant3.PersonType = "医生";
frmAssistant3.SelectDepartmentName = cboApplyDepId.Text;
frmAssistant3.SelectPersonData = SelectAssistant3Data;
frmAssistant3.FormClosed += new FormClosedEventHandler(frmAssistant3_FormClosed);
frmAssistant3.ShowDialog();
}
void frmAssistant3_FormClosed(object sender, FormClosedEventArgs e)
{
txtAssistant3.Text = "";
if (frmAssistant3.SelectPersonData.Count > 0)
{
SelectAssistant3Data = frmAssistant3.SelectPersonData;
foreach (int RowId in frmAssistant3.SelectPersonData)
{
txtAssistant3.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtAssistant3.Text.LastIndexOf(" ,");
txtAssistant3.Text = txtAssistant3.Text.Substring(0, idxStart);
}
}
private void rdbIsPlanReturnOperation_CheckedChanged(object sender, EventArgs e)
{
if (rdbIsPlanReturnOperation.Checked)
{
rdbIsPlanReturnOperation.Checked = true;
rdbIsNotPlanReturnOperation.Checked = false;
}
}
private void rdbIsNotPlanReturnOperation_CheckedChanged(object sender, EventArgs e)
{
if (rdbIsNotPlanReturnOperation.Checked)
{
rdbIsPlanReturnOperation.Checked = false;
rdbIsNotPlanReturnOperation.Checked = true;
}
}
#endregion
private void tsbExit_Click(object sender, EventArgs e)
{
Close();
}
private void tsbCancel_Click(object sender, EventArgs e)
{
ControlExtension.ClearControl(panel1);
SelectDiseaseData.Clear();
SelectOperationData.Clear();
SelectOperationCutTypeData.Clear();
SelectOperationPositionData.Clear();
SelectAnaesthesiaMethodData.Clear();
SelectContagionData.Clear();
SelectOperationDoctor.Clear();
SelectAssistant1Data.Clear();
SelectAssistant2Data.Clear();
SelectAssistant3Data.Clear();
txtMdrecNo.Select();
cboApplyDepId.Text = BDepartment.SelectSingle(AIMSExtension.PublicMethod.DepId).Name;
}
private void tsbSava_Click(object sender, EventArgs e)
{
if (ValidInput())
{
if (this.chbIsReturnOperation.Checked)
{
if (!this.rdbIsPlanReturnOperation.Checked && !this.rdbIsNotPlanReturnOperation.Checked)
{
MessageBox.Show("请选择重返再手术类型,重返再手术类型不能为空!", "系统提示");
}
}
OrisPatient Oris_PatientObj = new OrisPatient();
if (State == AIMSExtension.EditState.EDIT)
{
Oris_PatientObj = EditOris_PatientObj;
}
Oris_PatientObj.PatientType = cboPatientType.Text.Trim();
Oris_PatientObj.MdrecNo = txtMdrecNo.Text.Trim();
Oris_PatientObj.ArchivesNo = txtArchivesNo.Text.Trim();
Oris_PatientObj.Name = txtName.Text.Trim();
Oris_PatientObj.Sex = cboSex.Text.Trim();
Oris_PatientObj.BirthDay = DateTime.Parse(dtpBirthDay.Value.ToString("yyyy-MM-dd"));
Oris_PatientObj.Age = PublicMethod.GetAge(Oris_PatientObj.BirthDay.Value);
Oris_PatientObj.Height = txtHeight.Text.Trim();
Oris_PatientObj.Weight = txtWeight.Text.Trim();
Oris_PatientObj.DepId = int.Parse(cboDepartment.SelectedValue.ToString());
Oris_PatientObj.Illdistrict = txtIlldistrict.Text.Trim();
Oris_PatientObj.SickBed = txtSickBed.Text.Trim();
Oris_PatientObj.BloodType = cboBloodType.Text.Trim();
Oris_PatientObj.RHBloodType = cboRHBloodType.Text.Trim();
Oris_PatientObj.PatientKind = cboPatientKind.Text.Trim();
Oris_PatientObj.InHosDate = DateTime.Parse(dtpInHosDate.Value.ToString("yyyy-MM-dd"));
Oris_PatientObj.IdentityCard = txtIdentityCard.Text.Trim();
Oris_PatientObj.Contacts = txtContacts.Text.Trim();
Oris_PatientObj.ContactsPhone = txtContactsPhone.Text.Trim();
Oris_PatientObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
Oris_PatientObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
Oris_PatientObj.OperateDate = AIMSExtension.PublicMethod.SystemDate();
OperationApply OperationApplyObj = new OperationApply();
if (State == AIMSExtension.EditState.EDIT)
{
OperationApplyObj = EditOperationApplyObj;
}
OperationApplyObj.ApplyDepId = int.Parse(cboApplyDepId.SelectedValue.ToString());
if (rboJZ.Checked == true)
{
OperationApplyObj.OperationType = "急诊";
}
if (rboRJ.Checked == true)
{
OperationApplyObj.OperationType = "日间";
}
if (rboZQ.Checked == true)
{
OperationApplyObj.OperationType = "择期";
}
if (State == AIMSExtension.EditState.ADD || OperationApplyObj.State <= 5)
OperationApplyObj.OrderOperationTime = DateTime.Parse(dtpOrderOperationTime.Value.ToString("yyyy-MM-dd HH:mm"));
//if (txtOperationTimeLeight.Text != "")
// OperationApplyObj.OperationTimeLeight = int.Parse(txtOperationTimeLeight.Text);
//else
OperationApplyObj.OperationTimeLeight = 0;
OperationApplyObj.IsReturnOperation = chbIsReturnOperation.Checked ? 1 : 0;
OperationApplyObj.IsPlanReturnOperation = rdbIsPlanReturnOperation.Checked ? 1 : 0;
OperationApplyObj.IsNotPlanReturnOperation = rdbIsNotPlanReturnOperation.Checked ? 1 : 0;
OperationApplyObj.DiagnoseRemark = "";
OperationApplyObj.OperationRemark = txtOperationRemark.Text.Trim();
if (cboOperationLevel.SelectedValue != null && cboOperationLevel.SelectedValue.ToString() != "")
OperationApplyObj.OperationLevelId = int.Parse(cboOperationLevel.SelectedValue.ToString());
OperationApplyObj.Contagion = txtContagion.Text.Trim();
OperationApplyObj.Intern = txtIntern.Text.Trim();
//OperationApplyObj.Other = txtOther.Text.Trim();
OperationApplyObj.Remark = "";
OperationApplyObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
OperationApplyObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
OperationApplyObj.OperateDate = AIMSExtension.PublicMethod.SystemDate();
if(OperationApplyObj.OperationSite==null || OperationApplyObj.OperationSite=="")
OperationApplyObj.OperationSite = "手术室";
try
{
if (State == AIMSExtension.EditState.ADD)
{
//if (MessageBox.Show("您确定要提交手术申请吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
//{
OperationApplyObj.ApplyTime = AIMSExtension.PublicMethod.SystemDate();
OperationApplyObj.ApplyOperatorNo = AIMSExtension.PublicMethod.OperatorNo;
//做是否审核判断
if (sysPass.IsValid == 1 && sysPass.Value == "1")
OperationApplyObj.State = 1;
else
OperationApplyObj.State = 2;
HelperDB.DbHelperSQL.BeginTrans();
BOrisPatient.Add(Oris_PatientObj);
OperationApplyObj.OrisPatientId = BOrisPatient.GetOris_PatientMaxId();
BOperationApply.Add(OperationApplyObj);
SaveSelectItem(BOperationApply.GetOperationApplyMaxId(), OperationApplyObj.OperateDate.Value);
HelperDB.DbHelperSQL.CommitTrans();
MessageBox.Show("提交成功!", "系统提示");
Close();
//}
}
if (State == AIMSExtension.EditState.EDIT)
{
//if (MessageBox.Show("您确定要修改(住院号:" + Oris_PatientObj.MdrecNo + " 患者姓名:" + Oris_PatientObj.Name + ")手术申请吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
//{
HelperDB.DbHelperSQL.BeginTrans();
if (OperationApplyObj.PlanOperationTime != null && OperationApplyObj.PlanOperationTime.Value.Year != 1 && OperationApplyObj.State <= 5)
if (OperationApplyObj.OrderOperationTime.Value.Day != OperationApplyObj.PlanOperationTime.Value.Day)
{
OperationApplyObj.PlanOperationTime = OperationApplyObj.OrderOperationTime.Value;
OperationApplyObj.PlanOrder = BOperationApply.GetMaxPlanOrder(OperationApplyObj.PlanOperationTime.Value, OperationApplyObj.OperationRoomId.Value) + 1;
}
BOrisPatient.Update(Oris_PatientObj);
BOperationApply.Update(OperationApplyObj);
SaveSelectItem(EditApplyId, OperationApplyObj.OperateDate.Value);
HelperDB.DbHelperSQL.CommitTrans();
MessageBox.Show("修改成功!", "系统提示");
Close();
//}
}
}
catch (Exception ex)
{
HelperDB.DbHelperSQL.RollbackTrans();
MessageBox.Show(ex.Message);
}
}
}
private void SaveSelectItem(int OperationApplyId, DateTime OperateDate)
{
//诊断
ApplyDiagnoseInfo ApplyDiagnoseInfoObj = new ApplyDiagnoseInfo();
BApplyDiagnoseInfo.Delete(OperationApplyId);
foreach (int DiseaseId in SelectDiseaseData)
{
ApplyDiagnoseInfoObj.OperationApplyId = OperationApplyId;
ApplyDiagnoseInfoObj.DiagnoseId = DiseaseId;
ApplyDiagnoseInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyDiagnoseInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyDiagnoseInfoObj.OperateDate = OperateDate;
BApplyDiagnoseInfo.Add(ApplyDiagnoseInfoObj);
}
//手术
BApplyOperationInfo.Delete(OperationApplyId);
if (txtOperation.Tag != null && txtOperation.Text != "")
{
ApplyOperationInfo ApplyOperationInfoObj = new ApplyOperationInfo();
ApplyOperationInfoObj.OperationApplyId = OperationApplyId;
ApplyOperationInfoObj.OperationId = int.Parse(txtOperation.Tag.ToString());
ApplyOperationInfoObj.OperationName = txtLeft.Text + txtOperation.Text + txtRight.Text;
ApplyOperationInfoObj.LeftRemark = txtLeft.Text;
ApplyOperationInfoObj.RightRemark = txtRight.Text;
ApplyOperationInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationInfoObj.OperateDate = OperateDate;
BApplyOperationInfo.Add(ApplyOperationInfoObj);
}
if (txtOperation2.Tag != null && txtOperation2.Text != "")
{
ApplyOperationInfo ApplyOperationInfoObj = new ApplyOperationInfo();
ApplyOperationInfoObj.OperationApplyId = OperationApplyId;
ApplyOperationInfoObj.OperationId = int.Parse(txtOperation2.Tag.ToString());
ApplyOperationInfoObj.OperationName = txtLeft2.Text + txtOperation2.Text + txtRight2.Text;
ApplyOperationInfoObj.LeftRemark = txtLeft2.Text;
ApplyOperationInfoObj.RightRemark = txtRight2.Text;
ApplyOperationInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationInfoObj.OperateDate = OperateDate;
BApplyOperationInfo.Add(ApplyOperationInfoObj);
}
if (txtOperation3.Tag != null && txtOperation3.Text != "")
{
ApplyOperationInfo ApplyOperationInfoObj = new ApplyOperationInfo();
ApplyOperationInfoObj.OperationApplyId = OperationApplyId;
ApplyOperationInfoObj.OperationId = int.Parse(txtOperation3.Tag.ToString());
ApplyOperationInfoObj.OperationName = txtLeft3.Text + txtOperation3.Text + txtRight3.Text;
ApplyOperationInfoObj.LeftRemark = txtLeft3.Text;
ApplyOperationInfoObj.RightRemark = txtRight3.Text;
ApplyOperationInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationInfoObj.OperateDate = OperateDate;
BApplyOperationInfo.Add(ApplyOperationInfoObj);
}
if (txtOperation4.Tag != null && txtOperation4.Text != "")
{
ApplyOperationInfo ApplyOperationInfoObj = new ApplyOperationInfo();
ApplyOperationInfoObj.OperationApplyId = OperationApplyId;
ApplyOperationInfoObj.OperationId = int.Parse(txtOperation4.Tag.ToString());
ApplyOperationInfoObj.OperationName = txtLeft4.Text + txtOperation4.Text + txtRight4.Text;
ApplyOperationInfoObj.LeftRemark = txtLeft4.Text;
ApplyOperationInfoObj.RightRemark = txtRight4.Text;
ApplyOperationInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationInfoObj.OperateDate = OperateDate;
BApplyOperationInfo.Add(ApplyOperationInfoObj);
}
if (txtOperation5.Tag != null && txtOperation5.Text != "")
{
ApplyOperationInfo ApplyOperationInfoObj = new ApplyOperationInfo();
ApplyOperationInfoObj.OperationApplyId = OperationApplyId;
ApplyOperationInfoObj.OperationId = int.Parse(txtOperation5.Tag.ToString());
ApplyOperationInfoObj.OperationName = txtLeft5.Text + txtOperation5.Text + txtRight5.Text;
ApplyOperationInfoObj.LeftRemark = txtLeft5.Text;
ApplyOperationInfoObj.RightRemark = txtRight5.Text;
ApplyOperationInfoObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationInfoObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationInfoObj.OperateDate = OperateDate;
BApplyOperationInfo.Add(ApplyOperationInfoObj);
}
//切口类型
ApplyOperationCutType ApplyOperationCutTypeObj = new ApplyOperationCutType();
BApplyOperationCutType.Delete(OperationApplyId);
foreach (int OperationCutTypeId in SelectOperationCutTypeData)
{
ApplyOperationCutTypeObj.OperationApplyId = OperationApplyId;
ApplyOperationCutTypeObj.OperationCutTypeId = OperationCutTypeId;
ApplyOperationCutTypeObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationCutTypeObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationCutTypeObj.OperateDate = OperateDate;
BApplyOperationCutType.Add(ApplyOperationCutTypeObj);
}
//手术部位
ApplyOperationPosition ApplyOperationPositionObj = new ApplyOperationPosition();
BApplyOperationPosition.Delete(OperationApplyId);
foreach (int OperationPositionId in SelectOperationPositionData)
{
ApplyOperationPositionObj.OperationApplyId = OperationApplyId;
ApplyOperationPositionObj.OperationPositionId = OperationPositionId;
ApplyOperationPositionObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyOperationPositionObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyOperationPositionObj.OperateDate = OperateDate;
BApplyOperationPosition.Add(ApplyOperationPositionObj);
}
//拟施麻醉
ApplyAnaesthesiaMethod ApplyAnaesthesiaMethodObj = new ApplyAnaesthesiaMethod();
BApplyAnaesthesiaMethod.Delete(OperationApplyId);
foreach (int AnaesthesiaMethodId in SelectAnaesthesiaMethodData)
{
ApplyAnaesthesiaMethodObj.OperationApplyId = OperationApplyId;
ApplyAnaesthesiaMethodObj.AnaesthesiaMethodId = AnaesthesiaMethodId;
ApplyAnaesthesiaMethodObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyAnaesthesiaMethodObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyAnaesthesiaMethodObj.OperateDate = OperateDate;
BApplyAnaesthesiaMethod.Add(ApplyAnaesthesiaMethodObj);
}
//术者
ApplyPersonDuty ApplyPersonDutyOperationDoctor = new ApplyPersonDuty();
BApplyPersonDuty.Delete(OperationApplyId, 1);
foreach (int PersonId in SelectOperationDoctor)
{
ApplyPersonDutyOperationDoctor.OperationApplyId = OperationApplyId;
ApplyPersonDutyOperationDoctor.PersonDutyId = 1; // 1 术者
ApplyPersonDutyOperationDoctor.PersonId = PersonId;
ApplyPersonDutyOperationDoctor.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyPersonDutyOperationDoctor.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyPersonDutyOperationDoctor.OperateDate = OperateDate;
BApplyPersonDuty.Add(ApplyPersonDutyOperationDoctor);
}
//一助
ApplyPersonDuty ApplyPersonDutyAssistant1 = new ApplyPersonDuty();
BApplyPersonDuty.Delete(OperationApplyId, 2);
foreach (int PersonId in SelectAssistant1Data)
{
ApplyPersonDutyAssistant1.OperationApplyId = OperationApplyId;
ApplyPersonDutyAssistant1.PersonDutyId = 2; // 2 一助
ApplyPersonDutyAssistant1.PersonId = PersonId;
ApplyPersonDutyAssistant1.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyPersonDutyAssistant1.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyPersonDutyAssistant1.OperateDate = OperateDate;
BApplyPersonDuty.Add(ApplyPersonDutyAssistant1);
}
//二助
ApplyPersonDuty ApplyPersonDutyAssistant2 = new ApplyPersonDuty();
BApplyPersonDuty.Delete(OperationApplyId, 3);
foreach (int PersonId in SelectAssistant2Data)
{
ApplyPersonDutyAssistant2.OperationApplyId = OperationApplyId;
ApplyPersonDutyAssistant2.PersonDutyId = 3; // 3 二助
ApplyPersonDutyAssistant2.PersonId = PersonId;
ApplyPersonDutyAssistant2.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyPersonDutyAssistant2.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyPersonDutyAssistant2.OperateDate = OperateDate;
BApplyPersonDuty.Add(ApplyPersonDutyAssistant2);
}
//
ApplyPersonDuty ApplyPersonDutyAssistant3 = new ApplyPersonDuty();
BApplyPersonDuty.Delete(OperationApplyId, 4);
foreach (int PersonId in SelectAssistant3Data)
{
ApplyPersonDutyAssistant3.OperationApplyId = OperationApplyId;
ApplyPersonDutyAssistant3.PersonDutyId = 4; // 4 三助
ApplyPersonDutyAssistant3.PersonId = PersonId;
ApplyPersonDutyAssistant3.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
ApplyPersonDutyAssistant3.OperatorName = AIMSExtension.PublicMethod.OperatorName;
ApplyPersonDutyAssistant3.OperateDate = OperateDate;
BApplyPersonDuty.Add(ApplyPersonDutyAssistant3);
}
}
private bool ValidInput()
{
bool result = false;
if (this.txtMdrecNo.Text.Trim().Length < 1)
{
MessageBox.Show("住院号不能为空!");
}
else if (txtArchivesNo.Text.Trim().Length < 1)
{
MessageBox.Show("病历号不能为空!");
}
else if (txtName.Text.Trim().Length < 1)
{
MessageBox.Show("患者姓名不能为空!");
}
else if (cboSex.Text.Trim().Length < 1)
{
MessageBox.Show("性别不能为空!");
}
//else if (txtSickBed.Text.Trim().Length < 1)
//{
// MessageBox.Show("床位不能为空!");
//}
else if (cboDepartment.Text.Trim().Length < 1)
{
MessageBox.Show("所在科室不能为空!");
}
else if (cboApplyDepId.Text.Trim().Length < 1)
{
MessageBox.Show("申请科室不能为空!");
}
else if (rboZQ.Checked == false && rboJZ.Checked == false && rboRJ.Checked == false)
{
MessageBox.Show("请选择择期或急诊或日间", "系统提示");
}
else if (SelectDiseaseData.Count < 1)
{
MessageBox.Show("诊断不能为空!");
}
else if (txtOperation.Text == "")
{
MessageBox.Show("拟施手术不能为空!");
}
//else if (cboOperationLevel.Text.Trim().Length < 1)
//{
// MessageBox.Show("手术分级不能为空!");
//}
//else if (SelectOperationCutTypeData.Count < 1)
//{
// MessageBox.Show("切口类型不能为空!");
//}
//else if (SelectOperationPositionData.Count < 1)
//{
// MessageBox.Show("手术部位不能为空!");
//}
else if (SelectAnaesthesiaMethodData.Count < 1)
{
MessageBox.Show("拟施麻醉不能为空!");
}
else if (SelectOperationDoctor.Count < 1)
{
MessageBox.Show("术者不能为空!");
}
else
{
result = true;
}
return result;
}
private void txtDisease_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtOperation_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtOperationCutType_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtOperationPosition_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtAnaesthesiaMethod_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtOperationDoctor_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtAssistant1_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtAssistant2_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void txtAssistant3_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void cboApplyDepId_SelectedIndexChanged(object sender, EventArgs e)
{
//cboDepartment.Text = cboApplyDepId.Text;
}
private void cboDepartment_SelectedIndexChanged(object sender, EventArgs e)
{
//cboApplyDepId.Text = cboDepartment.Text;
}
private void btnDR_Click(object sender, EventArgs e)
{
try
{
if (PublicMethod.HospitalName.Contains("屯留"))
{
string sqlStr = string.Format("select * from AIMS_PATIENT where IPD_NO like '%{0}%'", txtMdrecNo.Text);
DataTable dt = null;
dt = HisDBHelper.GetDataTable(sqlStr);
if (dt != null && dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
txtArchivesNo.Text = row["PATIENT_ID"].ToString();//HIS患者ID
cboDepartment.Text = row["PATIENT_SECTION_NAME"].ToString(); //申请手术科室编码
cboApplyDepId.Text = row["PATIENT_SECTION_NAME"].ToString(); //申请手术科室编码
txtName.Text = row["PATIENT_NAME"].ToString();
cboSex.Text = row["PATIENT_SEX"].ToString();
try
{
dtpBirthDay.Value = Convert.ToDateTime(row["PATIENT_BIRTH"].ToString());
if (row["PATIENT_HEIGHT"].ToString() != "") txtHeight.Text = Convert.ToDecimal(row["PATIENT_HEIGHT"].ToString()).ToString();
if (row["PATIENT_WEIGHT"].ToString() != "") txtWeight.Text = Convert.ToDecimal(row["PATIENT_WEIGHT"].ToString()).ToString();
}
catch (Exception)
{
}
cboBloodType.Text = row["PATINET_BLOODTYPE"].ToString();
cboRHBloodType.Text = row["PATINET_BLOODTYPE_RH"].ToString();
txtIdentityCard.Text = row["IDNO"].ToString();
cboPatientKind.Text = row["PATIENT_CHARGE_TYPE"].ToString();
txtIlldistrict.Text = row["ROOM_NO"].ToString();
txtSickBed.Text = row["PATIENT_BED"].ToString();
//patient.ADDRESS = row["PATIENT_ADDRESS"].ToString();
txtContacts.Text = row["PATIENT_CONTACTOR"].ToString();
txtContactsPhone.Text = row["PATIENT_CONTACTOR_PHONE"].ToString();
dtpInHosDate.Value = Convert.ToDateTime(row["INHOSPITALTIME"].ToString());
rboZQ.Checked = true;
}
else
{
MessageBox.Show("未找到该患者信息!");
}
}
else if (PublicMethod.HospitalName.Contains("秦皇岛"))
{
string sqlStr = string.Format("select * from AIMS_PATIENTS where IPD_NO like '%{0}%'", txtMdrecNo.Text);
DataTable dt = null;
dt = HisDBHelper.GetDataTable(sqlStr);
if (dt != null && dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
txtArchivesNo.Text = row["PATIENT_ID"].ToString();//HIS患者ID
cboDepartment.Text = row["AREA_NAME"].ToString(); //申请手术科室编码
cboApplyDepId.Text = row["AREA_NAME"].ToString(); //申请手术科室编码
txtName.Text = row["PATIENT_NAME"].ToString();
cboSex.Text = row["PATIENT_SEX"].ToString();
try
{
dtpBirthDay.Value = Convert.ToDateTime(row["PATIENT_BIRTH"].ToString());
if (row["PATIENT_HEIGHT"].ToString() != "") txtHeight.Text = Convert.ToDecimal(row["PATIENT_HEIGHT"].ToString()).ToString();
if (row["PATIENT_WEIGHT"].ToString() != "") txtWeight.Text = Convert.ToDecimal(row["PATIENT_WEIGHT"].ToString()).ToString();
}
catch (Exception)
{
}
cboBloodType.Text = row["PATINET_BLOODTYPE"].ToString();
cboRHBloodType.Text = row["PATINET_BLOODTYPE_RH"].ToString();
txtIdentityCard.Text = row["IDNO"].ToString();
cboPatientKind.Text = row["PATIENT_CHARGE_TYPE"].ToString();
txtIlldistrict.Text = row["ROOM_NO"].ToString();
txtSickBed.Text = row["PATIENT_BED"].ToString();
//patient.ADDRESS = row["PATIENT_ADDRESS"].ToString();
txtContacts.Text = row["PATIENT_CONTACTOR"].ToString();
txtContactsPhone.Text = row["PATIENT_CONTACTOR_PHONE"].ToString();
dtpInHosDate.Value = Convert.ToDateTime(row["INHOSPITALTIME"].ToString());
rboZQ.Checked = true;
}
}
else if (PublicMethod.HospitalName.Contains("大连市金州区中医医院"))
{
string sqlStr = string.Format("select * from AIMS_PATIENTS where IPD_NO like '%{0}%'", txtMdrecNo.Text);
DataTable dt = null;
dt = HisDBHelper.GetDataTable(sqlStr);
if (dt != null && dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
txtArchivesNo.Text = row["IPD_NO"].ToString();//HIS患者ID
cboDepartment.Text = row["名称"].ToString(); //申请手术科室编码
cboApplyDepId.Text = row["名称"].ToString(); //申请手术科室编码
txtName.Text = row["PATIENT_NAME"].ToString();
cboSex.Text = row["PATIENT_SEX"].ToString();
try
{
dtpBirthDay.Value = Convert.ToDateTime(row["PATIENT_BIRTH"].ToString());
if (row["PATIENT_HEIGHT"].ToString() != "") txtHeight.Text = Convert.ToDecimal(row["PATIENT_HEIGHT"].ToString()).ToString();
if (row["PATIENT_WEIGHT"].ToString() != "") txtWeight.Text = Convert.ToDecimal(row["PATIENT_WEIGHT"].ToString()).ToString();
}
catch (Exception)
{
}
cboBloodType.Text = row["PATINET_BLOODTYPE"].ToString();
cboRHBloodType.Text = row["PATINET_BLOODTYPE_RH"].ToString();
txtIdentityCard.Text = row["IDNO"].ToString();
cboPatientKind.Text = row["PATIENT_CHARGE_TYPE"].ToString();
txtIlldistrict.Text = row["WARD_NO"].ToString();
txtSickBed.Text = row["ROOM_NO"].ToString();
//patient.ADDRESS = row["PATIENT_ADDRESS"].ToString();
txtContacts.Text = row["PATIENT_CONTACTOR"].ToString();
txtContactsPhone.Text = row["PATIENT_CONTACTOR_PHONE"].ToString();
dtpInHosDate.Value = Convert.ToDateTime(row["INHOSPITALTIME"].ToString());
rboZQ.Checked = true;
}
}
else if (PublicMethod.HospitalName.Contains("漳浦"))
{
string sqlStr = string.Format("select * from AIMS_PATIENTS where IPD_NO like '%{0}%'", txtMdrecNo.Text);
DataTable dt = null;
dt = PGDBHelper.GetDataTable(sqlStr);
if (dt != null && dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
txtArchivesNo.Text = row["IPD_NO"].ToString();//HIS患者ID
cboDepartment.Text = row["department_name"].ToString(); //申请手术科室编码
cboApplyDepId.Text = row["department_name"].ToString(); //申请手术科室编码
txtName.Text = row["PATIENT_NAME"].ToString();
cboSex.Text = row["PATIENT_SEX"].ToString();
try
{
dtpBirthDay.Value = Convert.ToDateTime(row["PATIENT_BIRTH"].ToString());
if (row["PATIENT_HEIGHT"].ToString() != "") txtHeight.Text = Convert.ToDecimal(row["PATIENT_HEIGHT"].ToString()).ToString();
if (row["PATIENT_WEIGHT"].ToString() != "") txtWeight.Text = Convert.ToDecimal(row["PATIENT_WEIGHT"].ToString()).ToString();
}
catch (Exception)
{
}
cboBloodType.Text = row["PATINET_BLOODTYPE"].ToString();
cboRHBloodType.Text = row["PATINET_BLOODTYPE_RH"].ToString();
txtIdentityCard.Text = row["IDNO"].ToString();
cboPatientKind.Text = row["PATIENT_CHARGE_TYPE"].ToString();
txtIlldistrict.Text = row["WARD_NO"].ToString();
txtSickBed.Text = row["ROOM_NO"].ToString();
//patient.ADDRESS = row["PATIENT_ADDRESS"].ToString();
txtContacts.Text = row["PATIENT_CONTACTOR"].ToString();
txtContactsPhone.Text = row["PATIENT_CONTACTOR_PHONE"].ToString();
dtpInHosDate.Value = Convert.ToDateTime(row["INHOSPITALTIME"].ToString());
rboZQ.Checked = true;
}
}
else
{
MessageBox.Show("未找到该患者信息!");
}
}
catch (Exception ex)
{
MessageBox.Show("导入患者出错! " + ex.Message + ex.StackTrace);
}
}
private void rboZQ_CheckedChanged(object sender, EventArgs e)
{
if (rboJZ.Checked == true || rboRJ.Checked == true)
{
dtpOrderOperationTime.Text = DateTime.Now.AddMinutes(1).ToString("yyyy-MM-dd HH:mm");
}
else
{
dtpOrderOperationTime.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd HH:mm");
}
}
}
}