extensions/net.sf.basedb.meludi/trunk/resources/personal/generate-referral-forms_alt_ntr.jsp

Code
Comments
Other
Rev Date Author Line
5686 25 Oct 19 olle 1 <%@ page
5686 25 Oct 19 olle 2   pageEncoding="UTF-8"
5686 25 Oct 19 olle 3   session="false"
5686 25 Oct 19 olle 4   import="net.sf.basedb.core.Application"
5686 25 Oct 19 olle 5   import="net.sf.basedb.core.User"
5686 25 Oct 19 olle 6   import="net.sf.basedb.core.DbControl"
5686 25 Oct 19 olle 7   import="net.sf.basedb.core.SessionControl"
5686 25 Oct 19 olle 8   import="net.sf.basedb.clients.web.Base"
5686 25 Oct 19 olle 9   import="net.sf.basedb.clients.web.util.HTML"
5686 25 Oct 19 olle 10   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
5686 25 Oct 19 olle 11   import="net.sf.basedb.util.Values"
5686 25 Oct 19 olle 12   import="net.sf.basedb.util.formatter.DateFormatter"
5686 25 Oct 19 olle 13 %>
5686 25 Oct 19 olle 14 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
5686 25 Oct 19 olle 15 <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
5686 25 Oct 19 olle 16 <%
5686 25 Oct 19 olle 17 //final SessionControl sc = Base.getExistingSessionControl(request, "net.sf.basedb.meludi", true);
5686 25 Oct 19 olle 18 final SessionControl sc = Base.getExistingSessionControl(request, true);
5686 25 Oct 19 olle 19 final String ID = sc.getId();
5686 25 Oct 19 olle 20 final float scale = Base.getScale(sc);
5686 25 Oct 19 olle 21 final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.meludi");
5686 25 Oct 19 olle 22
5686 25 Oct 19 olle 23 DbControl dc = null;
5686 25 Oct 19 olle 24 try
5686 25 Oct 19 olle 25 {
5686 25 Oct 19 olle 26   dc = sc.newDbControl();
5686 25 Oct 19 olle 27   final User user = User.getById(dc, sc.getLoggedInUserId());
5686 25 Oct 19 olle 28   DateFormatter dateFormat = new DateFormatter("yyyy-MM-dd");
5686 25 Oct 19 olle 29 %>
5686 25 Oct 19 olle 30 <base:page type="default" >
5686 25 Oct 19 olle 31 <base:head 
5686 25 Oct 19 olle 32   scripts="~../meludi-2.js,~generate-referral-forms_alt_ntr.js" 
5686 25 Oct 19 olle 33   styles="path.css,~../css/meludi-2.css"
5686 25 Oct 19 olle 34 >
5686 25 Oct 19 olle 35 <style>
5686 25 Oct 19 olle 36 #not-found
5686 25 Oct 19 olle 37 {
5686 25 Oct 19 olle 38   margin: 0 1em 0 4em; 
5686 25 Oct 19 olle 39   padding: 0.5em 1em; 
5686 25 Oct 19 olle 40   font-family: monospace,Courier New;
5686 25 Oct 19 olle 41   max-height: 25em;
5686 25 Oct 19 olle 42   overflow: auto;
5686 25 Oct 19 olle 43 }
5686 25 Oct 19 olle 44 </style>
5686 25 Oct 19 olle 45 </base:head>
5686 25 Oct 19 olle 46 <base:body>
5686 25 Oct 19 olle 47
5686 25 Oct 19 olle 48   <p:path><p:pathelement 
5686 25 Oct 19 olle 49     title="Meludi" href="<%="../index.jsp?ID="+ID%>" 
5695 04 Nov 19 olle 50     /><p:pathelement title="Generate referral forms - NordicTrip" 
5686 25 Oct 19 olle 51     /></p:path>
5686 25 Oct 19 olle 52
5686 25 Oct 19 olle 53   <div class="content">
5686 25 Oct 19 olle 54   <form name="meludi" id="wizard" class="wizard">
5686 25 Oct 19 olle 55   
5686 25 Oct 19 olle 56   <div class="step" id="step-1">
5686 25 Oct 19 olle 57     <div class="step-no">1</div>
5695 04 Nov 19 olle 58 <!--
5686 25 Oct 19 olle 59     <div class="step-title">Enter info on the referral form batch to create</div>
5695 04 Nov 19 olle 60 -->
5695 04 Nov 19 olle 61     <div class="step-title">Referral form generation</div>
5686 25 Oct 19 olle 62     <div class="step-content">
5686 25 Oct 19 olle 63   
5686 25 Oct 19 olle 64       <div class="bg-filled-50" style="padding: 2px;">
5686 25 Oct 19 olle 65 <!--
5686 25 Oct 19 olle 66         * A form set consists of forms with the same base SCAN-B ID, i.e. ignoring optional suffix.<br>
5686 25 Oct 19 olle 67         * A form batch consists of a number of form sets with consecutive SCAN-B ID's.<br>
5686 25 Oct 19 olle 68 -->
5686 25 Oct 19 olle 69         * A form set consists of forms for the same site.<br>
5686 25 Oct 19 olle 70         * A form batch consists of a number of form sets with consecutive ID's.<br>
5686 25 Oct 19 olle 71         * A form batch is distributed as two files, with forms intended for printing on<br>
5686 25 Oct 19 olle 72         &nbsp;&nbsp;&nbsp;referral form sheets or regular paper, respectively:<br>
5686 25 Oct 19 olle 73         <br>
5686 25 Oct 19 olle 74 <!--
5686 25 Oct 19 olle 75         &nbsp;&nbsp;&nbsp;Batch file 1: Form sets with 2 or 4 (Kit 2) forms to be printed on referral form sheets.<br>
5686 25 Oct 19 olle 76         &nbsp;&nbsp;&nbsp;Batch file 2: Form sets with 2 forms to be printed on regular paper.<br>
5686 25 Oct 19 olle 77 -->
5686 25 Oct 19 olle 78         &nbsp;&nbsp;&nbsp;Batch file 1: Form sets with forms to be printed on referral form sheets.<br>
5686 25 Oct 19 olle 79         &nbsp;&nbsp;&nbsp;Batch file 2: Form sets with forms to be printed on regular paper.<br>
5686 25 Oct 19 olle 80         <br>
5686 25 Oct 19 olle 81         &nbsp;&nbsp;&nbsp;Printing options:<br>
5686 25 Oct 19 olle 82         <br>
5686 25 Oct 19 olle 83 <!--
5686 25 Oct 19 olle 84         &nbsp;&nbsp;&nbsp;Batch file 1: One-sided printing, one page per sheet, print size "Actual size".<br>
5686 25 Oct 19 olle 85         &nbsp;&nbsp;&nbsp;Batch file 2: Double-sided printing, two pages per sheet, print size "Actual size".<br>
5686 25 Oct 19 olle 86 -->
5686 25 Oct 19 olle 87         &nbsp;&nbsp;&nbsp;Batch file 1 & 2: One-sided printing, one page per sheet, print size "Actual size".<br>
5686 25 Oct 19 olle 88         <br> 
5686 25 Oct 19 olle 89       </div>
5686 25 Oct 19 olle 90
5695 04 Nov 19 olle 91 <!--
5686 25 Oct 19 olle 92       <table class="step-form">
5686 25 Oct 19 olle 93       <tr>
5686 25 Oct 19 olle 94         <td class="prompt">Site</td>
5686 25 Oct 19 olle 95         <td class="input">
5695 04 Nov 19 olle 96 -->
5686 25 Oct 19 olle 97 <!--
5686 25 Oct 19 olle 98           <select id="sites" name="sites" style="width: 15em;"></select>
5686 25 Oct 19 olle 99 -->
5695 04 Nov 19 olle 100 <!--
5686 25 Oct 19 olle 101           <select id="sites" name="sites"
5686 25 Oct 19 olle 102             class="auto-init" data-auto-init="focus-on-enter" data-next-focus="tubeContentType">
5686 25 Oct 19 olle 103           </select>
5686 25 Oct 19 olle 104         </td>
5686 25 Oct 19 olle 105         <td class="status" id="sites.status"></td>
5686 25 Oct 19 olle 106         <td class="help">
5686 25 Oct 19 olle 107           <span id="sites.message" class="message"></span>
5686 25 Oct 19 olle 108           Select what site to generate referral forms for.
5686 25 Oct 19 olle 109         </td>
5686 25 Oct 19 olle 110       </tr>
5695 04 Nov 19 olle 111 -->
5686 25 Oct 19 olle 112 <!--
5686 25 Oct 19 olle 113       <tr>
5686 25 Oct 19 olle 114         <td class="prompt">Form set variant</td>
5686 25 Oct 19 olle 115         <td class="input">
5686 25 Oct 19 olle 116           <select name="referralvariant" id="referralvariant">
5686 25 Oct 19 olle 117             <option value="kit1_standard" selected="yes">Kit 1 - Standard</option>
5686 25 Oct 19 olle 118             <option value="kit2_neoadjuvant">Kit 2 - Neoadjuvant therapy</option>
5686 25 Oct 19 olle 119           </select>
5686 25 Oct 19 olle 120         </td>
5686 25 Oct 19 olle 121         <td valign="top" class="status" id="referralvariant.status"></td>
5686 25 Oct 19 olle 122         <td class="help">
5686 25 Oct 19 olle 123           <span id="referralvariant.message" class="message"></span>
5686 25 Oct 19 olle 124           Select form set variant.
5686 25 Oct 19 olle 125         </td>
5686 25 Oct 19 olle 126       </tr>
5686 25 Oct 19 olle 127 -->
5695 04 Nov 19 olle 128 <!--
5686 25 Oct 19 olle 129       </table>
5686 25 Oct 19 olle 130       <div id="step1message"></div>
5686 25 Oct 19 olle 131
5686 25 Oct 19 olle 132     </div>
5686 25 Oct 19 olle 133   </div>
5686 25 Oct 19 olle 134
5686 25 Oct 19 olle 135   <div class="step" id="step-2">
5686 25 Oct 19 olle 136     <div class="step-no">2</div>
5686 25 Oct 19 olle 137     <div class="step-title">Referral form generation</div>
5686 25 Oct 19 olle 138     <div class="step-content">
5686 25 Oct 19 olle 139
5695 04 Nov 19 olle 140 -->
5686 25 Oct 19 olle 141       <table class="step-form">
5686 25 Oct 19 olle 142       <tr>
5686 25 Oct 19 olle 143         <td class="prompt">Start referral ID</td>
5686 25 Oct 19 olle 144         <td class="input"><input type="text" name="itemName" id="itemName"
5686 25 Oct 19 olle 145           class="required auto-init" data-auto-init="focus"
5686 25 Oct 19 olle 146           style="width: 12em;" maxlength="12"></td>
5686 25 Oct 19 olle 147         <td class="status" id="itemName.status"></td>
5686 25 Oct 19 olle 148         <td class="help">
5686 25 Oct 19 olle 149           <span id="itemName.message" class="message"></span>
5686 25 Oct 19 olle 150 <!--
5686 25 Oct 19 olle 151           The 7-digit SCAN-B ID (barcode) for the first referral form set. Last updated: <b><span id="scanbIdLastUpdated"></span></b>.
5686 25 Oct 19 olle 152 -->
5734 19 Nov 19 olle 153           The 4-digit ID (barcode) for the first referral form set. Last updated: <b><span id="referralIdLastUpdated"></span></b>.
5686 25 Oct 19 olle 154         </td>
5686 25 Oct 19 olle 155       </tr>
5686 25 Oct 19 olle 156       <tr>
5686 25 Oct 19 olle 157         <td class="prompt"># Form sets</td>
5686 25 Oct 19 olle 158         <td class="input"><input type="text" name="nofFormSets" id="nofFormSets"
5686 25 Oct 19 olle 159           class="required auto-init" data-auto-init="focus"
5686 25 Oct 19 olle 160           style="width: 12em;" maxlength="12"></td>
5686 25 Oct 19 olle 161         <td class="status" id="nofFormSets.status"></td>
5686 25 Oct 19 olle 162         <td class="help">
5686 25 Oct 19 olle 163           <span id="nofFormSets.message" class="message"></span>
5686 25 Oct 19 olle 164           Number of form sets to generate.
5686 25 Oct 19 olle 165         </td>
5686 25 Oct 19 olle 166       </tr>
5686 25 Oct 19 olle 167       </table>
5695 04 Nov 19 olle 168 <!--
5686 25 Oct 19 olle 169       <div id="step2message"></div>
5695 04 Nov 19 olle 170 -->
5695 04 Nov 19 olle 171       <div id="step1message"></div>
5686 25 Oct 19 olle 172     </div>
5686 25 Oct 19 olle 173   </div>
5686 25 Oct 19 olle 174
5695 04 Nov 19 olle 175 <!--
5686 25 Oct 19 olle 176   <div class="step" id="step-3">
5686 25 Oct 19 olle 177     <div class="step-no">3</div>
5695 04 Nov 19 olle 178 -->
5695 04 Nov 19 olle 179   <div class="step" id="step-2">
5695 04 Nov 19 olle 180     <div class="step-no">2</div>
5686 25 Oct 19 olle 181     <div class="step-title">Referral form download</div>
5686 25 Oct 19 olle 182     <div class="step-content">
5686 25 Oct 19 olle 183
5686 25 Oct 19 olle 184       <table class="step-form">
5686 25 Oct 19 olle 185       </table>
5695 04 Nov 19 olle 186 <!--
5686 25 Oct 19 olle 187       <div id="step3message"></div>
5695 04 Nov 19 olle 188 -->
5695 04 Nov 19 olle 189       <div id="step2message"></div>
5686 25 Oct 19 olle 190     </div>
5686 25 Oct 19 olle 191   </div>
5686 25 Oct 19 olle 192
5686 25 Oct 19 olle 193   <div id="wizard-status"></div>
5686 25 Oct 19 olle 194   <div id="wizard-progress"></div>
5686 25 Oct 19 olle 195
5686 25 Oct 19 olle 196   <div id="not-found" style="display: none;" class="bg-filled-100 fullborder"></div>
5686 25 Oct 19 olle 197
5686 25 Oct 19 olle 198   <table class="navigation" id="navigation">
5686 25 Oct 19 olle 199   <tr>
5686 25 Oct 19 olle 200     <td><base:button id="gocancel" title="Cancel" /></td>
5686 25 Oct 19 olle 201     <td><base:button id="gonext" title="Next" image="<%=home+"/images/gonext.png"%>" /></td>
5686 25 Oct 19 olle 202     <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" /></td>
5686 25 Oct 19 olle 203     <td><base:button id="downloadformbatch1" title="Download form batch file 1" image="<%=home+"/images/download.png"%>" /></td>
5686 25 Oct 19 olle 204     <td><base:button id="downloadformbatch2" title="Download form batch file 2" image="<%=home+"/images/download.png"%>" /></td>
5686 25 Oct 19 olle 205     <td><base:button id="downloadlabelfile" title="Download serum label file" image="<%=home+"/images/download.png"%>" /></td>
5686 25 Oct 19 olle 206     <td><base:button id="updateuseditemidlist" title="Update used item ID list" image="<%=home+"/images/gonext.png"%>" /></td>
5686 25 Oct 19 olle 207     <td id="gonext-message" class="message"></td>
5686 25 Oct 19 olle 208   </tr>
5686 25 Oct 19 olle 209   </table>
5686 25 Oct 19 olle 210   
5686 25 Oct 19 olle 211   </form>
5686 25 Oct 19 olle 212   </div>
5686 25 Oct 19 olle 213   
5686 25 Oct 19 olle 214 </base:body>
5686 25 Oct 19 olle 215 </base:page>
5686 25 Oct 19 olle 216 <%
5686 25 Oct 19 olle 217 }
5686 25 Oct 19 olle 218 finally
5686 25 Oct 19 olle 219 {
5686 25 Oct 19 olle 220   if (dc != null) dc.close();
5686 25 Oct 19 olle 221 }
5686 25 Oct 19 olle 222 %>