Example #1
0
        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');";
                    }
                }
            }
        }
Example #2
0
        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 + "');";
                }
            }
        }