Ignore:
Timestamp:
Feb 16, 2010, 3:13:09 PM (12 years ago)
Author:
jahn
Message:

Added some features: subgrouping by event groups and times, select all and select none, autmatic checking of all samples belonging to a subject and of all samples and subjects belonging to a study. Beatufied some outputs.

Ideally, there should be some extra functionality for automatically putting samples into the right subgroup and for selecting the correct subgroup upon checking its commading subject or study.

File:
1 edited

Legend:

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

    r198 r201  
    2727
    2828    def selectsample = {
     29
     30
     31            // produce error message here if studies don't contain samples!
     32            // redirect back or use error
     33
    2934
    3035            println "in selectsample: "
     
    8085
    8186                  // testing:
    82                   // there is a lack of data in the mockup
    83                   // as long as there are no groups in the bootstart,
     87                  // there is a lack of data in the mockup (subject groups are still missing)
     88                  // as long as there are no groups in the boot script,
    8489                  // we use this
    8590                  subgroups = studyGroups.size()<=0 ?
    86                       ["subject group 1","subject group 2"] : studyGroups
     91                       ["subject group 1","subject group 2"] : studyGroups
    8792
    8893                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
    8994                  break
     95
    9096             case "Event Groups":
    91                   render("Event Groups")
    92                   subgroups=["event group 1","event group 2"]
     97                  def eventGroups = []
     98                  if(selectedStudies!=null)
     99                  {
     100                    selectedStudies.each{ study ->
     101                         println study.id
     102                         println study.samplingEvents.each{ eventGroups.add(it) }
     103                    }
     104                  }
     105                  subgroups=eventGroups
    93106                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
    94107                  break
     108
    95109             case "Starting Time Groups":
     110
     111                  def timeGroups = []
     112                  if(selectedStudies!=null)
     113                  {
     114                    selectedStudies.each{ study ->
     115                         println study.samplingEvents.each{
     116                             def timeDiff = it.getPrettyDuration( study.startDate, it.startTime )
     117                             if( !timeGroups.contains(timeDiff) ) timeGroups.add(timeDiff)
     118                         }
     119                    }
     120                  }
     121                  subgroups=timeGroups
    96122                  render("Starting Time Groups")
    97                   subgroups=["time group 1","time group 2"]
    98123                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
    99124                  break
     125
    100126             case ">> Execute and continue with biomarker selection":
    101127                  render("Starting Time Groups")
Note: See TracChangeset for help on using the changeset viewer.