Ejemplo n.º 1
0
        protected void BuildBMDDiagnostics(int PatientID, string FormName, string FormType, string searchField, string searchClause, string[] searchFilter)
        {
            DiagnosticDa bmdDa = new DiagnosticDa();
            DataTable    bmdDt = bmdDa.GetDxImagesByType(PatientID, searchFilter);

            if (bmdDt.Rows.Count > 0)
            {
                NoDiagnostiMsgTr.Visible = false;
                DataTable parentDs = bmdDt.DefaultView.ToTable(true, Diagnostic.DiagnosticId, Diagnostic.DxDateText, Diagnostic.DxType, Diagnostic.DxResult, Diagnostic.DxInstitution);
                DataTable childDs  = bmdDt;

                parentDs.TableName = "Diagnostic";
                childDs.TableName  = "DiagnosticImageFindings";

                DataSet parentAndChildDs = new DataSet();
                parentAndChildDs.Tables.Add(parentDs.Copy());
                parentAndChildDs.Tables.Add(childDs.Copy());

                parentAndChildDs.Relations.Add("myrelation", parentAndChildDs.Tables["Diagnostic"].Columns[Diagnostic.DiagnosticId], parentAndChildDs.Tables["DiagnosticImageFindings"].Columns[Diagnostic.DiagnosticId]);


                BmdRptr.DataSource = parentAndChildDs.Tables["Diagnostic"].DefaultView;
                BmdRptr.DataBind();
            }
            else
            {
                NoDiagnostiMsgTr.Visible = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the next ImgFindGroupNum based on current type of scan
        /// </summary>
        /// <returns></returns>
        private int GetNextGroupNum()
        {
            DiagnosticDa da           = new DiagnosticDa();
            int          nextGroupNum = da.GetNextDxImgGroupNum(int.Parse(BaseDecryptedPatientId), ImageTypes);

            return(nextGroupNum);
        }
Ejemplo n.º 3
0
        override protected void BuildImages(int MinNumImageRowsToShow, int minNumBlankImageRows)
        {
            if (patientID != 0)
            {
                DiagnosticDa imagesDa = new DiagnosticDa();
                DataSet      imagesDs = imagesDa.FormGetDxImages(this.patientID, this._formName, "Dynamic", "NOT CT/MRI");

                if (imagesDs.Tables.Count > 0)
                {
                    int numBlankImageRows = MinNumImageRowsToShow - imagesDs.Tables[0].Rows.Count;

                    /* this code truncated the text in the notes field.  removed 11/17 from development.
                     *                  if (imagesDs.Tables[0].Rows.Count > 0)
                     *                  {
                     *
                     *                          for (int i=0; i<(imagesDs.Tables[0].Rows.Count - 1); i++)
                     *                          {
                     *                                  int DxNotesLength = imagesDs.Tables[0].Rows[i]["DxNotes"].ToString().Length;
                     *                                  if (DxNotesLength > 255)
                     *                                  {
                     *                                          imagesDs.Tables[0].Rows[i]["DxNotes"] = imagesDs.Tables[0].Rows[i]["DxNotes"].ToString().Remove(255, (DxNotesLength-255)) + "...";
                     *                                  }
                     *                          }
                     *                  }
                     */



                    // be sure you have at least the number of blank rows specified earlier
                    if (numBlankImageRows < minNumBlankImageRows)
                    {
                        numBlankImageRows = minNumBlankImageRows;
                    }

                    // add the blank rows
                    for (int i = 0; i < numBlankImageRows; i++)
                    {
                        DataRow blankImageRow;
                        blankImageRow = imagesDs.Tables[0].NewRow();
                        blankImageRow["DxDateText"] = "/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/";
                        blankImageRow["DxType"]     = "";
                        blankImageRow["DxResult"]   = "";
                        blankImageRow["DxNotes"]    = "";
                        imagesDs.Tables[0].Rows.Add(blankImageRow);
                    }

                    images.DataSource = imagesDs.Tables[0].DefaultView;
                }
                else
                {
                    images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
                }
            }
            else
            {
                images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
            }

            images.DataBind();
        }
Ejemplo n.º 4
0
        protected virtual void BuildImagesWithKidneyFindings(int MinNumImageRowsToShow, int minNumBlankImageRows)
        {
            string[] kidneyDx = new string[] { "CT Scan", "MRI", "Ultrasound" };

            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetDiagnosticsByType(this._patientId, kidneyDx);

            if (imagesDt.Rows.Count > 0)
            {
                // filter to last 18mo
                DataView imagesDv     = new DataView(imagesDt);
                string   imagesFilter = BOL.Diagnostic.DxDate + " >= #" + DateTime.Now.AddMonths(-18).Date.ToShortDateString() + "#";
                imagesFilter      += " AND (";
                imagesFilter      += BOL.Diagnostic.DxTarget + "  LIKE '%CHEST%'";
                imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%ABDOMEN%'";
                imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%PELVIS%'";
                imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%KIDNEY%'";
                imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%RENAL%'";
                imagesFilter      += ")";
                imagesDv.RowFilter = imagesFilter;


                imagesDv.Sort = BOL.Diagnostic.DxDate + " ASC";

                DataTable filteredImagesDt = imagesDv.ToTable();



                // check for older intitial CT/US
                DataView olderImagesDv     = new DataView(imagesDt);
                string   olderImagesFilter = BOL.Diagnostic.DxDate + " < #" + DateTime.Now.AddMonths(-18).Date.ToShortDateString() + "#";
                olderImagesFilter      += " AND " + BOL.Diagnostic.DxType + " <> 'MRI'";
                olderImagesFilter      += " AND (";
                olderImagesFilter      += BOL.Diagnostic.DxTarget + "  LIKE '%CHEST%'";
                olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%ABDOMEN%'";
                olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%PELVIS%'";
                olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%KIDNEY%'";
                olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%RENAL%'";
                olderImagesFilter      += ")";
                olderImagesDv.RowFilter = olderImagesFilter;
                olderImagesDv.Sort      = BOL.Diagnostic.DxDate + " ASC";

                if (olderImagesDv.Count > 0)
                {
                    filteredImagesDt.ImportRow(olderImagesDv[0].Row);
                    DataView repeaterDV = new DataView(filteredImagesDt);
                    repeaterDV.Sort  = BOL.Diagnostic.DxDate + " ASC";
                    filteredImagesDt = repeaterDV.ToTable();
                }


                images.DataSource = filteredImagesDt;
                images.DataBind();
            }
        }
Ejemplo n.º 5
0
        protected void BuildImagesMamograms(int PatientID)
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetDiagnosticsByType(PatientID, "Mammogram");

            if (imagesDt.Rows.Count > 0)
            {
                images.DataSource = imagesDt.DefaultView;
                images.DataBind();
            }
        }
Ejemplo n.º 6
0
        protected void BuildProstateImages()
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetProstateMRIFindings(this._patientId);

            if (imagesDt.Rows.Count > 0)
            {
                images.DataSource = imagesDt.DefaultView;
                images.DataBind();
            }
        }
Ejemplo n.º 7
0
        protected void BuildGUEFormImages(int PatientID, string FormName, string FormType)
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataSet      imagesDs = imagesDa.FormGetDxImages(PatientID, FormName, FormType);

            if (imagesDs.Tables.Count > 0 && imagesDs.Tables[0].Rows.Count > 0)
            {
                images.DataSource = imagesDs.Tables[0].DefaultView;
                images.DataBind();
            }
        }
Ejemplo n.º 8
0
        protected DataTable ProstateVolumesByDescendingDate(int PatientId)
        {
            DataTable volumes = new DataTable();


            // add PSA Density
            DiagnosticDa d = new DiagnosticDa();
            DataTable    ProstateImages        = d.GetProstateImageFindings(PatientId);
            DataView     ProstateImagesWithLWH = new DataView(ProstateImages);

            string prostateImgFilter = Diagnostic.DxDate + " IS NOT NULL";

            prostateImgFilter += " and Len(" + ImageProstate.ImgProstateHeight + ") > 0";
            prostateImgFilter += " and Len(" + ImageProstate.ImgProstateLength + ") > 0";
            prostateImgFilter += " and Len(" + ImageProstate.ImgProstateWidth + ") > 0";

            ProstateImagesWithLWH.RowFilter = prostateImgFilter;
            if (ProstateImagesWithLWH.Count > 0)
            {
                DataTable ProstateDimensions = ProstateImagesWithLWH.ToTable(false, Diagnostic.DxDateText, Diagnostic.DxDate, ImageProstate.ImgProstateHeight, ImageProstate.ImgProstateLength, ImageProstate.ImgProstateWidth, ImageProstate.ImgProstateVolume);

                foreach (DataRow ProstateMeasurement in ProstateDimensions.Rows)
                {
                    double ImgProstateHeight = 0;
                    double ImgProstateLength = 0;
                    double ImgProstateWidth  = 0;

                    if (double.TryParse(ProstateMeasurement[ImageProstate.ImgProstateHeight].ToString(), out ImgProstateHeight) &&
                        double.TryParse(ProstateMeasurement[ImageProstate.ImgProstateLength].ToString(), out ImgProstateLength) &&
                        double.TryParse(ProstateMeasurement[ImageProstate.ImgProstateWidth].ToString(), out ImgProstateWidth))
                    {
                        double vol = (ImgProstateHeight * ImgProstateLength * ImgProstateWidth * 0.52);
                        ProstateMeasurement[ImageProstate.ImgProstateVolume] = vol;
                    }
                    else
                    {
                        ProstateMeasurement[ImageProstate.ImgProstateVolume] = null;
                    }
                }

                DataView vols = new DataView(ProstateDimensions);
                vols.RowFilter = ImageProstate.ImgProstateVolume + " IS NOT NULL";
                vols.Sort      = Diagnostic.DxDate + " DESC";

                if (vols.Count > 0)
                {
                    volumes = vols.ToTable();
                }
            }

            return(volumes);
        }
Ejemplo n.º 9
0
        protected void BuildImaging(int PatientID, string FormName, string FormType)
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetImagingAll(PatientID);
            DataView     dv       = new DataView(imagesDt);

            dv.RowFilter = Diagnostic.DxType + " IN ('Colonoscopy', 'Stress Test')";

            if (dv.Count > 0)
            {
                images.DataSource = dv;
                images.DataBind();
            }
        }
Ejemplo n.º 10
0
        protected void BuildImaging(int PatientID, string FormName, string FormType)
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetImagingAll(PatientID);
            DataView     dv       = new DataView(imagesDt);

            dv.RowFilter = Diagnostic.DxType + " IN ('TRUS', 'MRUS')";

            if (dv.Count > 0)
            {
                NoImagesMsg.Visible = false;
                images.DataSource   = dv;
                images.DataBind();
            }
        }
Ejemplo n.º 11
0
        protected void BuildImaging(int PatientID, string FormName, string FormType)
        {
            DiagnosticDa imagesDa = new DiagnosticDa();
            DataTable    imagesDt = imagesDa.GetImagingAll(PatientID);
            DataView     dv       = new DataView(imagesDt);

            dv.RowFilter = Diagnostic.DxType + " IN ('MRI', 'MRSI', 'EMRI') and " + BOL.Diagnostic.DxTarget + " = 'Prostate'";



            if (dv.Count > 0)
            {
//                NoImagesMsg.Visible = false;
                images.DataSource = dv;
                images.DataBind();
            }
        }
Ejemplo n.º 12
0
        protected void BuildImagingHistory(int PatientID, string FormName, string FormType)
        {
            DataTable    dxDt, dxFindingDt;
            DiagnosticDa dxDa = new DiagnosticDa();

            // retrieve lookupcode values for specified dx types
            DataTable dxTypeLkpcodes = CacheManager.GetLookupCodeList(DxType_1.LookupCode);
            string    dxTypeList     = CreateDelimitedString(dxTypeLkpcodes, LookupCode.LkpCode, ",");

            dxDt = dxDa.GetDiagnosticsByTypeString(PatientID, dxTypeList);

            if (dxDt.Rows.Count > 0)
            {
                NoImagingHxMsgTr.Visible = false;

                // limit to last 10 records
                PastRecordsCountImaging = dxDt.Rows.Count;
                DataView dxDv = new DataView(dxDt);
                dxDv.Sort = Diagnostic.DxDate + " DESC ";
                dxDv      = GetTopDataViewRows(dxDv, 10);
                dxDv.Sort = Diagnostic.DxDate + " ASC ";
                DataTable dxTopTenDt = dxDv.ToTable();

                // get the diagnostic ids of the most recent 10 to find their corressponding findings
                string diagnosticIds = String.Empty;
                foreach (DataRow dr in dxTopTenDt.Rows)
                {
                    diagnosticIds = String.Concat(diagnosticIds, dr[Diagnostic.DiagnosticId].ToString(), ",");
                }
                diagnosticIds = diagnosticIds.Trim(',');

                dxFindingDt = dxDa.GetDxImagesByDiagnosticIds(PatientID, diagnosticIds);

                dxTopTenDt.TableName  = "Imaging";
                dxFindingDt.TableName = "ImagingFindings";

                DataSet dxWithDxFindingsDs = new DataSet();
                dxWithDxFindingsDs.Tables.Add(dxTopTenDt.Copy());
                dxWithDxFindingsDs.Tables.Add(dxFindingDt.Copy());

                dxWithDxFindingsDs.Relations.Add("myrelation", dxWithDxFindingsDs.Tables["Imaging"].Columns[Diagnostic.DiagnosticId], dxWithDxFindingsDs.Tables["ImagingFindings"].Columns[Diagnostic.DiagnosticId]);

                ImagingHx.DataSource = dxWithDxFindingsDs.Tables["Imaging"].DefaultView;
                ImagingHx.DataBind();
            }
        }
Ejemplo n.º 13
0
        protected void BuildImages()
        {
            if (patientID != 0)
            {
                DiagnosticDa imagesDa = new DiagnosticDa();
                DataSet      imagesDs = imagesDa.FormGetDxImages(this.patientID, this._formName, "Dynamic");

                if (imagesDs.Tables.Count > 0 && imagesDs.Tables[0].Rows.Count > 0)
                {
                    BuildImagesRpt(imagesDs.Tables[0], "X-ray Chest", XRayChest, BlankCXRTable);
                    BuildImagesRpt(imagesDs.Tables[0], "US Scrotum", ScrotalUS, BlankScrotalUSTable);
                    BuildImagesRpt(imagesDs.Tables[0], "CT Chest", CTChest, BlankChestCTTable);
                    BuildImagesRpt(imagesDs.Tables[0], "CT Abdomen/Pelvis", CTAbdomenPelvis, BlankCTAbdomenPelvisTable);
                    BuildImagesRpt(imagesDs.Tables[0], "Brain Scan", BrainScan, BlankBrainScanTable);
                    BuildImagesRpt(imagesDs.Tables[0], "PET Scan", PETScan, BlankPETScanTable);
                }
            }
        }
Ejemplo n.º 14
0
        private void BuildImgCompared(Control container, int?diagnosticId)
        {
            CaisisSelect imgCompared = FindInputControl(container, Diagnostic.ImgCompared) as CaisisSelect;

            if (imgCompared != null)
            {
                int patientId       = int.Parse(BaseDecryptedPatientId);
                var allDiagnostics  = new DiagnosticDa().GetDiagnosticsByType(patientId, ImageTypes).DefaultView;
                var prevDiagnostics = from diagnostic in allDiagnostics.Table.AsEnumerable()
                                      let rowDiagnosticId = (int)diagnostic[Diagnostic.DiagnosticId]
                                                            let dxType = diagnostic[Diagnostic.DxType]
                                                                         let dxDate = diagnostic[Diagnostic.DxDate]
                                                                                      // exclude current ?
                                                                                      where !diagnosticId.HasValue || diagnosticId.Value != rowDiagnosticId
                                                                                      // display text as "Bone Scan 01/26/2010" and value = diag id
                                                                                      let displayText = string.Format("{0} {1:d}", dxType, dxDate)
                                                                                                        let sortDate = !diagnostic.IsNull(Diagnostic.DxDate) ? (DateTime)dxDate : DateTime.MaxValue
                                                                                                                       orderby sortDate ascending
                                                                                                                       select new
                {
                    DiagnosticText = displayText,
                    DiagnosticId   = rowDiagnosticId
                };
                // build dropdown
                imgCompared.DataSource = prevDiagnostics;
                imgCompared.DataBind();
                // SPECIAL CASE:  for current diagnostic, check if there is a related record, used as compare to for follow up scans
                if (diagnosticId.HasValue)
                {
                    // get related diagnostic id
                    var relatedDiagnostics = Caisis.Controller.RelatedRecordController.GetRelatedRecords("Diagnostics", diagnosticId.Value, "Diagnostics");
                    // set related diagnostic
                    if (relatedDiagnostics.Count() > 0)
                    {
                        int relatedDiagnosticId = (int)relatedDiagnostics.First()[RelatedRecord.DestPrimaryKey];
                        PageUtil.SelectDropDownItem(imgCompared, relatedDiagnosticId.ToString());
                    }
                }
            }
        }
Ejemplo n.º 15
0
        override protected void BuildImages(int MinNumImageRowsToShow, int minNumBlankImageRows)
        {
            if (patientID != 0)
            {
                DiagnosticDa imagesDa = new DiagnosticDa();
                DataTable    imagesDt = imagesDa.GetProstateMRIFindings(this.patientID);

                int numBlankImageRows = MinNumImageRowsToShow - imagesDt.Rows.Count;

                // be sure you have at least the number of blank rows specified earlier
                if (numBlankImageRows < minNumBlankImageRows)
                {
                    numBlankImageRows = minNumBlankImageRows;
                }

                // add the blank rows
                for (int i = 0; i < numBlankImageRows; i++)
                {
                    DataRow blankImageRow;
                    blankImageRow = imagesDt.NewRow();
                    blankImageRow["DxDateText"] = "/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/";
                    imagesDt.Rows.Add(blankImageRow);
                }

                images.DataSource = imagesDt.DefaultView;
                //else
                //{
                //    images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
                //}
            }
            //else
            //{
            //    images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
            //}

            images.DataBind();
        }
Ejemplo n.º 16
0
        protected virtual void BuildImagesWithKidneyFindings(int MinNumImageRowsToShow, int minNumBlankImageRows)
        {
            if (patientID != 0)
            {
                string[] kidneyDx = new string[] { "CT Scan", "MRI", "Ultrasound" };

                DiagnosticDa imagesDa = new DiagnosticDa();
//                DataTable imagesDt = imagesDa.GetImagingAll(this.patientID);
                DataTable imagesDt = imagesDa.GetDiagnosticsByType(this.patientID, kidneyDx);

                if (imagesDt.Rows.Count > 0)
                {
                    // filter to last 18mo
                    DataView imagesDv     = new DataView(imagesDt);
                    string   imagesFilter = BOL.Diagnostic.DxDate + " >= #" + DateTime.Now.AddMonths(-18).Date.ToShortDateString() + "#";
                    imagesFilter      += " AND (";
                    imagesFilter      += BOL.Diagnostic.DxTarget + "  LIKE '%CHEST%'";
                    imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%ABDOMEN%'";
                    imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%PELVIS%'";
                    imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%KIDNEY%'";
                    imagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%RENAL%'";
                    imagesFilter      += ")";
                    imagesDv.RowFilter = imagesFilter;


                    imagesDv.Sort = BOL.Diagnostic.DxDate + " ASC";

                    DataTable filteredImagesDt = imagesDv.ToTable();



                    // check for older intitial CT/US
                    DataView olderImagesDv     = new DataView(imagesDt);
                    string   olderImagesFilter = BOL.Diagnostic.DxDate + " < #" + DateTime.Now.AddMonths(-18).Date.ToShortDateString() + "#";
                    olderImagesFilter      += " AND " + BOL.Diagnostic.DxType + " <> 'MRI'";
                    olderImagesFilter      += " AND (";
                    olderImagesFilter      += BOL.Diagnostic.DxTarget + "  LIKE '%CHEST%'";
                    olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%ABDOMEN%'";
                    olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%PELVIS%'";
                    olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%KIDNEY%'";
                    olderImagesFilter      += " OR " + BOL.Diagnostic.DxTarget + "  LIKE '%RENAL%'";
                    olderImagesFilter      += ")";
                    olderImagesDv.RowFilter = olderImagesFilter;
                    olderImagesDv.Sort      = BOL.Diagnostic.DxDate + " ASC";

                    if (olderImagesDv.Count > 0)
                    {
                        filteredImagesDt.ImportRow(olderImagesDv[0].Row);
                        DataView repeaterDV = new DataView(filteredImagesDt);
                        repeaterDV.Sort  = BOL.Diagnostic.DxDate + " ASC";
                        filteredImagesDt = repeaterDV.ToTable();
                    }



                    int numBlankImageRows = MinNumImageRowsToShow - filteredImagesDt.Rows.Count;

                    // be sure you have at least the number of blank rows specified earlier
                    if (numBlankImageRows < minNumBlankImageRows)
                    {
                        numBlankImageRows = minNumBlankImageRows;
                    }

                    // add the blank rows
                    for (int i = 0; i < numBlankImageRows; i++)
                    {
                        DataRow blankImageRow;
                        blankImageRow = filteredImagesDt.NewRow();
                        blankImageRow[BOL.Diagnostic.DxDateText] = "/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/";
                        blankImageRow[BOL.Diagnostic.DxType]     = "";
                        blankImageRow[BOL.Diagnostic.DxResult]   = "";
                        blankImageRow[BOL.Diagnostic.DxNotes]    = "";
                        blankImageRow[BOL.Diagnostic.DxTarget]   = "";
                        filteredImagesDt.Rows.Add(blankImageRow);
                    }

                    images.DataSource = filteredImagesDt;
                }
                else
                {
                    images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
                }
            }
            else
            {
                images.DataSource = BlankImages(MinNumImageRowsToShow).DefaultView;
            }

            images.DataBind();
        }
Ejemplo n.º 17
0
        protected void PopulateKindneyImageFindings(Object Sender, RepeaterItemEventArgs e)
        {
            if (patientID != 0)
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    Literal           DxTarget    = (Literal)e.Item.FindControl("DxTarget");
                    Literal           MaxDim      = (Literal)e.Item.FindControl("MaxDim");
                    Label             NumTumors   = (Label)e.Item.FindControl("NumTumors");
                    HtmlInputCheckBox MultTumors  = (HtmlInputCheckBox)e.Item.FindControl("MultTumors");
                    Label             MaxDimMsg   = (Label)e.Item.FindControl("MaxDimMsg");
                    Literal           ImgFindSide = (Literal)e.Item.FindControl("ImgFindSide");
                    Literal           TumorType   = (Literal)e.Item.FindControl("TumorType");
                    Literal           NoTumorType = (Literal)e.Item.FindControl("NoTumorType");



                    int rowNumber = e.Item.ItemIndex + 1;



                    if (((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DiagnosticId] != null || ((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DiagnosticId].ToString().Length > 0)
                    {
                        int DiagnosticId = int.MinValue;

                        if (int.TryParse(((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DiagnosticId].ToString(), out DiagnosticId))
                        {
                            DiagnosticDa DXda = new DiagnosticDa();
                            DataTable    DXdt = DXda.GetDxImageFindingsKidneyByDiagnosticId(DiagnosticId);

                            if (DXdt.Rows.Count > 0)
                            {
                                decimal maxDimVal           = decimal.MinValue;
                                int     maxDimFindingsRowId = int.MinValue;
                                //                            if (DXdt.Rows.Count > 1) { MultTumors.Checked = true; NumTumors.Text = DXdt.Rows.Count.ToString(); }


                                foreach (DataRow DXdr in DXdt.Rows)
                                {
                                    decimal ImgFindHeight = decimal.MinValue;
                                    decimal ImgFindWidth  = decimal.MinValue;
                                    decimal ImgFindLength = decimal.MinValue;

                                    bool ImgFindHeightExists = decimal.TryParse(DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindHeight].ToString(), out ImgFindHeight);
                                    bool ImgFindWidthExists  = decimal.TryParse(DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindWidth].ToString(), out ImgFindWidth);
                                    bool ImgFindLengthExists = decimal.TryParse(DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindLength].ToString(), out ImgFindLength);

                                    decimal MaxDimValForThisFindingRecord = Math.Max(Math.Max(ImgFindHeight, ImgFindWidth), ImgFindLength);

                                    if (MaxDimValForThisFindingRecord > maxDimVal)
                                    {
                                        maxDimVal = MaxDimValForThisFindingRecord;
                                        int FindingsRowId = int.MinValue;

                                        string MaxDimDisplayText = MaxDimValForThisFindingRecord.ToString();

                                        if (DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindSide].ToString().Length > 0)
                                        {
                                            ImgFindSide.Text = DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindSide].ToString();
                                            //                                           MaxDimDisplayText += " (" + DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindSide].ToString() + ")";
                                        }

                                        MaxDim.Text = MaxDimDisplayText;


                                        if (!ImgFindHeightExists || !ImgFindWidthExists || !ImgFindLengthExists)
                                        {
                                            MaxDimMsg.Visible = true;
                                        }
                                        else
                                        {
                                            MaxDimMsg.Visible = false;
                                        }


                                        if (int.TryParse(DXdt.Rows[0][BOL.ImageFindingKidney.DxImageFindingKidneyId].ToString(), out FindingsRowId))
                                        {
                                            maxDimFindingsRowId = FindingsRowId;
                                        }

                                        try
                                        {
                                            if (DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindTumorType] != null && DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindTumorType].ToString().Length > 0)
                                            {
                                                TumorType.Text      = DXdt.Rows[0][BOL.ImageFindingKidney.ImgFindTumorType].ToString();
                                                NoTumorType.Visible = false;
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            ExceptionHandler.Publish(ex);
                                        }
                                    }
                                }
                            }
                        }
                    }



                    if (((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DxTotalNumTumors] != null || ((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DxTotalNumTumors].ToString().Length > 0)
                    {
                        int DxTotalNumTumors = int.MinValue;

                        if (int.TryParse(((DataRowView)e.Item.DataItem)[BOL.Diagnostic.DxTotalNumTumors].ToString(), out DxTotalNumTumors))
                        {
                            if (DxTotalNumTumors > 1)
                            {
                                MultTumors.Checked = true; NumTumors.Text = DxTotalNumTumors.ToString();
                            }
                        }
                    }
                }
            }
        }