Permalink
Browse files

Improved getMeasurementDataForAssay API call output format

  • Loading branch information...
ferryjagers committed Nov 7, 2018
1 parent f8a7b0a commit 995b4154fefcb845dfcf7c50ac588c965bb2eac4
Showing with 6 additions and 1 deletion.
  1. +6 −1 grails-app/controllers/api/ApiController.groovy
@@ -483,6 +483,7 @@ class ApiController {
String subjectEventGroupStartTime = sample.getParentSubjectEventGroupStartTime().toString().intern()
String sampleRelativeStartTime = sample.getSampleRelativeStartTime().toString().intern()
String subjectGroupName = sample.getParentSubjectEventGroup().getSubjectGroup().getName().intern()
String sampleTypeName = sample.getParentEvent().getEvent().getName().intern()
String subjectName = sample.getParentSubjectName().intern()

if ( !measurements[featureName] ) {
@@ -505,7 +506,11 @@ class ApiController {
measurements[featureName][eventGroupName][subjectEventGroupStartTime][sampleRelativeStartTime][subjectGroupName] = [:]
}

measurements[featureName][eventGroupName][subjectEventGroupStartTime][sampleRelativeStartTime][subjectGroupName].put(subjectName, value)
if ( !measurements[featureName][eventGroupName][subjectEventGroupStartTime][sampleRelativeStartTime][subjectGroupName][sampleTypeName] ) {
measurements[featureName][eventGroupName][subjectEventGroupStartTime][sampleRelativeStartTime][subjectGroupName][sampleTypeName] = [:]
}

measurements[featureName][eventGroupName][subjectEventGroupStartTime][sampleRelativeStartTime][subjectGroupName][sampleTypeName].put(subjectName, value)
count += 1
}
}

0 comments on commit 995b415

Please sign in to comment.