예제 #1
0
        protected void BuildOtherStatusRow(string Status, Label StatusDateLabel, EformHidden StatusDate, EformTextBox StatusDateText, HtmlTableRow StatusRow, EformCheckBox CurrentStatusCheckBox, EformComboBox StatusValue)
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.FormGetLastStatusByStatus(this._patientId, this._eformName, "Dynamic", Status);

            // set the number of blank rows that are added to the medications section

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                if (sDs.Tables[0].Rows[0]["StatusDateText"].ToString().Length > 0)
                {
                    StatusDateLabel.Text          = sDs.Tables[0].Rows[0]["StatusDateText"].ToString();
                    StatusDateText.Visible        = false;
                    CurrentStatusCheckBox.Visible = false;
                    ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
                }
                else if (sDs.Tables[0].Rows[0]["StatusDate"].ToString().Length > 0)
                {
                    StatusDateLabel.Text          = sDs.Tables[0].Rows[0]["StatusDate"].ToString();
                    StatusDateText.Visible        = false;
                    CurrentStatusCheckBox.Visible = false;
                    ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
                }
                else
                {
                    CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "', '" + StatusDate.ClientID + "');");
                    StatusDateLabel.Visible = false;   // prob not necessary -jf
                }
            }
            else
            {
                CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "', '" + StatusDate.ClientID + "');");
                StatusDateLabel.Visible = false;   // prob not necessary -jf
            }
        }
예제 #2
0
        protected string GetLastStatus(int PatientID, string FormName, string FormType)
        {
            string returnString = "";

            StatusDa sDa = new StatusDa();

            returnString = sDa.FormGetLastStatus(PatientID, FormName, FormType);


            return(returnString);
        }
예제 #3
0
        protected virtual void BuildKidneyDiseaseState(int PatientID, string FormName, string FormType)
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.GetStatus(PatientID, "Kidney");

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                StatusRpt.DataSource = sDs.Tables[0].DefaultView;
                StatusRpt.DataBind();
            }
        }
예제 #4
0
        protected virtual void BuildStatus(int patientId, string PatientStatus)
        {
            StatusDa Da = new StatusDa();
            DataSet  Ds = Da.GetStatus(patientId, PatientStatus);

            if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
            {
                StatusRpt.DataSource = Ds.Tables[0].DefaultView;
                StatusRpt.DataBind();
            }
        }
예제 #5
0
        protected void GetAliveStatus()
        {
            StatusDa da   = new StatusDa();
            DataSet  ds   = da.GetStatusField(_patientId, "Alive");
            DataView view = ds.Tables[0].DefaultView;

            if (view.Count >= 1)
            {
                SpineLastKnownAliveRpt.DataSource = view;
                SpineLastKnownAliveRpt.DataBind();
            }
        }
예제 #6
0
        protected void BuildStatusRptr(int PatientId, string EformName, string EformType)
        {
            StatusDa statusDa = new StatusDa();
            DataSet  statusDs = statusDa.GetStatus(PatientId, "Salivary Cancer");
            DataView dv       = new DataView(statusDs.Tables[0]);

            dv.RowFilter = Status.Status_Field + " LIKE '%Recurrence%' OR " + Status.Status_Field + " LIKE '%Metastasis%' ";
            if (dv.Count > 0)
            {
                StatusRptr.DataSource = dv;
                StatusRptr.DataBind();
            }
        }
        protected void ShowLastStatus()
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.GetStatus(this._patientId, "Prostate Cancer");

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                DataView sDv = new DataView(sDs.Tables[0]);
                sDv.Sort = BOL.Status.StatusDate + " DESC";

                lastProstateStatus.Text         = sDv[0][BOL.Status.Status_Field].ToString() + " on " + sDv[0][BOL.Status.StatusDateText].ToString();
                lastProstateStatusTable.Visible = true;
            }
        }
예제 #8
0
        protected virtual void BuildDiseaseStateForDisease(int PatientID, string Disease)
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.GetStatus(PatientID, Disease);

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                if (StatusMsg != null)
                {
                    StatusMsg.Visible = false;
                }
                StatusRpt.DataSource = sDs.Tables[0].DefaultView;
                StatusRpt.DataBind();
            }
        }
예제 #9
0
        protected void GetStatus()
        {
            StatusDa da   = new StatusDa();
            DataSet  ds   = da.GetStatusField(_patientId, "Diagnosis Date");
            DataView view = ds.Tables[0].DefaultView;

            if (view.Count >= 1)
            {
                SpineStatusRpt.DataSource = view;
                SpineStatusRpt.DataBind();
            }
            else
            {
                NoSpineStatusMsgTr.Style.Add("display", "block");
            }
        }
예제 #10
0
        override protected string GetLastStatus()
        {
            string returnString = "Date:";

            if (patientID != 0)
            {
                StatusDa sDa         = new StatusDa();
                string   StatusCheck = sDa.FormGetLastStatus(this.patientID, this._formName, "Dynamic");
                if (StatusCheck != null && StatusCheck.Length > 0)
                {
                    returnString        = StatusCheck;
                    LastStatus.CssClass = "blackBoldText";
                }
            }
            return(returnString);
        }
예제 #11
0
        protected void GetDiagnosis(int PatientID, string FormName, string FormType)
        {
            StatusDa statusDa = new StatusDa();
            DataSet  statusDs = statusDa.GetStatusField(PatientID, "Diagnosis Date");

            if (statusDs.Tables.Count > 0 && statusDs.Tables[0].Rows.Count > 0)
            {
                // limit to last 10 records
                PastRecordsCountStatus = statusDs.Tables[0].Rows.Count;
                DataView statusDv = new DataView(statusDs.Tables[0]);
                statusDv.Sort = Status.StatusDate + " DESC ";
                statusDv      = GetTopDataViewRows(statusDv, 10);
                statusDv.Sort = Status.StatusDate + " ASC ";

                DiagnosisHx.DataSource = statusDv;
                DiagnosisHx.DataBind();
            }
            else
            {
                PastRecordsCountStatus = 0;
            }
        }
예제 #12
0
        protected void PreSetDiagnosisDate(string Status)
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.FormGetLastStatusByStatus(this._patientId, this._eformName, "Dynamic", Status);


            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                if (sDs.Tables[0].Rows[0]["StatusDateText"].ToString().Length > 0)
                {
                    PresetDiagnosisDateText = sDs.Tables[0].Rows[0]["StatusDateText"].ToString();
                }
                if (sDs.Tables[0].Rows[0]["StatusDate"].ToString().Length > 0)
                {
                    PresetDiagnosisDate = sDs.Tables[0].Rows[0]["StatusDate"].ToString();
                }
            }
            else
            {
                PresetDiagnosisDateText = Diagnosis_StatusDateText.Value;
                PresetDiagnosisDate     = Diagnosis_StatusDate.Value;
            }
        }
예제 #13
0
        /// <summary>
        /// Displays the patients last status
        /// </summary>
        protected void ShowActiveSurveillance()
        {
            bool   ActiveSurveillanceStarted     = false;
            string ActiveSurveillanceStartedDate = "";
            bool   ActiveSurveillanceEnded       = false;
            string ActiveSurveillanceEndedDate   = "";

            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.GetStatus(this._patientId, "Prostate Cancer");

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                DataTable sDt = sDs.Tables[0];
                DataView  ActiveSurveillanceRecords = new DataView(sDt);
                ActiveSurveillanceRecords.RowFilter = BOL.Status.Status_Field + " IN ('Active Surveillance', 'Watchful Waiting')";

                if (ActiveSurveillanceRecords.Count > 0)
                {
                    ActiveSurveillanceStarted     = true;
                    ActiveSurveillanceStartedDate = ActiveSurveillanceRecords[0][BOL.Status.StatusDateText].ToString();

                    DataView EndActiveSurveillanceRecords = new DataView(sDt);
                    EndActiveSurveillanceRecords.RowFilter = BOL.Status.Status_Field + " = 'End Active Surveillance'";

                    if (EndActiveSurveillanceRecords.Count > 0)
                    {
                        ActiveSurveillanceEnded     = true;
                        ActiveSurveillanceEndedDate = EndActiveSurveillanceRecords[0][BOL.Status.StatusDateText].ToString();
                    }
                }
            }

            if (ActiveSurveillanceStarted && !ActiveSurveillanceEnded)
            {
                EndActiveSurveilancePanel.Visible = true;
            }
        }
예제 #14
0
        /// <summary>
        /// Displays the patients last status
        /// </summary>
        protected void ShowLastStatus()
        {
            //string status = GetLastStatus(this._patientId, this._eformName, "Dynamic");
            //if (status.Length > 0)
            //{
            //    LastStatus.Text = status + "<br/><br/>";
            //}



            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.GetStatus(_patientId, "Prostate Cancer");

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                LastStatusDisplayRow.Visible = true;
                DataRow sDr = sDs.Tables[0].Rows[sDs.Tables[0].Rows.Count - 1];
                LastStatus.Text = "Last Status: " + sDr[BOL.Status.Status_Field] + " on " + sDr[BOL.Status.StatusDateText];
                if (sDr[BOL.Status.StatusQuality].ToString().Length > 0)
                {
                    LastStatus.Text += " (Data Quality: " + sDr[BOL.Status.StatusQuality].ToString() + ")";
                }
            }
        }
예제 #15
0
        // add an active surveillance record to Caisis if the patient doesn't already have one
        private void AddActiveSurveillanceStatus()
        {
            StatusDa sDa            = new StatusDa();
            DataSet  sDs            = sDa.GetStatus(this._patientId, "Prostate%");
            bool     ASRecordExists = false;

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                DataView sDv = new DataView(sDs.Tables[0]);
                sDv.RowFilter = BOL.Status.Status_Field + " IN ('Active Surveillance', 'Watchful Waiting') and " + BOL.Status.StatusDate + " IS NOT NULL";

                if (sDv.Count > 0)
                {
                    ASRecordExists = true;
                }
            }


            if (!ASRecordExists)
            {
//                ActiveSurveillanceStatusMsg.Visible = true;
                ASStatus.Visible = true;
            }
        }
예제 #16
0
        public static string ActiveSurveillanceDate(int patientID)
        {
            string ASDateStr = "";

            if (patientID != 0)
            {
                DateTime ASStatusDate             = new DateTime();
                string   ASStatusDateText         = "";
                bool     PatientHasASStatusRecord = false;

                // check for Previous AS Status----------------------------------
                StatusDa sDa = new StatusDa();
                DataSet  sDs = sDa.GetStatus(patientID, "Prostate%");

                if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
                {
                    DataView sDv = new DataView(sDs.Tables[0]);
                    sDv.RowFilter = BOL.Status.Status_Field + " IN ('Active Surveillance', 'Watchful Waiting') and " + BOL.Status.StatusDate + " IS NOT NULL";
                    sDv.Sort      = "StatusDate ASC";

                    if (sDv.Count > 0)
                    {
                        ASStatusDate             = (DateTime)sDv[0][BOL.Status.StatusDate];
                        ASStatusDateText         = sDv[0][BOL.Status.StatusDateText].ToString();
                        PatientHasASStatusRecord = true;
                    }
                }
                //-------------------------------------------------------------------

                if (PatientHasASStatusRecord)
                {
                    DateTime ASDate     = new DateTime();
                    string   ASDateText = "";

                    DataTable ProstateBiopsies;
                    BiopsyDa  bDa = new BiopsyDa();
                    ProstateBiopsies = bDa.GetProstateBiopsies(patientID);

                    // make sure patient has biopsies
                    if (ProstateBiopsies.Rows.Count > 0)
                    {
                        // check for GGS > 0
                        DataView PVView = new DataView(ProstateBiopsies);
                        PVView.RowFilter = BOL.Procedure.ProcDate + " IS NOT NULL and (" + BOL.BiopsyProstatePathology.PathGG1 + " > 0 or " + BOL.BiopsyProstatePathology.PathGG2 + " > 0 or " + BOL.BiopsyProstatePathology.PathGGS + " > 0)";
                        if (PVView.Count > 0)
                        {
                            PVView.Sort = BOL.Procedure.ProcDate + " ASC";


                            // info on first positive biopsy--------------
                            DateTime FirstPosBiopsyDate     = ((DateTime)PVView[0][BOL.Procedure.ProcDate]);
                            string   FirstPosBiopsyDateText = PVView[0][BOL.Procedure.ProcDateText].ToString();
                            bool     FirstPosBiopsyIsSTD    = PVView[0][BOL.Procedure.ProcQuality].ToString().Equals("STD");



                            // info on first positive MSK biopsy (might be the same as above)--------------
                            DateTime FirstMSKPosBiopsyDate     = new DateTime();
                            string   FirstMSKPosBiopsyDateText = "";

                            DataView MSKPosBiopies = new DataView(PVView.ToTable());
                            MSKPosBiopies.RowFilter = BOL.Procedure.ProcQuality + " = 'STD'";



                            if (FirstPosBiopsyIsSTD)
                            {
                                FirstMSKPosBiopsyDate     = FirstPosBiopsyDate;
                                FirstMSKPosBiopsyDateText = FirstPosBiopsyDateText;
                            }
                            else
                            {
                                if (MSKPosBiopies.Count > 0)
                                {
                                    FirstMSKPosBiopsyDate     = ((DateTime)MSKPosBiopies[0][BOL.Procedure.ProcDate]);
                                    FirstMSKPosBiopsyDateText = MSKPosBiopies[0][BOL.Procedure.ProcDateText].ToString();
                                }
                            }



                            //all MSK Biopsies
                            DataView MSKAllBiopsies = new DataView(ProstateBiopsies);
                            MSKAllBiopsies.RowFilter = BOL.Procedure.ProcQuality + " = 'STD'";
                            DateTime FirstMSKBiopsyDate     = new DateTime();
                            string   FirstMSKBiopsyDateText = "";
                            DateTime LastMSKBiopsyDate      = new DateTime();
                            string   LastMSKBiopsyDateText  = "";
                            if (MSKAllBiopsies.Count > 0)
                            {
                                FirstMSKBiopsyDate     = ((DateTime)MSKAllBiopsies[0][BOL.Procedure.ProcDate]);
                                FirstMSKBiopsyDateText = MSKAllBiopsies[0][BOL.Procedure.ProcDate].ToString();
                                LastMSKBiopsyDate      = ((DateTime)MSKAllBiopsies[MSKAllBiopsies.Count - 1][BOL.Procedure.ProcDate]);
                                LastMSKBiopsyDateText  = MSKAllBiopsies[MSKAllBiopsies.Count - 1][BOL.Procedure.ProcDate].ToString();
                            }



                            if (FirstMSKBiopsyDate > DateTime.MinValue && ASStatusDate < FirstMSKBiopsyDate)  // patient has an MSK Pos biopsy and AS Record is earlier
                            {
                                if (!FirstPosBiopsyIsSTD && (FirstMSKBiopsyDate - FirstPosBiopsyDate).TotalDays > 365)
                                {
                                    // AS Date is set
                                    ASDate     = ASStatusDate;
                                    ASDateText = ASStatusDateText;
                                }
                                else
                                {
                                    // AS Date is set
                                    ASDate     = FirstMSKBiopsyDate;
                                    ASDateText = FirstMSKBiopsyDateText;
                                }
                            }



                            if (ASDate.Equals(DateTime.MinValue)) // AS Date is not set yet
                            {
                                if (FirstPosBiopsyIsSTD)
                                {
                                    if (MSKPosBiopies.Count > 1 && ((DateTime)MSKPosBiopies[1][BOL.Procedure.ProcDate] - FirstMSKPosBiopsyDate).TotalDays <= 365)
                                    {
                                        ASDate     = (DateTime)MSKPosBiopies[1][BOL.Procedure.ProcDate];
                                        ASDateText = MSKPosBiopies[1][BOL.Procedure.ProcDateText].ToString();
                                    }
                                    else
                                    {
                                        ASDate     = FirstPosBiopsyDate;     // same value as FirstMSKPosBiopsyDate;
                                        ASDateText = FirstPosBiopsyDateText; // same value as FirstMSKPosBiopsyDateText;
                                    }
                                }
                                else // first pos biopsy is outside
                                {
                                    int FirstBiopsyGG1 = 0;
                                    int FirstBiopsyGG2 = 0;
                                    int FirstBiopsyGGS = 0;

                                    if (PVView[0][BOL.BiopsyProstatePathology.PathGGS].ToString().Length > 0)
                                    {
                                        // if first biopsy has GGS = 6 AND has subsequent MSK biopsy         //not necessary anymore--> (msk biopsy is 1 yr or more later)
                                        // if the last MSK biopsy is after the first pos biopsy, there is a subsequent MSK biopsy
                                        if (MSKAllBiopsies.Count > 0 && (LastMSKBiopsyDate > FirstPosBiopsyDate)) //FirstBiopsyGGS == 6 &&
                                        {
                                            // get first MSK biopsy after first pos biopsy
                                            DataRowView ASMSKBiopsy = FirstBiopsyAfterDate(MSKAllBiopsies.ToTable(), FirstPosBiopsyDate);
                                            if (ASMSKBiopsy != null)
                                            {
                                                ASDate     = (DateTime)ASMSKBiopsy[BOL.Procedure.ProcDate];
                                                ASDateText = ASMSKBiopsy[BOL.Procedure.ProcDateText].ToString();
                                            }
                                        }
                                        else
                                        {
                                            ASDate     = ASStatusDate;
                                            ASDateText = ASStatusDateText;
                                        }
                                    }
                                    else if (int.TryParse(PVView[0][BOL.BiopsyProstatePathology.PathGG1].ToString(), out FirstBiopsyGG1) && int.TryParse(PVView[0][BOL.BiopsyProstatePathology.PathGG2].ToString(), out FirstBiopsyGG2))
                                    {
                                        //                                    FirstBiopsyGGS = FirstBiopsyGG1 + FirstBiopsyGG2;
                                        // if first biopsy has GGS = 6 AND has subsequent MSK biopsy         //not necessary anymore--> (msk biopsy is 1 yr or more later)
                                        // if the last MSK biopsy is after the first pos biopsy, there is a subsequent MSK biopsy
                                        if (MSKAllBiopsies.Count > 0 && (LastMSKBiopsyDate > FirstPosBiopsyDate)) //FirstBiopsyGGS == 6 &&
                                        {
                                            // get first MSK biopsy after first pos biopsy
                                            DataRowView ASMSKBiopsy = FirstBiopsyAfterDate(MSKAllBiopsies.ToTable(), FirstPosBiopsyDate);
                                            if (ASMSKBiopsy != null)
                                            {
                                                ASDate     = (DateTime)ASMSKBiopsy[BOL.Procedure.ProcDate];
                                                ASDateText = ASMSKBiopsy[BOL.Procedure.ProcDateText].ToString();
                                            }
                                        }
                                        else
                                        {
                                            ASDate     = ASStatusDate;
                                            ASDateText = ASStatusDateText;
                                        }
                                    }
                                    else
                                    {
                                        ASDate     = ASStatusDate;
                                        ASDateText = ASStatusDateText;
                                    }
                                }
                            }



                            // if ASDate has been set, display ASDateText
                            if (ASDate > DateTime.MinValue)
                            {
                                ASDateStr = ASDateText;
                            }
                        }
                        //else leave blank
                    }
                }
            }

            return(ASDateStr);
        }