Ignore:
Timestamp:
Jan 28, 2011, 12:30:39 PM (13 years ago)
Author:
robert@…
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/nl/tno/metagenomics/integration/SynchronizationService.groovy

    r7 r9  
    7979         */
    8080        public void fullSynchronization() {
    81                 if( !timeForFullSynchronization() )
    82                         return
    83 
    8481                def previousEager = this.eager
    8582                this.eager = true
     
    630627
    631628                                        // Update the sample object if necessary
    632                                         if( sampleFound.name != gscfSample.name ) {
    633                                                 sampleFound.name = gscfSample.name
    634                                                 sampleFound.save();
    635                                         }
     629                                        sampleFound.name = gscfSample.name
     630                                        sampleFound.subject = gscfSample.subject
     631                                        sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     632                                        sampleFound.save();
    636633                                } else {
    637634                                        log.trace( "AssaySample not found in assay" )
     
    644641
    645642                                                // Update the sample object if necessary
    646                                                 if( sampleFound.name != gscfSample.name ) {
    647                                                         sampleFound.name = gscfSample.name
    648                                                         sampleFound.save();
    649                                                 }
     643                                                sampleFound.name = gscfSample.name
     644                                                sampleFound.subject = gscfSample.subject
     645                                                sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     646                                                sampleFound.save();
    650647                                        } else {
    651648                                                log.trace( "Sample " + gscfSample.sampleToken + " not found in database. Creating a new object." )
     
    653650                                                // If it doesn't exist, create a new object
    654651                                                sampleFound = new Sample( sampleToken: gscfSample.sampleToken, name: gscfSample.name, study: assay.study );
     652                                                sampleFound.subject = gscfSample.subject
     653                                                sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
    655654                                                assay.study.addToSamples( sampleFound );
    656655                                                sampleFound.save();
Note: See TracChangeset for help on using the changeset viewer.