-
Notifications
You must be signed in to change notification settings - Fork 30
Add serializer for DataType retrieval #66
base: gb-dev
Are you sure you want to change the base?
Conversation
def getDataTypes(List conceptKeysList){ | ||
List cohortDataTypes = [] | ||
Map datatypesMap = [:] | ||
public def getDataTypes(List conceptKeysList, List dataTypes, Integer cohortNumber){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small remarks:
- use cmd+alt+L (in your IntelliJ on Mac at least) to format your code nicely. This way you will avoid style guide mistakes (we follow the google one for java - see the wiki) like lack of space between closing and opening brancets: ){
- cohortNumber can probably be just int
conceptKeysList.each { conceptKey -> | ||
OntologyTerm concept = conceptsResourceService.getByKey(conceptKey) | ||
datatypesMap = getHighDimDataType(concept, datatypesMap) | ||
dataTypes = getDataType(concept, dataTypes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was your intension here to create a collection of dataTypes and return this collection ?
If yes - then you could use .collect() {element-> getDatatype(...)}
this forEach loop looks as if it was overwriting dataTypes over and over.
throw new NoSuchResourceException("No parameter named concepts was given.") | ||
} | ||
|
||
if (params.get('concepts') == "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be replaced with
if (params.get('concepts'))
} | ||
|
||
def getHighDimDataType(OntologyTerm term, Map datatypesMap) { | ||
private void getDataType(String conceptKey, List dataTypes, int cohortNumber) { | ||
OntologyTerm term = conceptsResourceService.getByKey(conceptKey) | ||
// Retrieve all descendant terms that have the HIGH_DIMENSIONAL attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is intended as a description of this method right?
Then you should put it on top of the method declaration like this:
/**
* description of the functionality
*/
method() {}
5a52096
to
2da53ac
Compare
Along with:
thehyve/transmart-rest-api#36