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