This repository has been archived by the owner on Jan 21, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge thehyve/cross_trial into thehyve/master
Conflicts: TransmartCoreGrailsPlugin.groovy grails-app/conf/BuildConfig.groovy transmart-core-db-tests/TransmartCoreDbTestsGrailsPlugin.groovy
- Loading branch information
Showing
47 changed files
with
2,471 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
grails-app/domain/org/transmartproject/db/ontology/ModifierDimensionCoreDb.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.transmartproject.db.ontology | ||
|
||
class ModifierDimensionCoreDb { | ||
|
||
String path | ||
String code | ||
String name | ||
Long level | ||
String studyId | ||
String nodeType | ||
|
||
// unused | ||
// String modifierBlob | ||
// Date updateDate | ||
// Date downloadDate | ||
// Date importDate | ||
// Long uploadId | ||
|
||
static mapping = { | ||
table schema: 'i2b2demodata', name: 'modifier_dimension' | ||
id name: 'path', generator: 'assigned' | ||
version false | ||
|
||
path column: 'modifier_path' | ||
code column: 'modifier_cd' | ||
name column: 'name_char' | ||
level column: 'modifier_level' | ||
studyId column: 'sourcesystem_cd' | ||
nodeType column: 'modifier_node_type' // known values: {L, F} | ||
} | ||
|
||
static constraints = { | ||
path maxSize: 700 | ||
code nullable: true, maxSize: 50 | ||
name nullable: true, maxSize: 2000 | ||
level nullable: true | ||
studyId nullable: true, maxSize: 50 | ||
nodeType nullable: true, maxSize: 10 | ||
|
||
// unused: | ||
// modifierBlob nullable: true | ||
// updateDate nullable: true | ||
// downloadDate nullable: true | ||
// importDate nullable: true | ||
// uploadId nullable: true | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
grails-app/domain/org/transmartproject/db/ontology/ModifierDimensionView.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright © 2013-2014 The Hyve B.V. | ||
* | ||
* This file is part of transmart-core-db. | ||
* | ||
* Transmart-core-db is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* transmart-core-db. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.transmartproject.db.ontology | ||
|
||
/** | ||
* View that joins {@link ModifierDimensionView} and | ||
* {@link ModifierMetadataCoreDb}. It has to be done on a view because | ||
* modifier_metadata inexplicably doesn't use modifier_dimension's primary key, | ||
* though modifier_cd functions as a de facto second primary key. | ||
*/ | ||
class ModifierDimensionView { | ||
|
||
// it's a view! | ||
|
||
String path | ||
String code | ||
String name | ||
Long level | ||
String studyId | ||
String nodeType | ||
String valueType | ||
String unit | ||
String visitInd = 'N' | ||
|
||
static transients = ['visit'] | ||
|
||
Boolean visit | ||
|
||
Boolean isVisit() { | ||
visitInd == 'Y' | ||
} | ||
|
||
void setVisit(Boolean visit) { | ||
visitInd == visit == null ? null : | ||
visit ? 'Y' : 'N' | ||
} | ||
|
||
static mapping = { | ||
table schema: 'i2b2demodata', name: 'modifier_dimension_view' | ||
id name: 'path', generator: 'assigned' | ||
version false | ||
|
||
path column: 'modifier_path' | ||
code column: 'modifier_cd' | ||
name column: 'name_char' | ||
level column: 'modifier_level' | ||
studyId column: 'sourcesystem_cd' | ||
nodeType column: 'modifier_node_type' // known values: {L, F} | ||
valueType column: 'valtype_cd' | ||
unit column: 'std_units' | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
grails-app/domain/org/transmartproject/db/ontology/ModifierMetadataCoreDb.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.transmartproject.db.ontology | ||
|
||
class ModifierMetadataCoreDb implements Serializable { | ||
|
||
/* why the tables were designed in a way that this one has no reference | ||
* modifier_dimension's primary key is beyond me. | ||
* Add to that oddity that this table that it stores a boolean as a string | ||
* and doesn't even have a primary key (though in this mapping I chose | ||
* modifierCode as the primary key (the queries make it clear modifierCode | ||
* must be unique) */ | ||
String code //id | ||
|
||
String valueType | ||
String unit | ||
Character visitInd = 'N' as Character | ||
|
||
static transients = ['visit'] | ||
|
||
Boolean visit | ||
|
||
Boolean isVisit() { | ||
visitInd == 'Y' | ||
} | ||
|
||
void setVisit(Boolean visit) { | ||
visitInd == visit == null ? null : | ||
visit ? 'Y' : 'N' | ||
} | ||
|
||
static mapping = { | ||
table schema: 'i2b2demodata', name: 'modifier_metadata' | ||
id generator: 'assigned', name: 'code' | ||
version false | ||
|
||
code column: 'modifier_cd' | ||
valueType column: 'valtype_cd' | ||
unit column: 'std_units' | ||
} | ||
|
||
static constraints = { | ||
code maxSize: 50 | ||
valueType nullable: true, maxSize: 10 | ||
unit nullable: true, maxSize: 50 | ||
visitInd nullable: false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.