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

Add serializer for DataType retrieval #66

Open
wants to merge 5 commits into
base: gb-dev
Choose a base branch
from

Conversation

Jarvanerp
Copy link

def getDataTypes(List conceptKeysList){
List cohortDataTypes = []
Map datatypesMap = [:]
public def getDataTypes(List conceptKeysList, List dataTypes, Integer cohortNumber){

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)

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') == "") {

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

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() {}  

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants