Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Add CSR test study #382

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class AggregateDataServicePgSpec extends Specification {
'TUMOR_NORMAL_SAMPLES',
'SURVEY1',
'SURVEY2',
'100_CATS',
'CSR'
] as Set

then: "the result should have the correct counts for study EHR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,11 @@ class QueryServicePgSpec extends Specification {
void "test values of date type"() {
def user = User.findByUsername('test-public-user-1')

Constraint constraint = new ValueConstraint(valueType: Type.DATE, operator: Operator.AFTER,
value: DATE_FORMAT.parse('1986-10-21 00:00:00'))
Constraint constraint = new AndConstraint([
new StudyNameConstraint(studyId: 'SURVEY1'),
new ValueConstraint(valueType: Type.DATE, operator: Operator.AFTER,
value: DATE_FORMAT.parse('1986-10-21 00:00:00'))
])

when:
def values = multiDimService.retrieveClinicalData(constraint, user).asList()*.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import grails.orm.HibernateCriteriaBuilder
import grails.test.mixin.integration.Integration
import grails.transaction.Rollback
import org.transmartproject.db.i2b2data.PatientDimension
import org.transmartproject.db.i2b2data.PatientMapping
import spock.lang.Specification
import spock.lang.Unroll

Expand All @@ -14,22 +15,32 @@ import java.util.function.Supplier
class InQuerySpec extends Specification {

@Unroll
void 'test postgres query splitting for list of #values.size() values'(Integer expectedCount, List<Long> values) {
when: 'Querying for patients'
void 'test listIn fetches requested entities'(Integer expectedCount, List<Long> values) {
when: 'Querying for patient mappings'
Supplier<HibernateCriteriaBuilder> criteriaBuilderProducer = { ->
PatientDimension.createCriteria() as HibernateCriteriaBuilder
PatientMapping.createCriteria() as HibernateCriteriaBuilder
}
List result = InQuery.listIn(criteriaBuilderProducer, 'id', values)
List result = InQuery.listIn(criteriaBuilderProducer, 'encryptedId', values)

then: 'The expected amount of objects is returned'
then: 'The expected amount of patient mappings is returned'
result.size() == expectedCount

where: 'sizes range from 0 to more than 30000'
where:
expectedCount | values
0 | []
1 | [-40L]
3 | [-41L, -42L, -43L]
1250 | (-20000L .. 20000L)
1 | ['CV:40']
3 | ['CT:41', 'EHR:42', 'TNS:43']
}

void 'test listIn gets actual patients by wide range of ids'() {
when: 'Querying for patients'
Supplier<HibernateCriteriaBuilder> criteriaBuilderProducer = { ->
PatientDimension.createCriteria() as HibernateCriteriaBuilder
}
List result = InQuery.listIn(criteriaBuilderProducer, 'id', (-20000L..20000L))

then: 'The actual amount of patient is returned'
result.size() == PatientDimension.count()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ class TreeServiceSpec extends Specification {
then: "the top level should contain one node with all public studies as children"
forest*.name == ['Public Studies']
forest[0].children*.name == [
'100 CATS',
'CATEGORICAL_VALUES',
'CLINICAL_TRIAL',
'CLINICAL_TRIAL_HIGHDIM',
'CSR',
'EHR',
'EHR_HIGHDIM',
'MIX_HD',
Expand All @@ -77,7 +79,6 @@ class TreeServiceSpec extends Specification {
'SHARED_HD_CONCEPTS_STUDY_A',
'SHARED_HD_CONCEPTS_STUDY_B',
'TUMOR_NORMAL_SAMPLES'

]
}

Expand Down
2 changes: 2 additions & 0 deletions transmart-data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ postgres_test:
$(MAKE) -C ddl/postgres load
$(MAKE) -C data/postgres load_schema_amapp
$(MAKE) -C test_data/ postgres_test_data
$(MAKE) -C test_studies/ load
$(MAKE) -C data/postgres refresh_mvs

oracle:
Expand All @@ -28,6 +29,7 @@ oracle_test:
$(MAKE) -C ddl/oracle load
$(MAKE) -C data/oracle load_schema_amapp
$(MAKE) -C test_data/ oracle_test_data
$(MAKE) -C test_studies/ load
$(MAKE) -C data/oracle refresh_mvs

oracle_drop:
Expand Down
4 changes: 3 additions & 1 deletion transmart-data/env/vars-ubuntu.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@

PATH=<?= realpath(__DIR__) ?>:$PATH

TM_CZ_PWD=tm_cz

export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD TABLESPACES PGSQL_BIN \
KETTLE_JOBS_PSQL KITCHEN PATH
KETTLE_JOBS_PSQL KITCHEN PATH TM_CZ_PWD
1 change: 1 addition & 0 deletions transmart-data/test_studies/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
transmart-copy-*.jar
8 changes: 8 additions & 0 deletions transmart-data/test_studies/CSR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Central Subject Registry

CSR study has been composed to test sample-based features.
Patient data has been made up.
Novelty of the study that it stores observations over multiple level of entities:
Patient > Diagnosis > Biosource > Biomateral

This realtion expressed by means of modifiers
34 changes: 34 additions & 0 deletions transmart-data/test_studies/CSR/i2b2demodata/concept_dimension.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
concept_blob concept_cd concept_path download_date import_date name_char sourcesystem_cd table_name update_date upload_id
82fe43990271eabe4266c0392e99327f7b68d9a8 \Public Studies\CSR\03. Biosource information\01. Biosource parent\ 01. Biosource parent
1d92eaf563dcb89a4beca0698e983acf9b7c37a6 \Public Studies\CSR\04. Biomaterial information\02. Date of biomaterial\ 02. Date of biomaterial
1ce3fc1098b2b8179e5b486b8349a5c08f807898 \Public Studies\CSR\03. Biosource information\02. Date of biosource\ 02. Date of biosource
309c81ae7e5f3fdcb3d32721460fb1796d4b24c3 \Public Studies\CSR\03. Biosource information\06. Biosource dedicated for specific study\ 06. Biosource dedicated for specific study
60da92e9c0229b8ce64785ce3060f2ac7a2ce8ac \Public Studies\CSR\01. Patient information\01. Date of birth\ 01. Date of birth
a7cfe8e9c9d0ee7d282ee4bc579d9ea2d2f5f167 \Public Studies\CSR\02. Diagnosis information\05. Center of treatment\ 05. Center of treatment
e27724a7b7c9e8ed0c653d9e27ee0b770563f98e \Public Studies\CSR\01. Patient information\05. Date of death\ 05. Date of death
9a35d3ffc12c75bbd93a8804e27d31ea1ee20c93 \Public Studies\CSR\02. Diagnosis information\01. Date of diagnosis\ 01. Date of diagnosis
584786ca0ff21ee8ceb22dc1e0d7d6ca7b2a90e3 \Public Studies\CSR\03. Biosource information\04. Disease status\ 04. Disease status
e24277e1af6ded3d1a0b231f32e7723c566d5e67 \Public Studies\CSR\01. Patient information\02. Gender\ 02. Gender
246e7915066ee4a150322518b213181a7f3903d9 \Public Studies\CSR\01. Patient information\Informed consent\05. Informed consent data\ 05. Informed consent data
7816a9fbf89154bdbfadda6daded4b6c58dd37b3 \Public Studies\CSR\01. Patient information\Informed consent\06. Informed concent linking external database\ 06. Informed concent linking external database
0e87b77f99a0e9d444cf4729e88301231334630d \Public Studies\CSR\01. Patient information\Informed consent\04. Informed consent material\ 04. Informed consent material
b64e4f7183e7b75a6faedb430285e326c5a30fde \Public Studies\CSR\01. Patient information\Informed consent\01. Informed consent type\ 01. Informed consent type
e1ee31813ba7572cfd8ac3a36ec5a22a3d22512e \Public Studies\CSR\01. Patient information\Informed consent\03. Date informed consent withdrawn\ 03. Date informed consent withdrawn
480736dfd7cc2d85ec65223382b7c480b32f455c \Public Studies\CSR\01. Patient information\Informed consent\07. Report heriditary susceptibility\ 07. Report heriditary susceptibility
08e58306d0b4cf7e9b10dfe47135ef607d2bae3a \Public Studies\CSR\04. Biomaterial information\01. Biomaterial parent\ 01. Biomaterial parent
debae43031f4a461b0e7a7fa0a0d89c793573df6 \Public Studies\CSR\01. Patient information\Taxonomy\ Taxonomy
640e439053c924ca78f5ec339e4f6fe26bd4073d \Public Studies\CSR\03. Biosource information\03. Tissue\ 03. Tissue
4f33eeb399622afda11f16c40a3e87dea82d6414 \Public Studies\CSR\02. Diagnosis information\03. Topography\ 03. Topography
c3bb4810113fc3daa877a2109c1a9c1358955021 \Public Studies\CSR\02. Diagnosis information\Treatment\ Treatment
83faa63b282f9ff2e97312309b3b18760a6db97b \Public Studies\CSR\03. Biosource information\05. Tumor percentage\ 05. Tumor percentage
7043ff91b2bd050feca89996be82eb1421a3372b \Public Studies\CSR\02. Diagnosis information\04. Tumor stage\ 04. Tumor stage
4fc4afd045e321c824da01fae5c679cb34d71cac \Public Studies\CSR\02. Diagnosis information\02. Tumor type\ 02. Tumor type
e0e1f2c1393ba80effa972e6f395566104fcce8e \Public Studies\CSR\04. Biomaterial information\03. Biomaterial type\ 03. Biomaterial type
6b74b1eda880cca4473e2793e13e88869c0a03a5 \Public Studies\CSR\05. Study information\STD1\01. Study ID\ 01. Study ID
c18ba4a966d996090e78993dc087b24dfaeea87a \Public Studies\CSR\05. Study information\STD1\04. Individual Study ID\ 04. Individual Study ID
1cbd83e436976dee45dd5c446290b2cb508b801e \Public Studies\CSR\05. Study information\STD1\02. Study acronym\ 02. Study acronym
f79e5c3b50c3c3f889281a8567ba2db15c657a18 \Public Studies\CSR\05. Study information\STD1\03. Study title\ 03. Study title
f997c8d7bffdc73544e76688094f42b347fc8dac \Public Studies\CSR\05. Study information\STD2\01. Study ID\ 01. Study ID
eecc1d9cbd2b8ac72e1fc9771e574b248931328c \Public Studies\CSR\05. Study information\STD2\04. Individual Study ID\ 04. Individual Study ID
bb02b2fe41e213d2f2511228236e63c8144c2bd9 \Public Studies\CSR\05. Study information\STD2\02. Study acronym\ 02. Study acronym
e2823a4ea40466a199a724b967a1cd8f9f28b533 \Public Studies\CSR\05. Study information\STD2\03. Study title\ 03. Study title
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modifier_path modifier_cd name_char modifier_blob update_date download_date import_date sourcesystem_cd upload_id modifier_level modifier_node_type
\biomaterial_mod CSR_BIOMATERIAL_MOD Biomaterial ID
\biosource_mod CSR_BIOSOURCE_MOD Biosource ID
\diagnose_mod CSR_DIAGNOSIS_MOD Diagnosis ID
Loading