Changeset 289


Ignore:
Timestamp:
Jun 24, 2011, 7:00:50 PM (9 years ago)
Author:
business@…
Message:

correct catastrophic error where samples were located on the basis of their sample parent, now SAM actually works with sampleToken instead of sample name. Tagging 0.1.2 due to major change

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r286 r289  
    88app.name=sam
    99app.servlet.version=2.4
    10 app.version=0.1.1
     10app.version=0.1.2
    1111plugins.db-util=0.4
    1212plugins.grom=0.2.0
  • trunk/grails-app/controllers/importer/ImporterController.groovy

    r288 r289  
    302302                // return the list of subjects and assays
    303303                try{
    304                     addMeasurementsToFlow(flow, params)  // set up-to-date measurements in flow.measurements
     304                    addMeasurementsToFlow(flow, params) // set up-to-date measurements in flow.measurements
    305305                }
    306306                catch (Exception e) {
     
    798798        def time     = map['startTime']
    799799        def material = map[ 'material']
    800         def name     = map[    'event']
    801         def externalSampleId = map['name']
    802         def query  = "from SimpleAssaySample as s where s.assay= '${assay.id}' and s.subject = '${subject}' AND s.startTime = '${time}' "
     800        def name     = map[     'name']
     801            def event    = map[    'event']
     802        def externalSampleId = map['sampleToken']
     803        def query  = "from SimpleAssaySample as s where s.assay= '${assay.id}' and s.externalSampleId = '${externalSampleId}'"
    803804        def sample = SimpleAssaySample.find(query)
    804805        if(!sample)
    805806        {
    806             sample = new SimpleAssaySample( assay:assay, startTime:time, name:name, material:material,
     807            sample = new SimpleAssaySample( assay:assay, startTime:time, name:name, material:material, event:event,
    807808                subject:subject, externalSampleId:externalSampleId )
    808809            sample.save(flush:true)
     
    877878        samples.each{ row,sampleName ->
    878879            types.each{ col,typeName ->
    879                 if( !sampleName.equals('') && !typeName.equals('-') ) {
     880                    if( !sampleName.equals('') && !typeName.equals('-') ) {
    880881                    def ck = col+'.' + row
    881882                    def value = cells[ck]
    882883                    if(value!=null && value!=""){
    883884                        value = value.replace(",",".").toDouble()
    884                         try{
    885                             measurements.add setMeasurement(flow,sampleObjects,typeObjects,sampleName,typeName,value,assay)
    886                         } catch (Exception e) {
    887                             flash.errors = "Error addMeasurementsToFlow: "+e
    888                             error()
    889                         }
     885
     886                                        // first error will be catched in the calling function
     887                                        measurements.add setMeasurement(flow,sampleObjects,typeObjects,sampleName,typeName,value,assay)
     888
    890889                    }
    891890                }
     
    904903     */
    905904    private setMeasurement( flow,samples,types,sampleName,typeName,value,assay ) {
    906         def sample = samples.find{ it.externalSampleId==sampleName }
     905        def sample = samples.find{ it.name==sampleName && it.assay.id == assay.id }
    907906        def type   = types.find{ it.name==typeName}
    908907
  • trunk/grails-app/domain/data/SimpleAssaySample.groovy

    r223 r289  
    2727
    2828        def String toString() {
    29         return externalSampleId ?: "";
     29        return name ?: "";
    3030        }
    3131
  • trunk/grails-app/views/simpleAssay/list.gsp

    r276 r289  
    4444                                    </g:if>
    4545                                    <g:else>
    46                                         <td> None found at this moment. </td>
     46                                        <td> - </td>
    4747                                    </g:else>
    4848
     
    5454                                    </g:if>
    5555                                    <g:else>
    56                                         <td> None found at this moment. </td>
     56                                        <td> - </td>
    5757                                    </g:else>
    5858                            </tr>
Note: See TracChangeset for help on using the changeset viewer.