extensions/net.sf.basedb.meludi/trunk/resources/reports/meludi_quarter_month_report_generator.jsp

Code
Comments
Other
Rev Date Author Line
3505 23 Sep 15 olle 1 <%@ page
3505 23 Sep 15 olle 2   pageEncoding="UTF-8"
3505 23 Sep 15 olle 3   session="false"
3505 23 Sep 15 olle 4   import="net.sf.basedb.core.User"
3505 23 Sep 15 olle 5   import="net.sf.basedb.core.DbControl"
3505 23 Sep 15 olle 6   import="net.sf.basedb.core.SessionControl"
3505 23 Sep 15 olle 7   import="net.sf.basedb.core.Application"
3505 23 Sep 15 olle 8   import="net.sf.basedb.clients.web.Base"  
3505 23 Sep 15 olle 9   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
3505 23 Sep 15 olle 10 %>
3505 23 Sep 15 olle 11 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
3505 23 Sep 15 olle 12 <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
3505 23 Sep 15 olle 13 <%
3505 23 Sep 15 olle 14 final SessionControl sc = Base.getExistingSessionControl(request, true);
3505 23 Sep 15 olle 15 final String ID = sc.getId();
3505 23 Sep 15 olle 16 final float scale = Base.getScale(sc);
3505 23 Sep 15 olle 17 final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.meludi");
3505 23 Sep 15 olle 18 DbControl dc = null;
3505 23 Sep 15 olle 19 try
3505 23 Sep 15 olle 20 {
3505 23 Sep 15 olle 21   dc = sc.newDbControl();
3505 23 Sep 15 olle 22   final User user = User.getById(dc, sc.getLoggedInUserId());
3505 23 Sep 15 olle 23   %>
3505 23 Sep 15 olle 24 <base:page type="default" >
3505 23 Sep 15 olle 25 <base:head 
3505 23 Sep 15 olle 26   scripts="~../meludi-2.js,~boxplot.js,~meludi_quarter_month_report_generator.js" 
3505 23 Sep 15 olle 27   styles="path.css,~../css/meludi-2.css,~../css/report.css">
3505 23 Sep 15 olle 28   <style>
3505 23 Sep 15 olle 29   canvas
3505 23 Sep 15 olle 30   {
3505 23 Sep 15 olle 31     width: 700px;
3505 23 Sep 15 olle 32     height: 550px;
3505 23 Sep 15 olle 33   }  
3505 23 Sep 15 olle 34   .guide
3505 23 Sep 15 olle 35   {
3505 23 Sep 15 olle 36     position: absolute; 
3505 23 Sep 15 olle 37     z-index: 99; 
3505 23 Sep 15 olle 38     display: none; 
3505 23 Sep 15 olle 39     background-color: #224488;
3505 23 Sep 15 olle 40   }
3505 23 Sep 15 olle 41   </style>
3505 23 Sep 15 olle 42   </base:head>
3505 23 Sep 15 olle 43   <base:body>
3505 23 Sep 15 olle 44     <p:path><p:pathelement 
3505 23 Sep 15 olle 45       title="MeLuDI" href="<%="../index.jsp?ID="+ID%>" 
3505 23 Sep 15 olle 46       /><p:pathelement title="Sample processing statistics" 
3505 23 Sep 15 olle 47       /></p:path>
3505 23 Sep 15 olle 48       
3505 23 Sep 15 olle 49     <div id="x-guide" class="guide" style="width: 1px;"></div>
3505 23 Sep 15 olle 50     <div id="y-guide" class="guide" style="height: 1px;"></div>
3505 23 Sep 15 olle 51
3505 23 Sep 15 olle 52     <div class="content">
3505 23 Sep 15 olle 53     <form name="meludi" id="wizard" class="wizard">
3505 23 Sep 15 olle 54
3505 23 Sep 15 olle 55       <div class="step" id="step-1">
3505 23 Sep 15 olle 56         <div class="step-no">1</div>
3505 23 Sep 15 olle 57         <div class="step-title">Report parameters</div>
3505 23 Sep 15 olle 58         <div class="step-content">
3505 23 Sep 15 olle 59
3505 23 Sep 15 olle 60           <div class="bg-filled-50" style="padding: 2px;">
3505 23 Sep 15 olle 61             This wizard is intended for creating box-plot statistics for fixed time intervals<br>
3505 23 Sep 15 olle 62             of original quantities for DNA and RNA extracts, as well as DNA ΔCt values.<br>
3505 23 Sep 15 olle 63             If few entries exist for some time intervals, the results must be taken with a<br>
3505 23 Sep 15 olle 64             grain of salt, as a box plot will only be generated if at least 5 data points<br>
3505 23 Sep 15 olle 65             exist for a time interval, since otherwise no relevant statistic can be calculated.<br>
3505 23 Sep 15 olle 66             This may be extra important, if filters are used to reduce the amount of data.<br>
3505 23 Sep 15 olle 67             <br>
3505 23 Sep 15 olle 68             The statistics is based on the following DNA and RNA items:<br>
3505 23 Sep 15 olle 69             <br>
3505 23 Sep 15 olle 70             1. MeLuDI items only, not extra material.<br>
3505 23 Sep 15 olle 71             2. Extracts with a case or specimen as parent, i.e. not extract child items.<br>
3505 23 Sep 15 olle 72             3. Extracts with QIAcube date set.<br>
4727 04 Apr 18 olle 73             4. Extracts passing optional project focus and/or hospital site filters.<br>
3505 23 Sep 15 olle 74             <br>
3505 23 Sep 15 olle 75           </div>
3505 23 Sep 15 olle 76
3505 23 Sep 15 olle 77           <table class="step-form" id="report-type-meludiquartermonthreport">            
3505 23 Sep 15 olle 78           <tr>
3505 23 Sep 15 olle 79             <td class="prompt">Report period</td>
3505 23 Sep 15 olle 80             <td valign="top" class="input">
3505 23 Sep 15 olle 81               From <input type="text" name="fromdate" id="fromdate" 
3505 23 Sep 15 olle 82                 style="width: 8em;" maxlength="8">&nbsp;
3505 23 Sep 15 olle 83               To <input type="text" name="todate" id="todate" 
3505 23 Sep 15 olle 84                 style="width: 8em;" maxlength="8">
3505 23 Sep 15 olle 85             </td>
3505 23 Sep 15 olle 86             <td class="status" id="period.status"></td>
3505 23 Sep 15 olle 87             <td class="help">
3505 23 Sep 15 olle 88               <span id="period.message" class="message"></span>
3505 23 Sep 15 olle 89               [YY]YYMMDD. Define which period the report should cover. 
3505 23 Sep 15 olle 90               Empty fields will include all items.
3505 23 Sep 15 olle 91             </td>
3505 23 Sep 15 olle 92           </tr>  
3505 23 Sep 15 olle 93           <tr>
3505 23 Sep 15 olle 94             <td class="prompt">View type</td>
3505 23 Sep 15 olle 95             <td class="input">
3505 23 Sep 15 olle 96               <select name="viewtype" id="viewtype" style="width: 15em;">
3505 23 Sep 15 olle 97                 <option value="QUARTERMONTH" selected="yes">Quarter + Month</option>
3505 23 Sep 15 olle 98                 <option value="AUTO">Auto</option>
3505 23 Sep 15 olle 99                 <option value="WEEK">Week</option>
3505 23 Sep 15 olle 100                 <option value="MONTH">Month</option>
3505 23 Sep 15 olle 101                 <option value="QUARTER">Quarter</option>
3505 23 Sep 15 olle 102                 <option value="YEAR">Year</option>
3505 23 Sep 15 olle 103               </select>
3505 23 Sep 15 olle 104             </td>
3505 23 Sep 15 olle 105             <td class="status" id="viewtype.status"></td>
3505 23 Sep 15 olle 106             <td class="help">
3505 23 Sep 15 olle 107               <span id="viewtype.message" class="message"></span>
3505 23 Sep 15 olle 108               Auto will adjust the report depending on the size of the period.
3505 23 Sep 15 olle 109               <ul>
3505 23 Sep 15 olle 110                 <li>Period shorter than 13 months - samples per month</li>
3505 23 Sep 15 olle 111                 <li>Period shorter than 3 years - samples per quarter</li>
3505 23 Sep 15 olle 112                 <li>Period is 3 years or greater - samples per year</li>
3505 23 Sep 15 olle 113               </ul>
3505 23 Sep 15 olle 114             </td>
3505 23 Sep 15 olle 115           </tr>
3515 29 Sep 15 olle 116           <tr id="extractsource-filter">
3515 29 Sep 15 olle 117             <td class="prompt">Extract source filter</td>
3515 29 Sep 15 olle 118             <td class="input">
3515 29 Sep 15 olle 119               <select name="extractsourcefilter" id="extractsourcefilter">
3515 29 Sep 15 olle 120                 <option value="none" selected="yes">None</option>
3515 29 Sep 15 olle 121                 <option value="meludi_specimen_extract">MeLuDI specimen extract</option>
3515 29 Sep 15 olle 122                 <option value="input_extract">Input extract (Pathology DNA/RNA)</option>
3515 29 Sep 15 olle 123               </select>
3515 29 Sep 15 olle 124             </td>
3515 29 Sep 15 olle 125             <td class="status" id="extractsourcefilter.status"></td>
3515 29 Sep 15 olle 126             <td class="help">
3515 29 Sep 15 olle 127               <span id="extractsourcefilter.message" class="message"></span>
3515 29 Sep 15 olle 128               Select extract source filter for report.
3515 29 Sep 15 olle 129             </td>
3515 29 Sep 15 olle 130           </tr>          
3505 23 Sep 15 olle 131           <tr id="projectfocus-filter">
3505 23 Sep 15 olle 132             <td class="prompt">Project focus filter</td>
3505 23 Sep 15 olle 133             <td class="input">
3505 23 Sep 15 olle 134               <select name="projectfocusfilter" id="projectfocusfilter">
3505 23 Sep 15 olle 135                 <option value="none" selected="yes">None</option>
3505 23 Sep 15 olle 136                 <option value="melanoma">Melanoma</option>
3505 23 Sep 15 olle 137                 <option value="lungcancer">Lung cancer</option>
3505 23 Sep 15 olle 138                 <option value="coloncancer">Colon cancer</option>
3505 23 Sep 15 olle 139                 <option value="GIST">GIST (Gastrointestinal stromal tumour)</option>
4196 31 Oct 16 olle 140                 <option value="breastcancer">Breast cancer</option>
3505 23 Sep 15 olle 141                 <option value="">unknown</option>
3505 23 Sep 15 olle 142               </select>
3505 23 Sep 15 olle 143             </td>
3505 23 Sep 15 olle 144             <td class="status" id="projectfocusfilter.status"></td>
3505 23 Sep 15 olle 145             <td class="help">
3505 23 Sep 15 olle 146               <span id="projectfocusfilter.message" class="message"></span>
3505 23 Sep 15 olle 147               Select project focus filter for report.
3505 23 Sep 15 olle 148             </td>
3505 23 Sep 15 olle 149           </tr>          
3505 23 Sep 15 olle 150           <tr>
4727 04 Apr 18 olle 151             <td class="prompt">Chart hospital site</td>
3505 23 Sep 15 olle 152             <td class="input">
3505 23 Sep 15 olle 153               <select id="sites" name="sites" style="width: 15em;"></select>
3505 23 Sep 15 olle 154             </td>
3505 23 Sep 15 olle 155             <td class="status" id="sites.status"></td>
3505 23 Sep 15 olle 156             <td class="help">
3505 23 Sep 15 olle 157               <span id="sites.message" class="message"></span>
4727 04 Apr 18 olle 158               Select what hospital site to take input data from.
3505 23 Sep 15 olle 159             </td>
3505 23 Sep 15 olle 160           </tr>          
3505 23 Sep 15 olle 161           <tr>
3505 23 Sep 15 olle 162             <td class="prompt">Chart data</td>
3505 23 Sep 15 olle 163             <td class="input">
3505 23 Sep 15 olle 164               <select name="chartvariant">
3505 23 Sep 15 olle 165                 <option value="allcharts" selected="yes">All</option>
3505 23 Sep 15 olle 166 <!--
3505 23 Sep 15 olle 167                 <option value="originalquantitytissue">Original quantity tissue</option>
3505 23 Sep 15 olle 168                 <option value="quantitytissueused">Quantity tissue used for MeLuDI specimens</option>
3505 23 Sep 15 olle 169                 <option value="histologypiecequantity">Histology piece quantity</option>
3505 23 Sep 15 olle 170                 <option value="remainingquantityformeludispecimen">Remaining quantity for MeLuDI specimens</option>
3505 23 Sep 15 olle 171 -->
3505 23 Sep 15 olle 172                 <option value="originalquantitydna">Original quantity DNA for MeLuDI extractions</option>
3505 23 Sep 15 olle 173                 <option value="originalquantityrna">Original quantity RNA for MeLuDI extractions</option>
3505 23 Sep 15 olle 174                 <option value="deltactdna">DNA ΔCt value for MeLuDI extractions</option>
3505 23 Sep 15 olle 175 <!--
3505 23 Sep 15 olle 176                 <option value="dnayield">DNA yield</option>
3505 23 Sep 15 olle 177                 <option value="rnayield">RNA yield</option>
3505 23 Sep 15 olle 178                 <option value="dnayieldcorrected">DNA yield (corrected for only processing half of the lysate volume)</option>
3505 23 Sep 15 olle 179                 <option value="rnayieldcorrected">RNA yield (corrected for only processing half of the lysate volume)</option>
3505 23 Sep 15 olle 180                 <option value="rnaqc">RNA QC</option>
3505 23 Sep 15 olle 181                 <option value="minutestornalater">Min to RNAlater</option>
3505 23 Sep 15 olle 182 -->
3505 23 Sep 15 olle 183               </select>
3505 23 Sep 15 olle 184             </td>
3505 23 Sep 15 olle 185             <td valign="top" class="status" id="chartvariant.status"></td>
3505 23 Sep 15 olle 186             <td class="help">
3505 23 Sep 15 olle 187               <span id="chartvariant.message" class="message"></span>
3505 23 Sep 15 olle 188               Select what data to report.
3505 23 Sep 15 olle 189             </td>
3505 23 Sep 15 olle 190           </tr>
3505 23 Sep 15 olle 191           </table>
3505 23 Sep 15 olle 192         </div>
3505 23 Sep 15 olle 193       </div>
3505 23 Sep 15 olle 194       
3505 23 Sep 15 olle 195       <div class="step" id="step-2">
3505 23 Sep 15 olle 196         <div class="step-no">2</div>
3505 23 Sep 15 olle 197         <div class="step-title">Generated report
3505 23 Sep 15 olle 198           <span id="printButton" class="link"><img src="../images/print.png">Print version&hellip;</span>
3505 23 Sep 15 olle 199         </div>
3505 23 Sep 15 olle 200         <div class="step-content" id="step-2-content">
3505 23 Sep 15 olle 201           <div id="reportdiv" style="text-align: center;"></div>
3505 23 Sep 15 olle 202         </div>
3505 23 Sep 15 olle 203       </div>
3505 23 Sep 15 olle 204       
3505 23 Sep 15 olle 205     
3505 23 Sep 15 olle 206     <div id="wizard-status"></div>
3505 23 Sep 15 olle 207
3505 23 Sep 15 olle 208     <table class="navigation" id="navigation">
3505 23 Sep 15 olle 209     <tr>
3505 23 Sep 15 olle 210       <td><base:button id="gocancel" title="Cancel" /></td>
3505 23 Sep 15 olle 211       <td><base:button id="gonext" title="Next" image="<%=home+"/images/gonext.png"%>" /></td>
3505 23 Sep 15 olle 212       <td><base:button id="gocreate" title="Generate" image="<%=home+"/images/gonext.png"%>" /></td>
3505 23 Sep 15 olle 213       <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" /></td>
3505 23 Sep 15 olle 214       <td id="gonext-message" class="message"></td>
3505 23 Sep 15 olle 215     </tr>
3505 23 Sep 15 olle 216     </table>
3505 23 Sep 15 olle 217   
3505 23 Sep 15 olle 218     
3505 23 Sep 15 olle 219     </form>
3505 23 Sep 15 olle 220     </div>
3505 23 Sep 15 olle 221     
3505 23 Sep 15 olle 222   </base:body>
3505 23 Sep 15 olle 223   </base:page>
3505 23 Sep 15 olle 224   <%
3505 23 Sep 15 olle 225 }
3505 23 Sep 15 olle 226 finally
3505 23 Sep 15 olle 227 {
3505 23 Sep 15 olle 228   if (dc != null) dc.close();
3505 23 Sep 15 olle 229 }
3505 23 Sep 15 olle 230 %>