Changeset 2117
- Timestamp:
- Nov 4, 2013, 2:46:34 PM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/ticket-489
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/ticket-489/resources/index.jsp
r2063 r2117 104 104 url = 'Histology.servlet?ID=<%=ID%>&cmd=CountParaffinBlocksWithoutHeGlass'; 105 105 } 106 else if (what == 'unscored-heglass') 107 { 108 url = 'Histology.servlet?ID=<%=ID%>&cmd=CountUnscoredHeGlass'; 109 } 106 110 else if (what == 'lysate') 107 111 { … … 206 210 var count = error ? -1 : response.count; 207 211 setCount('count.paraffin-blocks-without-heglass', count, 'paraffin blocks', msg); 212 startCounting('unscored-heglass'); 213 } 214 else if (currentCount == 'unscored-heglass') 215 { 216 var msg = error || 'Number of unscored HE glass'; 217 var count = error ? -1 : response.count; 218 setCount('count.unscored-heglass', count, 'HE glass', msg); 208 219 startCounting('lysate'); 209 220 } … … 429 440 <li><a href="sampleproc/histology_protocol.jsp?ID=<%=ID%>">Lab tracking protocol for FFPE/HE</a> <span class="counter" id="count.histology-lists" title="Counting..."><img src="images/loading-small.gif"></span> 430 441 <li><a href="sampleproc/histology_block.jsp?ID=<%=ID%>">Register paraffin blocks</a> <span class="counter" id="count.paraffin-blocks" title="Counting..."><img src="images/loading-small.gif"></span> 431 <li><a href="sampleproc/histology_glass.jsp?ID=<%=ID%>">Register histology HE glass information</a> <span class="counter" id="count.paraffin-blocks-without-heglass" title="Counting..."><img src="images/loading-small.gif"></span> 442 <li><a href="sampleproc/histology_glass.jsp?ID=<%=ID%>">Register HE glass</a> <span class="counter" id="count.paraffin-blocks-without-heglass" title="Counting..."><img src="images/loading-small.gif"></span> 443 <li><a href="sampleproc/histology_score.jsp?ID=<%=ID%>">Score HE glass</a> <span class="counter" id="count.unscored-heglass" title="Counting..."><img src="images/loading-small.gif"></span> 432 444 </ul> 433 445 </dd> -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/JsonUtil.java
r1940 r2117 60 60 61 61 @SuppressWarnings("unchecked") 62 public static JSONObject getBioWellAsJSON(BioWell well )62 public static JSONObject getBioWellAsJSON(BioWell well, boolean includePlateInfo) 63 63 { 64 64 if (well == null) return null; … … 71 71 json.put("canAdd", well.canAddBioMaterial()); 72 72 json.put("canRemove", well.canClearBioMaterial()); 73 74 if (includePlateInfo) 75 { 76 BioPlate plate = well.getPlate(); 77 JSONObject jsonPlate = new JSONObject(); 78 jsonPlate.put("id", plate.getId()); 79 jsonPlate.put("name", plate.getName()); 80 jsonPlate.put("barcode", plate.getBarcode()); 81 jsonPlate.put("editable", plate.hasPermission(Permission.WRITE)); 73 82 74 BioPlate plate = well.getPlate(); 75 JSONObject jsonPlate = new JSONObject(); 76 jsonPlate.put("id", plate.getId()); 77 jsonPlate.put("name", plate.getName()); 78 jsonPlate.put("barcode", plate.getBarcode()); 79 jsonPlate.put("editable", plate.hasPermission(Permission.WRITE)); 80 81 Hardware storage = plate.getFreezer(); 82 if (storage != null || plate.getSection() != null || plate.getTray() != null || plate.getPosition() != null) 83 { 84 JSONObject jsonStorage = new JSONObject(); 85 if (storage != null) 83 Hardware storage = plate.getFreezer(); 84 if (storage != null || plate.getSection() != null || plate.getTray() != null || plate.getPosition() != null) 86 85 { 87 jsonStorage.put("id", storage.getId()); 88 jsonStorage.put("name", storage.getName()); 86 JSONObject jsonStorage = new JSONObject(); 87 if (storage != null) 88 { 89 jsonStorage.put("id", storage.getId()); 90 jsonStorage.put("name", storage.getName()); 91 } 92 jsonStorage.put("section", plate.getSection()); 93 jsonStorage.put("tray", plate.getTray()); 94 jsonStorage.put("position", plate.getPosition()); 95 jsonPlate.put("storage", jsonStorage); 89 96 } 90 jsonStorage.put("section", plate.getSection()); 91 jsonStorage.put("tray", plate.getTray()); 92 jsonStorage.put("position", plate.getPosition()); 93 jsonPlate.put("storage", jsonStorage); 97 98 json.put("bioPlate", jsonPlate); 94 99 } 95 96 json.put("bioPlate", jsonPlate);97 100 return json; 98 101 } -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Annotationtype.java
r2102 r2117 242 242 public static final Annotationtype GOOD_STAIN = 243 243 new Annotationtype("GoodStain", Type.BOOLEAN, Item.SAMPLE); 244 245 246 /** 247 The "ScoreComplete" annotation type, used for histology samples 248 (Stained) and bioplates (HE glass). It is a boolean annotation type. 249 @since 2.14 250 */ 251 public static final Annotationtype SCORE_COMPLETE = 252 new Annotationtype("ScoreComplete", Type.BOOLEAN, Item.SAMPLE, Item.BIOPLATE); 253 254 255 /** 256 The "ScoreInvasiveCancer" annotation type, used for histology samples 257 (Stained). It is an integer annotation type. 258 @since 2.14 259 */ 260 public static final Annotationtype SCORE_INVASIVE_CANCER = 261 new Annotationtype("ScoreInvasiveCancer", Type.INT, Item.SAMPLE); 262 263 /** 264 The "ScoreInsituCancer" annotation type, used for histology samples 265 (Stained). It is an integer annotation type. 266 @since 2.14 267 */ 268 public static final Annotationtype SCORE_INSITU_CANCER = 269 new Annotationtype("ScoreInsituCancer", Type.INT, Item.SAMPLE); 270 271 /** 272 The "ScoreLymphocytes" annotation type, used for histology samples 273 (Stained). It is an integer annotation type. 274 @since 2.14 275 */ 276 public static final Annotationtype SCORE_LYMPHOCYTES = 277 new Annotationtype("ScoreLymphocytes", Type.INT, Item.SAMPLE); 278 279 /** 280 The "ScoreNormal" annotation type, used for histology samples 281 (Stained). It is an integer annotation type. 282 @since 2.14 283 */ 284 public static final Annotationtype SCORE_NORMAL = 285 new Annotationtype("ScoreNormal", Type.INT, Item.SAMPLE); 286 287 /** 288 The "ScoreStroma" annotation type, used for histology samples 289 (Stained). It is an integer annotation type. 290 @since 2.14 291 */ 292 public static final Annotationtype SCORE_STROMA = 293 new Annotationtype("ScoreStroma", Type.INT, Item.SAMPLE); 294 295 /** 296 The "ScoreFat" annotation type, used for histology samples 297 (Stained). It is an integer annotation type. 298 @since 2.14 299 */ 300 public static final Annotationtype SCORE_FAT = 301 new Annotationtype("ScoreFat", Type.INT, Item.SAMPLE); 244 302 245 303 /** -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/CDna.java
r2082 r2117 102 102 if (jsonWell == null) 103 103 { 104 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );104 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 105 105 } 106 106 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Dna.java
r2098 r2117 107 107 if (jsonWell == null) 108 108 { 109 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );109 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 110 110 } 111 111 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/FlowThrough.java
r2098 r2117 107 107 if (jsonWell == null) 108 108 { 109 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );109 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 110 110 } 111 111 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Histology.java
r1831 r2117 157 157 if (jsonWell == null) 158 158 { 159 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );159 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 160 160 } 161 161 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Library.java
r2050 r2117 141 141 if (well != null) 142 142 { 143 jsonWell = JsonUtil.getBioWellAsJSON(well );143 jsonWell = JsonUtil.getBioWellAsJSON(well, true); 144 144 } 145 145 -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Lysate.java
r1831 r2117 130 130 if (jsonWell == null) 131 131 { 132 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );132 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 133 133 } 134 134 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/MRna.java
r2050 r2117 113 113 if (jsonWell == null) 114 114 { 115 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );115 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 116 116 } 117 117 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/Rna.java
r2020 r2117 367 367 if (jsonWell == null) 368 368 { 369 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );369 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 370 370 } 371 371 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/dao/SpecimenTube.java
r1826 r2117 213 213 if (jsonWell == null) 214 214 { 215 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell() );215 jsonWell = JsonUtil.getBioWellAsJSON(getItem().getBioWell(), true); 216 216 } 217 217 return jsonWell; -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/servlet/CaseSummaryServlet.java
r2103 r2117 472 472 if (goodIsGood) 473 473 { 474 his.setAnnotation("bestStain", JsonUtil.getBioWellAsJSON(good.getBioWell() ));474 his.setAnnotation("bestStain", JsonUtil.getBioWellAsJSON(good.getBioWell(), true)); 475 475 } 476 476 } … … 564 564 rna.setAnnotation("nofQc", rnaqc.size()); 565 565 rna.setAnnotation("qcProtocol", JsonUtil.getProtocolAsJSON(lastQc.getProtocol())); 566 rna.setAnnotation("qcPlate", JsonUtil.getBioWellAsJSON(lastQc.getBioWell() ));566 rna.setAnnotation("qcPlate", JsonUtil.getBioWellAsJSON(lastQc.getBioWell(), true)); 567 567 rna.setAnnotation("qcComment", lastQc.getDescription()); 568 568 -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/servlet/HistologyServlet.java
r1983 r2117 37 37 import net.sf.basedb.core.SessionControl; 38 38 import net.sf.basedb.core.data.PlateCoordinate; 39 import net.sf.basedb.core.query.Annotations; 39 40 import net.sf.basedb.core.query.Expressions; 40 41 import net.sf.basedb.core.query.Hql; … … 44 45 import net.sf.basedb.reggie.dao.Annotationtype; 45 46 import net.sf.basedb.reggie.dao.BioplateType; 47 import net.sf.basedb.reggie.dao.HeGlass; 46 48 import net.sf.basedb.reggie.dao.Histology; 47 49 import net.sf.basedb.reggie.dao.ReactionPlate; … … 343 345 out.close(); 344 346 347 } 348 else if ("CountUnscoredHeGlass".equals(cmd)) 349 { 350 dc = sc.newDbControl(); 351 ItemQuery<BioPlate> query = BioPlate.getQuery(); 352 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 353 BioplateType.HE_GLASS.addFilter(dc, query, true); 354 355 // Missing of 'false' for SCORE_COMPLETE annotation 356 query.join(Annotations.leftJoin(null, Annotationtype.SCORE_COMPLETE.load(dc), "sc")); 357 query.restrict( 358 Restrictions.or( 359 Restrictions.eq(Hql.alias("sc"), null), 360 Restrictions.eq(Hql.alias("sc"), Expressions.bool(false)) 361 )); 362 363 long count = query.count(dc); 364 json.put("count", count); 365 } 366 else if ("GetHeGlassToScore".equals(cmd)) 367 { 368 dc = sc.newDbControl(); 369 370 String name = Values.getStringOrNull(req.getParameter("name")); 371 372 JSONArray jsonHeGlasses = new JSONArray(); 373 if (name == null) 374 { 375 // No name specified... 376 // ... find the name of first unscored glass that is not destroyed 377 ItemQuery<BioPlate> tmpQuery = BioPlate.getQuery(); 378 tmpQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 379 BioplateType.HE_GLASS.addFilter(dc, tmpQuery, true); 380 tmpQuery.join(Annotations.leftJoin(null, Annotationtype.SCORE_COMPLETE.load(dc), "sc")); 381 tmpQuery.restrict(Restrictions.eq(Hql.alias("sc"), null)); 382 tmpQuery.order(Orders.asc(Hql.property("name"))); 383 tmpQuery.setMaxResults(1); 384 List<BioPlate> result = tmpQuery.list(dc); 385 if (result.size() > 0) 386 { 387 name = result.get(0).getName(); 388 } 389 } 390 391 if (name != null) 392 { 393 // Now, find all HE glass that are related to the original 394 String prefix = name.substring(0, name.indexOf('.')); 395 ItemQuery<BioPlate> query = BioPlate.getQuery(); 396 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 397 BioplateType.HE_GLASS.addFilter(dc, query, false); 398 query.restrict(Restrictions.rlike(Hql.property("name"), Expressions.string("^" + prefix + "\\.[0-9]+$"))); 399 query.order(Orders.asc(Hql.property("name"))); 400 401 List<HeGlass> plates = HeGlass.toList(query.list(dc)); 402 for (HeGlass heGlass : plates) 403 { 404 heGlass.loadSampleScores(dc); 405 heGlass.loadAnnotations(dc, "ScoreComplete", Annotationtype.SCORE_COMPLETE, null); 406 407 jsonHeGlasses.add(heGlass.asJSONObject()); 408 } 409 } 410 json.put("name", name); 411 json.put("heGlasses", jsonHeGlasses); 345 412 } 346 413 } -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r2109 r2117 230 230 231 231 jsonChecks.add(checkAnnotationType(dc, Annotationtype.GOOD_STAIN, 1, null, effectiveOptions, createIfMissing)); 232 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_COMPLETE, 1, null, effectiveOptions, createIfMissing)); 233 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_INVASIVE_CANCER, 1, null, effectiveOptions, createIfMissing)); 234 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_INSITU_CANCER, 1, null, effectiveOptions, createIfMissing)); 235 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_LYMPHOCYTES, 1, null, effectiveOptions, createIfMissing)); 236 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_NORMAL, 1, null, effectiveOptions, createIfMissing)); 237 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_STROMA, 1, null, effectiveOptions, createIfMissing)); 238 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SCORE_FAT, 1, null, effectiveOptions, createIfMissing)); 232 239 233 240 jsonChecks.add(checkAnnotationType(dc, Annotationtype.QIACUBE_DATE, 1, null, effectiveOptions, createIfMissing)); … … 330 337 331 338 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.STAINED, createIfMissing, 332 Annotationtype.GOOD_STAIN)); 339 Annotationtype.GOOD_STAIN, Annotationtype.SCORE_COMPLETE, Annotationtype.SCORE_INVASIVE_CANCER, 340 Annotationtype.SCORE_INSITU_CANCER, Annotationtype.SCORE_LYMPHOCYTES, Annotationtype.SCORE_NORMAL, 341 Annotationtype.SCORE_STROMA, Annotationtype.SCORE_FAT)); 333 342 334 343 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.LYSATE, createIfMissing, -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/servlet/SpecimenTubeServlet.java
r2082 r2117 144 144 while (free != null) 145 145 { 146 jsonWells.add(JsonUtil.getBioWellAsJSON(free ));146 jsonWells.add(JsonUtil.getBioWellAsJSON(free, true)); 147 147 if (jsonWells.size() == nofTubes) break; 148 148 free = getNextFreeWell(free);
Note: See TracChangeset
for help on using the changeset viewer.