Esempio n. 1
0
        protected DataView DREFindingsByEncounter(int EncounterID)
        {
            EncRectalExamDa dreDA = new EncRectalExamDa();
            DataTable       dreDT = dreDA.GetAllDREFindings(this._patientId);
            DataView        dreDV = new DataView(dreDT);

            dreDV.RowFilter = EncRectalExamFinding.EncounterId + " = " + EncounterID.ToString();

            return(dreDV);
        }
Esempio n. 2
0
        protected void BuildDREHistory()
        {
            EncRectalExamDa eda = new EncRectalExamDa();
            DataTable       dt  = eda.GetDREHistory(this._patientId);

            if (dt.Rows.Count > 0)
            {
                DREHistory.DataSource = dt.DefaultView;
                DREHistory.DataBind();

                DREHistoryTableHeader.Visible    = true;
                NoDREHistoryTableMessage.Visible = false;
            }
        }
/*
 *      protected DataTable ASLabsTable(string[] labTestsToGet, DataTable allLabs)
 *      {
 *
 *          // data table structure
 *          DataTable labsTable = new DataTable();
 *
 *          DataColumn DateTextCol = new DataColumn();
 *          DateTextCol.ColumnName = "LabDateText";
 *          labsTable.Columns.Add(DateTextCol);
 *
 *          DataColumn DateCol = new DataColumn();
 *          DateCol.ColumnName = "LabDate";
 *          DateCol.DataType = System.Type.GetType("System.DateTime");
 *          labsTable.Columns.Add(DateCol);
 *
 *          DataColumn PSADT = new DataColumn();
 *          PSADT.ColumnName = "PSADT";
 *          labsTable.Columns.Add(PSADT);
 *
 *
 *          foreach (string lab in labTestsToGet)
 *          {
 *              DataColumn col = new DataColumn();
 *              col.ColumnName = lab;
 *              labsTable.Columns.Add(col);
 *
 *              DataColumn IDCol = new DataColumn();
 *              IDCol.ColumnName = (lab + "Id");
 *              IDCol.DataType = System.Type.GetType("System.Int32");
 *              labsTable.Columns.Add(IDCol);
 *          }
 *
 *
 *          // table rows
 *
 *          if (allLabs != null)
 *          {
 *              foreach (DataRow row in allLabs.Rows)
 *              {
 *                  string LabDateText = row[BOL.LabTest.LabDateText].ToString();
 *                  DateTime LabDate = new DateTime();
 *                  if (row[BOL.LabTest.LabDate].ToString().Length > 0) LabDate = (DateTime)row[BOL.LabTest.LabDate];
 *                  string LabType = row[BOL.LabTest.LabTest_Field].ToString();
 *                  string LabResult = row[BOL.LabTest.LabResult].ToString();
 *                  string LabNotes = row[BOL.LabTest.LabNotes].ToString();
 *                  int LabTestId = (int)row[BOL.LabTest.LabTestId];
 *
 *                  DataRow[] currentDateRow = labsTable.Select("LabDateText = '" + LabDateText + "'");
 *                  if (currentDateRow.Length > 0)
 *                  {
 *                      currentDateRow[0][LabType] = LabResult;
 *                      currentDateRow[0][LabType + "Id"] = LabTestId;
 *
 *                      // special cases
 *                      if (LabType.ToUpper().Equals("PROLARIS SCORE")) currentDateRow[0]["Prolaris AUA"] = LabNotes;
 *                      if (LabType.ToUpper().Equals("ONCOTYPE GPS")) currentDateRow[0]["Oncotype Path"] = LabNotes;
 *
 *                  }
 *                  else
 *                  {
 *                      DataRow dr = labsTable.NewRow();
 *                      dr["LabDateText"] = LabDateText;
 *                      dr["LabDate"] = LabDate;
 *                      dr[LabType] = LabResult;
 *                      dr[LabType + "Id"] = LabTestId;
 *
 *                      // special cases
 *                      if (LabType.ToUpper().Equals("PROLARIS SCORE")) dr["Prolaris AUA"] = LabNotes;
 *                      if (LabType.ToUpper().Equals("ONCOTYPE GPS")) dr["Oncotype Path"] = LabNotes;
 *
 *                      labsTable.Rows.Add(dr);
 *                  }
 *
 *
 *              }
 *
 *
 *              if (labsTable.Rows.Count > 0)
 *              {
 *                  DataView sortedLabView = new DataView(labsTable);
 *                  sortedLabView.Sort = LabTest.LabDate + " ASC";
 *                  labsTable = sortedLabView.ToTable();
 *
 *
 *
 *                  // get prostate volumes to calculate PSADensity in lab tests
 *                  DataTable ProstateVolumes = ProstateVolumesByDescendingDate();
 *                  if (ProstateVolumes.Rows.Count > 0)
 *                  {
 *                          foreach (DataRow labRow in labsTable.Rows)
 *                          {
 *                              double psa = 0;
 *                              if (labRow["LabDate"].ToString().Length > 0 && labRow["PSA"].ToString().Length > 0 && double.TryParse(labRow["PSA"].ToString(), out psa))
 *                              {
 *
 *                                  DataView v = new DataView(ProstateVolumes);
 *                                  v.RowFilter = Diagnostic.DxDate + " <= #" + ((DateTime)labRow["LabDate"]).ToShortDateString() + "#";
 *
 *                                  if (v.Count > 0)
 *                                  {
 *                                      double mostRecentVolumeMeasurement = 0;
 *
 *                                      if (double.TryParse(v[0][ImageProstate.ImgProstateVolume].ToString(), out mostRecentVolumeMeasurement))
 *                                      {
 *                                          double psadt = Math.Round((psa / mostRecentVolumeMeasurement), 4);
 *                                          labRow["PSADT"] = psadt;
 *                                      }
 *                                  }
 *
 *                              }
 *                          }
 *                  }
 *
 *
 *              }
 *
 *          }
 *          return labsTable;
 *      }
 *
 *
 */



        protected void BuildDREHistory()
        {
            if (patientID != 0)
            {
                EncRectalExamDa eda = new EncRectalExamDa();
                DataTable       dt  = eda.GetDREHistory(this.patientID);

                if (dt.Rows.Count > 0)
                {
                    DREHistory.DataSource = dt.DefaultView;
                    DREHistory.DataBind();
                }
            }
        }