source: trunk/grails-app/domain/dbnp/studycapturing/Study.groovy @ 212

Last change on this file since 212 was 212, checked in by keesvb, 10 years ago

refactored template entity code into TemplateEntity?, added more template field types, updated BootStrap? with some more details on PPSH, changed code in study overview to get template field contents in a nicer way

  • Property svn:keywords set to Rev Date Author
File size: 1.1 KB
RevLine 
[77]1package dbnp.studycapturing
2
3/**
4 * Domain class describing the basic entity in the study capture part: the Study class.
[103]5 *
6 * Revision information:
7 * $Rev: 212 $
8 * $Author: keesvb $
9 * $Date: 2010-02-25 14:06:16 +0000 (do, 25 feb 2010) $
[77]10 */
[212]11class Study extends TemplateEntity implements Serializable {
[139]12        static searchable = true
[92]13        nimble.User owner
14        String title
15        String code
16        String researchQuestion
17        String description
18        String ecCode
19        Date dateCreated
20        Date lastUpdated
21        Date startDate
22        Template template
[77]23
[212]24        static hasMany = [
25                editors: nimble.User,
26                readers: nimble.User,
27                subjects: Subject,
28                groups: SubjectGroup,
29                events: Event,
30                samplingEvents: SamplingEvent,
31                assays: Assay,
32                persons: StudyPerson,
33                publications: Publication
[103]34        ]
[77]35
[92]36        static constraints = {
[101]37                owner(nullable: true, blank: true)
38                title(nullable: false, blank: false)
39                template(nullable: true, blank: true)
[92]40        }
[77]41
[92]42        static mapping = {
43                researchQuestion type: 'text'
44                description type: 'text'
[136]45                autoTimestamp true
[92]46        }
[100]47
[103]48        def String toString() {
49                return title;
50        }
[176]51
[177]52        def giveAllFields() {
53                return template.studyFields;
[176]54        }
[186]55
56        def giveSamples() {
57                return samplingEvents*.samples;
58        }
[77]59}
Note: See TracBrowser for help on using the repository browser.