override protected void BuildReferringMD() { PatientPhysicianDa rmdDa = new PatientPhysicianDa(); DataSet rmdDs = rmdDa.FormGetReferringMDs(this._patientId, this._eformName, "Dynamic"); if (rmdDs.Tables.Count > 0 && !rmdDs.Tables[0].Rows.Count.Equals(0)) { ReferringMD.DataSource = rmdDs.Tables[0].DefaultView; ReferringMD.DataBind(); } }
protected void BuildPatientPhysicians(int PatientID, string FormName, string FormType) { DataSet ptPtPhysDs; PatientPhysicianDa ptPhysDa = new PatientPhysicianDa(); ptPtPhysDs = ptPhysDa.FormGetPatientPhysicians(PatientID, FormName, FormType); if (ptPtPhysDs.Tables.Count > 0 && ptPtPhysDs.Tables[0].Rows.Count > 0) { PtPhys.DataSource = ptPtPhysDs.Tables[0].DefaultView; PtPhys.DataBind(); } }
private void BuildPatientPhysiciansReferring(int PatientID, string FormName, string FormType) { DataSet ptPtPhysDs; PatientPhysicianDa ptPhysDa = new PatientPhysicianDa(); ptPtPhysDs = ptPhysDa.FormGetPatientPhysicians(PatientID, FormName, FormType); if (ptPtPhysDs.Tables.Count > 0 && ptPtPhysDs.Tables[0].Rows.Count > 0) { DataView dv = ptPtPhysDs.Tables[0].DefaultView; dv.RowFilter = PatientPhysician.PtPhRole + " LIKE '*Referring*' "; PtPhys.DataSource = dv; PtPhys.DataBind(); } }
protected void AssignPhysicianClick(object sender, EventArgs e) { // assign selected physician as following physician if (!String.IsNullOrEmpty(FollowingPhysicianId.SelectedValue) && PatientId != 0) { Physician phObj = new Physician(); phObj.Get(Int32.Parse(FollowingPhysicianId.SelectedValue)); if (!phObj.IsEmpty) { PhysicianDa pda = new PhysicianDa(); int physicianId = Int32.Parse(phObj[Physician.PhysicianId].ToString()); PatientPhysicianDa ptPhDa = new PatientPhysicianDa(); DataTable ptphDt = ptPhDa.ValidatePatientPhysician(PatientId, physicianId).Tables[0]; if (VerifyUnique(ptphDt)) { AssignPhysicianErrorLBL.Text = String.Empty; // NEW CODE, insert record though middle tier PatientPhysician ptPhysician = new PatientPhysician(); ptPhysician[PatientPhysician.PatientId] = PatientId; ptPhysician[PatientPhysician.PhysicianId] = physicianId; ptPhysician[PatientPhysician.PtPhRole] = "Following"; UserController userCt = new UserController(); int currentUserId = userCt.GetUserId(); UserDa currentUserDa = new UserDa(); DataSet currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId()); ptPhysician[PatientPhysician.EnteredTime] = DateTime.Now; ptPhysician[PatientPhysician.EnteredBy] = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified"; ptPhysician.Save(); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_refreshPage", "refreshPage(); ", true); } else { AssignPhysicianErrorLBL.Text = "Physician " + phObj[Physician.PhFirstName].ToString() + " " + phObj[Physician.PhLastName].ToString() + " already assigned to patient as a(n) " + ptphDt.Rows[0][PatientPhysician.PtPhRole].ToString() + " physician."; } } } }
protected void BuildReferringMD() { if (_patientId != 0) { PatientPhysicianDa rmdDa = new PatientPhysicianDa(); DataSet rmdDs = rmdDa.FormGetReferringMDs(_patientId, _eformName, "Dynamic"); if (rmdDs.Tables.Count > 0 && !rmdDs.Tables[0].Rows.Count.Equals(0)) { ReferringMD.DataSource = rmdDs.Tables[0].DefaultView; ReferringMD.DataBind(); blankReferrringMD.Visible = false; } else { blankReferrringMD.Text = "(" + CaisisConfiguration.GetWebConfigValue("institutionShortName") + ")<img src=\"../../images/shim.gif\" border=\"0\" width=\"200\" height=\"1\">Non-" + CaisisConfiguration.GetWebConfigValue("institutionShortName") + ": "; } } else { blankReferrringMD.Text = "(" + CaisisConfiguration.GetWebConfigValue("institutionShortName") + ")<img src=\"../../images/shim.gif\" border=\"0\" width=\"200\" height=\"1\">Non-" + CaisisConfiguration.GetWebConfigValue("institutionShortName") + ": "; } }
override protected void BuildReferringMD() { if (patientID != 0) { PatientPhysicianDa rmdDa = new PatientPhysicianDa(); DataSet rmdDs = rmdDa.FormGetReferringMDs(this.patientID, this._formName, "Dynamic"); if (rmdDs.Tables[0].Rows.Count > 0) { ReferringMd1Name.Text = rmdDs.Tables[0].Rows[0]["PhFirstName"].ToString() + " " + rmdDs.Tables[0].Rows[0]["PhMiddleName"].ToString() + " " + rmdDs.Tables[0].Rows[0]["PhLastName"].ToString(); ReferringMd1Phone.Text = rmdDs.Tables[0].Rows[0]["PhWorkPhone"].ToString(); ReferringMd1Fax.Text = rmdDs.Tables[0].Rows[0]["PhFax"].ToString(); ReferringMd1Specialty.Text = rmdDs.Tables[0].Rows[0]["PhSpecialty"].ToString(); if (rmdDs.Tables[0].Rows.Count > 1) { ReferringMd2Name.Text = rmdDs.Tables[0].Rows[1]["PhFirstName"].ToString() + " " + rmdDs.Tables[0].Rows[1]["PhMiddleName"].ToString() + " " + rmdDs.Tables[0].Rows[1]["PhLastName"].ToString(); ReferringMd2Phone.Text = rmdDs.Tables[0].Rows[1]["PhWorkPhone"].ToString(); ReferringMd2Fax.Text = rmdDs.Tables[0].Rows[1]["PhFax"].ToString(); ReferringMd2Specialty.Text = rmdDs.Tables[0].Rows[1]["PhSpecialty"].ToString(); } } } }
protected void SetPatientInfo() { if (Request.QueryString.HasKeys() && Request.QueryString.Get("patientId") != null) { PatientId = Int32.Parse(Request.QueryString.Get("patientId").ToString()); if (PatientId != 0) { // set patient name Patient ptObj = new Patient(); ptObj.Get(PatientId); if (!String.IsNullOrEmpty(ptObj[BOL.Patient.PtLastName].ToString())) { PatientName = String.Concat(PatientName, ptObj[BOL.Patient.PtLastName].ToString()); } if (!String.IsNullOrEmpty(ptObj[BOL.Patient.PtMiddleName].ToString())) { PatientName = String.Concat(PatientName, " ", ptObj[BOL.Patient.PtMiddleName].ToString()); } if (!String.IsNullOrEmpty(ptObj[BOL.Patient.PtFirstName].ToString())) { PatientName = String.Concat(PatientName, ", ", ptObj[BOL.Patient.PtFirstName].ToString()); } // set patient following physician info PatientPhysicianDa ptPhDa = new PatientPhysicianDa(); DataTable ptPhysiciansDt = ptPhDa.GetPatientPhysicians(PatientId); DataView ptPhysiciansDv = new DataView(ptPhysiciansDt); ptPhysiciansDv.RowFilter = PatientPhysician.PtPhRole + " LIKE '%following%'"; ptPhysiciansDv.Sort = PatientPhysician.UpdatedTime + " DESC, " + PatientPhysician.EnteredTime + " DESC"; if (ptPhysiciansDv.Count > 0) { NoPhysicianDiv.Style["display"] = "none"; PhysicianDiv.Style["display"] = ""; if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhTitle].ToString())) { PatientFollowingPhysicianTitle = String.Concat(PatientFollowingPhysicianTitle, ptPhysiciansDv[0][BOL.Physician.PhTitle].ToString(), " "); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhFirstName].ToString())) { PatientFollowingPhysicianFirstName = String.Concat(PatientFollowingPhysicianFirstName, ptPhysiciansDv[0][BOL.Physician.PhFirstName].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhLastName].ToString())) { PatientFollowingPhysicianLastName = String.Concat(PatientFollowingPhysicianLastName, " ", ptPhysiciansDv[0][BOL.Physician.PhLastName].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhTitle].ToString())) { PatientFollowingPhysicianName = String.Concat(PatientFollowingPhysicianName, ptPhysiciansDv[0][BOL.Physician.PhTitle].ToString(), " "); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhFirstName].ToString())) { PatientFollowingPhysicianName = String.Concat(PatientFollowingPhysicianName, ptPhysiciansDv[0][BOL.Physician.PhFirstName].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhLastName].ToString())) { PatientFollowingPhysicianName = String.Concat(PatientFollowingPhysicianName, " ", ptPhysiciansDv[0][BOL.Physician.PhLastName].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhSuffix].ToString())) { PatientFollowingPhysicianName = String.Concat(PatientFollowingPhysicianName, ", ", ptPhysiciansDv[0][BOL.Physician.PhSuffix].ToString()); } PatientFollowingPhysicianWorkPhone = ptPhysiciansDv[0][BOL.Physician.PhWorkPhone].ToString(); PatientFollowingPhysicianFax = ptPhysiciansDv[0][BOL.Physician.PhFax].ToString(); if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhAddress1].ToString())) { PatientFollowingPhysicianAddressLine1 = String.Concat(PatientFollowingPhysicianAddressLine1, ptPhysiciansDv[0][BOL.Physician.PhAddress1].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhAddress2].ToString())) { PatientFollowingPhysicianAddressLine2 = String.Concat(PatientFollowingPhysicianAddressLine2, ptPhysiciansDv[0][BOL.Physician.PhAddress2].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhCity].ToString())) { PatientFollowingPhysicianAddressCity = String.Concat(PatientFollowingPhysicianAddressCity, ptPhysiciansDv[0][BOL.Physician.PhCity].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhState].ToString())) { PatientFollowingPhysicianAddressState = String.Concat(PatientFollowingPhysicianAddressState, ptPhysiciansDv[0][BOL.Physician.PhState].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhPostalCode].ToString())) { PatientFollowingPhysicianAddressPostalCode = String.Concat(PatientFollowingPhysicianAddressPostalCode, ptPhysiciansDv[0][BOL.Physician.PhPostalCode].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhAddress1].ToString())) { PatientFollowingPhysicianAddress = String.Concat(PatientFollowingPhysicianAddress, ptPhysiciansDv[0][BOL.Physician.PhAddress1].ToString(), "<br/>"); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhAddress2].ToString())) { PatientFollowingPhysicianAddress = String.Concat(PatientFollowingPhysicianAddress, ptPhysiciansDv[0][BOL.Physician.PhAddress2].ToString(), "<br/>"); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhCity].ToString())) { PatientFollowingPhysicianAddress = String.Concat(PatientFollowingPhysicianAddress, ptPhysiciansDv[0][BOL.Physician.PhCity].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhState].ToString())) { PatientFollowingPhysicianAddress = String.Concat(PatientFollowingPhysicianAddress, ", ", ptPhysiciansDv[0][BOL.Physician.PhState].ToString()); } if (!String.IsNullOrEmpty(ptPhysiciansDv[0][BOL.Physician.PhPostalCode].ToString())) { PatientFollowingPhysicianAddress = String.Concat(PatientFollowingPhysicianAddress, " ", ptPhysiciansDv[0][BOL.Physician.PhPostalCode].ToString()); } CloseBtn.Style["display"] = "none"; CancelBtn.Style["display"] = ""; AddPhysicianLink.Attributes["onclick"] = "popupAddEditPhysician('../../../Core/Utilities/AddEditPhysicians.aspx?newWindow=true');"; EditPhysicianLink.Attributes["onclick"] = "popupAddEditPhysician('../../../Core/Utilities/AddEditPhysicians.aspx?physid=" + ptPhysiciansDv[0][BOL.Physician.PhysicianId].ToString() + "'); "; } // else, paitent has no following physician else { this.PopulatePhysiciansDropDown(); NoPhysicianDiv.Style["display"] = ""; PhysicianDiv.Style["display"] = "none"; NeedMD_ContactCompleteBtn.Style["display"] = "none"; CloseBtn.Style["display"] = ""; CancelBtn.Style["display"] = "none"; AddPhysicianLink.Attributes["onclick"] = "popupAddEditPhysician('../../../Core/Utilities/AddEditPhysicians.aspx?newWindow=true');"; EditPhysicianLink.Attributes["onclick"] = "popupAddEditPhysician('../../../Core/Utilities/AddEditPhysicians.aspx?newWindow=true');"; } } } }
protected override void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!String.IsNullOrEmpty(CoverLetterXmlFileName)) { if (CoverLetterXmlFileName.Contains(".xml")) { LetterDataSource.DataFile = "~/Modules/FollowUp/LongitudinalFollowUp/" + CoverLetterXmlFileName; } else { LetterDataSource.DataFile = "~/Modules/FollowUp/LongitudinalFollowUp/" + CoverLetterXmlFileName + ".xml"; } Patient pt = new Patient(); pt.Get(PatientId); string ptMRN = pt[Patient.PtMRN].ToString(); string ptTitle = pt[Patient.PtTitle].ToString().ToUpper(); string ptFirstName = pt[Patient.PtFirstName].ToString().ToUpper(); string ptGender = pt[Patient.PtGender].ToString().ToUpper(); string greeting = ""; if (!String.IsNullOrEmpty(ptMRN)) { identifier.Text = "MRN: " + ptMRN; } if (!String.IsNullOrEmpty(ptTitle)) { greeting = ptTitle; } else if (!String.IsNullOrEmpty(ptFirstName)) { greeting = ptFirstName; } else if (!String.IsNullOrEmpty(ptGender)) { if (ptGender.Equals("MALE")) { greeting = "Mr."; } else if (ptGender.Equals("FEMALE")) { greeting = "Ms."; } } this.Date.Text = DateTime.Today.ToLongDateString(); this.PatientName.Text = pt[Patient.PtFirstName].ToString().ToUpper() + " " + pt[Patient.PtMiddleName].ToString().ToUpper() + " " + pt[Patient.PtLastName].ToString().ToUpper(); this.PatientGreetingName.Text = greeting + " " + pt[Patient.PtLastName].ToString().ToUpper(); string addrLine1 = !String.IsNullOrEmpty(pt[Patient.PtAddress1].ToString()) ? pt[Patient.PtAddress1].ToString() : String.Empty; addrLine1 = !String.IsNullOrEmpty(addrLine1) && !String.IsNullOrEmpty(pt[Patient.PtAddress2].ToString()) ? addrLine1 + " " + pt[Patient.PtAddress2].ToString() : addrLine1; string addrLine2 = pt[Patient.PtCity].ToString(); addrLine2 = !String.IsNullOrEmpty(pt[Patient.PtCity].ToString()) && !String.IsNullOrEmpty(pt[Patient.PtState].ToString()) ? addrLine2 + ", " + pt[Patient.PtState].ToString() : addrLine2; addrLine2 = String.IsNullOrEmpty(pt[Patient.PtCity].ToString()) && !String.IsNullOrEmpty(pt[Patient.PtState].ToString()) ? addrLine2 + pt[Patient.PtState].ToString() : addrLine2; addrLine2 = !String.IsNullOrEmpty(addrLine2) && !String.IsNullOrEmpty(pt[Patient.PtPostalCode].ToString()) ? addrLine2 + " " + pt[Patient.PtPostalCode].ToString() : addrLine2 + pt[Patient.PtPostalCode].ToString(); this.PatientAddress.Text = addrLine1.ToUpper(); this.PatientAddress.Text = !String.IsNullOrEmpty(addrLine1) ? this.PatientAddress.Text + "<br/>" + addrLine2.ToUpper() : addrLine2.ToUpper(); FollowUpDA da = new FollowUpDA(); this.PhysicianName.Text = da.GetMostRecentTreatingPhysician(PatientId); PatientPhysicianDa ptPhDa = new PatientPhysicianDa(); DataSet ptPhDs = ptPhDa.FormGetPatientPhysicians(PatientId, "", "Dynamic"); DataView ptPhDv = new DataView(ptPhDs.Tables[0]); if (ptPhDv.Count > 0) { ptPhDv.Sort = PatientPhysician.EnteredTime + " DESC "; this.PhysicianName.Text = ptPhDv[0][Physician.PhFirstName].ToString() + " " + ptPhDv[0][Physician.PhMiddleName].ToString() + " " + ptPhDv[0][Physician.PhLastName].ToString() + " " + ptPhDv[0][Physician.PhSuffix].ToString(); this.PhysicianInfo.Text = String.Empty; if (!String.IsNullOrEmpty(ptPhDv[0][Physician.PhLevel].ToString())) { this.PhysicianInfo.Text = this.PhysicianInfo.Text + ptPhDv[0][Physician.PhLevel].ToString() + " Physician<br/>"; } if (!String.IsNullOrEmpty(ptPhDv[0][Physician.PhInstitution].ToString())) { this.PhysicianInfo.Text = this.PhysicianInfo.Text + ptPhDv[0][Physician.PhInstitution].ToString() + "<br/>"; } if (!String.IsNullOrEmpty(ptPhDv[0][Physician.PhWorkPhone].ToString())) { this.PhysicianInfo.Text = this.PhysicianInfo.Text + "Phone: " + ptPhDv[0][Physician.PhWorkPhone].ToString() + "<br/>"; physicianWorkPh = ptPhDv[0][Physician.PhWorkPhone].ToString(); } // if physician has a signature image stord, add to Letter // image file should be stored as Images/FormImages/PhysicianSig_[PhLastName][PhFirstName].jpg if (!String.IsNullOrEmpty(ptPhDv[0][Physician.PhFirstName].ToString()) && !String.IsNullOrEmpty(ptPhDv[0][Physician.PhLastName].ToString())) { string signaturesSourceFolder = Server.MapPath("../../../Images/FormImages/"); string signatureFileName = "PhysicianSig_" + ptPhDv[0][Physician.PhLastName].ToString() + ptPhDv[0][Physician.PhFirstName].ToString() + ".jpg"; string signaturePath = signaturesSourceFolder + signatureFileName; if (File.Exists(signaturePath)) { SignatureImage.ImageUrl = signaturePath; SignaturePH.Visible = true; } } } /// Add institution logo based on web.config variable to Xsl params. /// Institution logo should be stored in the format AbbreviatedName_FormLogo.gif, ie MSKCC_FormLogo.gif. string logoUrl = "../../../Images/FormImages/" + CaisisConfiguration.GetWebConfigValue("institutionShortName") + "_FormLogo.gif"; HeaderLogo.Src = Server.MapPath(logoUrl);; BuildLetter(); } } ExternalContent.Visible = false; }
private void ConfigurePatientRepeater(Object Sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { HtmlTableCell ControlCellTitle = (HtmlTableCell)e.Item.FindControl("ControlCellTitle"); HtmlTableCell ControlCellTitle2 = (HtmlTableCell)e.Item.FindControl("ControlCellTitle2"); HtmlTableCell NameCellTitle = (HtmlTableCell)e.Item.FindControl("NameCellTitle"); HtmlTableCell MRNCellTitle = (HtmlTableCell)e.Item.FindControl("MRNCellTitle"); HtmlTableCell PhysicianTreatingCellTitle = (HtmlTableCell)e.Item.FindControl("PhysicianTreatingCellTitle"); HtmlTableCell SurveysDueCellTitle = (HtmlTableCell)e.Item.FindControl("SurveysDueCellTitle"); ControlCellTitle.Style["display"] = ""; ControlCellTitle2.Style["display"] = ""; NameCellTitle.Style["display"] = ""; MRNCellTitle.Style["display"] = ""; PhysicianTreatingCellTitle.Style["display"] = ""; SurveysDueCellTitle.Style["display"] = ""; ControlCellTitle.Style["width"] = "5%"; ControlCellTitle2.Style["width"] = "5%"; NameCellTitle.Style["width"] = "25%"; MRNCellTitle.Style["width"] = "20%"; PhysicianTreatingCellTitle.Style["width"] = "25%"; SurveysDueCellTitle.Style["width"] = "20%"; } if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // create a reference to the current tr System.Web.UI.HtmlControls.HtmlContainerControl listRow; listRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("listRow"); HtmlTableCell ControlCellValue = (HtmlTableCell)e.Item.FindControl("ControlCellValue"); HtmlTableCell ControlCellValue2 = (HtmlTableCell)e.Item.FindControl("ControlCellValue2"); Label StatusPatientId = (Label)e.Item.FindControl("StatusPatientId"); HtmlTableCell NameCellValue = (HtmlTableCell)e.Item.FindControl("NameCellValue"); HtmlTableCell MRNCellValue = (HtmlTableCell)e.Item.FindControl("MRNCellValue"); HtmlTableCell PhysicianTreatingCellValue = (HtmlTableCell)e.Item.FindControl("PhysicianTreatingCellValue"); HtmlTableCell SurveysDueCellValue = (HtmlTableCell)e.Item.FindControl("SurveysDueCellValue"); CheckBox EmailCB = (CheckBox)e.Item.FindControl("EmailCB"); CheckBox PrintCB = (CheckBox)e.Item.FindControl("PrintCB"); Literal PhysicianTreating = (Literal)e.Item.FindControl("PhysicianTreating"); Label SurveysDue = (Label)e.Item.FindControl("SurveysDue"); Label SurveysDueFileNames = (Label)e.Item.FindControl("SurveysDueFileNames"); Label SurveyMenuLinkTitle = (Label)e.Item.FindControl("SurveyMenuLinkTitle"); HtmlAnchor SurveyMenuLink = (HtmlAnchor)e.Item.FindControl("SurveyMenuLink"); HtmlGenericControl SurveyPacketMenuDiv = (HtmlGenericControl)e.Item.FindControl("SurveyPacketMenuDiv"); ControlCellValue.Style["display"] = ""; ControlCellValue2.Style["display"] = ""; NameCellValue.Style["display"] = ""; MRNCellValue.Style["display"] = ""; PhysicianTreatingCellValue.Style["display"] = ""; SurveysDueCellValue.Style["display"] = ""; SetLinkToPagePatientData(Sender, e, NameCellValue); NameCellValue.Style["text-decoration"] = "underline"; EmailCB.Attributes.Add("onClick", "return mutuallyExcludeCheckbox(" + EmailCB.ClientID + "," + PrintCB.ClientID + ",'email');"); PrintCB.Attributes.Add("onClick", "return mutuallyExcludeCheckbox(" + EmailCB.ClientID + "," + PrintCB.ClientID + ",'mail');"); // re-populate checkbox counter (postback) int counter = 0; if (EmailCB.Checked) { if (int.TryParse(NumOfPatientsToEmail.Text, out counter)) { NumOfPatientsToEmail.Text = (counter + 1).ToString(); } } if (PrintCB.Checked) { if (int.TryParse(NumOfPatientsToMail.Text, out counter)) { NumOfPatientsToMail.Text = (counter + 1).ToString(); } } string currentStatus = String.Empty; if (((DataRowView)e.Item.DataItem)[BOL.Patient.PtContactStatus].ToString().Length > 0) { currentStatus = ((DataRowView)e.Item.DataItem)[BOL.Patient.PtContactStatus].ToString(); } int patientId; if (Int32.TryParse(StatusPatientId.Text, out patientId)) { //get patient's treating physician, if any PatientPhysicianDa ptPhDa = new PatientPhysicianDa(); DataView patientPhysiciansDv = ptPhDa.GetPatientPhysicians(patientId).DefaultView; patientPhysiciansDv.RowFilter = PatientPhysician.PtPhRole + " = 'Treating' "; if (patientPhysiciansDv.Count > 0) { PhysicianTreating.Text = patientPhysiciansDv[0]["PhysicianName"].ToString(); } // set survey sent/due fields SurveyMenuLinkTitle.Text = currentStatus; SurveyMenuLinkTitle.Style["text-decoration"] = "underline"; SurveyMenuLinkTitle.Style["cursor"] = "pointer"; SurveyMenuLink.Attributes["onclick"] = "ShowGetNeedPtAuthorizationPacket('" + patientId.ToString() + "','" + SurveyPacketMenuDiv.ClientID + "','" + SurveyMenuLinkTitle.ClientID + "','" + SurveysDue.ClientID + "','" + SurveysDueFileNames.ClientID + "');"; SurveyMenuLink.Attributes["onmouseout"] = "HideGetNeedPtAuthorizationPacket('" + SurveyPacketMenuDiv.ClientID + "','" + SurveyMenuLinkTitle.ClientID + "','" + SurveysDue.ClientID + "','" + SurveysDueFileNames.ClientID + "');"; } } }
private void InsertDimension(object atts, int patientId, SqlTransaction trans) { DataRow dr; if (atts is XmlNode) { dr = this.AttributesToRow(((XmlNode)atts).Attributes); } else { dr = (DataRow)atts; } string dimType = (string)dr["type"]; switch (dimType) { case "Institution": InstitutionDa ida = new InstitutionDa(); int institutionId = ida.GetPrimKey((string)dr["value"]); this._CheckId(institutionId, dimType, dr); PatientInstitutionDa pida = new PatientInstitutionDa(); if (VerifyUnique((pida.GetPatientInstitution(patientId, institutionId, trans)).Tables[0])) { // NEW CODE, insert record though middle tier PatientInstitution ptInstitution = new PatientInstitution(); ptInstitution[PatientInstitution.PatientId] = patientId; ptInstitution[PatientInstitution.InstitutionId] = institutionId; ptInstitution.Save(); // OLD CODE, inserts now handled by middle tier // pida.InsertPatientInstitution(patientId, institutionId, trans); add trans logic after concurrency fully tested- spy 2/21 // pida.InsertPatientInstitution(patientId, institutionId, trans); } break; case "Physician": PhysicianDa pda = new PhysicianDa(); //to get Physician primary key need to pass first and last name in from dataset defined in XML int physicianId = pda.GetPrimKey((string)dr["value"], (string)dr["value2"]); this._CheckId(physicianId, dimType, dr); PatientPhysicianDa ppda = new PatientPhysicianDa(); if (VerifyUnique((ppda.ValidatePatientPhysician(patientId, physicianId)).Tables[0])) { // NEW CODE, insert record though middle tier PatientPhysician ptPhysician = new PatientPhysician(); ptPhysician[PatientPhysician.PatientId] = patientId; ptPhysician[PatientPhysician.PhysicianId] = physicianId; ptPhysician.Save(); // OLD CODE, inserts now handled by middle tier //should be creating Patient Physician biz object and passing object to PatientPhysicianDa //ppda.InsertPatientPhysicianDimension(patientId, physicianId, _sc.GetUserName(), trans); } break; case "Protocol": ProtocolDa protDa = new ProtocolDa(); int protocolId = protDa.GetPrimKey((string)dr["value"]); this._CheckId(protocolId, dimType, dr); PatientProtocolDa ptProtDa = new PatientProtocolDa(); if (VerifyUnique((ptProtDa.ValidatePatientProtocol(patientId, protocolId)).Tables[0])) { // NEW CODE, insert record though middle tier PatientProtocol ptProtocol = new PatientProtocol(); ptProtocol[PatientProtocol.PatientId] = patientId; ptProtocol[PatientProtocol.ProtocolId] = protocolId; ptProtocol.Save(); // OLD CODE, inserts now handled by middle tier //ptProtDa.InsertPatientProtocolDimension(patientId, protocolId, _sc.GetUserName(), trans); } break; case "Disease": DiseaseDa disDa = new DiseaseDa(); int diseaseId = disDa.GetPrimKey((string)dr["value"]); this._CheckId(diseaseId, dimType, dr); PatientDiseaseDa ptDiseaseDa = new PatientDiseaseDa(); if (VerifyUnique((ptDiseaseDa.GetPatientDisease(patientId, diseaseId)).Tables[0])) { // NEW CODE, insert record though middle tier PatientDisease ptDisease = new PatientDisease(); ptDisease[PatientDisease.PatientId] = patientId; ptDisease[PatientDisease.DiseaseId] = diseaseId; ptDisease.Save(); // OLD CODE, inserts now handled by middle tier //ptDiseaseDa.InsertPatientDisease(patientId, diseaseId, trans); } break; } }