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