Line | |
---|
1 | package dbnp.studycapturing |
---|
2 | |
---|
3 | import dbnp.data.Term |
---|
4 | |
---|
5 | /** |
---|
6 | * The Sample class describes an actual sample which results from a SamplingEvent. |
---|
7 | */ |
---|
8 | class Sample extends TemplateEntity { |
---|
9 | static searchable = true |
---|
10 | |
---|
11 | Subject parentSubject |
---|
12 | SamplingEvent parentEvent |
---|
13 | |
---|
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 |
---|
17 | |
---|
18 | Map giveDomainFields() { |
---|
19 | return ['name':TemplateFieldType.STRING,'material':TemplateFieldType.ONTOLOGYTERM] |
---|
20 | } |
---|
21 | |
---|
22 | static constraints = { |
---|
23 | parentSubject(nullable:true) |
---|
24 | } |
---|
25 | |
---|
26 | static getSamplesFor( event ) { |
---|
27 | return Sample.findAll( 'from Sample s where s.parentEvent =:event', [event:event] ) |
---|
28 | } |
---|
29 | |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.