Ignore:
Timestamp:
Jan 27, 2010, 9:58:59 AM (9 years ago)
Author:
keesvb
Message:

changed domain model for events and protocol parameters, and for template field storage, added NuGO PPS3 events, added searchable plugin for full text queries, corrected a few HTML errors in create study

Location:
trunk/grails-app/domain/dbnp
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/data/Term.groovy

    r138 r139  
    77 * The Term object should point to an existing term in an online ontology, therefore instances of this class can also
    88 * be seen as a cache of elements of the external ontology.
    9  *
    10  * Revision information:
    11  * $Rev$
    12  * $Author$
    13  * $Date$
    149 */
    15 class Term implements Serializable {
    16         String name
    17         Ontology ontology
    18         String accession
     10class Term {
     11    static searchable = true
     12    String name
     13    Ontology ontology
     14    String accession
    1915
    20         static constraints = {
    21         }
     16    static constraints = {
     17    }
    2218
    23         def String toString() {
    24                 return name
    25         }
     19  def String toString() {
     20    return name
     21  }
     22
     23
    2624}
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r124 r139  
    22
    33import groovy.time.*
    4 
    54
    65/**
     
    1110class Event {
    1211
    13     Subject subject
    14     EventDescription eventDescription
    15     Date startTime
    16     Date endTime
     12        Subject subject
     13        EventDescription eventDescription
     14        Date startTime
     15        Date endTime
     16        Map parameterStringValues
     17        Map parameterIntegerValues
     18        Map parameterFloatValues
     19
     20        static hasMany = [
     21                parameterStringValues : String, // stores both STRING and STRINGLIST items (latter should be checked against the list)
     22                parameterIntegerValues : int,
     23                parameterFloatValues : float
     24        ]
     25
     26        // static constraints = { }
     27
     28        def getDuration() {
     29                //endTime - startTime  // this is not documented and does not work either
     30                // so, it's useless.
     31                // thus, do this manually as follows
     32
     33                def timeMillis = (endTime.getTime() - startTime.getTime()).abs()
     34                def days = (timeMillis / (1000 * 60 * 60 * 24)).toInteger()
     35                def hours = (timeMillis / (1000 * 60 * 60)).toInteger()
     36                def minutes = (timeMillis / (1000 * 60)).toInteger()
     37                def seconds = (timeMillis / 1000).toInteger()
     38                def millis = (timeMillis % 1000).toInteger()
     39
     40                return new Duration(days, hours, minutes, seconds, millis)
     41        }
    1742
    1843
    19     // static constraints = { }
    20     def getDuration() {
    21         //endTime - startTime  // this is not documented and does not work either
    22                                // so, it's useless.
    23                                // thus, do this manually as follows
    24 
    25         def timeMillis = (endTime.getTime() - startTime.getTime()).abs()
    26         def days    = (timeMillis/(1000*60*60*24)).toInteger()
    27         def hours   = (timeMillis/(1000*60*60)).toInteger()
    28         def minutes = (timeMillis/(1000*60)).toInteger()
    29         def seconds = (timeMillis/1000).toInteger()
    30         def millis  = (timeMillis%1000).toInteger()
    31 
    32         return new Duration(days,hours,minutes,seconds,millis)
    33     }
    34 
    35 
    36     def getDurationString()
    37     {
    38         def d = getDuration()
    39         return  "${d.days} days, ${d.hours} hrs, ${d.minutes} min, ${d.seconds} sec."
    40     }
     44        def getDurationString() {
     45                def d = getDuration()
     46                return "${d.days} days, ${d.hours} hrs, ${d.minutes} min, ${d.seconds} sec."
     47        }
    4148
    4249
  • trunk/grails-app/domain/dbnp/studycapturing/EventDescription.groovy

    r116 r139  
    1313    String description
    1414    Term classification
    15     ProtocolInstance protocol
     15    Protocol protocol
    1616
    1717    static constraints = {
  • trunk/grails-app/domain/dbnp/studycapturing/ProtocolInstance.groovy

    r112 r139  
    11package dbnp.studycapturing
     2
     3// this class is now obsolete, should be deleted by Jahn when he's done with Event controller/views
    24
    35/**
     
    911
    1012
    11     // TODO: check how the values can be indexed so that they can be mapped to their respective parameters (should we use maps here?)
    12     static hasMany = [values : ProtocolParameterInstance]
    1313    static constraints = {
    1414    }
  • trunk/grails-app/domain/dbnp/studycapturing/ProtocolParameter.groovy

    r114 r139  
    1010
    1111    String name
    12     String type       //  development. replace by: ProtocolParameterType type
     12    ProtocolParameterType type
    1313    String unit
    1414    String description
     
    1818
    1919    static constraints = {
     20            unit(nullable: true)
     21            reference(nullable: true)
     22            description(nullable: true)
    2023    }
    2124}
  • trunk/grails-app/domain/dbnp/studycapturing/ProtocolParameterInstance.groovy

    r115 r139  
    11package dbnp.studycapturing
    22
     3// this class is now obsolete, should be deleted by Jahn when he's done with Event controller/views
    34class ProtocolParameterInstance {
    45
  • trunk/grails-app/domain/dbnp/studycapturing/ProtocolParameterType.groovy

    r84 r139  
    66public enum ProtocolParameterType {
    77    STRING('String'),
    8     NUMBER('Number'),
     8    INTEGER('Integer number'),
     9    FLOAT('Decimal number'),
    910    STRINGLIST('List')
    1011
     
    1617
    1718    static list() {
    18      [STRING, NUMBER, STRINGLIST]
     19     [STRING, INTEGER, FLOAT, STRINGLIST]
    1920    }
    2021
  • trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy

    r106 r139  
    77 */
    88class Sample {
     9        static searchable = true
    910
    1011    // TODO: should Sample also carry a reference to its parent study,
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r138 r139  
    1010 */
    1111class Study implements Serializable {
     12        static searchable = true
    1213        nimble.User owner
    1314        String title
  • trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy

    r138 r139  
    11package dbnp.studycapturing
     2
    23import dbnp.data.Term
    34
    45/**
    56 * This domain class describes the subjects in a study.
    6  *
    7  * Revision information:
    8  * $Rev$
    9  * $Author$
    10  * $Date$
    117 */
    12 class Subject implements Serializable {
     8class Subject {
     9        static searchable = true
    1310        String name
    1411        Term species
    1512        Map templateStringFields
    16         Map templateNumberFields
    17         Map templateStringListFields
     13        Map templateIntegerFields
     14        Map templateFloatFields
    1815        Map templateTermFields
    1916
    2017        static hasMany = [
    21                 templateStringFields: String,
    22                 templateNumberFields: float,
    23                 templateStringListFields: String,
    24                 templateTermFields: Term
     18                templateStringFields : String, // stores both STRING and STRINGLIST items (latter should be checked against the list)
     19                templateIntegerFields : int,
     20                templateFloatFields : float,
     21                templateTermFields : Term
    2522        ]
    26 
     23       
    2724        static constraints = {
    2825        }
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldType.groovy

    r84 r139  
    66public enum TemplateFieldType {
    77    STRING('String'),
    8     NUMBER('Number'),
    9     STRINGLIST('List'),
     8    INTEGER('Integer number'),
     9    FLOAT('Decimal number'),
     10    STRINGLIST('List of items'),
    1011    ONTOLOGYTERM('Ontology Reference')
    1112
     
    1718
    1819    static list() {
    19      [STRING, NUMBER, STRINGLIST, ONTOLOGYTERM]
     20     [STRING, INTEGER, FLOAT, STRINGLIST, ONTOLOGYTERM]
    2021    }
    2122
Note: See TracChangeset for help on using the changeset viewer.