Changeset 2131


Ignore:
Timestamp:
Nov 11, 2013, 1:43:24 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #489: Histology scoring wizard

Added score information to case summary page.

Location:
extensions/net.sf.basedb.reggie/branches/ticket-489
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/ticket-489/resources/reports/case_summary.jsp

    r2106 r2131  
    281281}
    282282
     283function asPercent(value)
     284{
     285  var result = '';
     286  if (value != null)
     287  {
     288    result = value + '%';
     289  }
     290  return result;
     291}
     292
    283293function init()
    284294{
     
    463473
    464474      var stained = h.stainDate ? true : false;
     475      var bestStain = stained ? h.bestStain : null;
     476      var scored = bestStain && bestStain.ScoreComplete != null ? true : false;
     477       
    465478      addColumn('histology.stained', stained ? formatDate(h.stainDate) : 'No');
    466479      addColumn('histology.nofSlides', stained ? h.numStains : null);
    467       addColumn('histology.heGlass', stained ? asBioPlateLocation(h.bestStain) : null);
     480      addColumn('histology.heGlass', stained ? asBioPlateLocation(bestStain.bioWell) : null);
    468481      addColumn('histology.stainProtocol', stained ? makeLink('PROTOCOL', h.stainProtocol, truncateAt) : null);
     482     
     483      addColumn('histology.scored', scored ? (bestStain.ScoreComplete ? 'Complete' : 'In progress') : 'No');
     484      addColumn('histology.scoreInvasiveCancer', scored ? asPercent(bestStain.ScoreInvasiveCancer) : null);
     485      addColumn('histology.scoreInsituCancer', scored ? asPercent(bestStain.ScoreInsituCancer) : null);
     486      addColumn('histology.scoreLymphocytes', scored ? asPercent(bestStain.ScoreLymphocytes) : null);
     487      addColumn('histology.scoreNormal', scored ? asPercent(bestStain.ScoreNormal) : null);
     488      addColumn('histology.scoreStroma', scored ? asPercent(bestStain.ScoreStroma) : null);
     489      addColumn('histology.scoreFat', scored ? asPercent(bestStain.ScoreFat) : null);
     490      addColumn('histology.scoreComments', scored ? truncate(bestStain.comments, truncateAt) : null);
    469491    }
    470492  }
     
    11231145              <th>Protocol</th>
    11241146            </tr>
     1147            <tr id="histology.scored" class="subtitle">
     1148              <th>Scored</th>
     1149            </tr>
     1150            <tr id="histology.scoreInvasiveCancer" class="dynamic-column">
     1151              <th>Invasive cancer</th>
     1152            </tr>
     1153            <tr id="histology.scoreInsituCancer" class="dynamic-column">
     1154              <th>Insitu cancer</th>
     1155            </tr>
     1156            <tr id="histology.scoreLymphocytes" class="dynamic-column">
     1157              <th>Lymphocytes</th>
     1158            </tr>
     1159            <tr id="histology.scoreNormal" class="dynamic-column">
     1160              <th>Normal</th>
     1161            </tr>
     1162            <tr id="histology.scoreStroma" class="dynamic-column">
     1163              <th>Stroma</th>
     1164            </tr>
     1165            <tr id="histology.scoreFat" class="dynamic-column">
     1166              <th>Fat</th>
     1167            </tr>
     1168            <tr id="histology.scoreComments" class="comment dynamic-column">
     1169              <th>Comments</th>
     1170            </tr>
    11251171          </tbody>
    11261172          </table>
  • extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/servlet/CaseSummaryServlet.java

    r2117 r2131  
    430430  }
    431431
     432  @SuppressWarnings("unchecked")
    432433  private void loadHistologyInfo(DbControl dc, Histology his)
    433434  {
     
    472473      if (goodIsGood)
    473474      {
    474         his.setAnnotation("bestStain", JsonUtil.getBioWellAsJSON(good.getBioWell(), true));
     475        JSONObject jsonGood = new JSONObject();
     476        jsonGood.put("id", good.getId());
     477        jsonGood.put("name", good.getName());
     478        jsonGood.put("bioWell", JsonUtil.getBioWellAsJSON(good.getBioWell(), true));
     479        jsonGood.put("comments", good.getDescription());
     480       
     481        jsonGood.put("ScoreComplete", Annotationtype.SCORE_COMPLETE.getAnnotationValue(dc, good));
     482        jsonGood.put("ScoreInvasiveCancer", Annotationtype.SCORE_INVASIVE_CANCER.getAnnotationValue(dc, good));
     483        jsonGood.put("ScoreInsituCancer", Annotationtype.SCORE_INSITU_CANCER.getAnnotationValue(dc, good));
     484        jsonGood.put("ScoreLymphocytes", Annotationtype.SCORE_LYMPHOCYTES.getAnnotationValue(dc, good));
     485        jsonGood.put("ScoreNormal", Annotationtype.SCORE_NORMAL.getAnnotationValue(dc, good));
     486        jsonGood.put("ScoreStroma", Annotationtype.SCORE_STROMA.getAnnotationValue(dc, good));
     487        jsonGood.put("ScoreFat", Annotationtype.SCORE_FAT.getAnnotationValue(dc, good));
     488       
     489        his.setAnnotation("bestStain", jsonGood);
    475490      }
    476491    }
Note: See TracChangeset for help on using the changeset viewer.