예제 #1
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa pDa   = new PatientDa();
                    DataSet   hpiDs = pDa.GetPatientHPIBladder(this.patientID);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();

                    int rowCount = hpiDs.Tables[0].Rows.Count;

                    /*					if (rowCount < NumHpiRowsAllowed)
                     *                  {
                     *                      int newHeight = (NumHpiRowsAllowed-rowCount)*10;
                     *                      HpiSpacer.Height = newHeight;
                     *                  }
                     */
                }
                catch (Exception ex)
                {
                    //					HpiSpacer.Height = NumHpiRowsAllowed*10;
                    //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                    ExceptionHandler.Publish(ex);
                }
            }

            /*			else
             *          {
             *              HpiSpacer.Height = NumHpiRowsAllowed*14;
             *          }
             */
        }
예제 #2
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                PatientDa hpiDa = new PatientDa();
                DataSet   hpiDs = hpiDa.GetPatientHPI(this.patientID, 0, 0);
                hpi.DataSource = hpiDs.Tables[0].DefaultView;
                hpi.DataBind();

                int rowCount = hpiDs.Tables[0].Rows.Count;


                //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();
 */
                // set the value of the biopsy Id that is to be REMOVED from the results of the
                // stored proc spFormListBiopsies so that the biopsy is only listed once in the
                // hpi section of the form

                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"];
                }
            }
        }
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();
                    DataSet   hpiDs = hpiDa.GetPatientHPI(this.patientID, 0, 0);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();

                    int rowCount = hpiDs.Tables[0].Rows.Count;

                    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"];
                        ShowDxBiopsy(hpiBiopsyId);
                    }
                }
                catch (Exception ex)
                {
                    hpi.Visible = false;
                    //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                    ExceptionHandler.Publish(ex);
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Returns a Table which represent the TableName and TableCount of tables and respecitive records
        /// which must be deleted manually before deleting the patient record. 0 rows =no restrictions
        /// </summary>
        /// <param name="patientId">The PatientId of the patient to check</param>
        /// <returns>A table containing TableName, TableCount of child table constraints.</returns>
        public DataTable ValidatePatientDeleteConstraints(int patientId)
        {
            PatientDa da = new PatientDa();
            DataTable dt = da.ValidatePatientDeletion(patientId).Tables[0];

            return(dt);
        }
예제 #5
0
        private void PopulateResults()
        {
            if (!String.IsNullOrEmpty(FollowUpListCriteria))
            {
                PatientListController ct = new PatientListController();
                DataSet ds = null;

                // get list of patients
                string    dsSQL = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
                PatientDa ptDa  = new PatientDa();
                ds = ptDa.ListPatientsByContactStatusPhysicianAndDisease(dsSQL, new string[] { FollowUpListCriteria }, SelectedTreatingPhysicianId,
                                                                         "Treating", SelectedPatientDisease, "", 0, 0);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        rptPatient.DataSource = ds.Tables[0].DefaultView;
                        rptPatient.DataBind();
                    }

                    // three sp's used to retrieve patient lists and they all have an output parameter returning a record count
                    ResultsRecordCount = (int)ds.Tables[0].ExtendedProperties[ExtendedProperty.RowCount];
                    ResultsRecordMemo  = ResultsRecordCount + " patients returned";
                }
            }
        }
예제 #6
0
        public DataSet FindPatientByIdentifier(string searchFilter, string identifierType, string datasetSQL)
        {
            ValidatePatientIdentifierSearch(identifierType);
            PatientDa da = new PatientDa();

            return(da.FindPatientByIdentifier(searchFilter, identifierType, datasetSQL));
        }
예제 #7
0
        public DataSet FindPatient(string strFind, string datasetSQL)
        {
            ValidatePatientSearch();
            PatientDa da = new PatientDa();

            return(da.FindPatient(strFind, datasetSQL));
        }
예제 #8
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();


                    DataSet hpiDs = hpiDa.GetPatientHPITestis(this.patientID);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();


//					int rowCount = hpiDs.Tables[0].Rows.Count;
//					if (rowCount < NumHpiRowsAllowed)
//					{
//						int newHeight = (NumHpiRowsAllowed-rowCount)*10;
//						HpiSpacer.Height = newHeight;
//					}
                }
                catch (Exception ex)
                {
                    HpiSpacer.Height = NumHpiRowsAllowed * 10;
                    ExceptionHandler.Publish(ex);
                }
            }
            else
            {
                HpiSpacer.Height = NumHpiRowsAllowed * 10;
            }
        }
예제 #9
0
/*        protected void LoadSurveyForm()
 *      {
 *          if (null != SurveyFormHolder)
 *          {
 *              SurveyFormControl = (Caisis.UI.Core.Classes.BasePaperFormControl)this.LoadControl("UroSurveyUrinSexFunc.ascx");
 *
 *
 *              SurveyFormControl.BatchPatientId = this._batchPatientId;
 *              SurveyFormControl.FormInPatientId = this._formInPatientId;
 *              SurveyFormControl.FormAppointmentId = this._formAppointmentId;
 *
 *
 *
 *              SurveyFormHolder.Controls.Add(SurveyFormControl);
 *          }
 *      }
 */
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();
                    DataSet   hpiDs = hpiDa.GetPatientHPIProstateGU(this.patientID, 0);


                    if (hpiDs.Tables[0].Rows.Count > 0)
                    {
                        hpi.DataSource = hpiDs.Tables[0].DefaultView;
                        hpi.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    hpi.Visible = false;
                    ExceptionHandler.Publish(ex);
                }



                NomogramDa nda = new NomogramDa();

                try
                {
                    preRP5Nomo.Text = "PreRP 5: " + ((int)Math.Round(nda.GetPreRPResult(patientID, 5), 0)).ToString();
                }
                catch { }

                try
                {
                    preRP10Nomo.Text = "PreRP 10: " + ((int)Math.Round(nda.GetPreRPResult(patientID, 10), 0)).ToString();
                }
                catch { }

                try
                {
                    preXRTNomo.Text = "PreXRT: " + ((int)Math.Round(nda.GetPreXRTResult(patientID), 0)).ToString();
                }
                catch { }

                try
                {
                    preBrachyNomo.Text = "PreBrachy: " + ((int)Math.Round(nda.GetPreBrachyResult(patientID), 0)).ToString();
                }
                catch { }

                /*
                 * try
                 * {
                 *  psaDT.Text = "PSA Doubling Time calculated based on all PSA values from the last 6 months: " + ((int)Math.Round(nda.GetPreBrachyResult(patientID), 0)).ToString();
                 * }
                 * catch { }
                 */
            }
        }
예제 #10
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();


                    DataSet hpiDs = hpiDa.GetPatientHPI(this.patientID, 0, 0);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();


                    int rowCount = hpiDs.Tables[0].Rows.Count;

                    //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();

                    NomogramDa nda = new NomogramDa();

                    try
                    {
                        preRP5Nomo.Text = ((int)Math.Round(nda.GetPreRPResult(patientID, 5), 0)).ToString();
                    }
                    catch { }

                    try
                    {
                        preRP10Nomo.Text = ((int)Math.Round(nda.GetPreRPResult(patientID, 10), 0)).ToString();
                    }
                    catch { }

                    try
                    {
                        preXRTNomo.Text = ((int)Math.Round(nda.GetPreXRTResult(patientID), 0)).ToString();
                    }
                    catch { }

                    try
                    {
                        preBrachyNomo.Text = ((int)Math.Round(nda.GetPreBrachyResult(patientID), 0)).ToString();
                    }
                    catch { }
                }
                catch (Exception ex)
                {
                    //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                    ExceptionHandler.Publish(ex);
                }
            }
//			else
//			{
//				HpiSpacer.Height = NumHpiRowsAllowed*12;
//			}
        }
예제 #11
0
        protected void BindData(Object Sender, RepeaterItemEventArgs e)
        {
            Literal ProbsPlans = (Literal)e.Item.FindControl("ProbsPlans");
            Literal PtHPI      = (Literal)e.Item.FindControl("PtHPI");

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView drv       = (DataRowView)e.Item.DataItem;
                string      PtId      = drv["ApptPatientId"].ToString();
                string      physician = drv["ApptPhysician"].ToString();
                if (!string.IsNullOrEmpty(PtId))
                {
                    //gets all problems from recent encounter per patient per physician
                    DataTable ProbsDt = da.GetProblems(PtId, physician);

                    StringBuilder plstr = new StringBuilder();
                    StringBuilder str   = new StringBuilder();
                    if (ProbsDt.Rows.Count > 0)
                    {
                        foreach (DataRow probs in ProbsDt.Rows)
                        {
                            string ProbPlanDt = probs["EnteredDate"].ToString();

                            string ProbName = probs["ProblemName"].ToString();
                            int    PtprobId = int.Parse(probs["PatientProblemId"].ToString());
                            //gets all plans per problem
                            DataTable PlansDt = da.GetPlans(PtprobId);
                            if (PlansDt.Rows.Count > 0)
                            {
                                foreach (DataRow plans in PlansDt.Rows)
                                {
                                    string PlanName = plans["PlanName"].ToString();
                                    plstr.Append(PlanName + ", ");
                                }
                                str.Append("<strong>Problem:</strong> " + ProbName + "<br/><strong>Plans:</strong> " + plstr.ToString() + "<br/><br/>");
                            }
                            ProbsPlans.Text = "<strong>Visit Date:</strong> " + ProbPlanDt + "<br/>" + str.ToString();
                            plstr.Remove(0, plstr.Length);
                        }
                    }
                    //gets HPI data for each patient
                    PatientDa     ptDa   = new PatientDa();
                    DataSet       hpiDs  = ptDa.GetPatientHPI(int.Parse(PtId), 0, 0);
                    StringBuilder hpiStr = new StringBuilder();
                    if (hpiDs.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow hpi in hpiDs.Tables[0].Rows)
                        {
                            string hpiData = hpi["patientHPI"].ToString();
                            hpiStr.Append(hpiData + "<br/>");
                        }
                    }
                    PtHPI.Text = hpiStr.ToString();
                }
            }
        }
예제 #12
0
        /// <summary>
        /// Returns if a Patient (by patient id) is in the specifiec dataset.
        /// </summary>
        /// <param name="patientId"></param>
        /// <param name="datasetSQL"></param>
        /// <returns></returns>
        public bool IsPatientInDataset(int patientId, string datasetSQL)
        {
            bool isInDataset = false;

            if (!string.IsNullOrEmpty(datasetSQL))
            {
                isInDataset = new PatientDa().IsPatientInDataset(patientId, datasetSQL);
            }
            return(isInDataset);
        }
예제 #13
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();
                    DataSet   hpiDs = hpiDa.GetPatientHPIBreast(this.patientID);


                    if (hpiDs.Tables[0].Rows.Count > 0)
                    {
                        DataColumn VarOrderNumCol = new DataColumn("VarOrderNum", typeof(System.Int32));
                        hpiDs.Tables[0].Columns.Add(VarOrderNumCol);

                        DataColumn IsAppendedRowCol = new DataColumn("RowType", typeof(System.String));
                        hpiDs.Tables[0].Columns.Add(IsAppendedRowCol);

                        for (int i = 0; i < hpiDs.Tables[0].Rows.Count; i++)
                        {
                            hpiDs.Tables[0].Rows[i]["VarOrderNum"] = i;
                            hpiDs.Tables[0].Rows[i]["RowType"]     = "normal";
                        }

                        int currentRowId = 0;
                        for (int k = 0; k < hpiDs.Tables[0].Rows.Count; k++)
                        {
                            currentRowId = Convert.ToInt16(hpiDs.Tables[0].Rows[k]["RowId"]);
                            for (int j = 0; j < hpiDs.Tables[0].Rows.Count; j++)
                            {
                                if (j != k && hpiDs.Tables[0].Rows[j]["RelatedRowId"].Equals(currentRowId))
                                {
                                    hpiDs.Tables[0].Rows[j]["VarOrderNum"] = hpiDs.Tables[0].Rows[k]["VarOrderNum"];
                                    hpiDs.Tables[0].Rows[j]["RowType"]     = "multi";
                                    hpiDs.Tables[0].Rows[k]["RowType"]     = "start multi";
                                }
                            }
                        }


                        DataView hpiDv = hpiDs.Tables[0].DefaultView;
                        hpiDv.Sort = "VarOrderNum ASC, RowId ASC";

                        hpi.DataSource = hpiDv;
                        hpi.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    hpi.Visible = false;
                    ExceptionHandler.Publish(ex);
                }
            }
        }
예제 #14
0
        protected void BuildPastProblemsPlans(int PatientID)
        {
            if (Session[SessionKey.CurrentListCrit] != null && Session[SessionKey.CurrentListCrit].ToString().Length > 0)
            {
                PatientDa pDa = new PatientDa();
                DataSet   pDs = pDa.FormGetLastPatientProblemPlans(PatientID, Session[SessionKey.CurrentListCrit].ToString());
                if (pDs.Tables.Count > 0 && pDs.Tables[0].Rows.Count > 0)
                {
                    NoPastProblemsMsgRow.Visible = false;
                    ShowPastProblemsOnLoad(true);

                    string currentProblemId           = "";
                    int    currentProblemNumber       = 0;
                    int    currentPlanNumber          = 0;
                    int    currentProblemDataRowIndex = 0;

                    pDs.Tables[0].Columns.Add("ProblemNumber");
                    pDs.Tables[0].Columns.Add("PlanNumber");
                    pDs.Tables[0].Columns.Add("ProblemDisplayRowSpan");


                    for (int i = 0; i < pDs.Tables[0].Rows.Count; i++)
                    {
                        if (pDs.Tables[0].Rows[i]["PatientProblemId"].ToString().Equals(currentProblemId))
                        {
                            currentPlanNumber += 1;
                            pDs.Tables[0].Rows[i]["ProblemName"] = "&nbsp;";
                            pDs.Tables[0].Rows[currentProblemDataRowIndex]["ProblemDisplayRowSpan"] = (i - currentProblemDataRowIndex + 1);
                            pDs.Tables[0].Rows[i]["ProblemDisplayRowSpan"] = 0;
                        }
                        else
                        {
                            currentProblemNumber      += 1;
                            currentPlanNumber          = 1;
                            currentProblemDataRowIndex = i;
                            pDs.Tables[0].Rows[i]["ProblemDisplayRowSpan"] = 1;
                        }
                        pDs.Tables[0].Rows[i]["ProblemNumber"] = currentProblemNumber.ToString();
                        pDs.Tables[0].Rows[i]["PlanNumber"]    = currentPlanNumber.ToString();
                        currentProblemId = pDs.Tables[0].Rows[i]["PatientProblemId"].ToString();
                    }


                    PastProblemsRpt.DataSource = pDs.Tables[0].DefaultView;
                    PastProblemsRpt.DataBind();
                    ShowPastProblemsOnLoad(true);
                }
                else
                {
                    ShowPastProblemsOnLoad(false);
                }
            }
        }
예제 #15
0
        private void BuildPatientDemographics(int PatientID, string FormName, string FormType)
        {
            DataSet   ptDemoGxDs;
            PatientDa ptDemoDa = new PatientDa();

            ptDemoGxDs = ptDemoDa.FormGetPatientsIdentificationAll(PatientID, FormName, FormType);

            if (ptDemoGxDs.Tables.Count > 0 && ptDemoGxDs.Tables[0].Rows.Count > 0)
            {
                PtDemoGx.DataSource = ptDemoGxDs.Tables[0].DefaultView;
                PtDemoGx.DataBind();
            }
        }
예제 #16
0
 protected void BuildHPI()
 {
     try
     {
         PatientDa pDa   = new PatientDa();
         DataSet   hpiDs = pDa.GetPatientHPIKidney(this._patientId);
         DataView  view  = GetPatientHPIKidneyView(hpiDs.Tables[0]);
         hpi.DataSource = view;
         hpi.DataBind();
     }
     catch (Exception ex)
     {
         hpi.Visible = false;
         ExceptionHandler.Publish(ex);
     }
 }
예제 #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dsSQL"></param>
        /// <param name="listName"></param>
        /// <param name="listValue"></param>
        /// <param name="listModifier"></param>
        /// <param name="orderBy"></param>
        /// <param name="startRow"></param>
        /// <param name="numRows"></param>
        /// <param name="clinicDate"></param>
        /// <param name="listUser"></param>
        /// <returns></returns>
        public DataSet GetList(string dsSQL, string listName, string listValue, string listModifier, string orderBy, int startRow, int numRows, string clinicDate, string listUser)
        {
            DataSet ds = new DataSet();

            try
            {
                PatientDa da = new PatientDa();
                ds = da.ListPatients(dsSQL, listName, listValue, listModifier, orderBy, startRow, numRows, listUser);
            }
            catch (Exception e)
            {
                Caisis.UI.Core.Classes.ExceptionHandler.Publish(e);
                //throw new ClientException(e.Message);
            }
            return(ds);
        }
    override protected void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);

        valMsg.Text       = "";
        groupMessage.Text = "";
        AddBtn.ImageUrl   = "../Images/AdminImages/submit.gif";
        AddBtn.Width      = 65;
        AddBtn.Height     = 21;

        SelectPatientName.Attributes.Add("onchange", "this.form." + SelectSubmitted.ClientID + ".value = 'true'; this.form.submit();");

        if (Page.IsPostBack)
        {
            //check if form is submitted from select box or to update password
            if (!Request.Form["SelectPatientName"].Equals("") && Request.Form["SelectSubmitted"] != null && Request.Form["SelectSubmitted"].Equals("true"))
            {
                this.ShowInstitutionSelect(int.Parse(Request.Form["SelectPatientName"]));
            }
        }
        else
        {
            // Put user code to initialize the page here
            //don't use AdminUtil function because need username here
            if (Request.QueryString["firstLetter"] != null && Request.QueryString["firstLetter"].ToString().Length > 0)
            {
                PatientDa das        = new PatientDa();
                string    searchTerm = Request.QueryString["firstLetter"].ToString() + "%";
                DataTable dt         = das.GetPatientsByLastName(searchTerm);

                DataView view = dt.DefaultView;
                view.Sort = "PatientName ASC";
                SelectPatientName.DataSource     = view;
                SelectPatientName.DataValueField = "PatientId";
                SelectPatientName.DataTextField  = "PatientName";
                SelectPatientName.DataBind();
                SelectPatientName.Items.Insert(0, new ListItem(""));

                SelectedLetter.Value = Request.QueryString["firstLetter"].ToString();
            }
            else
            {
                SelectedLetter.Value = "";
            }
            SelectInstitutionTable.Visible = false;
        }
    }//end page_load
예제 #19
0
 protected void BuildHPI()
 {
     if (patientID != 0)
     {
         try
         {
             PatientDa pDa   = new PatientDa();
             DataSet   hpiDs = pDa.GetPatientHPIKidney(this.patientID);
             hpi.DataSource = hpiDs.Tables[0].DefaultView;
             hpi.DataBind();
         }
         catch (Exception ex)
         {
             hpi.Visible = false;
             ExceptionHandler.Publish(ex);
         }
     }
 }
예제 #20
0
        override protected void Page_Load(object sender, System.EventArgs e)
        {
            AppointmentDa aptDa = new AppointmentDa();

            //populate clinic list Physicians from look up codes
            //rptClinicPhysicians.DataSource = CacheManager.GetLookupCodeList("apptPhysician");
            //updated 9/22 fs
            rptClinicPhysicians.DataSource = aptDa.GetDistinctAppointmentPhysicians().Tables[0].DefaultView;
            rptClinicPhysicians.DataBind();


            //append inpatient services to the bottom of the clinic list drop down
            //added 12/06/04 to allow form printing of inpatients
            InPatientDa ipda = new InPatientDa();

            rptInPatientServices.DataSource = ipda.GetInPatientServices();
            rptInPatientServices.DataBind();

            //populate contact status from distinct values- status also present in look up codes
            PatientDa patDa = new PatientDa();
            //count of patients in each contact status should be based on dataset user is logged into
            string  datasetSql      = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataSet contactStatusDs = patDa.GetDistinctContactStatus(datasetSql);

            rptStatus.DataSource = contactStatusDs;
            rptStatus.DataBind();

            //populate categories from distinct values, takes username to display private
            SecurityController ct       = new SecurityController();
            string             userName = ct.GetUserName();

            CategoryDa catDa = new CategoryDa();
            DataSet    catDs = catDa.GetDistinctCategories(userName);

            rptCategories.DataSource = catDs;
            rptCategories.DataBind();

            //v5.1: count of patients by action items
            ActionDa  actionDa = new ActionDa();
            DataTable actionDt = actionDa.GetDistinctPatientActions(datasetSql);

            rptActions.DataSource = actionDt;
            rptActions.DataBind();
        }
예제 #21
0
        protected void BuildHPI()
        {
            try
            {
                PatientDa hpiDa = new PatientDa();
                DataSet   hpiDs = hpiDa.GetPatientHPIForEForm(this._patientId, 0, 0, 1);

                if (hpiDs.Tables[0].Rows.Count > 0)
                {
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();
                }
                else
                {
                    NoHPIMsg.Visible = true;
                }



                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"];
                    ShowDxBiopsy(hpiBiopsyId);
                }
            }
            catch (Exception ex)
            {
                hpi.Visible = false;
                //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                ExceptionHandler.Publish(ex);
            }



            PopulateHPIPreTxPotency();



            BuildHpiProstatectomies(this._patientId, this._eformName, "Dynamic");
            BuildHpiProtocols(this._patientId, this._eformName, "Dynamic");
            BuildHpiBiopsies(this._patientId, this._eformName, "Dynamic", hpiBiopsyId);
            BuildHPINerveStatus();
        }
예제 #22
0
        //protected Hashtable TimeSpanByYearsMonthsDays(DateTime FirstDate, DateTime SecondDate)
        //{
        //    Hashtable span = new Hashtable();
        //    span.Add("Years", 0);
        //    span.Add("Months", 0);
        //    span.Add("Days", 0);

        //    int diff = (SecondDate - FirstDate).Days;
        //    if (diff > 365)
        //    {
        //        int years = (int)(Math.Floor(diff / 365.25));
        //        int extraMonthDays = (int)(Math.Floor(diff % (365.25)));
        //        int months = (int)(Math.Floor(extraMonthDays / (365.25 / 12)));
        //        int extraDays = (int)(Math.Round(extraMonthDays % (365.25 / 12)));

        //        span["Years"] = years;
        //        span["Months"] = months;
        //        span["Days"] = extraDays;
        //    }
        //    else if (diff > 30)
        //    {
        //        int months = (int)(Math.Floor(diff / (365.25 / 12)));
        //        int extraDays = (int)(Math.Round(diff % (365.25 / 12)));
        //        span["Months"] = months;
        //        span["Days"] = extraDays;
        //    }
        //    else
        //    {
        //        span["Days"] = diff.ToString() + " days";
        //    }

        //    return span;
        //}


        protected int?PatientAge(int PatientId)
        {
            int?age = null;

            string    datasetSQL = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            PatientDa p          = new PatientDa();
            DataTable pt         = p.GetPatientById(PatientId, datasetSQL);

            if (pt.Rows.Count == 1 && pt.Rows[0][BOL.Patient.PtBirthDateText].ToString().Length > 0)
            {
                DateTime dob = new DateTime();
                if (DateTime.TryParse(pt.Rows[0][BOL.Patient.PtBirthDateText].ToString(), out dob))
                {
                    int diff = (DateTime.Now - dob).Days;
                    age = (int)(Math.Floor(diff / 365.2422));
                }
            }
            return(age);
        }
예제 #23
0
        protected void BuildHPI()
        {
            InitContentBuffer();

            PatientDa hpiDa = new PatientDa();
            DataSet   hpiDs;

            hpiDs = hpiDa.GetPatientHPIProstateGU(this._patientId, 1);

            if (hpiDs.Tables[0].Rows.Count > 0)
            {
                DataTable ExpandedHpiDT = ExpandedHpi(hpiDs.Tables[0]);
                hpi.DataSource = ExpandedHpiDT.DefaultView;
                hpi.DataBind();
            }
            else
            {
                NoHPIMsg.Visible = true;
            }
        }
예제 #24
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();
                    DataSet   hpiDs = hpiDa.GetPatientHPIBreast(this.patientID);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();

                    int rowCount = hpiDs.Tables[0].Rows.Count;
                }
                catch (Exception ex)
                {
                    hpi.Visible = false;
                    ExceptionHandler.Publish(ex);
                }
            }
        }
예제 #25
0
        protected void GetLastProblemPlans()
        {
            if (patientID != 0)
            {
                PatientDa da = new PatientDa();
                DataSet   ds = da.FormGetLastPatientProblemPlans(this.patientID);
                if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    dt.Columns.Add("ProblemDisplayName");
                    dt.Rows[0]["ProblemDisplayName"] = dt.Rows[0][BOL.PatientProblem.ProblemName];

                    if (dt.Rows.Count > 1)
                    {
                        for (int i = 1; i < dt.Rows.Count; i++)
                        {
                            if (dt.Rows[i][BOL.PatientProblem.ProblemName].ToString() != dt.Rows[i - 1][BOL.PatientProblem.ProblemName].ToString())
                            {
                                dt.Rows[i]["ProblemDisplayName"] = dt.Rows[i][BOL.PatientProblem.ProblemName];
                            }
                        }
                    }

                    RptProblems.DataSource = ds.Tables[0].DefaultView;
                    RptProblems.DataBind();
                    noProblemPlans.Visible = false;

                    string ProblemPlanNoteText = "";
                    if (dt.Rows[0][BOL.Encounter.EncPhysician].ToString().Length > 0)
                    {
                        ProblemPlanNoteText += "by " + dt.Rows[0][BOL.Encounter.EncPhysician].ToString();
                    }
                    if (dt.Rows[0][BOL.Encounter.EncDateText].ToString().Length > 0)
                    {
                        ProblemPlanNoteText += " on " + dt.Rows[0][BOL.Encounter.EncDateText].ToString();
                    }

                    ProblemPlanNote.Text = (ProblemPlanNoteText.Length > 0) ? ProblemPlanNoteText : "(None Recorded)";
                }
            }
        }
예제 #26
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa hpiDa = new PatientDa();
                    DataSet   hpiDs = hpiDa.GetPatientHPI(this.patientID, 0, 0);
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();

                    int rowCount = hpiDs.Tables[0].Rows.Count;


                    //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();
                     */
                    // set the value of the biopsy Id that is to be REMOVED from the results of the
                    // stored proc spFormListBiopsies so that the biopsy is only listed once in the
                    // hpi section of the form

                    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"];
                    }
                }
                catch (Exception ex)
                {
                    hpi.Visible = false;
                    //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                    ExceptionHandler.Publish(ex);
                }
            }
        }
예제 #27
0
        protected void BuildHPI()
        {
            if (patientID != 0)
            {
                try
                {
                    PatientDa pDa      = new PatientDa();
                    DataSet   hpiDs    = pDa.GetPatientHPIBladder(this.patientID);
                    int       rowCount = hpiDs.Tables[0].Rows.Count;

                    if (rowCount > 0)
                    {
                        hpi.DataSource = hpiDs.Tables[0].DefaultView;
                        hpi.DataBind();

                        if (rowCount > (NumHpiRowsAllowed / 5))
                        {
                            BlankHPITable.Visible = false;
                        }
                    }
                    else
                    {
                        PopulatedHPITable.Visible = false;
                    }
                }
                catch (Exception ex)
                {
                    BlankHPITable.Visible     = true;
                    PopulatedHPITable.Visible = false;
                    //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                    ExceptionHandler.Publish(ex);
                }
            }
            else
            {
                PopulatedHPITable.Visible = false;
            }
        }
예제 #28
0
 protected void BuildHPI()
 {
     try
     {
         PatientDa pDa   = new PatientDa();
         DataSet   hpiDs = pDa.GetPatientHPIBladder(this._patientId);
         DataView  view  = new DataView(hpiDs.Tables[0]);
         if (view.Count > 0)
         {
             hpi.DataSource = view;
             hpi.DataBind();
             NoHPIMsgTr.Visible = false;
         }
     }
     catch (Exception ex)
     {
         hpi.Visible = false;
         ExceptionHandler.Publish(ex);
         NoHPIMsgTr.Visible    = true;
         NoHPIMsgTd.InnerHtml  = "There was an error retreiving the HPI for this patient.";
         NoHPIMsgTd.InnerHtml += ex.Message;
     }
 }
예제 #29
0
        protected void BuildHPI()
        {
            try
            {
                PatientDa hpiDa = new PatientDa();
                DataSet   hpiDs = hpiDa.GetPatientHPIForEForm(this._patientId, 0, 0, 1);

                if (hpiDs.Tables[0].Rows.Count > 0)
                {
                    hpi.DataSource = hpiDs.Tables[0].DefaultView;
                    hpi.DataBind();
                }
                else
                {
                    NoHPIMsg.Visible = true;
                }
            }
            catch (Exception ex)
            {
                hpi.Visible = false;
                //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                ExceptionHandler.Publish(ex);
            }
        }
예제 #30
0
        protected void BuildHPI()
        {
            try
            {
                PatientDa hpiDa = new PatientDa();
                DataSet   hpiDs = hpiDa.GetPatientHPIForEForm(this._patientId, 0, 0, 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();

                NomogramDa nda = new NomogramDa();

                string PreRP5Error    = null;
                string PreRP10Error   = null;
                string PreXRTError    = null;
                string PreBrachyError = null;
                string PostRP7Error   = null;
                string PostRP10Error  = null;

                try
                {
                    preRP5Nomo.Text = ((int)Math.Round(nda.GetPreRPResult(this._patientId, 5), 0)).ToString();
                }
                catch (NomogramDataException e1)
                {
                    PreRP5Error = e1.Message;
                }

                try
                {
                    preRP10Nomo.Text = ((int)Math.Round(nda.GetPreRPResult(this._patientId, 10), 0)).ToString();
                }
                catch (NomogramDataException e2)
                {
                    PreRP10Error = e2.Message;
                }

                try
                {
                    preXRTNomo.Text = ((int)Math.Round(nda.GetPreXRTResult(this._patientId), 0)).ToString();
                }
                catch (NomogramDataException e3)
                {
                    PreXRTError = e3.Message;
                }

                try
                {
                    preBrachyNomo.Text = ((int)Math.Round(nda.GetPreBrachyResult(this._patientId), 0)).ToString();
                }
                catch (NomogramDataException e4)
                {
                    PreBrachyError = e4.Message;
                }

                try
                {
                    postRP7yrNomo.Text = ((int)Math.Round(nda.GetPostRPResult(this._patientId, 7), 0)).ToString();
                }
                catch (NomogramDataException e5)
                {
                    PostRP7Error = e5.Message;
                }

                try
                {
                    postRP10yrNomo.Text = ((int)Math.Round(nda.GetPostRPResult(this._patientId, 10), 0)).ToString();
                }
                catch (NomogramDataException e6)
                {
                    PostRP10Error = e6.Message;
                }

                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"];
                }



                //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 (PreRP5Error != null && PreRP5Error.Length > 0)
                {
//						preRPNomo.ToolTip = PreRPError;
//						preRPNomo.Attributes.Add("style", "cursor:hand;");
                    preRP5Nomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\">&nbsp;" + PreRP5Error;
                    // old:with error displayed all the time
                    //NomogramError.Text += "<strong>* Cannot calculate PreRP:</strong>&nbsp;&nbsp;" + PreRPError + "<br/>";
                    //preRPNomo.Text += "*";
                }

                if (PostRP10Error != null && PostRP10Error.Length > 0)
                {
                    preRP10Nomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\">&nbsp;" + PreRP10Error;
                }

                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\">&nbsp;" + PreXRTError;
                        // old:with error displayed all the time
                        //NomogramError.Text += "<strong>** Cannot calculate PreXRT:</strong>&nbsp;&nbsp;" + 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\">&nbsp;" + PreBrachyError;
                    // old:with error displayed all the time
                    //NomogramError.Text += "<strong>*** Cannot calculate PreBrachy:</strong>&nbsp;&nbsp;" + PreBrachyError + "<br/>";
                    //preBrachyNomo.Text += "***";
                }
                if (PostRP7Error != null && PostRP7Error.Length > 0)
                {
                    if (PostRP7Error == "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\">&nbsp;" + PostRP7Error;

                        // old:with error displayed all the time
                        //NomogramError.Text += "<strong>**** Cannot calculate PostRP:</strong>&nbsp;&nbsp;" + PostRPError;
                        //postRP2yrNomo.Text += "****";
                        //postRP5yrNomo.Text += "****";
                        //postRP7yrNomo.Text += "****";
                    }
                }

                if (PostRP10Error != null && PostRP10Error.Length > 0)
                {
                    if (PostRP10Error == "No radical prostatectomy noted.")
                    {
                        postRP10yrNomo.Text = "No RP";
                    }
                    else
                    {
                        postRP10yrNomo.Text += "<img src=\"../../Images/NomogramAlert.gif\" width=\"9\" height=\"9\">&nbsp;" + PostRP10Error;
                    }
                }
            }
            catch (Exception ex)
            {
                hpi.Visible = false;
                //Caisis.UI.Other.EmailError.SendErrorEmail( "Clinic Form: " + this._formTitle, "error creating hpi output");
                ExceptionHandler.Publish(ex);
            }



            PopulateHPIPreTxPotency();



// this condition doesn't work, since this.EFormName doesn't always have a value
// so at the moment, on a GU form we are showing many things that don't need to be there.  - jf
//			if (this._eformName != null && this._eformName.IndexOf("GU") < 0)
//			{
            BuildHpiProstatectomies(this._patientId, this._eformName, "Dynamic");
            BuildHpiProtocols(this._patientId, this._eformName, "Dynamic");
            BuildHpiBiopsies(this._patientId, this._eformName, "Dynamic", hpiBiopsyId);
            BuildHPINerveStatus();

//			}
        }