Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Change name of DataTypeRetrieved to Datatypes for frontend consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarvanerp committed Nov 11, 2016
1 parent fb81fbc commit 2da53ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.transmartproject.core.exceptions.InvalidArgumentsException
import org.transmartproject.core.exceptions.NoSuchResourceException
import org.transmartproject.core.ontology.ConceptsResource
import org.transmartproject.core.ontology.OntologyTerm
import org.transmartproject.export.DataTypeRetrieved
import org.transmartproject.export.Datatypes
import org.transmartproject.export.Tasks.DataExportFetchTask
import org.transmartproject.export.Tasks.DataExportFetchTaskFactory

Expand All @@ -32,7 +32,7 @@ class RestExportService {
task.getTsv()
}

public List<DataTypeRetrieved> retrieveDataTypes(params) {
public List<Datatypes> retrieveDataTypes(params) {
if (!(params.containsKey('concepts'))) {
throw new NoSuchResourceException("No parameter named concepts was given.")
}
Expand All @@ -43,7 +43,7 @@ class RestExportService {

def jsonSlurper = new JsonSlurper()
def conceptParameters = params.get('concepts').decodeURL()
List<DataTypeRetrieved> dataTypes = []
List<Datatypes> dataTypes = []
try {
def conceptArguments = jsonSlurper.parseText(conceptParameters)
int cohortNumber = 0
Expand All @@ -57,7 +57,7 @@ class RestExportService {
}
}

private List<DataTypeRetrieved> getDataTypes(Map conceptKeysList, List dataTypes, int cohortNumber) {
private List<Datatypes> getDataTypes(Map conceptKeysList, List dataTypes, int cohortNumber) {
conceptKeysList.conceptKeys.collect { conceptKey ->
getDataType(conceptKey, dataTypes, cohortNumber)
}
Expand Down Expand Up @@ -96,16 +96,16 @@ class RestExportService {
List tempDataTypes = dataTypes.collect { it.dataType }
if (dataTypeString in tempDataTypes) {
int index = tempDataTypes.indexOf(dataTypeString)
DataTypeRetrieved dataType = dataTypes[index]
Datatypes dataType = dataTypes[index]
addOntologyTerm(term, dataType, cohortNumber)
} else {
DataTypeRetrieved dataType = new DataTypeRetrieved(dataType: dataTypeString, dataTypeCode: dataTypeCode)
Datatypes dataType = new Datatypes(dataType: dataTypeString, dataTypeCode: dataTypeCode)
addOntologyTerm(term, dataType, cohortNumber)
dataTypes.add(dataType)
}
}

private void addOntologyTerm(OntologyTerm term, DataTypeRetrieved dataType, int cohortNumberID) {
private void addOntologyTerm(OntologyTerm term, Datatypes dataType, int cohortNumberID) {
if (cohortNumberID in dataType.OntologyTermsMap.keySet()) {
dataType.OntologyTermsMap[cohortNumberID].add(term)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.transmartproject.export

import org.transmartproject.core.ontology.OntologyTerm

class DataTypeRetrieved {
class Datatypes {

Map<Integer, List<OntologyTerm>> OntologyTermsMap = [:]

Expand Down

0 comments on commit 2da53ac

Please sign in to comment.