Last change
on this file since 228 was
228,
checked in by keesvb, 8 years ago
|
study template convenience methods
|
-
Property svn:keywords set to
Rev Date Author
|
File size:
1.5 KB
|
Line | |
---|
1 | package dbnp.studycapturing |
---|
2 | |
---|
3 | /** |
---|
4 | * Domain class describing the basic entity in the study capture part: the Study class. |
---|
5 | * |
---|
6 | * Revision information: |
---|
7 | * $Rev: 228 $ |
---|
8 | * $Author: keesvb $ |
---|
9 | * $Date: 2010-03-03 11:17:06 +0000 (wo, 03 mrt 2010) $ |
---|
10 | */ |
---|
11 | class Study extends TemplateEntity implements Serializable { |
---|
12 | static searchable = true |
---|
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 | |
---|
23 | static hasMany = [ |
---|
24 | editors: nimble.User, |
---|
25 | readers: nimble.User, |
---|
26 | subjects: Subject, |
---|
27 | groups: SubjectGroup, |
---|
28 | events: Event, |
---|
29 | samplingEvents: SamplingEvent, |
---|
30 | samples: Sample, |
---|
31 | assays: Assay, |
---|
32 | persons: StudyPerson, |
---|
33 | publications: Publication |
---|
34 | ] |
---|
35 | |
---|
36 | static constraints = { |
---|
37 | owner(nullable: true, blank: true) |
---|
38 | title(nullable: false, blank: false) |
---|
39 | template(nullable: true, blank: true) |
---|
40 | } |
---|
41 | |
---|
42 | static mapping = { |
---|
43 | researchQuestion type: 'text' |
---|
44 | description type: 'text' |
---|
45 | autoTimestamp true |
---|
46 | } |
---|
47 | |
---|
48 | def String toString() { |
---|
49 | return title; |
---|
50 | } |
---|
51 | |
---|
52 | /** |
---|
53 | * Returns the template of all subjects in the study |
---|
54 | * Throws an error if there are no or multiple subject templates |
---|
55 | */ |
---|
56 | def Template giveSubjectTemplate() { |
---|
57 | TemplateEntity.giveTemplate(subjects); |
---|
58 | } |
---|
59 | |
---|
60 | /** |
---|
61 | * Returns the template of all samples in the study |
---|
62 | * Throws an error if there are no or multiple sample templates |
---|
63 | */ |
---|
64 | def Template giveSampleTemplate() { |
---|
65 | TemplateEntity.giveTemplate(samples); |
---|
66 | } |
---|
67 | /** |
---|
68 | * Returns the template of the study |
---|
69 | */ |
---|
70 | def Template giveStudyTemplate() { |
---|
71 | return this.template; |
---|
72 | } |
---|
73 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.