1 | <%@ page |
---|
2 | pageEncoding="UTF-8" |
---|
3 | session="false" |
---|
4 | import="net.sf.basedb.core.Application" |
---|
5 | import="net.sf.basedb.core.User" |
---|
6 | import="net.sf.basedb.core.DbControl" |
---|
7 | import="net.sf.basedb.core.SessionControl" |
---|
8 | import="net.sf.basedb.clients.web.Base" |
---|
9 | import="net.sf.basedb.clients.web.util.HTML" |
---|
10 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
11 | import="net.sf.basedb.util.Values" |
---|
12 | %> |
---|
13 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
14 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
15 | <% |
---|
16 | final SessionControl sc = Base.getExistingSessionControl(request, "net.sf.basedb.reggie", true); |
---|
17 | final String ID = sc.getId(); |
---|
18 | final float scale = Base.getScale(sc); |
---|
19 | final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie"); |
---|
20 | |
---|
21 | DbControl dc = null; |
---|
22 | try |
---|
23 | { |
---|
24 | dc = sc.newDbControl(); |
---|
25 | final User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
26 | %> |
---|
27 | <base:page type="default" > |
---|
28 | <base:head |
---|
29 | scripts="~../reggie-2.js,~map-external-data.js" |
---|
30 | styles="path.css,~../css/reggie-2.css" |
---|
31 | > |
---|
32 | <style> |
---|
33 | #preview |
---|
34 | { |
---|
35 | white-space: pre; |
---|
36 | font-size: 90%; |
---|
37 | color: #444444; |
---|
38 | background-color: #f0f0f0; |
---|
39 | overflow: hidden; |
---|
40 | min-height: 5em; |
---|
41 | /* Sizing settings that aims to make it align more or less to the file field */ |
---|
42 | width: 33rem; |
---|
43 | border-width: 1px; |
---|
44 | border-radius: 4px; |
---|
45 | padding: 3px 0.5em; |
---|
46 | margin: 0 0 0.5em 1px; |
---|
47 | box-sizing: content-box; |
---|
48 | } |
---|
49 | |
---|
50 | #more-lines |
---|
51 | { |
---|
52 | border-top-width: 1px; |
---|
53 | border-top-style: dotted; |
---|
54 | color: #000000; |
---|
55 | margin-top: 0.25em; |
---|
56 | } |
---|
57 | </style> |
---|
58 | </base:head> |
---|
59 | <base:body> |
---|
60 | |
---|
61 | <p:path><p:pathelement |
---|
62 | title="Reggie" href="<%="../index.jsp?ID="+ID%>" |
---|
63 | /><p:pathelement title="Map external data to releases" |
---|
64 | /></p:path> |
---|
65 | |
---|
66 | <div class="content"> |
---|
67 | <form name="reggie" id="wizard" class="wizard"> |
---|
68 | |
---|
69 | <div class="step" id="step-1"> |
---|
70 | <div class="step-no">1</div> |
---|
71 | <div class="step-title">Select a source data file</div> |
---|
72 | <div class="step-content"> |
---|
73 | |
---|
74 | <table class="step-form"> |
---|
75 | <tr class="align-top"> |
---|
76 | <td class="prompt">File</td> |
---|
77 | <td class="input"> |
---|
78 | <input type="file" name="file" id="file" class="required" style="width: 95%;" accept=".csv,.tsv"> |
---|
79 | </td> |
---|
80 | <td class="status" id="file.status"></td> |
---|
81 | <td class="help" rowspan="2"><span id="file.message" class="message"></span> |
---|
82 | <ul> |
---|
83 | <li>Select a tab-, comma-, or semicolon-separated text file in UTF-8 encoding. |
---|
84 | <li>The first line should contain column headers. |
---|
85 | <li>The first column should contain the personal number, or a release id value as specified by the <b>Map from</b> option. |
---|
86 | <li>The wizard will replace the first column with the value or values specified by the <b>Map to</b> option. |
---|
87 | <li>If no matching patient can be found the line is skipped. |
---|
88 | </ul> |
---|
89 | </td> |
---|
90 | </tr> |
---|
91 | <tr class="align-top"> |
---|
92 | <td class="subprompt">preview</td> |
---|
93 | <td> |
---|
94 | <div id="preview"><i>No file loaded...</i></div> |
---|
95 | </td> |
---|
96 | <td></td> |
---|
97 | </tr> |
---|
98 | <tr> |
---|
99 | <td class="prompt">Separator</td> |
---|
100 | <td> |
---|
101 | <select name="separator" id="separator"> |
---|
102 | <option value="tab">Tab |
---|
103 | <option value="comma">Comma |
---|
104 | <option value="semicolon">Semi-colon |
---|
105 | </select> |
---|
106 | </td> |
---|
107 | <td></td> |
---|
108 | </tr> |
---|
109 | <tr> |
---|
110 | <td class="prompt">Map from</td> |
---|
111 | <td class="input"> |
---|
112 | <select name="mapFrom" id="mapFrom"> |
---|
113 | <option value="PersonalNo">Personal number |
---|
114 | <option value="PAD">PAD |
---|
115 | <option value="PatientId">Patient release ID |
---|
116 | <option value="CaseId">Case release ID |
---|
117 | <option value="SpecimenId">Specimen release ID |
---|
118 | </select> |
---|
119 | </td> |
---|
120 | <td class="status" id="mapFrom.status"></td> |
---|
121 | <td class="help"><span id="mapFrom.message" class="message"></span> |
---|
122 | Select the kind of values that are found in the first column. |
---|
123 | </td> |
---|
124 | </tr> |
---|
125 | <tr> |
---|
126 | <td class="prompt">Map to</td> |
---|
127 | <td class="input" style="padding-top: 4px; padding-bottom: 4px;"> |
---|
128 | <div id="exportPersonalNo" style="display: none;"><input type="checkbox" checked disabled>Personal number</div> |
---|
129 | <div id="alsoExportPad" style="display: none;"><label><input type="checkbox" name="exportPad" id="exportPad">PAD</label></div> |
---|
130 | <div id="exportPatientId" style="display: none;"><input type="checkbox" checked disabled>Patient release ID</div> |
---|
131 | <div id="alsoExportCaseId" style="display: none;"><label><input type="checkbox" name="exportCaseId" id="exportCaseId">Case release ID</label></div> |
---|
132 | <div id="alsoExportSpecimenId" style="display: none;"><label><input type="checkbox" name="exportSpecimenId" id="exportSpecimenId">Specimen release ID</label></div> |
---|
133 | </td> |
---|
134 | <td class="status" id="mapTo.status"></td> |
---|
135 | <td class="help"><span id="mapTo.message" class="message"></span> |
---|
136 | Select the kind of values that should be outputted in the first column and, optionally, in extra columns. |
---|
137 | </td> |
---|
138 | </tr> |
---|
139 | <tr> |
---|
140 | <td class="prompt">Output order</td> |
---|
141 | <td class="input" style="padding-top: 4px; padding-bottom: 4px;"> |
---|
142 | <label><input type="radio" name="outputOrder" id="sortOutputOrder" checked>Sort by first column</label><br> |
---|
143 | <label><input type="radio" name="outputOrder" id="keepOutputOrder">Same as input file</label> |
---|
144 | </td> |
---|
145 | <td class="status" id="outputOrder.status"></td> |
---|
146 | <td class="help"><span id="outputOrder.message" class="message"></span> |
---|
147 | Select if the output file should be sorted by the value in the first column |
---|
148 | or keep the same order as the input file. |
---|
149 | </td> |
---|
150 | </tr> |
---|
151 | </table> |
---|
152 | </div> |
---|
153 | </div> |
---|
154 | |
---|
155 | <div id="wizard-status"></div> |
---|
156 | <div id="wizard-progress"></div> |
---|
157 | |
---|
158 | <table class="navigation" id="navigation"> |
---|
159 | <tr> |
---|
160 | <td><base:button id="gocancel" title="Cancel" /></td> |
---|
161 | <td><base:button id="goexport" title="Export" image="<%=home+"/images/gonext.png"%>" /></td> |
---|
162 | <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" /></td> |
---|
163 | <td><base:button id="godownload" title="Download" image="<%=home+"/images/download.png"%>" /></td> |
---|
164 | <td id="gonext-message" class="message"></td> |
---|
165 | </tr> |
---|
166 | </table> |
---|
167 | |
---|
168 | </form> |
---|
169 | </div> |
---|
170 | |
---|
171 | </base:body> |
---|
172 | </base:page> |
---|
173 | <% |
---|
174 | } |
---|
175 | finally |
---|
176 | { |
---|
177 | if (dc != null) dc.close(); |
---|
178 | } |
---|
179 | %> |
---|