caruby-tissue 1.3.6 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +20 -7
- data/README.md +28 -81
- data/conf/wustl/log4j.properties +40 -0
- data/examples/galena/README.md +34 -23
- data/examples/galena/conf/migration/annotation_defaults.yaml +2 -0
- data/examples/galena/conf/migration/annotation_fields.yaml +8 -0
- data/examples/galena/conf/migration/frozen_defaults.yaml +1 -0
- data/examples/galena/conf/migration/participant_fields.yaml +4 -0
- data/examples/galena/conf/migration/registration_fields.yaml +4 -0
- data/examples/galena/data/annotation.csv +1 -0
- data/examples/galena/data/participant.csv +1 -0
- data/examples/galena/data/registration.csv +1 -0
- data/examples/galena/lib/galena/{migration → tissue/migration}/filter_shims.rb +2 -3
- data/examples/galena/lib/galena/{migration → tissue/migration}/frozen_shims.rb +0 -10
- data/examples/galena/lib/galena/{seed → tissue/seed}/defaults.rb +24 -8
- data/examples/pcbin/README.md +44 -0
- data/examples/pcbin/conf/adjuvant_hormone_defaults.yaml +1 -0
- data/examples/pcbin/conf/adjuvant_radiation_defaults.yaml +2 -0
- data/examples/pcbin/conf/biopsy_defaults.yaml +3 -0
- data/examples/pcbin/conf/biopsy_fields.yaml +9 -0
- data/examples/pcbin/conf/neoadjuvant_hormone_defaults.yaml +1 -0
- data/examples/pcbin/conf/neoadjuvant_radiation_defaults.yaml +2 -0
- data/examples/pcbin/conf/patient_defaults.yaml +2 -0
- data/examples/pcbin/conf/patient_fields.yaml +5 -0
- data/examples/pcbin/conf/surgery_defaults.yaml +3 -0
- data/examples/pcbin/conf/surgery_fields.yaml +15 -0
- data/examples/pcbin/conf/t_stage_defaults.yaml +1 -0
- data/examples/pcbin/conf/t_stage_fields.yaml +4 -0
- data/examples/pcbin/conf/therapy_fields.yaml +5 -0
- data/examples/pcbin/data/adjuvant_hormone.csv +1 -0
- data/examples/pcbin/data/adjuvant_radiation.csv +1 -0
- data/examples/pcbin/data/biopsy.csv +1 -0
- data/examples/pcbin/data/neoadjuvant_hormone.csv +1 -0
- data/examples/pcbin/data/neoadjuvant_radiation.csv +1 -0
- data/examples/pcbin/data/patient.csv +1 -0
- data/examples/pcbin/data/surgery.csv +1 -0
- data/examples/pcbin/data/t_stage.csv +1 -0
- data/examples/pcbin/lib/pcbin/biopsy_shims.rb +15 -0
- data/examples/pcbin/lib/pcbin/surgery_shims.rb +15 -0
- data/lib/catissue.rb +0 -1
- data/lib/catissue/annotation/annotatable.rb +8 -1
- data/lib/catissue/annotation/annotatable_class.rb +40 -25
- data/lib/catissue/annotation/annotation.rb +8 -4
- data/lib/catissue/annotation/annotation_class.rb +83 -61
- data/lib/catissue/annotation/annotation_module.rb +56 -20
- data/lib/catissue/annotation/de_integration.rb +22 -0
- data/lib/catissue/annotation/proxy_class.rb +12 -2
- data/lib/catissue/cli/migrate.rb +1 -1
- data/lib/catissue/database.rb +198 -55
- data/lib/catissue/database/annotation/annotation_service.rb +17 -13
- data/lib/catissue/database/annotation/annotator.rb +6 -8
- data/lib/catissue/database/annotation/entity_facade.rb +65 -35
- data/lib/catissue/database/annotation/id_generator.rb +2 -2
- data/lib/catissue/database/annotation/integration_service.rb +12 -33
- data/lib/catissue/database/annotation/integrator.rb +38 -0
- data/lib/catissue/database/annotation/record_entry_integrator.rb +62 -0
- data/lib/catissue/database/controlled_values.rb +4 -18
- data/lib/catissue/domain/abstract_position.rb +2 -2
- data/lib/catissue/domain/abstract_specimen.rb +31 -23
- data/lib/catissue/domain/abstract_specimen_collection_group.rb +2 -4
- data/lib/catissue/domain/address.rb +1 -3
- data/lib/catissue/domain/cancer_research_group.rb +1 -3
- data/lib/catissue/domain/capacity.rb +1 -3
- data/lib/catissue/domain/check_in_check_out_event_parameter.rb +2 -5
- data/lib/catissue/domain/collection_event_parameters.rb +9 -5
- data/lib/catissue/domain/collection_protocol.rb +12 -11
- data/lib/catissue/domain/collection_protocol_event.rb +3 -3
- data/lib/catissue/domain/collection_protocol_registration.rb +23 -19
- data/lib/catissue/domain/consent_tier_response.rb +1 -3
- data/lib/catissue/domain/consent_tier_status.rb +1 -3
- data/lib/catissue/domain/container.rb +33 -33
- data/lib/catissue/domain/container_position.rb +4 -4
- data/lib/catissue/domain/container_type.rb +20 -9
- data/lib/catissue/domain/department.rb +1 -3
- data/lib/catissue/domain/disposal_event_parameters.rb +2 -4
- data/lib/catissue/domain/embedded_event_parameters.rb +2 -4
- data/lib/catissue/domain/external_identifier.rb +1 -3
- data/lib/catissue/domain/frozen_event_parameters.rb +2 -4
- data/lib/catissue/domain/institution.rb +1 -3
- data/lib/catissue/domain/new_specimen_array_order_item.rb +2 -4
- data/lib/catissue/domain/order_details.rb +2 -4
- data/lib/catissue/domain/participant.rb +5 -5
- data/lib/catissue/domain/participant_medical_identifier.rb +5 -3
- data/lib/catissue/domain/password.rb +1 -3
- data/lib/catissue/domain/race.rb +3 -4
- data/lib/catissue/domain/received_event_parameters.rb +7 -4
- data/lib/catissue/domain/site.rb +5 -3
- data/lib/catissue/domain/specimen.rb +68 -29
- data/lib/catissue/domain/specimen/pathology/prostate_specimen_pathology_annotation.rb +15 -0
- data/lib/catissue/domain/specimen/pathology/specimen_base_solid_tissue_pathology_annotation.rb +15 -0
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_type.rb +13 -0
- data/lib/catissue/domain/specimen_array.rb +1 -3
- data/lib/catissue/domain/specimen_array_content.rb +2 -2
- data/lib/catissue/domain/specimen_array_type.rb +7 -4
- data/lib/catissue/domain/specimen_characteristics.rb +1 -3
- data/lib/catissue/domain/specimen_collection_group.rb +29 -108
- data/lib/catissue/domain/specimen_event_parameters.rb +16 -6
- data/lib/catissue/domain/specimen_position.rb +2 -4
- data/lib/catissue/domain/specimen_protocol.rb +1 -3
- data/lib/catissue/domain/specimen_requirement.rb +5 -5
- data/lib/catissue/domain/storage_container.rb +22 -9
- data/lib/catissue/domain/storage_type.rb +8 -3
- data/lib/catissue/domain/transfer_event_parameters.rb +2 -4
- data/lib/catissue/domain/user.rb +18 -8
- data/lib/catissue/extract/delta.rb +2 -2
- data/lib/catissue/migration/migratable.rb +20 -0
- data/lib/catissue/migration/migrator.rb +17 -9
- data/lib/catissue/migration/shims.rb +9 -6
- data/lib/catissue/migration/uniquify.rb +2 -2
- data/lib/catissue/resource.rb +22 -22
- data/lib/catissue/util/collectible.rb +114 -0
- data/lib/catissue/util/collectible_event_parameters.rb +71 -0
- data/lib/catissue/util/location.rb +1 -1
- data/lib/catissue/util/storable.rb +6 -5
- data/lib/catissue/{domain → util}/uniquify.rb +4 -0
- data/lib/catissue/version.rb +2 -2
- data/lib/catissue/wustl/logger.rb +60 -0
- data/test/fixtures/lib/catissue/defaults_test_fixture.rb +6 -4
- data/test/fixtures/lib/examples/galena/migration/alt_key_shims.rb +7 -0
- data/test/lib/catissue/domain/address_test.rb +14 -35
- data/test/lib/catissue/domain/base_haemotology_pathology_test.rb +8 -9
- data/test/lib/catissue/domain/ca_tissue_test_defaults_test.rb +0 -1
- data/test/lib/catissue/domain/collection_event_parameters_test.rb +29 -12
- data/test/lib/catissue/domain/collection_protocol_event_test.rb +0 -1
- data/test/lib/catissue/domain/collection_protocol_registration_test.rb +0 -1
- data/test/lib/catissue/domain/collection_protocol_test.rb +0 -1
- data/test/lib/catissue/domain/container_position_test.rb +0 -1
- data/test/lib/catissue/domain/disposal_event_parameters_test.rb +0 -1
- data/test/lib/catissue/domain/external_identifier_test.rb +23 -0
- data/test/lib/catissue/domain/location_test.rb +0 -1
- data/test/lib/catissue/domain/participant_test.rb +41 -18
- data/test/lib/catissue/domain/site_test.rb +0 -1
- data/test/lib/catissue/domain/specimen_array_test.rb +0 -1
- data/test/lib/catissue/domain/specimen_characteristics_test.rb +0 -1
- data/test/lib/catissue/domain/specimen_collection_group_test.rb +83 -24
- data/test/lib/catissue/domain/specimen_event_parameters_test.rb +3 -18
- data/test/lib/catissue/domain/specimen_position_test.rb +0 -1
- data/test/lib/catissue/domain/specimen_requirement_test.rb +0 -1
- data/test/lib/catissue/domain/specimen_test.rb +122 -32
- data/test/lib/catissue/domain/storage_container_test.rb +35 -34
- data/test/lib/catissue/domain/storage_type_test.rb +0 -1
- data/test/lib/catissue/domain/transfer_event_parameters_test.rb +0 -1
- data/test/lib/catissue/domain/user_test.rb +0 -1
- data/test/lib/catissue/test_case.rb +24 -6
- data/test/lib/examples/galena/{domain → tissue/domain}/examples_test.rb +1 -1
- data/test/lib/examples/galena/tissue/migration/annotation_test.rb +27 -0
- data/test/lib/examples/galena/tissue/migration/filter_test.rb +29 -0
- data/test/lib/examples/galena/tissue/migration/frozen_test.rb +36 -0
- data/test/lib/examples/galena/tissue/migration/general_test.rb +56 -0
- data/test/lib/examples/galena/tissue/migration/participant_test.rb +61 -0
- data/test/lib/examples/galena/tissue/migration/registration_test.rb +23 -0
- data/test/lib/examples/galena/{migration/uniquify.rb → tissue/migration/seedify.rb} +30 -4
- data/test/lib/examples/galena/tissue/migration/simple_test.rb +30 -0
- data/test/lib/examples/galena/tissue/migration/test_case.rb +68 -0
- data/test/lib/examples/pcbin/migration_test.rb +132 -0
- metadata +259 -201
- data/examples/galena/data/minimal.csv +0 -1
- data/lib/catissue/domain/abstract_domain_object.rb +0 -8
- data/lib/catissue/domain/scg_event_parameters.rb +0 -11
- data/lib/catissue/util/log.rb +0 -30
- data/test/lib/catissue/database/database_test.rb +0 -28
- data/test/lib/catissue/domain/metadata_test.rb +0 -62
- data/test/lib/examples/galena/migration/catissue.log +0 -0
- data/test/lib/examples/galena/migration/filter_test.rb +0 -26
- data/test/lib/examples/galena/migration/frozen_test.rb +0 -28
- data/test/lib/examples/galena/migration/general_test.rb +0 -44
- data/test/lib/examples/galena/migration/simple_test.rb +0 -29
- data/test/lib/examples/galena/migration/test_case.rb +0 -52
data/History.txt
CHANGED
@@ -1,22 +1,25 @@
|
|
1
|
+
This history lists major release themes. See the GitHub source (https://github.com/caruby/tissue)
|
2
|
+
for change details.
|
3
|
+
|
1
4
|
=== 1.2.1 / 2010-11-23
|
2
5
|
|
3
6
|
* Initial public release.
|
4
7
|
|
5
8
|
=== 1.2.2 / 2010-11-30
|
6
9
|
|
7
|
-
*
|
10
|
+
* Galena example.
|
8
11
|
|
9
12
|
=== 1.2.3 / 2011-02-18
|
10
13
|
|
11
|
-
*
|
14
|
+
* Dynamic Extensions Support.
|
12
15
|
|
13
16
|
=== 1.3.1 / 2011-02-18
|
14
17
|
|
15
|
-
*
|
18
|
+
* Prostate Spore PCBIN DE support.
|
16
19
|
|
17
20
|
=== 1.3.2 / 2011-02-25
|
18
21
|
|
19
|
-
*
|
22
|
+
* Migration bug fixes.
|
20
23
|
|
21
24
|
=== 1.3.3 / 2011-02-26
|
22
25
|
|
@@ -28,10 +31,20 @@
|
|
28
31
|
|
29
32
|
=== 1.3.5 / 2011-03-04
|
30
33
|
|
31
|
-
*
|
32
|
-
|
34
|
+
* Annotation migration.
|
33
35
|
|
34
36
|
=== 1.3.6 / 2011-03-04
|
35
37
|
|
36
|
-
* Specify caruby-core version dependency.
|
38
|
+
* Specify caruby-core gem version dependency.
|
39
|
+
|
40
|
+
=== 1.4.1 / 2011-05-03
|
41
|
+
|
42
|
+
* caTissue 1.2 support.
|
43
|
+
|
44
|
+
* embed Java-caRuby bridge subproject.
|
45
|
+
|
46
|
+
=== 1.4.2 / 2011-05-04
|
47
|
+
|
48
|
+
* Add registration and PCBIN examples.
|
49
|
+
|
37
50
|
|
data/README.md
CHANGED
@@ -1,99 +1,46 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
caRuby Tissue: Simplifying caTissue
|
2
|
+
===================================
|
3
|
+
|
4
|
+
**Home**: [http://caruby.rubyforge.org/catissue.html](http://caruby.rubyforge.org/catissue.html)
|
5
|
+
**Git**: [http://github.com/caruby/tissue](http://github.com/caruby/tissue)
|
6
|
+
**Author**: OHSU Knight Cancer Institute
|
7
|
+
**Copyright**: 2010, 2011
|
8
|
+
**License**: MIT License
|
3
9
|
|
4
10
|
Synopsis
|
5
11
|
--------
|
6
|
-
This directory contains the caRuby Tissue example for the hypothetical Galena Cancer Center.
|
7
|
-
The example files are a useful template for building your own migrator.
|
8
|
-
|
9
|
-
The Galena example demonstrates how to load the content of a custom tissue bank into caTissue.
|
10
|
-
The use cases illustrate several common migration impediments:
|
11
|
-
|
12
|
-
* Different terminology than caTissue
|
13
|
-
* Different associations than caTissue
|
14
|
-
* Incomplete input for caTissue
|
15
|
-
* Denormalized input
|
16
|
-
* Inconsistent input
|
17
|
-
* Input data scrubbing
|
18
|
-
* Aliquot inference
|
19
|
-
* Pre-defined caTissue protocol
|
20
|
-
|
21
|
-
Setup
|
22
|
-
-----
|
23
|
-
1. Run the `crtexample --list` command to display the Galena example location.
|
24
|
-
|
25
|
-
2. Copy the example into a location of your choosing.
|
26
12
|
|
27
|
-
|
28
|
-
|
13
|
+
caRuby Tissue presents a JRuby facade that simplifies interaction with the
|
14
|
+
[caTissue](https://cabig-kc.nci.nih.gov/Biospecimen/KC/index.php/CaTissue_Suite) application.
|
29
15
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Migration
|
34
|
-
---------
|
35
|
-
The example migration input data resides in the `data` directory.
|
36
|
-
Each CSV input file holds one row for each specimen.
|
16
|
+
Feature List
|
17
|
+
------------
|
37
18
|
|
38
|
-
|
39
|
-
For example, the `simple.csv` input file is migrated into caTissue using the
|
40
|
-
`simple_migration.yaml` configuration file.
|
19
|
+
1. Declarative JRuby API that reduces caTissue API complexity.
|
41
20
|
|
42
|
-
|
21
|
+
2. Data migration and extraction.
|
43
22
|
|
44
|
-
|
23
|
+
See the project [Home](http://caruby.rubyforge.org/catissue.html) Page for a more complete feature list.
|
45
24
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
This command initializes the administrative objects in the Galena test database,
|
51
|
-
including the Galena collection protocol, site, cancer center, tissue bank and coordinator.
|
52
|
-
|
53
|
-
3. Run the following:
|
54
|
-
|
55
|
-
crtmigrate --target TissueSpecimen --mapping conf/migration/simple_fields.yaml data/simple.csv
|
56
|
-
|
57
|
-
This command migrates the CSV record in the `simple.csv` input file into a caTissue
|
58
|
-
`TissueSpecimen` based on the `simple_fields.yaml` mapping file.
|
59
|
-
The command will take a couple of minutes to finish, since the less information
|
60
|
-
you provide caRuby the more it works to fill in the missing bits. In the meantime,
|
61
|
-
peruse the configuration and data files to see which data are migrated and
|
62
|
-
where this data ends up in caTissue.
|
63
|
-
|
64
|
-
4. Open the caTissue application on the test server and verify the content of the
|
65
|
-
Galena CP collection protocol.
|
66
|
-
|
67
|
-
The other examples are run in a similar manner. Each example demonstrates different
|
68
|
-
features of the caRuby Migration utility as follows:
|
25
|
+
Installing
|
26
|
+
----------
|
27
|
+
caRuby Tissue is installed as a JRuby gem:
|
28
|
+
sudo jgem install caruby-tissue
|
69
29
|
|
70
|
-
|
71
|
-
|
72
|
-
* general - lots of input fields, no custom Ruby code
|
73
|
-
* filter - a smattering of custom Ruby shim code to convert input values to caTissue values
|
74
|
-
* frozen - an example demonstrating how to import storage locations
|
30
|
+
The caRuby Tissue [FAQ](https://caruby.tenderapp.com/dashboard/sections/tissue) describes how to
|
31
|
+
configure caRuby to access your caTissue instance.
|
75
32
|
|
76
|
-
|
77
|
-
|
33
|
+
Usage
|
34
|
+
-----
|
78
35
|
|
79
|
-
|
80
|
-
|
81
|
-
The sample Galena Tissue Bank CSV input files hold one row for each specimen.
|
82
|
-
Common fields are as follows:
|
36
|
+
The [Galena Example](https://github.com/caruby/tissue/blob/master/examples/galena/README.md) presents
|
37
|
+
a migration use case.
|
83
38
|
|
84
|
-
|
85
|
-
* Initials - Patient name initials
|
86
|
-
* Frozen? - Flag indicating whether the specimen is frozen
|
87
|
-
* SPN - Surgical Pathology Number
|
88
|
-
* Collection Date - Date the specimen was acquired by the tissue bank
|
89
|
-
* Received Date - Date the specimen was donated by the participant
|
90
|
-
* Quantity - Amount collected
|
91
|
-
* Box - Tissue storage container
|
92
|
-
* X - the tissue box column
|
93
|
-
* Y - the tissue box row
|
39
|
+
The caRuby Tissue [FAQ](https://caruby.tenderapp.com/dashboard/sections/tissue) contains caRuby Tissue API examples.
|
94
40
|
|
95
41
|
Copyright
|
96
42
|
---------
|
97
43
|
|
98
44
|
caRuby © 2010, 2011 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer/index.cfm).
|
99
|
-
caRuby is licensed under the MIT license. Please see the LICENSE and LEGAL
|
45
|
+
caRuby is licensed under the MIT license. Please see the LICENSE and LEGAL
|
46
|
+
files for more information.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
log4j.rootLogger==ERROR, clientLog, catissuecoreclientLog
|
2
|
+
|
3
|
+
log4j.appender.clientLog=org.apache.log4j.FileAppender
|
4
|
+
log4j.appender.clientLog.File=./log/client.log
|
5
|
+
log4j.appender.clientLog.layout=org.apache.log4j.PatternLayout
|
6
|
+
log4j.appender.clientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
7
|
+
|
8
|
+
log4j.appender.catissuecoreclientLog=org.apache.log4j.FileAppender
|
9
|
+
log4j.appender.catissuecoreclientLog.File=./log/catissuecoreclient.log
|
10
|
+
log4j.appender.catissuecoreclientLog.layout=org.apache.log4j.PatternLayout
|
11
|
+
log4j.appender.catissuecoreclientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} - %m%n
|
12
|
+
|
13
|
+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
14
|
+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
15
|
+
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
16
|
+
|
17
|
+
### set log levels - for more verbose logging change 'info' to 'debug' ###
|
18
|
+
|
19
|
+
log4j.rootLogger=warn, clientLog
|
20
|
+
|
21
|
+
log4j.logger.org.hibernate=info
|
22
|
+
|
23
|
+
## log the SQL
|
24
|
+
log4j.logger.org.hibernate.SQL=debug
|
25
|
+
|
26
|
+
### log JDBC bind parameters ###
|
27
|
+
log4j.logger.org.hibernate.type=info
|
28
|
+
|
29
|
+
### log schema export/update ###
|
30
|
+
log4j.logger.org.hibernate.tool.hbm2ddl=debug
|
31
|
+
|
32
|
+
### log cache activity ###
|
33
|
+
#log4j.logger.org.hibernate.cache=debug
|
34
|
+
|
35
|
+
### log JDBC resource acquisition
|
36
|
+
#log4j.logger.org.hibernate.jdbc=debug
|
37
|
+
|
38
|
+
### enable the following line if you want to track down connection ###
|
39
|
+
### leakages when using DriverManagerConnectionProvider ###
|
40
|
+
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
|
data/examples/galena/README.md
CHANGED
@@ -4,9 +4,9 @@ Galena caRuby Tissue example
|
|
4
4
|
Synopsis
|
5
5
|
--------
|
6
6
|
This directory contains the caRuby Tissue example for the hypothetical Galena Cancer Center.
|
7
|
-
The example files are a useful
|
7
|
+
The example files are a useful starting point for configuring your own migration.
|
8
8
|
|
9
|
-
The Galena example demonstrates how to load the content of a
|
9
|
+
The Galena example demonstrates how to load the content of a source tissue bank into caTissue.
|
10
10
|
The use cases illustrate several common migration impediments:
|
11
11
|
|
12
12
|
* Different terminology than caTissue
|
@@ -15,8 +15,8 @@ The use cases illustrate several common migration impediments:
|
|
15
15
|
* Denormalized input
|
16
16
|
* Inconsistent input
|
17
17
|
* Input data scrubbing
|
18
|
+
* Specimen annotations
|
18
19
|
* Aliquot inference
|
19
|
-
* Pre-defined caTissue protocol
|
20
20
|
|
21
21
|
Setup
|
22
22
|
-----
|
@@ -56,9 +56,7 @@ Migrate the Galena `simple` example as follows:
|
|
56
56
|
|
57
57
|
This command migrates the CSV record in the `simple.csv` input file into a caTissue
|
58
58
|
`TissueSpecimen` based on the `simple_fields.yaml` mapping file.
|
59
|
-
|
60
|
-
you provide caRuby the more it works to fill in the missing bits. In the meantime,
|
61
|
-
peruse the configuration and data files to see which data are migrated and
|
59
|
+
Peruse the configuration and data files to see which data are migrated and
|
62
60
|
where this data ends up in caTissue.
|
63
61
|
|
64
62
|
4. Open the caTissue application on the test server and verify the content of the
|
@@ -67,11 +65,20 @@ Migrate the Galena `simple` example as follows:
|
|
67
65
|
The other examples are run in a similar manner. Each example demonstrates different
|
68
66
|
features of the caRuby Migration utility as follows:
|
69
67
|
|
70
|
-
* simple - a good starting point with limited input fields
|
71
|
-
|
72
|
-
|
73
|
-
*
|
74
|
-
|
68
|
+
* `simple` - a good starting point with limited input fields
|
69
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/simple_fields.yaml data/simple.csv`
|
70
|
+
|
71
|
+
* `general` - lots of input fields, no custom Ruby code
|
72
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/general_fields.yaml data/general.csv`
|
73
|
+
|
74
|
+
* `filter` - a smattering of custom Ruby shim code to convert input values to caTissue values
|
75
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/filter_fields.yaml data/filter.csv`
|
76
|
+
|
77
|
+
* `frozen` - an example demonstrating how to import storage locations
|
78
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/frozen_fields.yaml --defaults conf/migration/frozen_defaults.yaml data/frozen.csv`
|
79
|
+
|
80
|
+
* `annotation` - an example demonstrating how to import annotations
|
81
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/annotation_fields.yaml --defaults conf/migration/annotation_defaults.yaml data/annotation.csv `
|
75
82
|
|
76
83
|
Try running an example with the `--debug` flag and look at the `log/migration.log` file to see
|
77
84
|
what caRuby is up to behind the scenes (hint: a lot!).
|
@@ -79,15 +86,19 @@ what caRuby is up to behind the scenes (hint: a lot!).
|
|
79
86
|
Input data
|
80
87
|
----------
|
81
88
|
The sample Galena Tissue Bank CSV input files hold one row for each specimen.
|
82
|
-
|
83
|
-
|
84
|
-
*
|
85
|
-
*
|
86
|
-
*
|
87
|
-
*
|
88
|
-
*
|
89
|
-
*
|
90
|
-
*
|
91
|
-
*
|
92
|
-
*
|
93
|
-
*
|
89
|
+
The following input fields are included in the examples:
|
90
|
+
|
91
|
+
* `Protocol` - Collection Protocol title
|
92
|
+
* `MRN` - Patient Medical Record Number
|
93
|
+
* `Initials` - Patient name initials
|
94
|
+
* `Frozen?` - Flag indicating whether the specimen is frozen
|
95
|
+
* `SPN` - Surgical Pathology Number
|
96
|
+
* `Collection Date` - Date the specimen was acquired by the tissue bank
|
97
|
+
* `Received Date` - Date the specimen was donated by the participant
|
98
|
+
* `Quantity` - Amount collected
|
99
|
+
* `Box` - Tissue storage container
|
100
|
+
* `X` - the tissue box column
|
101
|
+
* `Y` - the tissue box row
|
102
|
+
* `Gleason`: Specimen primary gleason score
|
103
|
+
* `Grade`: Specimen histologic WHO grade
|
104
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This is the Galena annotation example migration field mapping file.
|
2
|
+
# This example extends the simple migration with annotation fields.
|
3
|
+
|
4
|
+
Protocol: CollectionProtocol.short_title
|
5
|
+
MRN: ParticipantMedicalIdentifier.medical_record_number, Participant.last_name
|
6
|
+
SPN: SpecimenCollectionGroup.surgical_pathology_number
|
7
|
+
Gleason: SpecimenCollectionGroup::Pathology::GleasonScore.primary_pattern_score
|
8
|
+
Grade: SpecimenCollectionGroup::Pathology::HistologicGrade.grade
|
@@ -0,0 +1 @@
|
|
1
|
+
TissueSpecimen.specimen_type: Frozen Tissue
|
@@ -0,0 +1 @@
|
|
1
|
+
Protocol,MRN,SPN,Gleason,Grade
|
@@ -0,0 +1 @@
|
|
1
|
+
SSN,First,Middle,Last
|
@@ -0,0 +1 @@
|
|
1
|
+
Patient,Collection Point,Received,SCG Name
|
@@ -1,19 +1,18 @@
|
|
1
1
|
require 'uom'
|
2
2
|
|
3
3
|
module CaTissue
|
4
|
-
|
5
4
|
# Declares the classes modified for migration.
|
6
5
|
shims Participant, TissueSpecimen, SpecimenCollectionGroup
|
7
6
|
|
8
7
|
class Participant
|
9
8
|
# Extracts the Participant first name from the +Initials+ input field.
|
10
9
|
def migrate_first_name(value, row)
|
11
|
-
|
10
|
+
value[0, 1]
|
12
11
|
end
|
13
12
|
|
14
13
|
# Extracts the Participant last name from the +Initials+ input field.
|
15
14
|
def migrate_last_name(value, row)
|
16
|
-
|
15
|
+
value[-1, 1]
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
@@ -4,16 +4,6 @@ require File.join(File.dirname(__FILE__), '..', 'seed', 'defaults')
|
|
4
4
|
module CaTissue
|
5
5
|
# Declares the classes modified for migration.
|
6
6
|
shims TissueSpecimen, CollectionProtocolRegistration, StorageContainer
|
7
|
-
|
8
|
-
class TissueSpecimen
|
9
|
-
# Sets the specimen type to +Frozen Tissue+.
|
10
|
-
#
|
11
|
-
# @param (see CaRuby::Migratable#migrate)
|
12
|
-
def migrate(row, migrated)
|
13
|
-
super
|
14
|
-
self.specimen_type = 'Frozen Tissue'
|
15
|
-
end
|
16
|
-
end
|
17
7
|
|
18
8
|
class StorageContainer
|
19
9
|
# Creates the migrated box in the database, if necessary.
|
@@ -28,20 +28,26 @@ module Galena
|
|
28
28
|
class Defaults
|
29
29
|
include Singleton
|
30
30
|
|
31
|
-
attr_reader :
|
31
|
+
attr_reader :protocols, :hospital, :tissue_bank, :freezer_type, :box_type
|
32
32
|
|
33
33
|
# Creates the Galena example Defaults singleton and populates the attributes.
|
34
34
|
def initialize
|
35
35
|
super
|
36
|
+
@protocols = []
|
36
37
|
populate
|
37
38
|
end
|
38
39
|
|
39
40
|
# Creates the Galena example administrative objects as necessary.
|
40
41
|
def ensure_exists
|
41
|
-
@
|
42
|
+
@protocols.each { |pcl| pcl.find(:create) }
|
42
43
|
@hospital.find(:create)
|
43
44
|
@surgeon.find(:create)
|
44
|
-
@
|
45
|
+
@box_type.find(:create)
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [CaTissue::CollectionProtocol] the primary example protocol
|
49
|
+
def protocol
|
50
|
+
@protocols.first
|
45
51
|
end
|
46
52
|
|
47
53
|
private
|
@@ -65,11 +71,11 @@ module Galena
|
|
65
71
|
|
66
72
|
@hospital = CaTissue::Site.new(
|
67
73
|
:site_type => CaTissue::Site::SiteType::COLLECTION, :name => 'Galena Hospital',
|
68
|
-
:address => addr, :coordinator => coord)
|
74
|
+
:address => addr.copy, :coordinator => coord)
|
69
75
|
|
70
76
|
@tissue_bank = CaTissue::Site.new(
|
71
77
|
:site_type => CaTissue::Site::SiteType::REPOSITORY, :name => 'Galena Tissue Bank',
|
72
|
-
:address => addr, :coordinator => coord)
|
78
|
+
:address => addr.copy, :coordinator => coord)
|
73
79
|
|
74
80
|
pi = CaTissue::User.new(
|
75
81
|
:email_address => 'vesta.gator@galena.edu',
|
@@ -81,16 +87,26 @@ module Galena
|
|
81
87
|
:first_name => 'Serge', :last_name => 'On', :address => addr.copy,
|
82
88
|
:institution => galena, :department => dept, :cancer_research_group => crg)
|
83
89
|
|
84
|
-
@
|
90
|
+
@protocols << pcl = CaTissue::CollectionProtocol.new(:short_title => 'Galena Migration',
|
85
91
|
:principal_investigator => pi, :sites => [@tissue_bank])
|
86
92
|
|
87
93
|
# CPE has default 1.0 event point and label
|
88
|
-
cpe = CaTissue::CollectionProtocolEvent.new(:collection_protocol =>
|
94
|
+
cpe = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl, :event_point => 1.0, :label => 'Galena Migration_1')
|
89
95
|
|
90
|
-
#
|
96
|
+
# The sole specimen requirement. Setting the requirement collection_event attribute to a CPE automatically
|
91
97
|
# sets the CPE requirement inverse attribute in caRuby.
|
92
98
|
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe, :specimen_type => 'Fixed Tissue')
|
93
99
|
|
100
|
+
@protocols << pcl2 = CaTissue::CollectionProtocol.new(:short_title => 'Galena Migration 2',
|
101
|
+
:principal_investigator => pi, :sites => [@tissue_bank])
|
102
|
+
cpe2 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl2, :event_point => 2.0, :label => 'Galena Migration_2')
|
103
|
+
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe2, :specimen_type => 'Frozen Tissue')
|
104
|
+
|
105
|
+
@protocols << pcl3 = CaTissue::CollectionProtocol.new(:short_title => 'Galena Migration 3',
|
106
|
+
:principal_investigator => pi, :sites => [@tissue_bank])
|
107
|
+
cpe3 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl3, :event_point => 3.0, :label => 'Galena Migration_3')
|
108
|
+
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe3, :specimen_type => 'Frozen Tissue')
|
109
|
+
|
94
110
|
# the storage container type hierarchy
|
95
111
|
@freezer_type = CaTissue::StorageType.new(:name => 'GTB Freezer', :columns => 10, :rows => 1, :column_label => 'Rack')
|
96
112
|
rack_type = CaTissue::StorageType.new(:name => 'GTB Rack', :columns => 10, :rows => 10)
|