Ignore:
Timestamp:
Mar 3, 2010, 5:18:22 PM (13 years ago)
Author:
keesvb
Message:

adjusted Event-Sample relationship to go into EventGroup?, added EventGroups? in BootStrap?, added a Study template to BootStrap?

Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r209 r232  
    1414 */
    1515class Event implements Serializable {
    16         Subject subject
    1716        EventDescription eventDescription
    1817        Date startTime
     
    2928
    3029        static constraints = {
    31                 subject(nullable: true, blank: true)    // TODO: subject is to be removed from Event, and into EventGroup
    3230                startTime(nullable:false)
    3331                endTime(validator: {val, obj ->
  • trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy

    r224 r232  
    66 * The Sample class describes an actual sample which results from a SamplingEvent.
    77 */
    8 class Sample {
     8class Sample extends TemplateEntity {
    99        static searchable = true
    1010
     11        Subject parentSubject
     12        SamplingEvent parentEvent
    1113
     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
    1217
    13     String name      // should be unique with respect to the parent study (which can be inferred)
    14     Term material
    15     // don't we need a member that describes the quantity of the sample? --> should be in the templates
    16 
    17     static constraints = {
    18     }
     18        static constraints = {
     19        }
    1920
    2021}
  • trunk/grails-app/domain/dbnp/studycapturing/SamplingEvent.groovy

    r190 r232  
    55 *
    66 * NOTE: according to documentation, super classes and subclasses share the same table.
    7  *       thus, there is actually no reason not to merge the sampling with the Event super class.
    8  *       this is especially true, since the subclass adds only one has-many relation ship.
     7 *       thus, we could merge the sampling with the Event super class and include a boolean
     8 *       However, using a separate class makes it more clear in the code that Event and SamplingEvent are treated differently
    99 */
    1010
    1111class SamplingEvent extends Event {
    1212
    13     static hasMany = [samples : Sample]
    14 
    1513    static constraints = {
    1614    }
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r229 r232  
    2828                events: Event,
    2929                samplingEvents: SamplingEvent,
     30                eventGroups: EventGroup,
    3031                samples: Sample,
    3132                assays: Assay,
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy

    r224 r232  
    1414        String unit
    1515
    16     static hasMany = [listEntries : String] // to store the entries to choose from when the type is 'item from predefined list'
    17         //TODO: make TemplateFieldListItem and make a convenience setter for a string array
     16    static hasMany = [listEntries : TemplateFieldListItem] // to store the entries to choose from when the type is 'item from predefined list'
    1817
    1918        static constraints = {
     
    2524                return name
    2625        }
     26
     27        //TODO: make a convenience setter for a string array
     28        /*def setListEntries(ArrayList entries) {
     29                list=[]
     30                entries.each {
     31                        list.add(new TemplateFieldListItem(name: it))
     32                }
     33                this
     34        }*/
     35
    2736}
Note: See TracChangeset for help on using the changeset viewer.