<%@ page import="dbnp.studycapturing.Study" %> <%@ page import="dbnp.studycapturing.EventGroup" %> <%@ page import="dbnp.studycapturing.RelTime" %> <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(", ")}
Owner ${studyInstance.owner?.encodeAsHTML()} -
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() if( !subjectTemplates ) { subjectTemplates = []; subjectFields = []; } else { subjectFields = subjectTemplates*.fields?.flatten().unique() if( !subjectFields ) { 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
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() %> <% def sortedEventGroups = studyInstance.eventGroups.sort( { a, b -> return a.name <=> b.name; } as Comparator ); def orphans = studyInstance.getOrphanEvents(); if( orphans?.size() > 0 ) { sortedEventGroups.add( new EventGroup( id: -1, name: 'No group', events: orphans, subjects: [] )); } %>
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 Platform Link Samples
${studyInstance.title} ${assay.name} ${assay.module.name} ${assay.module.platform} view <% sortedAssaySamples = assay.samples.sort( { a, b -> a.name <=> b.name } as Comparator ) %> ${sortedAssaySamples.name.join( ', ' )}
No samples in the selected studies <% // Determine a union of the fields for all different // samples 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 sampleTemplates = studyList*.giveSampleTemplates().flatten().unique() if( !sampleTemplates ) { sampleTemplates = []; sampleFields = []; showSampleFields = []; } else { sampleFields = sampleTemplates*.fields.flatten().unique() if( !sampleFields ) { sampleFields = []; showSampleFields = []; } else { // Filter out all fields that are left blank for all samples allSamples = studyList*.samples.flatten() showSampleFields = []; sampleFields.each { sampleField -> for( sample in allSamples ) { // If the field is filled for this subject, we have to // show the field and should not check any other // samples (hence the break) if( sample.fieldExists( sampleField.name ) && sample.getFieldValue( sampleField.name ) ) { showSampleFields << sampleField; break; } } } } } %> <% // Sort samples by name samples = studyInstance.samples; sortedSamples = samples.sort( { a, b -> a.name <=> b.name } as Comparator ) %>
${field} ${field}
${studyInstance.title} ${sample.getFieldValue(field.name)} ${sample.getFieldValue(field.name)} N/A
<% // 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

${message(code: 'default.button.edit.label', default: 'Edit')} Back to list