Changeset 5782


Ignore:
Timestamp:
Dec 11, 2019, 4:00:14 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1214: Add support for external specimen

Changes to partition wizard to make it more compatible with external specimen. It now possible to register external specimen without a box and location. The sorting in the partition form has been fixed so that specimen without a box are sorted last by name (the default is to sort by box location). However, this would conflict with the sorting required to get "paused" and "re-extract" specimen correct in the second step so there is a re-sorting to put external specimen together with paused specimen in that step.

It was also noticed that registration of external specimen will affect counters on the front page and maybe also the statistics produced by the sample count reports and sample processing statistics. Since the external specimen can't be assigned to a site they are never grouped with site-specific data, but they may still be included in totals. This need to be checked but is not part of ticket.

Location:
extensions/net.sf.basedb.reggie/trunk/resources/sampleproc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/sampleproc/partitionform.js

    r5346 r5782  
    6868        if (specimen.reprocess)
    6969        {
    70           option.text += ' - ' + specimen.bioWell.bioPlate.name + ' ' + specimen.bioWell.location;
     70          option.text += ' - ' + (specimen.bioWell != null ? specimen.bioWell.bioPlate.name + ' ' + specimen.bioWell.location : 'no box');
    7171          frm.reextraction[frm.reextraction.length] = option;
    7272        }
     
    320320      hisWeightsAreValid[i] = !specimen.firstExtraction;
    321321      nofPiecesAreValid[i] = !specimen.firstExtraction;
    322      
     322      App.debug(specimen.name+':'+specimen.paused+':'+specimen.firstExtraction+':'+JSON.stringify(specimen));
    323323      if (specimen.paused && firstPaused)
    324324      {
    325325        html += '<tr style="border-top-width: 2px;">';
    326         html += '<th class="bg-filled-100">Paused specimen</th>';
     326        html += '<th class="bg-filled-100">Paused specimen &amp; external</th>';
    327327        html += '<th colspan="11" class="dottedleft"></th>';
    328328        html += '</tr>';
     
    397397      html += '<td class="if-yellow">';
    398398      // Only show box information if there is something show.     
    399       if (specimen.bioWell)
     399      if (specimen.bioWell || specimen.newBioWell)
    400400      {
    401401        if (specimen.reprocess)
     
    504504        return t1.AutoProcessing == null ? -1 : 1;
    505505      }
     506     
     507      if (t1.paused != t2.paused)
     508      {
     509        return t1.paused == pausedFirst ? -1 : 1;
     510      }
     511     
     512      if (t1.bioWell == null || t2.bioWell == null)
     513      {
     514        // Tubes without a box position are sorted last, in name order
     515        if (t1.bioWell != null) return -1;
     516        if (t2.bioWell != null) return 1;
     517        return t1.name < t2.name ? -1 : 1;
     518      }
     519     
    506520      var well1 = t1.bioWell;
    507521      var box1 = well1.bioPlate.name;
    508       var paused1 = box1.indexOf('PSp') == 0;
    509522      var well2 = t2.bioWell;
    510523      var box2 = well2.bioPlate.name;
    511       var paused2 = box2.indexOf('PSp') == 0;
    512524      if (box1 == box2)
    513525      {
    514526        return well1.row == well2.row ? well1.column - well2.column : well1.row - well2.row;
    515527      }
    516       else if (paused1 != paused2)
    517       {
    518         return paused1 == pausedFirst ? -1 : 1;
    519       }
    520528      else
    521529      {
     
    527535  partition.toLocation = function(well)
    528536  {
    529     return Strings.encodeTags(well.bioPlate.name+' ['+well.location+']')
     537    return well ? Strings.encodeTags(well.bioPlate.name+' ['+well.location+']') : 'Unknown box';
    530538  }
    531539 
  • extensions/net.sf.basedb.reggie/trunk/resources/sampleproc/partitionform.jsp

    r5299 r5782  
    9191      <table class="step-form">
    9292      <tr class="align-top" id="regularFlowRow">
    93         <td class="prompt">Specimen tubes<div style="font-weight: normal;">(regular flow)</div></td>
     93        <td class="prompt">Specimen tubes
     94          <div style="font-weight: normal; padding-left: 0.5em;">• regular flow</div>
     95        </td>
    9496        <td class="input">
    9597          <select name="specimentubes" id="specimentubes" multiple size="12" class="yellow-label-support"></select></td>
     
    103105      </tr>
    104106      <tr class="align-top" id="reExtractionRow" style="display: none;">
    105         <td class="prompt">Specimen tubes<div style="font-weight: normal;">(re-extraction)</div></td>
     107        <td class="prompt">Specimen tubes
     108          <div style="font-weight: normal; padding-left: 0.5em;">
     109          • re-extraction<br>
     110          • paused<br>
     111          • external
     112          </div>
     113        </td>
    106114        <td class="input">
    107115          <select name="reextraction" id="reextraction" multiple size="12" class="yellow-label-support"></select></td>
  • extensions/net.sf.basedb.reggie/trunk/resources/sampleproc/reextract_picklist.jsp

    r5335 r5782  
    130130    Float reminingQuantity = s.getRemainingQuantity();
    131131    BioWell well = s.getBioWell();
    132     BioPlate plate = well.getPlate();
    133     Hardware freezer = plate.getFreezer();
    134     String remark = plate.getName().startsWith("PSp") ? "Paused specimen" : "";
     132    BioPlate plate = well == null ? null : well.getPlate();
     133    Hardware freezer = plate == null ? null : plate.getFreezer();
     134    String remark = "";
    135135    List<String> freezerLocation = new ArrayList<>();
    136     if (plate.getSection() != null) freezerLocation.add("Section " + plate.getSection());
    137     if (plate.getTray() != null) freezerLocation.add("Tray " + plate.getTray());
    138     if (plate.getPosition() != null) freezerLocation.add("Position " + plate.getPosition());
     136    if (plate != null)
     137    {
     138      remark = plate.getName().startsWith("PSp") ? "Paused specimen" : "";
     139      if (plate.getSection() != null) freezerLocation.add("Section " + plate.getSection());
     140      if (plate.getTray() != null) freezerLocation.add("Tray " + plate.getTray());
     141      if (plate.getPosition() != null) freezerLocation.add("Position " + plate.getPosition());
     142    }
    139143    %>
    140144    <tr>
     
    155159        <%=Values.getString(freezerLocation, ", ", true) %>
    156160      </td>
    157       <td class="box"><%=HTML.encodeTags(plate.getName()) %> <%=well.getCoordinate() %></td>
     161      <td class="box">
     162        <%
     163        if (well == null)
     164        {
     165          %><i>- unknown -</i><%
     166        }
     167        else
     168        {
     169          %>
     170          <%=HTML.encodeTags(plate.getName()) %> <%=well.getCoordinate() %>
     171          <%
     172        }
     173        %>
     174      </td>
    158175      <td class="remain"><%=reminingQuantity == null ? "<i>n/a</i>" : Values.formatNumber(reminingQuantity / 1000, 0, "mg") %></td>
    159176      <td class="remark"><%=remark %></td>
Note: See TracChangeset for help on using the changeset viewer.