Changeset 703 for trunk/grails-app/conf


Ignore:
Timestamp:
Jul 23, 2010, 4:52:07 PM (13 years ago)
Author:
keesvb
Message:

added example assays to PPSH in BootStrap? in line with the example data in the SAM bootstrap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrapStudies.groovy

    r690 r703  
    340340                        else             { LFBV1.addToSubjects(currentSubject).save() }
    341341
     342                        // Create sample
     343                        def currentSample = new Sample(
     344                                name: currentSubject.name + '_B',
     345                                material: bloodTerm,
     346                                        template: humanBloodSampleTemplate,
     347                                parentSubject: currentSubject,
     348                                parentEvent: x > 40 ? evS4 : evS
     349                        );
     350                        currentSample.setFieldValue( "Text on vial", "T" + (Math.random() * 100L) )
     351
     352                        mouseStudy.addToSamples(currentSample).with { if (!validate()) { errors.each { println it} } else save()}
    342353                }
    343354
     
    501512                        name: 'Lipid profiling',
    502513                        module: clinicalModule,
    503                         externalAssayId: 0
    504                 )
    505 
    506                 humanStudy.samples*.each {
     514                        externalAssayID: 1
     515                )
     516
     517                mouseStudy.samples*.each {
    507518                        lipidAssayRef.addToSamples(it)
    508519                }
    509                 lipidAssayRef.save()
    510 
    511                 humanStudy.addToAssays(lipidAssayRef);
    512                 humanStudy.save()
    513520
    514521                mouseStudy.addToAssays(lipidAssayRef);
     
    517524                lipidAssayRef.with { if (!validate()) { errors.each { println it} } else save()}
    518525
     526                def  glucoseAssay2Ref = new Assay(
     527                        name: 'Glucose assay 2',
     528                        module: clinicalModule,
     529                        externalAssayID: 2
     530                )
     531
     532                def  glucoseAssay3Ref = new Assay(
     533                        name: 'Glucose assay 3',
     534                        module: clinicalModule,
     535                        externalAssayID: 3
     536                )
     537
     538                humanStudy.addToAssays(glucoseAssay2Ref)
     539                humanStudy.addToAssays(glucoseAssay3Ref)
     540                humanStudy.save()
     541
     542                humanStudy.samples*.each {
     543                        glucoseAssay2Ref.addToSamples(it)
     544                        glucoseAssay3Ref.addToSamples(it)
     545                }
     546
     547                glucoseAssay2Ref.with { if (!validate()) { errors.each { println it} } else save()}
     548                glucoseAssay3Ref.with { if (!validate()) { errors.each { println it} } else save()}
     549
    519550        }
    520551
Note: See TracChangeset for help on using the changeset viewer.