⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 procnephrectomiesform.ascx.cs

📁 医疗决策支持系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace Caisis.UI.Modules.Kidney.DataEntryForms
{
	using System;
	using System.Data;
	using System.Data.SqlClient;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Collections;
	using System.Collections.Specialized;

	using Caisis.Controller;
	using Caisis.DataAccess;
	using Caisis.BusinessObject;

	using System.Web.UI;

	using Caisis.UI.Core.Classes;
	using Caisis.UI.Core.Classes.CustomControls;


	public abstract class ProcNephrectomiesForm : DataEntryControl
	{

		protected HtmlInputHidden SurgeryId;
		protected HtmlInputText OpCPT_Code;
		protected HtmlInputText OpCPT_Description;
		protected ComboBox OpSurgeon;
		protected HtmlSelect OpSurgeonType;
		protected ComboBox OpAssistant;
		protected HtmlSelect OpAssistantType;
		protected HtmlSelect OpType;
		protected HtmlSelect OpTypePlanned;
		protected ComboBox OpApproach;
		protected HtmlSelect OpCaseQuality;
		protected HtmlSelect OpSide;
		protected HtmlSelect OpCompleteResectionByUS;
		protected ComboBox OpPartialReason;
		protected HtmlSelect OpPartialIschemia;
		protected HtmlSelect OpPartialIceSlush;
		protected HtmlInputText OpPartialClampStartTime;
		protected HtmlInputText OpPartialClampStopTime;
		protected HtmlInputText OpPartialClampTime;
		protected HtmlTextArea OpNotes;
		protected HtmlInputText PathNum;
		protected HtmlSelect PathExtension;
		protected ComboBox PathMarginStatus;
		protected HtmlSelect PathAdrenalInv;
		protected HtmlSelect PathAdrenalSide;
		protected HtmlSelect PathMultifocal;
		protected HtmlSelect PathStageSystem;
		protected HtmlSelect PathStageT;
		protected HtmlSelect PathStageM;
		protected HtmlSelect PathGrade;
		protected HtmlSelect PathNuclearGrade;
		protected ComboBox PathHistology;
		protected ComboBox PathPattern;
		protected HtmlInputText PathCancerMaxDim;
		protected HtmlSelect PathOtherKidney;
		protected ComboBox Pathologist;
		protected HtmlTextArea PathNotes;
		protected ComboBox PathDataSource;
		protected HtmlSelect PathQuality;
		protected HtmlInputHidden ProcNephrectomyId;

		protected HyperLink NephrectomyPathFindingsFormLink;

		protected Repeater rptTStages, rptMStages;

		protected HtmlAnchor TStagingInfoLink, MStagingInfoLink;

		private string _surgeryId = "";
		private string _saveSurgeryId = null;

		override protected void Page_Load(object sender, System.EventArgs e)
		{
			


			//populate look up and distinct value select boxes
			//PageUtil.FillLkpDropDown(OpCPT_Code, "OpCPT_Code", ViewState);
			PageUtil.FillLkpDropDown(OpSurgeonType, "OpSurgeonType", ViewState);
			PageUtil.FillLkpDropDown(OpAssistantType, "OpSurgeonType", ViewState);
			PageUtil.FillLkpDropDown(OpType, "OpTypeNephrectomy", ViewState);
			PageUtil.FillLkpDropDown(OpTypePlanned, "OpTypeNephrectomy", ViewState);
			PageUtil.FillLkpDropDown(OpCaseQuality, "DataQuality", ViewState);
			PageUtil.FillLkpDropDown(OpSide, "OpSide", ViewState);
			PageUtil.FillLkpDropDown(OpCompleteResectionByUS, "YesNoUnknown", ViewState);
			PageUtil.FillLkpDropDown(OpPartialIschemia, "YesNoUnknown", ViewState);
			PageUtil.FillLkpDropDown(OpPartialIceSlush, "OpPartialIceSlush", ViewState);
			//What field type should this be?
			PageUtil.FillLkpDropDown(PathExtension, "LocalExtensionKidney", ViewState);
			PageUtil.FillLkpDropDown(PathAdrenalInv, "PathAdrenalInv", ViewState);
			PageUtil.FillLkpDropDown(PathAdrenalSide, "PathAdrenalSide", ViewState);
			PageUtil.FillLkpDropDown(PathMultifocal, "PathMultifocal", ViewState);
			PageUtil.FillLkpDropDown(PathStageSystem, "StagingSystem", ViewState);
			PageUtil.FillLkpDropDown(PathNuclearGrade, "NephNuclearGrade", ViewState);

			SetStageSelects();

			//			PageUtil.FillLkpDropDown(PathStageT, "KidneyPathStageT", ViewState);
			//			PageUtil.FillLkpDropDown(PathStageM, "KidneyPathStageM", ViewState);
			PageUtil.FillLkpDropDown(PathGrade, "PathGrade", ViewState);
			//What field type should this be?
			PageUtil.FillLkpDropDown(PathNuclearGrade, "PathNuclearGrade", ViewState);
			PageUtil.FillLkpDropDown(PathOtherKidney, "PathHistologyKidney", ViewState);
			PageUtil.FillLkpDropDown(PathQuality, "DataQuality", ViewState);

			//create arrays that populate combo boxes
			
			Page.RegisterClientScriptBlock("OpSurgeon", PageUtil.FillComboDropDown(OpSurgeon.RefBy, "OpSurgeon"));
			Page.RegisterClientScriptBlock("OpAssistant", PageUtil.FillComboDropDown(OpAssistant.RefBy, "OpSurgeon"));
			Page.RegisterClientScriptBlock("OpApproach", PageUtil.FillComboDropDown(OpApproach.RefBy, "OpApproachNephrectomy"));
			Page.RegisterClientScriptBlock("PathHistology", PageUtil.FillComboDropDown(PathHistology.RefBy, "PathHistologyKidney"));
			Page.RegisterClientScriptBlock("Pathologist", PageUtil.FillComboDropDown(Pathologist.RefBy, "Pathologist"));
			Page.RegisterClientScriptBlock("OpPartialReason", PageUtil.FillComboDropDown(OpPartialReason.RefBy, "OpPartialReason"));
			Page.RegisterClientScriptBlock("PathMarginStatus", PageUtil.FillComboDropDown(PathMarginStatus.RefBy, "MarginStatus"));
			Page.RegisterClientScriptBlock("PathPattern", PageUtil.FillComboDropDown(PathPattern.RefBy, "PathPatternKidney"));
			Page.RegisterClientScriptBlock("PathDataSource", PageUtil.FillComboDropDown(PathDataSource.RefBy, "DataSource"));
			
			string reqFieldArray = PageUtil.CreateValidationScript("");
			Page.RegisterClientScriptBlock("requiredFieldArray", reqFieldArray);

			base.Page_Load(sender, e);
		}

	
		// override GetRecord because Nephrectomies one to many relationship to surgeries without a datagrid is a unique case
		protected override BizObject GetRecord()
		{
			string primKey = "";

			// loading form from chronological list sends "primkey" and "parentKey"
			if(Request.QueryString["primKey"] != null && !Request.QueryString["primKey"].Equals(""))
			{
				primKey = Request.QueryString["primKey"];
			}
			// loading form from breadcrumb trail on child form
			else if(Request.QueryString["nephId"] != null && !Request.QueryString["nephId"].Equals(""))
			{
				primKey = Request.QueryString["nephId"];	
			}
			// page is saved
			else if((this.GetPrimKeyField()).Value != null && (this.GetPrimKeyField()).Value != "" )
			{
				primKey = this.GetPrimKeyField().Value;
			}

			if (!primKey.Equals(""))  
			{
				int keyValue = int.Parse(primKey);
				DataEntryController ct = this.GetController();			
				BizObject bz = ct.GetRecord(keyValue);
				_surgeryId = bz.Tables[0].Rows[0][Nephrectomy.SurgeryId].ToString();		
				return bz;
							
			}
			return null;
		}

		override protected object SaveViewState()
		{
			//add select and combo boxes to view state
			
			//PageUtil.AddSelectToViewState(ViewState,OpCPT_Code);
			PageUtil.AddSelectToViewState(ViewState,OpSurgeonType);
			PageUtil.AddSelectToViewState(ViewState,OpAssistantType);
			PageUtil.AddSelectToViewState(ViewState,OpType);
			PageUtil.AddSelectToViewState(ViewState,OpTypePlanned);
			PageUtil.AddSelectToViewState(ViewState,OpCaseQuality);
			PageUtil.AddSelectToViewState(ViewState,OpSide);
			PageUtil.AddSelectToViewState(ViewState,OpCompleteResectionByUS);
			PageUtil.AddSelectToViewState(ViewState,OpPartialIschemia);
			PageUtil.AddSelectToViewState(ViewState,OpPartialIceSlush);
			PageUtil.AddSelectToViewState(ViewState,PathExtension);
			PageUtil.AddSelectToViewState(ViewState,PathAdrenalInv);
			PageUtil.AddSelectToViewState(ViewState,PathAdrenalSide);
			PageUtil.AddSelectToViewState(ViewState,PathMultifocal);
			PageUtil.AddSelectToViewState(ViewState,PathStageSystem);
			PageUtil.AddSelectToViewState(ViewState,PathStageT);
			PageUtil.AddSelectToViewState(ViewState,PathStageM);
			PageUtil.AddSelectToViewState(ViewState,PathGrade);
			PageUtil.AddSelectToViewState(ViewState,PathNuclearGrade);
			PageUtil.AddSelectToViewState(ViewState,PathOtherKidney);
			PageUtil.AddSelectToViewState(ViewState,PathQuality);
			
			PageUtil.AddComboToViewState(ViewState,OpSurgeon);
			PageUtil.AddComboToViewState(ViewState,OpAssistant);
			PageUtil.AddComboToViewState(ViewState,OpApproach);
			PageUtil.AddComboToViewState(ViewState,PathHistology);
			PageUtil.AddComboToViewState(ViewState,Pathologist);
			PageUtil.AddComboToViewState(ViewState,PathDataSource);
			PageUtil.AddComboToViewState(ViewState,OpPartialReason);
			PageUtil.AddComboToViewState(ViewState,PathMarginStatus);
			PageUtil.AddComboToViewState(ViewState,PathPattern);
			
			
			return base.SaveViewState();
		}

		override public HtmlInputHidden GetPrimKeyField()
		{
			return ProcNephrectomyId;
		}

		override protected DataEntryController GetController()
		{
			return new DataEntryController(new NephrectomyDa(), Nephrectomy.ProcNephrectomyId); //NOTE: fix args
		}

		override protected void SetDataEntryInfo() //nephrectomies is unique case due to one to many non datagrid relation with surgeries
		{
			this._tableInfo = "ProcNephrectomies";

			string surgeryId = "";

			// this is such a hack! procedures section of datamodel really need revision..
			if (!_surgeryId.Equals(""))
			{
				surgeryId = _surgeryId;
			}
			else if (Request.QueryString["parentKey"] != null)  
			{
				surgeryId = Request.QueryString["parentKey"];
			}
			else if(Request.QueryString["nephId"] !=null) // coming from subform. Need to get surgery id using nephrectomy id for use in breadcrumb trail
			{
				BizObject biz = this.GetRecord();
				surgeryId = biz.Tables[0].Rows[0][Nephrectomy.SurgeryId].ToString();
			}
			
			SurgeryId.Value = surgeryId;
			_saveSurgeryId = SurgeryId.Value;

			
			this._dataEntryTitle = "<a class=\"patientDataSectionTitle\"  href=\"DataEntryContainer.aspx?dataForm=SurgeriesForm&primKey="+surgeryId+"\">Surgeries</a> > Nephrectomies";
			
		}

		override protected BizObject GetParams()
		{
			Nephrectomy biz = new Nephrectomy();
			DataRow dr = biz.Tables[Nephrectomy.Table_ProcNephrectomies].NewRow();

			if (!ProcNephrectomyId.Value.Equals(""))
			{
				dr[Nephrectomy.ProcNephrectomyId] = ProcNephrectomyId.Value;
			}

			if(Request.QueryString["parentId"] != null && !Request.QueryString["parentId"].Equals(""))
			{
				SurgeryId.Value = Request.QueryString["parentId"];	
			}
			//selects use: Request.Form[FieldName.UniqueID].ToString();
			//dates use: PageUtil.ObjToDateTime(FieldName.Value);
			//checkbox use: if(FieldName.Checked){dr[BizObject.FieldName] = 1;}
			//Patient ID should = this.patientID
			
			dr[Nephrectomy.SurgeryId] = SurgeryId.Value;
			 
			//dr[Nephrectomy.OpCPT_Code] = Request.Form[OpCPT_Code.UniqueID].ToString();
			dr[Nephrectomy.OpCPT_Code] = OpCPT_Code.Value;
			dr[Nephrectomy.OpCPT_Description] = OpCPT_Description.Value;
			dr[Nephrectomy.OpSurgeon] = Request.Form[OpSurgeon.UniqueID].ToString();
			dr[Nephrectomy.OpSurgeonType] = Request.Form[OpSurgeonType.UniqueID].ToString();
			dr[Nephrectomy.OpAssistant] = Request.Form[OpAssistant.UniqueID].ToString();
			dr[Nephrectomy.OpAssistantType] = Request.Form[OpAssistantType.UniqueID].ToString();
			dr[Nephrectomy.OpType] = Request.Form[OpType.UniqueID].ToString();
			dr[Nephrectomy.OpTypePlanned] = Request.Form[OpTypePlanned.UniqueID].ToString();
			dr[Nephrectomy.OpApproach] = Request.Form[OpApproach.UniqueID].ToString();
			dr[Nephrectomy.OpCaseQuality] = Request.Form[OpCaseQuality.UniqueID].ToString();
			dr[Nephrectomy.OpSide] = Request.Form[OpSide.UniqueID].ToString();
			dr[Nephrectomy.OpCompleteResectionByUS] = Request.Form[OpCompleteResectionByUS.UniqueID].ToString();
			dr[Nephrectomy.OpPartialReason] = Request.Form[OpPartialReason.UniqueID].ToString();
			dr[Nephrectomy.OpPartialIschemia] = Request.Form[OpPartialIschemia.UniqueID].ToString();
			dr[Nephrectomy.OpPartialIceSlush] = Request.Form[OpPartialIceSlush.UniqueID].ToString();
			dr[Nephrectomy.OpPartialClampStartTime] = OpPartialClampStartTime.Value;
			dr[Nephrectomy.OpPartialClampStopTime] = OpPartialClampStopTime.Value;
			dr[Nephrectomy.OpPartialClampTime] = OpPartialClampTime.Value;
			dr[Nephrectomy.OpNotes] = OpNotes.Value;
			dr[Nephrectomy.PathNum] = PathNum.Value;
			dr[Nephrectomy.PathExtension] = Request.Form[PathExtension.UniqueID].ToString();
			dr[Nephrectomy.PathMarginStatus] = Request.Form[PathMarginStatus.UniqueID].ToString();
			dr[Nephrectomy.PathAdrenalInv] = Request.Form[PathAdrenalInv.UniqueID].ToString();
			dr[Nephrectomy.PathAdrenalSide] = Request.Form[PathAdrenalSide.UniqueID].ToString();
			dr[Nephrectomy.PathMultifocal] = Request.Form[PathMultifocal.UniqueID].ToString();
			dr[Nephrectomy.PathStageSystem] = Request.Form[PathStageSystem.UniqueID].ToString();

			if (Request.Form[PathStageT.UniqueID] != null && Request.Form[PathStageT.UniqueID].ToString() != "")
			{
				dr[Nephrectomy.PathStageT] = Request.Form[PathStageT.UniqueID].ToString();
			}
			if (Request.Form[PathStageM.UniqueID] != null && Request.Form[PathStageM.UniqueID].ToString() != "")
			{
				dr[Nephrectomy.PathStageM] = Request.Form[PathStageM.UniqueID].ToString();
			}

			dr[Nephrectomy.PathGrade] = Request.Form[PathGrade.UniqueID].ToString();
			dr[Nephrectomy.PathNuclearGrade] = Request.Form[PathNuclearGrade.UniqueID].ToString();
			dr[Nephrectomy.PathHistology] = Request.Form[PathHistology.UniqueID].ToString();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -