Ignore:
Timestamp:
Jun 10, 2010, 11:43:50 AM (8 years ago)
Author:
jahn
Message:

Refactored member 'code' of Study. Changed it from being template to being a proper member. This allows using as external ID in module communication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/RestController.groovy

    r549 r554  
    11/**
    2  * ModuleCommunicationController Controler
     2 * RestControler
    33 *
    44 * This controler provides a REST service.
     
    4242                List studies = []
    4343                Study.list().each { study ->
    44                     studies.push( [ 'externalStudyID': study.externalStudyID, 'name':study.title ] )
     44                    studies.push( [ 'externalStudyID': study.code, 'name':study.title ] )
    4545                }
    4646                render studies as JSON
     
    6161                if( params.externalStudyID ) {
    6262                        def id = Long.parseLong(params.externalStudyID)
    63                         def study = Study.find( "from Study as s where s.externalStudyID=?", [id])
     63                        def study = Study.find( "from Study as s where s.code=?", [id])
    6464                        if(study) study.subjects.each { subjects.push it.name }
    6565                }
     
    8181                if( params.externalStudyID ) {
    8282                        def id = Long.parseLong(params.externalStudyID)
    83                         def study = Study.find( "from Study as s where s.externalStudyID=?", [id])
     83                        def study = Study.find( "from Study as s where s.code=?", [id])
    8484                        if(study) study.assays.each{ assay -> assays.push assay.externalAssayID }
    8585                }
Note: See TracChangeset for help on using the changeset viewer.