Permalink
Browse files

Improvements to exportToOpal API call

  • Loading branch information...
ferryjagers committed Oct 11, 2018
1 parent 6e8139a commit 0bb54ed3e12cc88958813fe09441095120bea4c0
Showing with 18 additions and 7 deletions.
  1. +2 −2 grails-app/conf/BuildConfig.groovy
  2. +16 −5 grails-app/controllers/api/ApiController.groovy
@@ -14,8 +14,8 @@
grails.project.fork = [
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true], // configure settings for the test-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-app JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-war JVM
run: [maxMemory: 4560, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-app JVM
war: [maxMemory: 4560, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-war JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]// configure settings for the Console UI JVM
]
@@ -850,13 +850,23 @@ class ApiController {
def featureMap = [ "name": table, "entityType": "Participant", "variables": [ ] ]
featureMap['variables'] << ["name":"subjectName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Subject name","locale":"en"]]]
featureMap['variables'] << ["name":"eventGroupName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"EventGroup name","locale":"en"]]]
featureMap['variables'] << ["name":"subjectEventGroupStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup start time","locale":"en"]]]
featureMap['variables'] << ["name":"subjectEventGroupDuration","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup duration","locale":"en"]]]
featureMap['variables'] << ["name":"sampleRelativeStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Sample relative start time","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_eventGroupName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"EventGroup name","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_subjectEventGroupStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup start time","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_subjectEventGroupDuration","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup duration","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_sampleRelativeStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Sample relative start time","locale":"en"]]]
def header = "ID,subjectName,eventGroupName,subjectEventGroupStartTime,subjectEventGroupDuration,sampleRelativeStartTime"
(subjectTemplateFieldNameList+featureNameList).each() { name ->
subjectTemplateFieldNameList.each() { name ->
// Opal & Datashield have some requirements for variable names
def opalName = "subject_information_"+name.replace("(","_").replace(")","").replace(":","_").replace("/","_").replace(",","_")
header += ",${opalName}".toString()
featureMap['variables'] << [ "name": opalName, "entityType": "Participant", "valueType": variableTypeMap[name], "isRepeatable": false, "attributes": [ [ "name": "label", "value": name, "locale": "en" ] ] ]
}
featureNameList.each() { name ->
// Opal & Datashield have some requirements for variable names
def opalName = name.replace("(","_").replace(")","").replace(":","_").replace("/","_").replace(",","_")
@@ -865,6 +875,7 @@ class ApiController {
featureMap['variables'] << [ "name": opalName, "entityType": "Participant", "valueType": variableTypeMap[name], "isRepeatable": false, "attributes": [ [ "name": "label", "value": name, "locale": "en" ] ] ]
}
header += "\n"
opalDataImport << header

0 comments on commit 0bb54ed

Please sign in to comment.