<%@ page import="dbnp.studycapturing.Study" %> <g:message code="default.show.label" args="[entityName]" />

${flash.message}
<% // Determine a union of the fields from all studies, in order // to show a proper list. We want every field to appear just once, // so the list is filtered for unique values studyFields = studyList[0].giveDomainFields() + studyList*.giveTemplateFields().flatten().unique() %> <% // If a value is not set for any of the selected studies, the // field should not appear in the list showField = true in studyList.collect { it.fieldExists( field.name ) && it.getFieldValue( field.name ) != null }.flatten() %>
${studyInstance.title}
${field} ${studyInstance.getFieldValue(field.name)}
Events - ${studyInstance.giveEventTemplates().name.join(", ")}
Sampling events - ${studyInstance.giveSamplingEventTemplates().name.join(", ")}
Readers - , ${r?.encodeAsHTML()}
Editors - , ${r?.encodeAsHTML()}
No subjects in the selected studies <% // Determine a union of the fields for all different // subjects in all studies. In order to show a proper list. // We want every field to appear just once, // so the list is filtered for unique values subjectTemplates = studyList*.giveSubjectTemplates().flatten().unique() subjectFields = subjectTemplates*.fields.flatten().unique() showSubjectFields = subjectFields /* * These lines are rewritten because * performance sucked * * // These took about 9 seconds (for 31 subjects and * allSubjects = studyList*.subjects.flatten() * * subjectFields = subjectFields.findAll { subjectField -> * ( true in allSubjects.collect { subject -> subject.fieldExists( subjectField.name ) && subject.getFieldValue( subjectField.name ) != null }.flatten() ) * } */ // Filter out all fields that are left blank for all subjects allSubjects = studyList*.subjects.flatten() showSubjectFields = [] subjectFields.each { subjectField -> for( subject in allSubjects ) { // If the field is filled for this subject, we have to // show the field and should not check any other // subjects (hence the break) if( subject.fieldExists( subjectField.name ) && subject.getFieldValue( subjectField.name ) ) { showSubjectFields << subjectField; break; } } } %> <% // Sort subjects by name subjects = studyInstance.subjects; sortedSubjects = subjects.sort( { a, b -> a.name <=> b.name } as Comparator ) %>
${field} ${field}
${studyInstance.title} ${subject.getFieldValue(field.name)} ${subject.getFieldValue(field.name)} N/A
No events in these studies <% // Sort events by starttime and duration events = studyInstance.events + studyInstance.samplingEvents; sortedEvents = events.sort( { a, b -> a.startTime == b.startTime ? a.getDuration().toMilliseconds() <=> b.getDuration().toMilliseconds() : a.startTime <=> b.startTime } as Comparator ) %>
Start time Duration Type Sampling event Parameters
${studyInstance.title} ${event.getPrettyDuration(studyInstance.startDate,event.startTime)} ${event.getPrettyDuration()} ${event.template.name} , ${field.name} = ${event.getFieldValue( field.name )}
No event groups in this study <% // Determine a union of the event templates for all different // eventgroups in all studies, in order to show a proper list. // We want every field to appear just once, // so the list is filtered for unique values groupTemplates = studyList*.giveAllEventTemplates().flatten().unique() subjectFields = subjectTemplates*.fields.flatten().unique() %>
Name Events Subjects
${eventTemplate.name}
${studyInstance.title} ${eventGroup.name} , ${field.name} = ${event.getFieldValue( field.name )} <% sortedGroupSubjects = eventGroup.subjects.sort( { a, b -> a.name <=> b.name } as Comparator ) %> ${sortedGroupSubjects.name.join( ', ' )}
No assays in these studies
Assay Name Module Type Platform Url Samples
${studyInstance.title} ${assay.name} ${assay.module.name} ${assay.module.type} ${assay.module.platform} ${assay.module.url} <% sortedAssaySamples = assay.samples.sort( { a, b -> a.name <=> b.name } as Comparator ) %> ${sortedAssaySamples.name.join( ', ' )}
<% // Determine a list of all persons allPersons = studyList*.persons*.person.flatten().unique() %> No persons involved in these studies <% studyperson = studyInstance.persons.find { it.person == person } %>
Name Affiliations Phone Email ${studyInstance.title} Role
${person.firstName} ${person.prefix} ${person.lastName} ${person.affiliations.join(', ')} ${person.phone} ${person.email} ${studyperson.role.name}
<% // Determine a list of all persons allPublications = studyList*.publications.flatten().unique() %> No publications attached to these studies
Title Authors Comments ${studyInstance.title}
${publication.title} ${publication.authorsList} ${publication.comments} x

Back to list