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.show.label" args="[entityName]" /></title> |
---|
9 | <script type="text/javascript"> |
---|
10 | $(function() { |
---|
11 | $("#tabs").tabs(); |
---|
12 | }); |
---|
13 | </script> |
---|
14 | |
---|
15 | </head> |
---|
16 | <body> |
---|
17 | |
---|
18 | <div class="nav"> |
---|
19 | <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> |
---|
20 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
21 | <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> |
---|
22 | </div> |
---|
23 | |
---|
24 | <div class="body"> |
---|
25 | <h1><g:message code="default.show.label" args="[entityName]" /></h1> |
---|
26 | <g:if test="${flash.message}"> |
---|
27 | <div class="message">${flash.message}</div> |
---|
28 | </g:if> |
---|
29 | <div class="dialog"> |
---|
30 | |
---|
31 | <% protocolList = dbnp.studycapturing.Protocol.list() %> |
---|
32 | <% def study_eventsDescription = [] %> |
---|
33 | <% study_eventsDescription = studyInstance.events.eventDescription.unique() %> |
---|
34 | <% study_eventsDescription.addAll(studyInstance.samplingEvents.eventDescription.unique()) %> |
---|
35 | <% def study_events = [] %> |
---|
36 | <% study_events = studyInstance.events.unique() %> |
---|
37 | <% study_events.addAll(studyInstance.samplingEvents.unique()) %> |
---|
38 | |
---|
39 | <div id="tabs"> |
---|
40 | <ul> |
---|
41 | <li><a href="#study">Study Information</a></li> |
---|
42 | <li><a href="#subjects">Subjects</a></li> |
---|
43 | <li><a href="#groups">Groups</a></li> |
---|
44 | <li><a href="#protocols">Protocols</a></li> |
---|
45 | <li><a href="#events">Events</a></li> |
---|
46 | <li><a href="#event-description">Event Description</a></li> |
---|
47 | <li><a href="#event-group">Event Groups</a></li> |
---|
48 | <li><a href="#assays">Assays</a></li> |
---|
49 | </ul> |
---|
50 | |
---|
51 | <div id="study"> |
---|
52 | |
---|
53 | <b> Id </b>: ${fieldValue(bean: studyInstance, field: "id")} <br> |
---|
54 | <b>Template </b>:<g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link><br> |
---|
55 | <b> Start </b>:<g:formatDate date="${studyInstance?.startDate}" /> <br> |
---|
56 | <b> Events </b>: |
---|
57 | <g:if test="${studyInstance.events.eventDescription.size()==0}"> |
---|
58 | - |
---|
59 | </g:if> |
---|
60 | <g:else> |
---|
61 | ${studyInstance.events.eventDescription.unique().toString().replaceAll("]"," "). |
---|
62 | substring(1,studyInstance.events.eventDescription.unique().toString().size())} |
---|
63 | </g:else> |
---|
64 | <br> |
---|
65 | <b>Sampling Events </b>: |
---|
66 | <g:if test="${studyInstance.samplingEvents.eventDescription.size()==0}"> |
---|
67 | - |
---|
68 | </g:if> |
---|
69 | <g:else> |
---|
70 | ${studyInstance.samplingEvents.eventDescription.unique().toString().replaceAll("]"," "). |
---|
71 | substring(1,studyInstance.samplingEvents.eventDescription.unique().toString().size())} |
---|
72 | </g:else> |
---|
73 | <br> |
---|
74 | <b>Last Updated </b>:<g:formatDate date="${studyInstance?.lastUpdated}" /><br> |
---|
75 | <b>Readers </b>: |
---|
76 | |
---|
77 | <g:if test="${studyInstance.readers.size()==0}"> |
---|
78 | - |
---|
79 | </g:if> |
---|
80 | <g:else> |
---|
81 | <ul> |
---|
82 | <g:each in="${studyInstance.readers}" var="r"> |
---|
83 | <li><g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li> |
---|
84 | </g:each> |
---|
85 | </ul> |
---|
86 | </g:else> |
---|
87 | <br> |
---|
88 | <b>Code </b>: ${fieldValue(bean: studyInstance, field: "code")} <br> |
---|
89 | <b>Editors </b>: |
---|
90 | <g:if test="${studyInstance.editors.size()==0}"> |
---|
91 | - |
---|
92 | </g:if> |
---|
93 | <g:else> |
---|
94 | <ul> |
---|
95 | <g:each in="${studyInstance.editors}" var="e"> |
---|
96 | <li><g:link controller="user" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li> |
---|
97 | </g:each> |
---|
98 | </ul> |
---|
99 | </g:else> |
---|
100 | <br> |
---|
101 | <b>EC Code </b>: ${fieldValue(bean: studyInstance, field: "ecCode")} <br> |
---|
102 | <b>Research Question </b>: ${fieldValue(bean: studyInstance, field: "researchQuestion")} <br> |
---|
103 | <b>Title </b>: ${fieldValue(bean: studyInstance, field: "title")} <br> |
---|
104 | <b>Description </b>: ${fieldValue(bean: studyInstance, field: "description")} <br> |
---|
105 | <b>Owner </b>:<g:link controller="user" action="show" id="${studyInstance?.owner?.id}">${studyInstance?.owner?.encodeAsHTML()}</g:link> <br> |
---|
106 | <b>Date Created </b>:<g:formatDate date="${studyInstance?.dateCreated}" /> <br> |
---|
107 | </div> |
---|
108 | |
---|
109 | <div id="subjects"> |
---|
110 | <g:each in="${studyInstance.giveSubjectTemplates()}" var="template"> |
---|
111 | <table> |
---|
112 | <tr> |
---|
113 | <td><b>Id </b></td> |
---|
114 | <td><b>Species</b></td> |
---|
115 | <td><b>Name</b></td> |
---|
116 | <g:each in="${template.fields}" var="g"> |
---|
117 | <td><b> |
---|
118 | <g:link controller="templateField" action="show" id="${g.id}"> |
---|
119 | ${g}</b></td> |
---|
120 | </g:link> |
---|
121 | </g:each> |
---|
122 | </tr> |
---|
123 | |
---|
124 | <g:each in="${studyInstance.subjects.findAll {it.template == template}}" var="s"> |
---|
125 | <tr> |
---|
126 | <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> |
---|
127 | <td>${s.species}</td> |
---|
128 | <td>${s.name}</td> |
---|
129 | <g:each in="${template.fields}" var="g"> |
---|
130 | <td> |
---|
131 | <% print s.getFieldValue(g.toString()) %> |
---|
132 | </td> |
---|
133 | </g:each> |
---|
134 | </tr> |
---|
135 | </g:each> |
---|
136 | |
---|
137 | </table> |
---|
138 | |
---|
139 | </g:each> |
---|
140 | </div> |
---|
141 | |
---|
142 | <div id="groups"> |
---|
143 | <g:if test="${studyInstance.groups.size()==0}"> |
---|
144 | No groups in this study |
---|
145 | </g:if> |
---|
146 | <g:else> |
---|
147 | <g:each in="${studyInstance.groups}" var="g"> |
---|
148 | ${g.name} |
---|
149 | </g:each> |
---|
150 | </g:else> |
---|
151 | </div> |
---|
152 | |
---|
153 | <div id="protocols"> |
---|
154 | <% def protocol_list = [] %> |
---|
155 | <% protocol_list= studyInstance.events.eventDescription.protocol.unique() %> |
---|
156 | <g:if test="${protocol_list.size()==0}"> |
---|
157 | No protocols in this study |
---|
158 | </g:if> |
---|
159 | <g:else> |
---|
160 | <table> |
---|
161 | <tr> |
---|
162 | <td><b>Id </b></td> |
---|
163 | <td><b>Name</b></td> |
---|
164 | <td><b>Parameters</b></td> |
---|
165 | <td><b>Reference</b></td> |
---|
166 | </tr> |
---|
167 | <g:each in="${protocol_list}" var="protocol"> |
---|
168 | <tr> |
---|
169 | <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td> |
---|
170 | <td>${protocol.name}</td> |
---|
171 | <td> |
---|
172 | <g:each in="${protocol.parameters}" var="p"> |
---|
173 | <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link> |
---|
174 | </g:each> |
---|
175 | </td> |
---|
176 | <td>${protocol.reference}</td> |
---|
177 | </tr> |
---|
178 | |
---|
179 | </g:each> |
---|
180 | </table> |
---|
181 | </g:else> |
---|
182 | </div> |
---|
183 | |
---|
184 | <div id="events"> |
---|
185 | <g:if test="${study_events.size()==0}"> |
---|
186 | No events in this study |
---|
187 | </g:if> |
---|
188 | <g:else> |
---|
189 | <table> |
---|
190 | <tr> |
---|
191 | <td><b>Subject</b></td> |
---|
192 | <td><b>Start Time</b></td> |
---|
193 | <td><b>Duration</b></td> |
---|
194 | <td><b>Event Description</b></td> |
---|
195 | <td><b>Sampling Event</b></td> |
---|
196 | <td><b>Parameters</b></td> |
---|
197 | </tr> |
---|
198 | <g:each in="${study_events}" var="e"> |
---|
199 | <tr> |
---|
200 | <td>-</td> |
---|
201 | <td>${e.getPrettyDuration(studyInstance.startDate,e.startTime)}</td> |
---|
202 | <td>${e.getPrettyDuration()}</td> |
---|
203 | <td><g:link controller="event" action="show" id="${e.id}"> ${e.eventDescription.name}</g:link></td> |
---|
204 | <td> |
---|
205 | <g:if test="${e instanceof dbnp.studycapturing.SamplingEvent}"> |
---|
206 | <g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/> |
---|
207 | </g:if> |
---|
208 | <g:else> |
---|
209 | <g:checkBox name="event" disabled="${true}" value="${false}"/> |
---|
210 | </g:else> |
---|
211 | </td> |
---|
212 | <td> |
---|
213 | <g:if test="${e.parameterStringValues.size()>0}"> |
---|
214 | <% def stringValues = e.parameterStringValues.toString().replaceAll("}"," ") %> |
---|
215 | <% print stringValues.substring(1,stringValues.size()) %> |
---|
216 | </g:if> |
---|
217 | <g:elseif test="${e.parameterIntegerValues.size()>0}"> |
---|
218 | <% def integerValues = e.parameterInteger.toString().replaceAll("}"," ") %> |
---|
219 | <% print integerValues.substring(1,integerValues.size()) %> |
---|
220 | </g:elseif> |
---|
221 | <g:elseif test="${e.parameterFloatValues.size()>0}"> |
---|
222 | <% def floatValues = e.parameterFloatValues.toString().replaceAll("}"," ") %> |
---|
223 | <% print floatValues.substring(1,floatValues.size()) %> |
---|
224 | </g:elseif> |
---|
225 | </td> |
---|
226 | </tr> |
---|
227 | </g:each> |
---|
228 | </table> |
---|
229 | </g:else> |
---|
230 | </div> |
---|
231 | |
---|
232 | <div id="event-description"> |
---|
233 | <g:if test="${study_eventsDescription.size()==0}"> |
---|
234 | No events description in this study |
---|
235 | </g:if> |
---|
236 | <g:else> |
---|
237 | <table> |
---|
238 | <tr> |
---|
239 | <td><b>Event Name</b></td> |
---|
240 | <td><b>Parameters </b></td> |
---|
241 | </tr> |
---|
242 | <tr> |
---|
243 | <td><b></b></td> |
---|
244 | <td><b>Name</b></td> |
---|
245 | <td><b>Description</b></td> |
---|
246 | <td><b>Unit</b></td> |
---|
247 | <td><b>Reference</b></td> |
---|
248 | <td><b>Options</b></td> |
---|
249 | <td><b>Type</b></td> |
---|
250 | </tr> |
---|
251 | <g:each in="${study_eventsDescription}" var="e"> |
---|
252 | <tr> |
---|
253 | <td>${e.name} </td> |
---|
254 | <g:each in="${e.protocol.parameters}" var="p"> |
---|
255 | <td>${p.name}</td> |
---|
256 | <td>${p.description}</td> |
---|
257 | <td>${p.unit}</td> |
---|
258 | <td>${p.reference}</td> |
---|
259 | <g:if test="${(p.listEntries.size()==0)}" > |
---|
260 | <td>-</td> |
---|
261 | </g:if> |
---|
262 | <g:else> |
---|
263 | <td>${p.listEntries.toString().replaceAll("]"," ").substring(1,p.listEntries.toString().size())}</td> |
---|
264 | </g:else> |
---|
265 | <td>${p.type}</td> |
---|
266 | </tr> |
---|
267 | </g:each> |
---|
268 | </g:each> |
---|
269 | </table> |
---|
270 | |
---|
271 | <g:form controller="eventDescription" action="create"> |
---|
272 | <INPUT TYPE=submit name=submit Value="New Event Description"> |
---|
273 | </g:form> |
---|
274 | </g:else> |
---|
275 | </div> |
---|
276 | |
---|
277 | <div id="event-group"> |
---|
278 | <g:if test="${studyInstance.eventGroups.size()==0}"> |
---|
279 | No event groups in this study |
---|
280 | </g:if> |
---|
281 | <g:else> |
---|
282 | <table> |
---|
283 | <tr> |
---|
284 | <td><b>Name</b></td> |
---|
285 | <td colspan="${study_eventsDescription.size()}"><b>Events</b></td> |
---|
286 | <td><b>Subjects</b></td> |
---|
287 | </tr> |
---|
288 | <tr> |
---|
289 | <td></td> |
---|
290 | <g:each in="${study_eventsDescription}" var="list"> |
---|
291 | <td> |
---|
292 | <b>${list}</b> |
---|
293 | </td> |
---|
294 | </g:each> |
---|
295 | </tr> |
---|
296 | <g:each in="${studyInstance.eventGroups}" var="eventGroup"> |
---|
297 | <tr> |
---|
298 | <td>${eventGroup.name}</td> |
---|
299 | |
---|
300 | <g:each in="${study_eventsDescription}" var="des"> |
---|
301 | <td> |
---|
302 | <g:each in="${eventGroup.events}" var="e"> |
---|
303 | <g:if test="${e.eventDescription==des}"> |
---|
304 | <g:if test="${e.parameterStringValues.size()>0}"> |
---|
305 | <% def stringValues = e.parameterStringValues.toString().replaceAll("}"," ") %> |
---|
306 | <% print stringValues.substring(1,stringValues.size()) %> |
---|
307 | </g:if> |
---|
308 | <g:elseif test="${e.parameterIntegerValues.size()>0}"> |
---|
309 | <% def integerValues = e.parameterInteger.toString().replaceAll("}"," ") %> |
---|
310 | <% print integerValues.substring(1,integerValues.size()) %> |
---|
311 | </g:elseif> |
---|
312 | <g:elseif test="${e.parameterFloatValues.size()>0}"> |
---|
313 | <% def floatValues = e.parameterFloatValues.toString().replaceAll("}"," ") %> |
---|
314 | <% print floatValues.substring(1,floatValues.size()) %> |
---|
315 | </g:elseif> |
---|
316 | </g:if> |
---|
317 | </g:each> |
---|
318 | </td> |
---|
319 | </g:each> |
---|
320 | |
---|
321 | <td>${eventGroup.subjects.name.toString().replaceAll("]"," "). |
---|
322 | substring(1,eventGroup.subjects.name.toString().size())}</td> |
---|
323 | </tr> |
---|
324 | </g:each> |
---|
325 | </table> |
---|
326 | </g:else> |
---|
327 | </div> |
---|
328 | |
---|
329 | <div id="assays"> |
---|
330 | <g:if test="${studyInstance.assays.size()==0}"> |
---|
331 | No assays in this study |
---|
332 | </g:if> |
---|
333 | <g:else> |
---|
334 | <table> |
---|
335 | <tr> |
---|
336 | <td width="100"><b>Assay Name</b></td> |
---|
337 | <td width="100"><b>Module</b></td> |
---|
338 | <td><b>Type</b></td> |
---|
339 | <td width="150"><b>Platform</b></td> |
---|
340 | <td><b>Url</b></td> |
---|
341 | <td><b>Samples</b></td> |
---|
342 | </tr> |
---|
343 | <g:each in="${studyInstance.assays}" var="assay"> |
---|
344 | <tr> |
---|
345 | <td>${assay.name}</td> |
---|
346 | <td>${assay.module.name}</td> |
---|
347 | <td>${assay.module.type}</td> |
---|
348 | <td>${assay.module.platform}</td> |
---|
349 | <td>${assay.module.url}</td> |
---|
350 | <td> |
---|
351 | <g:each in="${assay.samples}" var="assaySample"> |
---|
352 | ${assaySample.name}<br> |
---|
353 | </g:each> |
---|
354 | </td> |
---|
355 | </tr> |
---|
356 | </g:each> |
---|
357 | |
---|
358 | </table> |
---|
359 | </g:else> |
---|
360 | </div> |
---|
361 | |
---|
362 | </div> |
---|
363 | </div> |
---|
364 | <br> |
---|
365 | <div class="buttons"> |
---|
366 | <g:form> |
---|
367 | <g:hiddenField name="id" value="${studyInstance?.id}" /> |
---|
368 | <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span> |
---|
369 | <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span> |
---|
370 | </g:form> |
---|
371 | </div> |
---|
372 | </div> |
---|
373 | </body> |
---|
374 | </html> |
---|