1 | <%@ page import="dbnp.studycapturing.Study" %> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
5 | <meta name="layout" content="main" /> |
---|
6 | <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" /> |
---|
7 | <title><g:message code="default.list.label" args="[entityName]" /></title> |
---|
8 | |
---|
9 | <script type="text/javascript"> |
---|
10 | $(function() { |
---|
11 | $("#tabs").tabs(); |
---|
12 | }); |
---|
13 | </script> |
---|
14 | |
---|
15 | </head> |
---|
16 | <body> |
---|
17 | |
---|
18 | <% studyList = dbnp.studycapturing.Study.list() %> |
---|
19 | <% def att_list = ['template','startDate','events','samplingEvents','lastUpdated','readers','code','editors','ecCode','researchQuestion','title','description','owner','dateCreated'] %> |
---|
20 | <% def selectedStudies = [] %> |
---|
21 | <% def tmpList = [] %> |
---|
22 | |
---|
23 | <div class="nav"> |
---|
24 | <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> |
---|
25 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
26 | <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> |
---|
27 | </div> |
---|
28 | |
---|
29 | <div class="body"> |
---|
30 | <h1>Studies Comparison</h1> |
---|
31 | <g:if test="${flash.message}"> |
---|
32 | <div class="message">${flash.message}</div> |
---|
33 | </g:if> |
---|
34 | |
---|
35 | <% params.each{key,values-> %> |
---|
36 | <% if (values=="on"){ %> |
---|
37 | <% tmpList.add(key) %> |
---|
38 | <% } }%> |
---|
39 | |
---|
40 | <% for (i in studyList) {%> |
---|
41 | <% if (tmpList.contains(i.getTitle())) { %> |
---|
42 | <% selectedStudies.add(i) %> |
---|
43 | <% }} %> |
---|
44 | |
---|
45 | <% if (selectedStudies.size()>0) {%> |
---|
46 | |
---|
47 | |
---|
48 | <div id="tabs"> |
---|
49 | <ul> |
---|
50 | <li><a href="#study">Study Information</a></li> |
---|
51 | <li><a href="#subjects">Subjects</a></li> |
---|
52 | <li><a href="#groups">Groups</a></li> |
---|
53 | <li><a href="#protocols">Protocols</a></li> |
---|
54 | <li><a href="#events">Events</a></li> |
---|
55 | <li><a href="#event-description">Event Description</a></li> |
---|
56 | <li><a href="#event-group">Event Groups</a></li> |
---|
57 | <li><a href="#assays">Assays</a></li> |
---|
58 | </ul> |
---|
59 | |
---|
60 | |
---|
61 | <div id="study"> |
---|
62 | <br> |
---|
63 | <table> |
---|
64 | <tr> |
---|
65 | <td></td> |
---|
66 | <g:each in="${selectedStudies}" status="j" var="studyIns"> |
---|
67 | <td width="50%"><b>${studyIns.title}</b></td> |
---|
68 | </g:each> |
---|
69 | </tr> |
---|
70 | <tr> |
---|
71 | <td><b>Id</b></td> |
---|
72 | <g:each in="${selectedStudies}" status="k" var="studyIns"> |
---|
73 | <td><g:link action="show" id="${studyIns.id}"> |
---|
74 | ${fieldValue(bean: studyIns, field: "id")}</g:link></td> |
---|
75 | </g:each> |
---|
76 | </tr> |
---|
77 | |
---|
78 | <g:each in="${att_list}" var="att"> |
---|
79 | <tr> |
---|
80 | <td><b>${att[0].toUpperCase()+att.substring(1)}</b></td> |
---|
81 | <g:each in="${selectedStudies}" status="k" var="studyIns"> |
---|
82 | |
---|
83 | <g:if test="${att == 'events'}"> |
---|
84 | <td> |
---|
85 | <% def eventList = [] %> |
---|
86 | <g:each in="${studyIns.events}" var="s"> |
---|
87 | <% eventList.add(s.eventDescription) %> |
---|
88 | </g:each> |
---|
89 | <g:if test="${eventList.size()==0}"> |
---|
90 | - |
---|
91 | </g:if> |
---|
92 | <g:else> |
---|
93 | <% def sampEvent = eventList.get(0).name %> |
---|
94 | ${sampEvent} |
---|
95 | <g:each in="${eventList}" var="event"> |
---|
96 | <g:if test="${(event.name!=sampEvent)}"> |
---|
97 | ${event.name} |
---|
98 | </g:if> |
---|
99 | </g:each> |
---|
100 | </g:else> |
---|
101 | </td> |
---|
102 | </g:if> |
---|
103 | |
---|
104 | <g:elseif test="${att == 'samplingEvents'}"> |
---|
105 | <td> |
---|
106 | <% def SampeventList = [] %> |
---|
107 | <g:each in="${studyIns.samplingEvents}" var="s"> |
---|
108 | <% SampeventList.add(s.eventDescription) %> |
---|
109 | </g:each> |
---|
110 | <g:if test="${SampeventList.size()==0}"> |
---|
111 | - |
---|
112 | </g:if> |
---|
113 | <g:else> |
---|
114 | <% def samplEvent = SampeventList.get(0).name %> |
---|
115 | ${samplEvent} |
---|
116 | <g:each in="${SampeventList}" var="samplingEvent"> |
---|
117 | <g:if test="${(samplingEvent.name!=samplEvent)}"> |
---|
118 | ${samplingEvent.name} |
---|
119 | </g:if> |
---|
120 | </g:each> |
---|
121 | </g:else> |
---|
122 | </td> |
---|
123 | </g:elseif> |
---|
124 | |
---|
125 | <g:else> |
---|
126 | <td>${fieldValue(bean: studyIns, field: att)}</td> |
---|
127 | </g:else> |
---|
128 | </g:each> |
---|
129 | </tr> |
---|
130 | </g:each> |
---|
131 | |
---|
132 | </table> |
---|
133 | </div> |
---|
134 | |
---|
135 | <div id="subjects"> |
---|
136 | |
---|
137 | <table border="2"> |
---|
138 | <tr> |
---|
139 | <g:each in="${selectedStudies}" var="study"> |
---|
140 | <td><center><b>${study.title}</b></center></td> |
---|
141 | </g:each> |
---|
142 | </tr> |
---|
143 | |
---|
144 | <tr> |
---|
145 | <g:each in="${selectedStudies}" var="stud"> |
---|
146 | <td> |
---|
147 | |
---|
148 | |
---|
149 | <g:each in="${stud.giveSubjectTemplates()}" var="template"> |
---|
150 | <table> |
---|
151 | <tr> |
---|
152 | <td><b>Id </b></td> |
---|
153 | <td><b>Species</b></td> |
---|
154 | <td><b>Name</b></td> |
---|
155 | <g:each in="${template.fields}" var="g"> |
---|
156 | <td><b> |
---|
157 | <g:link controller="templateField" action="show" id="${g.id}"> |
---|
158 | ${g}</b></td> |
---|
159 | </g:link> |
---|
160 | </g:each> |
---|
161 | </tr> |
---|
162 | |
---|
163 | <g:each in="${stud.subjects.findAll { it.template == template}}" var="s"> |
---|
164 | <tr> |
---|
165 | <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> |
---|
166 | <td>${s.species}</td> |
---|
167 | <td>${s.name}</td> |
---|
168 | <g:each in="${template.fields}" var="g"> |
---|
169 | <td> |
---|
170 | <% print s.getFieldValue(g.toString()) %> |
---|
171 | </td> |
---|
172 | </g:each> |
---|
173 | </tr> |
---|
174 | </g:each> |
---|
175 | |
---|
176 | </table> |
---|
177 | |
---|
178 | </g:each> |
---|
179 | |
---|
180 | |
---|
181 | |
---|
182 | </td> |
---|
183 | </g:each> |
---|
184 | </tr> |
---|
185 | </table> |
---|
186 | |
---|
187 | </div> |
---|
188 | |
---|
189 | <div id="groups"> |
---|
190 | <table border="2"> |
---|
191 | <tr> |
---|
192 | <g:each in="${selectedStudies}" var="study"> |
---|
193 | <td width="50%"><center><b>${study.title}</b></center></td> |
---|
194 | </g:each> |
---|
195 | </tr> |
---|
196 | <tr> |
---|
197 | <g:each in="${selectedStudies}" var="study"> |
---|
198 | <td> |
---|
199 | <g:if test="${study.groups.size()==0}"> No groups in this study </g:if> |
---|
200 | <g:else><center><b>${study.groups}</b></center></g:else> |
---|
201 | </td> |
---|
202 | </g:each> |
---|
203 | </tr> |
---|
204 | </table> |
---|
205 | </div> |
---|
206 | |
---|
207 | <div id="protocols"> |
---|
208 | <table border="2"> |
---|
209 | <tr> |
---|
210 | <g:each in="${selectedStudies}" var="study"> |
---|
211 | <td width="50%"><center><b>${study.title}</b></center></td> |
---|
212 | </g:each> |
---|
213 | </tr> |
---|
214 | |
---|
215 | <tr> |
---|
216 | <g:each in="${selectedStudies}" var="stud"> |
---|
217 | <td> |
---|
218 | <table> |
---|
219 | <tr> |
---|
220 | <td><b>Id </b></td> |
---|
221 | <td><b>Name</b></td> |
---|
222 | <td><b>Parameters</b></td> |
---|
223 | <td><b>Reference</b></td> |
---|
224 | </tr> |
---|
225 | |
---|
226 | <% def protocol_list = [] %> |
---|
227 | <% def tmp_protocol = stud.events.eventDescription.protocol.get(0) %> |
---|
228 | <% def tmpBis_protocol = stud.samplingEvents.eventDescription.protocol.get(0) %> |
---|
229 | <% protocol_list.add(tmp_protocol) %> |
---|
230 | <% protocol_list.add(tmpBis_protocol) %> |
---|
231 | |
---|
232 | <g:each in="${stud.events.eventDescription.protocol}" var="s"> |
---|
233 | <% if (tmp_protocol!=s) { %> |
---|
234 | <% protocol_list.add(s) %> |
---|
235 | <%}%> |
---|
236 | </g:each> |
---|
237 | |
---|
238 | <g:each in="${stud.samplingEvents.eventDescription.protocol}" var="s"> |
---|
239 | <% if (tmpBis_protocol!=s) { %> |
---|
240 | <% protocol_list.add(s) %> |
---|
241 | <%}%> |
---|
242 | </g:each> |
---|
243 | |
---|
244 | <g:each in="${protocol_list}" var="protocol"> |
---|
245 | <tr> |
---|
246 | <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td> |
---|
247 | <td>${protocol.name}</td> |
---|
248 | <td> |
---|
249 | <g:each in="${protocol.parameters}" var="p"><ul><li> |
---|
250 | <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link> |
---|
251 | </li></ul> |
---|
252 | </g:each> |
---|
253 | </td> |
---|
254 | <td>${protocol.reference}</td> |
---|
255 | </tr> |
---|
256 | </g:each> |
---|
257 | </table> |
---|
258 | |
---|
259 | </td> |
---|
260 | </g:each> |
---|
261 | </tr> |
---|
262 | </table> |
---|
263 | </div> |
---|
264 | |
---|
265 | <div id="events"> |
---|
266 | <table border="2"> |
---|
267 | <tr> |
---|
268 | <g:each in="${selectedStudies}" var="study"> |
---|
269 | <td><center><b>${study.title}</b></center></td> |
---|
270 | </g:each> |
---|
271 | </tr> |
---|
272 | |
---|
273 | <tr> |
---|
274 | <g:each in="${selectedStudies}" var="stud"> |
---|
275 | <td> |
---|
276 | |
---|
277 | <table> |
---|
278 | <tr> |
---|
279 | <td><b>Event Description</b></td> |
---|
280 | <td><b>Subject</b></td> |
---|
281 | <td><b>Start Time</b></td> |
---|
282 | <td><b>Duration</b></td> |
---|
283 | <td><b>Sampling Event</b></td> |
---|
284 | <td><b>Parameters</b></td> |
---|
285 | </tr> |
---|
286 | |
---|
287 | <g:each in="${stud.events}" var="e"> |
---|
288 | <tr> |
---|
289 | <td><g:link controller="event" action="show" id="${e.id}"> ${e.eventDescription.name}</g:link></td> |
---|
290 | <td>?</td> |
---|
291 | <td>${e.getPrettyDuration(stud.startDate,e.startTime)}</td> |
---|
292 | <td>${e.getPrettyDuration()}</td> |
---|
293 | <td><g:checkBox name="event" disabled="${true}" value="${false}"/></td> |
---|
294 | <g:each in="${e.eventDescription.protocol.parameters}" var="param"> |
---|
295 | <td> |
---|
296 | ${param.name} : ${param.listEntries} |
---|
297 | </td> |
---|
298 | </g:each> |
---|
299 | </tr> |
---|
300 | </g:each> |
---|
301 | |
---|
302 | <g:each in="${stud.samplingEvents}" var="e"> |
---|
303 | <tr> |
---|
304 | <td><g:link controller="event" action="show" id="${e.id}">${e.eventDescription.name}</g:link></td> |
---|
305 | <td>?</td> |
---|
306 | <td>${e.getPrettyDuration(stud.startDate,e.startTime)}</td> |
---|
307 | <td>${e.getPrettyDuration()}</td> |
---|
308 | <td><g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/></td> |
---|
309 | |
---|
310 | <g:each in="${e.eventDescription.protocol.parameters}" var="param"> |
---|
311 | <td> |
---|
312 | ${param.name} : ${param.listEntries} |
---|
313 | </td> |
---|
314 | </g:each> |
---|
315 | </tr> |
---|
316 | </g:each> |
---|
317 | |
---|
318 | |
---|
319 | </table> |
---|
320 | </td> |
---|
321 | </g:each> |
---|
322 | </tr> |
---|
323 | </table> |
---|
324 | |
---|
325 | </div> |
---|
326 | |
---|
327 | <div id="event-description"> |
---|
328 | <table border="2"> |
---|
329 | <tr> |
---|
330 | <g:each in="${selectedStudies}" var="study"> |
---|
331 | <td><center><b>${study.title}</b></center></td> |
---|
332 | </g:each> |
---|
333 | </tr> |
---|
334 | <tr> |
---|
335 | <g:each in="${selectedStudies}" var="stud"> |
---|
336 | <td> |
---|
337 | <table> |
---|
338 | <tr> |
---|
339 | |
---|
340 | <td><b>Event Name</b></td> |
---|
341 | <td><b>Parameters </b></td> |
---|
342 | </tr> |
---|
343 | <tr> |
---|
344 | <td><b></b></td> |
---|
345 | <td><b>Name</b></td> |
---|
346 | <td><b>Description</b></td> |
---|
347 | <td><b>Unit</b></td> |
---|
348 | <td><b>Reference</b></td> |
---|
349 | <td><b>Options</b></td> |
---|
350 | <td><b>Type</b></td> |
---|
351 | </tr> |
---|
352 | <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e"> |
---|
353 | <g:if test="${(stud.events.eventDescription.contains(e))}" > |
---|
354 | <tr> |
---|
355 | <td>${e.name} </td></tr><tr> |
---|
356 | <g:each in="${e.protocol.parameters}" var="p"> |
---|
357 | <td></td> |
---|
358 | <td>${p.name}</td> |
---|
359 | <td>${p.description}</td> |
---|
360 | <td>${p.unit}</td> |
---|
361 | <td>${p.reference}</td> |
---|
362 | <g:if test="${(p.listEntries.size()==0)}" > |
---|
363 | <td>-</td> |
---|
364 | </g:if> |
---|
365 | <g:else> |
---|
366 | <td>${p.listEntries}</td> |
---|
367 | </g:else> |
---|
368 | <td>${p.type}</td> |
---|
369 | </tr> |
---|
370 | </g:each> |
---|
371 | </g:if> |
---|
372 | </g:each> |
---|
373 | |
---|
374 | <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e"> |
---|
375 | <g:if test="${(stud.samplingEvents.eventDescription.contains(e))}" > |
---|
376 | <tr> |
---|
377 | <td>${e.name} </td></tr><tr> |
---|
378 | <g:each in="${e.protocol.parameters}" var="p"> |
---|
379 | <td></td> |
---|
380 | <td>${p.name}</td> |
---|
381 | <td>${p.description}</td> |
---|
382 | <td>${p.unit}</td> |
---|
383 | <td>${p.reference}</td> |
---|
384 | <g:if test="${(p.listEntries.size()==0)}" > |
---|
385 | <td>-</td> |
---|
386 | </g:if> |
---|
387 | <g:else> |
---|
388 | <td>${p.listEntries}</td> |
---|
389 | </g:else> |
---|
390 | <td>${p.type}</td> |
---|
391 | </tr> |
---|
392 | </g:each> |
---|
393 | </g:if> |
---|
394 | </g:each> |
---|
395 | |
---|
396 | </table> |
---|
397 | </td> |
---|
398 | </g:each> |
---|
399 | </tr> |
---|
400 | </table> |
---|
401 | |
---|
402 | </div> |
---|
403 | |
---|
404 | <div id="event-group"> |
---|
405 | </div> |
---|
406 | |
---|
407 | <div id="assays"> |
---|
408 | <table border="2"> |
---|
409 | <tr> |
---|
410 | <g:each in="${selectedStudies}" var="study"> |
---|
411 | <td><center><b>${study.title}</b></center></td> |
---|
412 | </g:each> |
---|
413 | </tr> |
---|
414 | <tr> |
---|
415 | <g:each in="${selectedStudies}" var="stud"> |
---|
416 | <td> |
---|
417 | <table> |
---|
418 | <tr><td> |
---|
419 | <g:if test="${stud.assays.size()==0}"> |
---|
420 | No assays in this study |
---|
421 | </g:if> |
---|
422 | <g:else> |
---|
423 | <table> |
---|
424 | <tr> |
---|
425 | |
---|
426 | <td width="100"><b>Assay Name</b></td> |
---|
427 | <td width="100"><b>Module</b></td> |
---|
428 | <td><b>Type</b></td> |
---|
429 | <td width="150"><b>Platform</b></td> |
---|
430 | <td><b>Url</b></td> |
---|
431 | <td><b>Samples</b></td> |
---|
432 | </tr> |
---|
433 | <g:each in="${stud.assays}" var="assay"> |
---|
434 | <tr> |
---|
435 | <td>${assay.name}</td> |
---|
436 | <td>${assay.module.name}</td> |
---|
437 | <td>${assay.module.type}</td> |
---|
438 | <td>${assay.module.platform}</td> |
---|
439 | <td>${assay.module.url}</td> |
---|
440 | <td> |
---|
441 | <g:each in="${assay.samples}" var="assaySample"> |
---|
442 | ${assaySample.name}<br> |
---|
443 | </g:each> |
---|
444 | </td> |
---|
445 | </tr> |
---|
446 | </g:each> |
---|
447 | </table> |
---|
448 | </g:else> |
---|
449 | |
---|
450 | |
---|
451 | </table> |
---|
452 | </td> |
---|
453 | </g:each> |
---|
454 | </tr> |
---|
455 | </table> |
---|
456 | |
---|
457 | </div> |
---|
458 | |
---|
459 | </div> |
---|
460 | |
---|
461 | <% } %> |
---|
462 | |
---|
463 | <% if (selectedStudies.size()==0) {%> |
---|
464 | Please select studies to compare. |
---|
465 | <% } %> |
---|
466 | |
---|
467 | </div> |
---|
468 | |
---|
469 | |
---|
470 | </body> |
---|
471 | </html> |
---|