Ignore:
Timestamp:
Mar 21, 2010, 2:17:51 PM (13 years ago)
Author:
jahn
Message:

Event's create and edit action have been tested and are now working.

Also, the old problem of adding Samples has been addressed. When a new event is created as a SamplingEvent?, no new samples can be added directly. The reason for this is, that the event is not yet assigned to any Subject, and thus the non nullable subject field of a new sample (belonging to the new event) cannot be filled.
Similarly, when a SamplingEvent? event is edited, new samples can only be added, if the event already is assigned to belong to a subject. New samples are always added to the same subject as the first (random) sample belonging to the SamplingEvent?.

However, there are still open questions:

(1) Should the sample also be assigned to the samples of its subject's Study?

(2) Should a sample also be assigned, if there are no samples assigned yet, but there is a subject assigned to this event?

(3) Should the user be allowed to chose to assign a subject if the event is assigned to a Study that contains multiple subjects?

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

Legend:

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

    r247 r288  
    2020        Map parameterIntegerValues
    2121        Map parameterFloatValues
     22        Map parameterStringListValues
    2223
    2324        static hasMany = [
    24                 parameterStringValues: String, // stores both STRING and STRINGLIST items (latter should be checked against the list)
     25                parameterStringValues: String, // stores STRINGLIST items
     26                parameterStringListValues: ParameterStringListItem,
    2527                parameterIntegerValues: int,
    2628                parameterFloatValues: float,
     
    100102                return eventDescription ? eventDescription.name : ""
    101103        }
     104
    102105}
  • trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy

    r247 r288  
    1717
    1818        static constraints = {
     19                parentSubject(nullable:true)
     20        }
     21
     22        static getSamplesFor( event ) {
     23            return  Sample.findAll( 'from Sample s where s.parentEvent =:event', [event:event] )
    1924        }
    2025
Note: See TracChangeset for help on using the changeset viewer.