- Timestamp:
- Feb 10, 2010, 4:09:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/clinicaldata/ClinicalMeasurement.groovy
r186 r187 1 1 package dbnp.clinicaldata 2 3 import dbnp.data.FeatureType 2 4 3 5 class ClinicalMeasurement 4 6 extends dbnp.data.FeatureBase { 5 7 6 ClinicalMeasurementType type 8 // For now, let's assume that quantitative values are stored as float, 9 // and qualitative values as string 10 // We can always add an additional ClinicalMeasurementType datatype (FLOAT, INTEGER etc.) later (as was here until rev 186) 11 7 12 String referenceValues 8 13 float detectableLimit … … 13 18 14 19 static constraints = { 20 name(unique:true) 15 21 referenceValues(nullable: true, blank: true) 16 22 detectableLimit(nullable: true) 17 23 correctionMethod(nullable: true, blank: true) 18 24 } 25 26 Map getValues(long assayID, String[] sampleIDs) { 27 FeatureType featureType = type 28 switch(featureType) { 29 case FeatureType.QUANTITATIVE: 30 def values = ClinicalFloatData.withCriteria { 31 assay { eq("id",assayID) } 32 eq("measurement",this) 33 'in'("sample",sampleIDs) 34 } 35 def result = new HashMap<String,Float>(); 36 values.each { 37 result.put(it.sample,it.value) 38 } 39 return result 40 default: 41 throw new NoSuchFieldException("Feature type ${featureType} not supported") 42 } 43 } 19 44 }
Note: See TracChangeset
for help on using the changeset viewer.