📄 prostatehpi.ascx.cs
字号:
namespace Caisis.UI.Modules.Prostate.Eforms
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Collections;
using Caisis.BusinessObject;
using Caisis.UI.Core.Classes;
using Caisis.UI.Modules.Prostate.PaperForms;
using Caisis.DataAccess;
/// <summary>
/// Summary description for ProstateHPI.
/// </summary>
public class ProstateHPI : BaseEFormControl
{
protected Repeater hpi;
protected Label preRPNomo, preXRTNomo, preBrachyNomo, postRP7yrNomo, PreTxPot, NVB_Left, NVB_Right;
protected Literal NoHPIMsg;
protected HtmlTableRow PreTxPotencyTr, NvbRightTr, NvbLeftTr;
override protected void Page_Load(object sender, System.EventArgs e)
{
base.Page_Load(sender, e);
BuildHPI();
BuildHpiProstatectomies(this._patientId, this._eformName, "Dynamic");
PopulateHPIPreTxPotency();
BuildHpiProtocols(this._patientId, this._eformName, "Dynamic");
BuildHpiBiopsies(this._patientId, this._eformName, "Dynamic", hpiBiopsyId);
BuildHPINerveStatus();
}
protected void BuildHPI()
{
try
{
PatientDa hpiDa = new PatientDa();
DataSet hpiDs = hpiDa.GetPatientHPIForEForm(this._patientId, 1, 1, 1);
if (hpiDs.Tables[0].Rows.Count > 0)
{
hpi.DataSource = hpiDs.Tables[0].DefaultView;
hpi.DataBind();
}
else
{
NoHPIMsg.Visible = true;
}
//nomograms are in a second result set
preRPNomo.Text = hpiDs.Tables[1].Rows[0]["preRPNomo"].ToString();
preXRTNomo.Text = hpiDs.Tables[1].Rows[0]["preXRTNomo"].ToString();
preBrachyNomo.Text = hpiDs.Tables[1].Rows[0]["preBrachyNomo"].ToString();
postRP7yrNomo.Text = hpiDs.Tables[1].Rows[0]["postRP7yrNomo"].ToString();
if (hpiDs.Tables[1].Rows[0]["DxBiopsyId"] != null && hpiDs.Tables[1].Rows[0]["DxBiopsyId"].ToString().Length > 0)
{
hpiBiopsyId = (int)hpiDs.Tables[1].Rows[0]["DxBiopsyId"];
}
string PreRPError, PreXRTError, PreBrachyError, PostRPError;
PreRPError = hpiDs.Tables[1].Rows[0]["PreRPError"].ToString();
PreXRTError = hpiDs.Tables[1].Rows[0]["PreXRTError"].ToString();
PreBrachyError = hpiDs.Tables[1].Rows[0]["PreBrachyError"].ToString();
PostRPError = hpiDs.Tables[1].Rows[0]["PostRPError"].ToString();
if (PreRPError != null && PreRPError.Length > 0)
{
// preRPNomo.ToolTip = PreRPError;
// preRPNomo.Attributes.Add("style", "cursor:hand;");
preRPNomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\"> " + PreRPError;
// old:with error displayed all the time
//NomogramError.Text += "<strong>* Cannot calculate PreRP:</strong> " + PreRPError + "<br/>";
//preRPNomo.Text += "*";
}
if (PreXRTError != null && PreXRTError.Length > 0)
{
if (PreXRTError == "No XRT noted.")
{
preXRTNomo.Text = "No XRT";
}
else
{
// preXRTNomo.ToolTip = PreXRTError;
// preXRTNomo.Attributes.Add("style", "cursor:hand;");
preXRTNomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\"> " + PreXRTError;
// old:with error displayed all the time
//NomogramError.Text += "<strong>** Cannot calculate PreXRT:</strong> " + PreXRTError + "<br/>";
//preXRTNomo.Text += "**";
}
}
if (PreBrachyError != null && PreBrachyError.Length > 0)
{
// preBrachyNomo.ToolTip = PreBrachyError;
// preBrachyNomo.Attributes.Add("style", "cursor:hand;");
preBrachyNomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\"> " + PreBrachyError;
// old:with error displayed all the time
//NomogramError.Text += "<strong>*** Cannot calculate PreBrachy:</strong> " + PreBrachyError + "<br/>";
//preBrachyNomo.Text += "***";
}
if (PostRPError != null && PostRPError.Length > 0)
{
if (PostRPError == "No radical prostatectomy noted.")
{
postRP7yrNomo.Text = "No RP";
}
else
{
// postRP7yrNomo.ToolTip = PostRPError;
// postRP7yrNomo.Attributes.Add("style", "cursor:hand;");
postRP7yrNomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\"> " + PostRPError;
// old:with error displayed all the time
//NomogramError.Text += "<strong>**** Cannot calculate PostRP:</strong> " + PostRPError;
//postRP2yrNomo.Text += "****";
//postRP5yrNomo.Text += "****";
//postRP7yrNomo.Text += "****";
}
}
}
catch (Exception ex)
{
hpi.Visible = false;
//Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
ExceptionHandler.Publish(ex);
}
}
protected void SetHpiItem(Object Sender, RepeaterItemEventArgs e)
{
Literal HpiRowItems;
HpiRowItems = (Literal) e.Item.FindControl("HpiRowItems");
HtmlTableRow HpiRow;
HpiRow = (HtmlTableRow) e.Item.FindControl("HpiRow");
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
char[] sep1 = {'|'};
char[] sep2 = {','};
string[] tableNames = ((DataRowView) e.Item.DataItem )["TableNames"].ToString().Split(sep2);
string[] primaryKeys = ((DataRowView) e.Item.DataItem )["PrimaryKeys"].ToString().Split(sep2);
string[] hpiItems = ((DataRowView) e.Item.DataItem )["patientHPIDelimited"].ToString().Split(sep1);
int numberOfHpiItems = primaryKeys.Length;
string s = "";
if (numberOfHpiItems > 0)
{
if (numberOfHpiItems > 1)
{
HpiRow.Attributes["class"] = "ClinicalEformPopulatedRowNonClickable";
HpiRow.Attributes.Remove("onmouseover");
HpiRow.Attributes.Remove("onmouseout");
for(int i = 0; i < numberOfHpiItems; i++)
{
try
{
if(hpiItems[i] != "" && primaryKeys.Length > i && tableNames.Length > i )
{
string hpiItem = hpiItems[i].Replace("__", " ");
if (primaryKeys[i].Length > 0 && tableNames[i].Length > 0)
{
s += "<span class=\"ClinicalEformPopulatedSpan\" onMouseOver=\"this.className='ClinicalEformHighlightedSpan';\" onMouseOut=\"this.className='ClinicalEformPopulatedSpan';\" onclick=\"LoadDataEntryForm('" + tableNames[i] + "', '" + primaryKeys[i] + "', '');\">" + hpiItem + " </span> ";
}
else
{
s += "<span style=\"padding: 2px;\" >" + hpiItem + " </span> ";
}
/*
if (i>0)
{
s += "<span class=\"ClinicalEformPopulatedSpan\" onMouseOver=\"this.className='ClinicalEformHighlightedSpan'; document.getElementById('" + HpiRow.ClientID + "').className='ClinicalEformPopulatedRow';\" onMouseOut=\"this.className='ClinicalEformPopulatedSpan';\" onclick=\"LoadDataEntryForm('" + tableNames[i] + "', '" + primaryKeys[i] + "', '');\">" + hpiItem + " </span> ";
}
else
{
HpiRow.Attributes.Add("onclick", "LoadDataEntryForm('" + tableNames[0] + "', '" + primaryKeys[0] + "', '');");
s += hpiItem + " ";
}
*/
}
}
catch (Exception ex)
{
s+= "<b>error: " + ex.Message + "</b>";
}
}
}
else
{
HpiRow.Attributes.Add("onclick", "LoadDataEntryForm('" + tableNames[0] + "', '" + primaryKeys[0] + "', '');");
string hpiItem = hpiItems[0].Replace("__", " ");
s = hpiItem;
}
HpiRowItems.Text = s;
}
}
}
protected void PopulateHPIPreTxPotency()
{
SurveyDa potencyDa = new SurveyDa();
Hashtable ht = potencyDa.FormGetPotencyStatusValues(this._patientId, this._eformName, "Dynamic");
if (ht["PreTxPot"] != null && ht["PreTxPot"].ToString().Length > 0)
{
PreTxPot.Text = ht["PreTxPot"].ToString();
PreTxPotencyTr.Visible = true;
}
else
{
PreTxPotencyTr.Visible = false;
}
}
protected virtual void BuildHPINerveStatus()
{
ProstatectomyDa pDa = new ProstatectomyDa();
Hashtable ht = pDa.FormGetNerveStatus(this._patientId, this._eformName, "Dynamic");
NvbRightTr.Visible = false;
NvbLeftTr.Visible = false;
if (ht["NVB_Left"] != null && ht["NVB_Left"].ToString() != "")
{
NVB_Left.Text = ht["NVB_Left"].ToString();
NvbLeftTr.Visible = true;
}
if (ht["NVB_Right"] != null && ht["NVB_Right"].ToString() != "")
{
NVB_Right.Text = ht["NVB_Right"].ToString();
NvbRightTr.Visible = true;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -