caruby-tissue 1.4.2 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +53 -0
- data/bin/crtdump +1 -6
- data/bin/crtexample +1 -6
- data/bin/crtmigrate +1 -6
- data/bin/crtsmoke +1 -6
- data/conf/migration/filter_fields.yaml +1 -1
- data/conf/migration/general_fields.yaml +1 -1
- data/conf/migration/simple_fields.yaml +1 -1
- data/conf/migration/small_fields.yaml +1 -1
- data/examples/galena/README.md +34 -25
- data/examples/galena/bin/seed +2 -7
- data/examples/galena/conf/migration/annotation_fields.yaml +1 -1
- data/examples/galena/conf/migration/filter_fields.yaml +1 -1
- data/examples/galena/conf/migration/frozen_fields.yaml +2 -2
- data/examples/galena/conf/migration/general_fields.yaml +1 -1
- data/examples/galena/conf/migration/registration_fields.yaml +1 -0
- data/examples/galena/conf/migration/simple_fields.yaml +1 -1
- data/examples/galena/data/frozen.csv +1 -1
- data/examples/galena/data/general.csv +1 -1
- data/examples/galena/data/registration.csv +1 -1
- data/examples/galena/lib/galena/tissue/migration/frozen_shims.rb +8 -4
- data/examples/galena/lib/galena/tissue/seed/defaults.rb +16 -9
- data/examples/pcbin/README.md +8 -8
- data/examples/pcbin/conf/biopsy_fields.yaml +1 -1
- data/examples/pcbin/conf/patient_fields.yaml +1 -1
- data/examples/pcbin/conf/surgery_fields.yaml +1 -1
- data/examples/pcbin/conf/t_stage_fields.yaml +1 -1
- data/examples/pcbin/conf/therapy_fields.yaml +1 -1
- data/lib/catissue.rb +1 -1
- data/lib/catissue/annotation/annotatable.rb +12 -22
- data/lib/catissue/annotation/annotatable_class.rb +87 -114
- data/lib/catissue/annotation/annotation.rb +9 -44
- data/lib/catissue/annotation/annotation_class.rb +238 -145
- data/lib/catissue/annotation/annotation_module.rb +47 -59
- data/lib/catissue/annotation/de_integration.rb +12 -2
- data/lib/catissue/annotation/proxy.rb +11 -17
- data/lib/catissue/annotation/proxy_1_1.rb +47 -0
- data/lib/catissue/annotation/proxy_class.rb +55 -37
- data/lib/catissue/annotation/record_entry_proxy.rb +20 -0
- data/lib/catissue/database.rb +164 -112
- data/lib/catissue/database/annotation/annotation_service.rb +5 -5
- data/lib/catissue/database/annotation/annotator.rb +2 -2
- data/lib/catissue/database/annotation/entity_facade.rb +24 -21
- data/lib/catissue/database/annotation/id_generator.rb +26 -26
- data/lib/catissue/database/annotation/integration_service.rb +8 -8
- data/lib/catissue/database/annotation/record_entry_integrator.rb +24 -6
- data/lib/catissue/database/annotation/reference_writer.rb +33 -6
- data/lib/catissue/domain.rb +26 -0
- data/lib/catissue/domain/abstract_position.rb +1 -1
- data/lib/catissue/domain/abstract_specimen.rb +16 -16
- data/lib/catissue/domain/check_in_check_out_event_parameter.rb +1 -1
- data/lib/catissue/domain/collection_event_parameters.rb +1 -1
- data/lib/catissue/domain/collection_protocol.rb +9 -13
- data/lib/catissue/domain/collection_protocol_event.rb +4 -4
- data/lib/catissue/domain/collection_protocol_registration.rb +4 -4
- data/lib/catissue/domain/container.rb +12 -21
- data/lib/catissue/domain/container_type.rb +65 -64
- data/lib/catissue/domain/disposal_event_parameters.rb +1 -1
- data/lib/catissue/domain/hash_code.rb +3 -6
- data/lib/catissue/domain/new_specimen_array_order_item.rb +4 -4
- data/lib/catissue/domain/order_details.rb +3 -3
- data/lib/catissue/domain/participant.rb +28 -20
- data/lib/catissue/domain/participant/clinical/chemotherapy.rb +21 -0
- data/lib/catissue/domain/participant/clinical/duration.rb +11 -0
- data/lib/catissue/domain/participant/clinical/radiation_therapy.rb +21 -0
- data/lib/catissue/domain/participant_medical_identifier.rb +2 -2
- data/lib/catissue/domain/site.rb +6 -6
- data/lib/catissue/domain/specimen.rb +41 -34
- data/lib/catissue/domain/specimen/pathology/prostate_specimen_gleason_score.rb +18 -0
- data/lib/catissue/domain/specimen/pathology/prostate_specimen_pathology_annotation.rb +13 -8
- data/lib/catissue/domain/specimen/pathology/specimen_additional_finding.rb +21 -0
- data/lib/catissue/domain/specimen/pathology/specimen_base_solid_tissue_pathology_annotation.rb +30 -7
- data/lib/catissue/domain/specimen/pathology/specimen_details.rb +18 -0
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_grade.rb +18 -0
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_type.rb +22 -6
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_variant_type.rb +18 -0
- data/lib/catissue/domain/specimen/pathology/specimen_invasion.rb +18 -0
- data/lib/catissue/domain/specimen_array.rb +8 -8
- data/lib/catissue/domain/specimen_array_content.rb +4 -4
- data/lib/catissue/domain/specimen_collection_group.rb +43 -41
- data/lib/catissue/domain/specimen_collection_group/pathology/base_pathology_annotation.rb +16 -0
- data/lib/catissue/domain/specimen_collection_group/pathology/base_solid_tissue_pathology_annotation.rb +16 -0
- data/lib/catissue/domain/specimen_position.rb +3 -3
- data/lib/catissue/domain/specimen_protocol.rb +7 -7
- data/lib/catissue/domain/specimen_requirement.rb +9 -9
- data/lib/catissue/domain/storage_container.rb +13 -13
- data/lib/catissue/domain/storage_type.rb +12 -7
- data/lib/catissue/domain/transfer_event_parameters.rb +2 -2
- data/lib/catissue/domain/user.rb +15 -15
- data/lib/catissue/extract/extractor.rb +1 -1
- data/lib/catissue/resource.rb +8 -36
- data/lib/catissue/util/location.rb +0 -13
- data/lib/catissue/util/person.rb +2 -1
- data/lib/catissue/util/position.rb +1 -11
- data/lib/catissue/util/uniquify.rb +1 -1
- data/lib/catissue/version.rb +1 -1
- data/lib/catissue/wustl/logger.rb +17 -16
- data/test/fixtures/lib/catissue/defaults_test_fixture.rb +6 -4
- data/test/lib/catissue/domain/collection_protocol_test.rb +0 -1
- data/test/lib/catissue/domain/participant_test.rb +74 -19
- data/test/lib/catissue/domain/specimen_collection_group_test.rb +14 -10
- data/test/lib/catissue/domain/specimen_test.rb +36 -60
- data/test/lib/catissue/domain/storage_type_test.rb +5 -5
- data/test/lib/catissue/domain/transfer_event_parameters_test.rb +14 -12
- data/test/lib/catissue/migration/test_case.rb +0 -1
- data/test/lib/catissue/test_case.rb +12 -12
- data/test/lib/examples/galena/tissue/domain/examples_test.rb +1 -1
- data/test/lib/examples/galena/tissue/migration/annotation_test.rb +9 -7
- data/test/lib/examples/galena/tissue/migration/frozen_test.rb +1 -1
- data/test/lib/examples/galena/tissue/migration/general_test.rb +1 -1
- data/test/lib/examples/galena/tissue/migration/registration_test.rb +3 -9
- data/test/lib/examples/galena/tissue/migration/seedify.rb +3 -3
- data/test/lib/examples/pcbin/migration_test.rb +37 -16
- metadata +24 -10
- data/History.txt +0 -50
data/History.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
This history lists major release themes. See the GitHub Commits (https://github.com/caruby/tissue)
|
2
|
+
for change details.
|
3
|
+
|
4
|
+
1.5.1 / 2011-06-15
|
5
|
+
------------------
|
6
|
+
* Annotation refactoring.
|
7
|
+
|
8
|
+
1.4.2 / 2011-05-04
|
9
|
+
------------------
|
10
|
+
* Add registration and PCBIN examples.
|
11
|
+
|
12
|
+
1.4.1 / 2011-05-03
|
13
|
+
------------------
|
14
|
+
* caTissue 1.2 support.
|
15
|
+
|
16
|
+
1.3.6 / 2011-03-04
|
17
|
+
------------------
|
18
|
+
* Specify caruby-core gem version dependency.
|
19
|
+
|
20
|
+
1.3.5 / 2011-03-04
|
21
|
+
------------------
|
22
|
+
* Annotation migration.
|
23
|
+
|
24
|
+
1.3.4 / 2011-02-26
|
25
|
+
------------------
|
26
|
+
* Use caruby-core JRuby 1.5 bug work-around.
|
27
|
+
|
28
|
+
1.3.3 / 2011-02-26
|
29
|
+
------------------
|
30
|
+
* JRuby 1.5 upgrade.
|
31
|
+
|
32
|
+
1.3.2 / 2011-02-25
|
33
|
+
------------------
|
34
|
+
* Migration bug fixes.
|
35
|
+
|
36
|
+
1.3.1 / 2011-02-18
|
37
|
+
------------------
|
38
|
+
* Prostate Spore PCBIN DE support.
|
39
|
+
|
40
|
+
1.2.3 / 2011-02-18
|
41
|
+
------------------
|
42
|
+
* Dynamic Extensions Support.
|
43
|
+
|
44
|
+
1.2.2 / 2010-11-30
|
45
|
+
------------------
|
46
|
+
* Galena example.
|
47
|
+
|
48
|
+
1.2.1 / 2010-11-23
|
49
|
+
------------------
|
50
|
+
* Initial public release.
|
51
|
+
|
52
|
+
* embed Java-caRuby bridge subproject.
|
53
|
+
|
data/bin/crtdump
CHANGED
@@ -5,12 +5,7 @@
|
|
5
5
|
|
6
6
|
# load the caruby-tissue gem
|
7
7
|
require 'rubygems'
|
8
|
-
|
9
|
-
gem 'caruby-tissue'
|
10
|
-
rescue LoadError
|
11
|
-
# if the gem is not available, then try a local source
|
12
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
13
|
-
end
|
8
|
+
gem 'caruby-tissue'
|
14
9
|
|
15
10
|
# the default log file
|
16
11
|
DEF_LOG_FILE = 'log/catissue.log'
|
data/bin/crtexample
CHANGED
@@ -5,12 +5,7 @@
|
|
5
5
|
|
6
6
|
# load the caruby-tissue gem
|
7
7
|
require 'rubygems'
|
8
|
-
|
9
|
-
gem 'caruby-tissue'
|
10
|
-
rescue LoadError
|
11
|
-
# if the gem is not available, then try a local source
|
12
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
13
|
-
end
|
8
|
+
gem 'caruby-tissue'
|
14
9
|
|
15
10
|
require 'catissue/cli/example'
|
16
11
|
|
data/bin/crtmigrate
CHANGED
@@ -5,12 +5,7 @@
|
|
5
5
|
|
6
6
|
# load the required gems
|
7
7
|
require 'rubygems'
|
8
|
-
|
9
|
-
gem 'caruby-tissue'
|
10
|
-
rescue LoadError
|
11
|
-
# if the gem is not available, then try a local source
|
12
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
13
|
-
end
|
8
|
+
gem 'caruby-tissue'
|
14
9
|
|
15
10
|
require 'catissue/cli/migrate'
|
16
11
|
|
data/bin/crtsmoke
CHANGED
@@ -12,12 +12,7 @@ puts "Loading the caruby-tissue gem..." unless quiet
|
|
12
12
|
|
13
13
|
# load the caruby-tissue gem
|
14
14
|
require 'rubygems'
|
15
|
-
|
16
|
-
gem 'caruby-tissue'
|
17
|
-
rescue LoadError
|
18
|
-
# if the gem is not available, then try a local source
|
19
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
20
|
-
end
|
15
|
+
gem 'caruby-tissue'
|
21
16
|
|
22
17
|
puts "Loading the caTissue client..." unless quiet
|
23
18
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# * the pre-defined Rubyized underscore form of the Java property, e.g. last_name
|
12
12
|
|
13
13
|
# The collection protocol title for the specimen
|
14
|
-
Protocol: CollectionProtocol.
|
14
|
+
Protocol: CollectionProtocol.title
|
15
15
|
|
16
16
|
# The input MRN field is used for the PMI MRN, CPR PPI and Participant last name.
|
17
17
|
# Since the migration source is for a single collection site, the MRN is unique within the protocol.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# The example does not use a shim.
|
4
4
|
|
5
5
|
# The collection protocol title for the specimen
|
6
|
-
Protocol: CollectionProtocol.
|
6
|
+
Protocol: CollectionProtocol.title
|
7
7
|
|
8
8
|
# The input MRN field is used for the PMI MRN, CPR PPI and Participant last name
|
9
9
|
MRN: ParticipantMedicalIdentifier.medical_record_number, Participant.last_name
|
data/examples/galena/README.md
CHANGED
@@ -45,14 +45,14 @@ Migrate the Galena `simple` example as follows:
|
|
45
45
|
|
46
46
|
2. Run the following:
|
47
47
|
|
48
|
-
|
48
|
+
`bin/seed`
|
49
49
|
|
50
50
|
This command initializes the administrative objects in the Galena test database,
|
51
51
|
including the Galena collection protocol, site, cancer center, tissue bank and coordinator.
|
52
52
|
|
53
53
|
3. Run the following:
|
54
54
|
|
55
|
-
|
55
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/simple_fields.yaml data/simple.csv`
|
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.
|
@@ -65,20 +65,29 @@ Migrate the Galena `simple` example as follows:
|
|
65
65
|
The other examples are run in a similar manner. Each example demonstrates different
|
66
66
|
features of the caRuby Migration utility as follows:
|
67
67
|
|
68
|
-
*
|
69
|
-
`crtmigrate --target TissueSpecimen --mapping conf/migration/simple_fields.yaml data/simple.csv`
|
68
|
+
* <tt>simple</tt> - a good starting point with limited input fields
|
70
69
|
|
71
|
-
|
72
|
-
`crtmigrate --target TissueSpecimen --mapping conf/migration/general_fields.yaml data/general.csv`
|
70
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/simple_fields.yaml data/simple.csv`
|
73
71
|
|
74
|
-
*
|
75
|
-
`crtmigrate --target TissueSpecimen --mapping conf/migration/filter_fields.yaml data/filter.csv`
|
72
|
+
* <tt>general</tt> - lots of input fields, no custom Ruby code
|
76
73
|
|
77
|
-
|
78
|
-
`crtmigrate --target TissueSpecimen --mapping conf/migration/frozen_fields.yaml --defaults conf/migration/frozen_defaults.yaml data/frozen.csv`
|
74
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/general_fields.yaml data/general.csv`
|
79
75
|
|
80
|
-
*
|
81
|
-
|
76
|
+
* <tt>filter</tt> - a smattering of custom Ruby shim code to convert input values to caTissue values and reject an incomplete migration
|
77
|
+
|
78
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/filter_fields.yaml --shims lib/galena/tissue/migration/filter_shims.rb --bad bad.csv data/filter.csv`
|
79
|
+
|
80
|
+
* <tt>frozen</tt> - storage locations
|
81
|
+
|
82
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/frozen_fields.yaml --defaults conf/migration/frozen_defaults.yaml --shims lib/galena/tissue/migration/frozen_shims.rb data/frozen.csv`
|
83
|
+
|
84
|
+
* <tt>annotation</tt> - Dynamic Extension annotations
|
85
|
+
|
86
|
+
`crtmigrate --target TissueSpecimen --mapping conf/migration/annotation_fields.yaml --defaults conf/migration/annotation_defaults.yaml data/annotation.csv`
|
87
|
+
|
88
|
+
* <tt>registration</tt> - register participants in a Collection Protocol without specimens
|
89
|
+
|
90
|
+
`crtmigrate --target SpecimenCollectionGroup --mapping conf/migration/registration_fields.yaml data/registration.csv`
|
82
91
|
|
83
92
|
Try running an example with the `--debug` flag and look at the `log/migration.log` file to see
|
84
93
|
what caRuby is up to behind the scenes (hint: a lot!).
|
@@ -88,17 +97,17 @@ Input data
|
|
88
97
|
The sample Galena Tissue Bank CSV input files hold one row for each specimen.
|
89
98
|
The following input fields are included in the examples:
|
90
99
|
|
91
|
-
*
|
92
|
-
*
|
93
|
-
*
|
94
|
-
*
|
95
|
-
*
|
96
|
-
*
|
97
|
-
*
|
98
|
-
*
|
99
|
-
*
|
100
|
-
*
|
101
|
-
*
|
102
|
-
*
|
103
|
-
*
|
100
|
+
* <tt>Protocol</tt> - Collection Protocol title
|
101
|
+
* <tt>MRN</tt> - Patient Medical Record Number
|
102
|
+
* <tt>Initials</tt> - Patient name initials
|
103
|
+
* <tt>Frozen?</tt> - Flag indicating whether the specimen is frozen
|
104
|
+
* <tt>SPN</tt> - Surgical Pathology Number
|
105
|
+
* <tt>Collection Date</tt> - Date the specimen was acquired by the tissue bank
|
106
|
+
* <tt>Received Date</tt> - Date the specimen was donated by the participant
|
107
|
+
* <tt>Quantity</tt> - Amount collected
|
108
|
+
* <tt>Box</tt> - Tissue storage container
|
109
|
+
* <tt>X</tt> - the tissue box column
|
110
|
+
* <tt>Y</tt> - the tissue box row
|
111
|
+
* <tt>Gleason</tt>: Specimen primary gleason score
|
112
|
+
* <tt>Grade</tt>: Specimen histologic WHO grade
|
104
113
|
|
data/examples/galena/bin/seed
CHANGED
@@ -5,12 +5,7 @@
|
|
5
5
|
|
6
6
|
# load the caRuby Tissue gem
|
7
7
|
require 'rubygems'
|
8
|
-
|
9
|
-
gem 'caruby-tissue'
|
10
|
-
rescue LoadError
|
11
|
-
# if the gem is not available, then try a local source
|
12
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
|
13
|
-
end
|
8
|
+
gem 'caruby-tissue'
|
14
9
|
|
15
10
|
# add the Galena lib to the path
|
16
11
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
@@ -21,6 +16,6 @@ DEF_LOG_FILE = 'log/migration.log'
|
|
21
16
|
require 'catissue'
|
22
17
|
require 'catissue/cli/command'
|
23
18
|
|
24
|
-
require 'galena/seed/defaults'
|
19
|
+
require 'galena/tissue/seed/defaults'
|
25
20
|
|
26
21
|
CaTissue::CLI::Command.new.start { Galena::Seed.defaults.ensure_exists }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# This is the Galena annotation example migration field mapping file.
|
2
2
|
# This example extends the simple migration with annotation fields.
|
3
3
|
|
4
|
-
Protocol: CollectionProtocol.
|
4
|
+
Protocol: CollectionProtocol.title
|
5
5
|
MRN: ParticipantMedicalIdentifier.medical_record_number, Participant.last_name
|
6
6
|
SPN: SpecimenCollectionGroup.surgical_pathology_number
|
7
7
|
Gleason: SpecimenCollectionGroup::Pathology::GleasonScore.primary_pattern_score
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# This example extends the simple migration with storage fields
|
3
3
|
# and the frozen defaults.
|
4
4
|
|
5
|
-
Protocol: CollectionProtocol.
|
5
|
+
Protocol: CollectionProtocol.title
|
6
6
|
MRN: ParticipantMedicalIdentifier.medical_record_number, Participant.last_name
|
7
7
|
SPN: SpecimenCollectionGroup.surgical_pathology_number
|
8
8
|
Collection Date: ReceivedEventParameters.timestamp
|
9
9
|
Quantity: TissueSpecimen.initial_quantity
|
10
|
-
Box:
|
10
|
+
Box: StorageContainer.name
|
11
11
|
X: SpecimenPosition.position_dimension_one
|
12
12
|
Y: SpecimenPosition.position_dimension_two
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# * the pre-defined Rubyized underscore form of the Java property, e.g. last_name
|
12
12
|
|
13
13
|
# The collection protocol title for the specimen
|
14
|
-
Protocol: CollectionProtocol.
|
14
|
+
Protocol: CollectionProtocol.title
|
15
15
|
|
16
16
|
# The input MRN field is used for the PMI MRN, CPR PPI and Participant last name.
|
17
17
|
# Since the migration source is for a single collection site, the MRN is unique within the protocol.
|
@@ -1 +1 @@
|
|
1
|
-
Protocol,MRN,SPN,Collection Date,Quantity,Box,X,Y
|
1
|
+
Protocol,MRN,SPN,Collection Date,Quantity,Box,X,Y
|
@@ -1 +1 @@
|
|
1
|
-
Protocol,Collection Site,MRN,First Name,Last Name,PPI,SPN,Collection Point,Receiver,Received Timestamp,Collector,Collected Timestamp,Diagnosis,Anatomic Site,Development,Label,Type,Quantity,Box,X,Y
|
1
|
+
Protocol,Collection Site,MRN,First Name,Last Name,PPI,SPN,Collection Point,Receiver,Received Timestamp,Collector,Collected Timestamp,Diagnosis,Anatomic Site,Development,Label,Type,Quantity,Box,X,Y
|
@@ -1 +1 @@
|
|
1
|
-
Patient,Collection Point,Received,SCG Name
|
1
|
+
Protocol,Patient,Collection Point,Received,SCG Name
|
@@ -22,13 +22,17 @@ module CaTissue
|
|
22
22
|
# @return [StorageContainer] the new box
|
23
23
|
def create_galena_box
|
24
24
|
defs = Galena::Seed.defaults
|
25
|
-
|
26
|
-
|
25
|
+
# the box container type
|
26
|
+
self.container_type = defs.box_type
|
27
|
+
# the required box site
|
28
|
+
self.site = defs.tissue_bank
|
27
29
|
# A freezer with a slot for the box.
|
28
30
|
frz = defs.freezer_type.find_available(site, :create)
|
29
|
-
|
30
|
-
# Add this box to the first open slot in the first unfilled rack in the freezer.
|
31
|
+
# Add the box to the first open slot in the first unfilled rack in the freezer.
|
31
32
|
frz << self
|
33
|
+
logger.debug { "Placed the tissue box #{self} in freezer #{frz}." }
|
34
|
+
logger.debug { "Creating the tissue box #{self}..." }
|
35
|
+
create
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
@@ -21,7 +21,7 @@ module Galena
|
|
21
21
|
#
|
22
22
|
# In a real-world use case, the administrative objects are typically built in the UI before-hand.
|
23
23
|
# In that case, it is only necessary to define the object secondary key rather than content, e.g.:
|
24
|
-
# pcl = CaTissue::CollectionProtocol.new(:
|
24
|
+
# pcl = CaTissue::CollectionProtocol.new(:title => 'Galena CP')
|
25
25
|
# The complete definitions are included in this method for convenience in order to seed the
|
26
26
|
# example in a test database. A real-world migration might find it useful to create a similar
|
27
27
|
# defaults file in order to rapidly seed an empty test or staging database.
|
@@ -42,7 +42,11 @@ module Galena
|
|
42
42
|
@protocols.each { |pcl| pcl.find(:create) }
|
43
43
|
@hospital.find(:create)
|
44
44
|
@surgeon.find(:create)
|
45
|
-
@
|
45
|
+
unless @box.find then
|
46
|
+
frz = @freezer_type.find_available(@tissue_bank, :create)
|
47
|
+
frz << @box
|
48
|
+
@box.create
|
49
|
+
end
|
46
50
|
end
|
47
51
|
|
48
52
|
# @return [CaTissue::CollectionProtocol] the primary example protocol
|
@@ -87,7 +91,7 @@ module Galena
|
|
87
91
|
:first_name => 'Serge', :last_name => 'On', :address => addr.copy,
|
88
92
|
:institution => galena, :department => dept, :cancer_research_group => crg)
|
89
93
|
|
90
|
-
@protocols << pcl = CaTissue::CollectionProtocol.new(:
|
94
|
+
@protocols << pcl = CaTissue::CollectionProtocol.new(:title => 'Galena Migration',
|
91
95
|
:principal_investigator => pi, :sites => [@tissue_bank])
|
92
96
|
|
93
97
|
# CPE has default 1.0 event point and label
|
@@ -97,23 +101,26 @@ module Galena
|
|
97
101
|
# sets the CPE requirement inverse attribute in caRuby.
|
98
102
|
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe, :specimen_type => 'Fixed Tissue')
|
99
103
|
|
100
|
-
@protocols << pcl2 = CaTissue::CollectionProtocol.new(:
|
104
|
+
@protocols << pcl2 = CaTissue::CollectionProtocol.new(:title => 'Galena Migration 2',
|
101
105
|
:principal_investigator => pi, :sites => [@tissue_bank])
|
102
106
|
cpe2 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl2, :event_point => 2.0, :label => 'Galena Migration_2')
|
103
107
|
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe2, :specimen_type => 'Frozen Tissue')
|
104
108
|
|
105
|
-
@protocols << pcl3 = CaTissue::CollectionProtocol.new(:
|
109
|
+
@protocols << pcl3 = CaTissue::CollectionProtocol.new(:title => 'Galena Migration 3',
|
106
110
|
:principal_investigator => pi, :sites => [@tissue_bank])
|
107
111
|
cpe3 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl3, :event_point => 3.0, :label => 'Galena Migration_3')
|
108
112
|
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe3, :specimen_type => 'Frozen Tissue')
|
109
113
|
|
110
114
|
# the storage container type hierarchy
|
111
|
-
@freezer_type = CaTissue::StorageType.new(:name => '
|
112
|
-
rack_type = CaTissue::StorageType.new(:name => '
|
113
|
-
@box_type = CaTissue::StorageType.new(:name => '
|
115
|
+
@freezer_type = CaTissue::StorageType.new(:name => 'Galena Freezer', :columns => 10, :rows => 1, :column_label => 'Rack')
|
116
|
+
rack_type = CaTissue::StorageType.new(:name => 'Galena Rack', :columns => 10, :rows => 10)
|
117
|
+
@box_type = CaTissue::StorageType.new(:name => 'Galena Box', :columns => 10, :rows => 10)
|
114
118
|
@freezer_type << rack_type
|
115
|
-
rack_type << box_type
|
119
|
+
rack_type << @box_type
|
116
120
|
@box_type << 'Tissue'
|
121
|
+
|
122
|
+
# the example tissue box
|
123
|
+
@box = @box_type.new_container(:name => 'Galena Box 1')
|
117
124
|
end
|
118
125
|
end
|
119
126
|
end
|
data/examples/pcbin/README.md
CHANGED
@@ -9,26 +9,26 @@ data elements. The official PCBIN import utility is a Java program which operate
|
|
9
9
|
special-purpose input XML file and calls caRuby to create annotations. The example shown
|
10
10
|
here is a caRuby Tissue Migrator import which operates on CSV files.
|
11
11
|
|
12
|
-
The migration input files are in the
|
12
|
+
The migration input files are in the `data` directory. The input maps to caTissue entities as follows:
|
13
13
|
|
14
|
-
*
|
14
|
+
* `patient` => `Participant`
|
15
15
|
|
16
|
-
*
|
16
|
+
* `biopsy` => prostate biopsy `SpecimenCollectionGroup`
|
17
17
|
|
18
|
-
*
|
18
|
+
* `surgery` => prostatectomy `SpecimenCollectionGroup`
|
19
19
|
|
20
|
-
*
|
20
|
+
* `t_stage` => the tumor stage as a lab annotation
|
21
21
|
|
22
|
-
* (
|
22
|
+
* (`neo`)`adjuvant_hormone` => (neo)adjuvant hormone therapy annotation
|
23
23
|
|
24
|
-
* (
|
24
|
+
* (`neo`)`adjuvant_radiation` => (neo)adjuvant radiation therapy annotation
|
25
25
|
|
26
26
|
Setup
|
27
27
|
-----
|
28
28
|
Configure caRuby and copy the PCBIN example as described in the Galena examples
|
29
29
|
[Setup](https://github.com/caruby/tissue/blob/master/examples/galena/README.md).
|
30
30
|
|
31
|
-
Create a simple
|
31
|
+
Create a simple `Prostate SPORE` caTissue collection protocol in a test database.
|
32
32
|
|
33
33
|
Migration
|
34
34
|
---------
|