source: trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy @ 389

Last change on this file since 389 was 389, checked in by duh, 9 years ago
  • reverted changes of revisions 386, 387 and 388 as they completely broke the repository (you need to get cake now! ;)
  • committed development version of modified study capture wizard (works until events)
  • Property svn:keywords set to Date Author Rev
File size: 767 bytes
RevLine 
[81]1package dbnp.studycapturing
2
[106]3import dbnp.data.Term
4
[84]5/**
6 * The Sample class describes an actual sample which results from a SamplingEvent.
7 */
[232]8class Sample extends TemplateEntity {
[139]9        static searchable = true
[81]10
[232]11        Subject parentSubject
12        SamplingEvent parentEvent
[84]13
[232]14        String name      // should be unique with respect to the parent study (which can be inferred)
15        Term material
16        // a member that describes the quantity of the sample? --> should be in the templates
[224]17
[389]18        Map giveDomainFields() {
19                return ['name':TemplateFieldType.STRING,'material':TemplateFieldType.ONTOLOGYTERM]
[375]20        }
21
[232]22        static constraints = {
[288]23                parentSubject(nullable:true)
[232]24        }
[81]25
[288]26        static getSamplesFor( event ) {
27            return  Sample.findAll( 'from Sample s where s.parentEvent =:event', [event:event] )
28        }
29
[81]30}
Note: See TracBrowser for help on using the repository browser.