caruby-tissue 1.5.6 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +17 -0
- data/History.md +5 -1
- data/README.md +2 -2
- data/bin/crtdump +2 -8
- data/bin/crtexample +2 -5
- data/bin/crtmigrate +3 -6
- data/bin/crtsmoke +3 -8
- data/conf/wustl/{log4j.properties → linux/log4j.properties} +3 -3
- data/conf/wustl/windows/log4j.properties +40 -0
- data/examples/galena/Gemfile +16 -0
- data/examples/galena/Gemfile.lock +88 -0
- data/examples/galena/README.md +16 -16
- data/examples/galena/Rakefile +30 -0
- data/examples/galena/bin/seed +5 -11
- data/examples/galena/conf/annotation/defaults.yaml +2 -0
- data/examples/galena/conf/{migration/annotation_fields.yaml → annotation/fields.yaml} +2 -4
- data/examples/galena/conf/defaults.yaml +9 -0
- data/examples/galena/conf/{migration/filter_fields.yaml → filter/fields.yaml} +0 -1
- data/examples/galena/conf/filter/values.yaml +8 -0
- data/examples/galena/conf/{migration/frozen_defaults.yaml → frozen/defaults.yaml} +0 -0
- data/examples/galena/conf/{migration/frozen_fields.yaml → frozen/fields.yaml} +0 -2
- data/examples/galena/conf/{migration/general_fields.yaml → general/fields.yaml} +0 -24
- data/examples/galena/conf/registration/fields.yaml +6 -0
- data/examples/galena/conf/{migration/simple_fields.yaml → simple/fields.yaml} +1 -6
- data/examples/galena/data/annotation.csv +1 -1
- data/examples/galena/data/filter.csv +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/data/simple.csv +1 -1
- data/examples/galena/galena.gemspec +24 -0
- data/examples/galena/lib/galena/filter.rb +25 -0
- data/examples/galena/lib/galena/{tissue/migration/frozen_shims.rb → frozen.rb} +6 -10
- data/examples/galena/lib/galena/seed.rb +126 -0
- data/examples/galena/lib/galena/version.rb +3 -0
- data/examples/galena/lib/galena.rb +18 -7
- data/examples/galena/log/galena.log +37351 -0
- data/examples/galena/log/galena.log.0 +147830 -0
- data/examples/galena/spec/annotation_spec.rb +46 -0
- data/examples/galena/spec/filter_spec.rb +94 -0
- data/examples/galena/spec/frozen_spec.rb +39 -0
- data/examples/galena/spec/general_spec.rb +62 -0
- data/examples/galena/spec/registration_spec.rb +37 -0
- data/examples/galena/spec/seed.rb +107 -0
- data/examples/galena/spec/simple_spec.rb +58 -0
- data/examples/galena/spec/spec_helper.rb +11 -0
- data/examples/galena/spec/support/migration.rb +70 -0
- data/lib/catissue/annotation/annotatable.rb +10 -8
- data/lib/catissue/annotation/annotation.rb +7 -7
- data/lib/catissue/annotation/de_integration.rb +9 -20
- data/lib/catissue/annotation/importer.rb +148 -0
- data/lib/catissue/annotation/introspector.rb +32 -0
- data/lib/catissue/annotation/metadata.rb +422 -0
- data/lib/catissue/annotation/proxy.rb +2 -2
- data/lib/catissue/annotation/proxy_class.rb +45 -30
- data/lib/catissue/annotation/record_entry_proxy.rb +2 -2
- data/lib/catissue/cli/command.rb +14 -24
- data/lib/catissue/cli/example.rb +5 -3
- data/lib/catissue/cli/migrate.rb +45 -37
- data/lib/catissue/cli/smoke.rb +2 -3
- data/lib/catissue/database/annotation/annotation_service.rb +8 -17
- data/lib/catissue/database/annotation/entity_facade.rb +33 -30
- data/lib/catissue/database/annotation/id_generator.rb +1 -1
- data/lib/catissue/database/annotation/integration_service.rb +11 -4
- data/lib/catissue/database/annotation/reference_writer.rb +38 -38
- data/lib/catissue/database/controlled_value_finder.rb +13 -28
- data/lib/catissue/database/controlled_values.rb +73 -45
- data/lib/catissue/database.rb +637 -277
- data/lib/catissue/domain/abstract_domain_object.rb +5 -0
- data/lib/catissue/domain/abstract_position.rb +3 -5
- data/lib/catissue/domain/abstract_specimen.rb +79 -65
- data/lib/catissue/domain/abstract_specimen_collection_group.rb +3 -6
- data/lib/catissue/domain/address.rb +0 -2
- data/lib/catissue/domain/cancer_research_group.rb +0 -3
- data/lib/catissue/domain/capacity.rb +2 -4
- data/lib/catissue/domain/check_in_check_out_event_parameter.rb +0 -3
- data/lib/catissue/domain/collection_event_parameters.rb +2 -7
- data/lib/catissue/domain/collection_protocol.rb +11 -16
- data/lib/catissue/domain/collection_protocol_event.rb +19 -12
- data/lib/catissue/domain/collection_protocol_registration.rb +8 -12
- data/lib/catissue/domain/consent_tier_response.rb +0 -4
- data/lib/catissue/domain/consent_tier_status.rb +1 -4
- data/lib/catissue/domain/container.rb +10 -10
- data/lib/catissue/domain/container_position.rb +4 -7
- data/lib/catissue/domain/container_type.rb +4 -7
- data/lib/catissue/domain/department.rb +0 -3
- data/lib/catissue/domain/disposal_event_parameters.rb +5 -5
- data/lib/catissue/domain/embedded_event_parameters.rb +1 -4
- data/lib/catissue/domain/external_identifier.rb +0 -12
- data/lib/catissue/domain/frozen_event_parameters.rb +1 -4
- data/lib/catissue/domain/institution.rb +0 -3
- data/lib/catissue/domain/new_specimen_array_order_item.rb +0 -5
- data/lib/catissue/domain/order_details.rb +0 -2
- data/lib/catissue/domain/participant/clinical/chemotherapy.rb +1 -3
- data/lib/catissue/domain/participant/clinical/duration.rb +2 -4
- data/lib/catissue/domain/participant/clinical/radiation_therapy.rb +2 -4
- data/lib/catissue/domain/participant.rb +22 -24
- data/lib/catissue/domain/participant_medical_identifier.rb +0 -4
- data/lib/catissue/domain/password.rb +0 -4
- data/lib/catissue/domain/race.rb +0 -3
- data/lib/catissue/domain/received_event_parameters.rb +3 -6
- data/lib/catissue/domain/site.rb +1 -4
- data/lib/catissue/domain/specimen/pathology/additional_finding.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/details.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/gleason_score.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/histologic_grade.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/histologic_type.rb +19 -0
- data/lib/catissue/domain/specimen/pathology/histologic_variant_type.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/invasion.rb +12 -0
- data/lib/catissue/domain/specimen/pathology/prostate_specimen_gleason_score.rb +5 -11
- data/lib/catissue/domain/specimen/pathology/prostate_specimen_pathology_annotation.rb +12 -12
- data/lib/catissue/domain/specimen/pathology/specimen_additional_finding.rb +5 -14
- data/lib/catissue/domain/specimen/pathology/specimen_base_solid_tissue_pathology_annotation.rb +6 -21
- data/lib/catissue/domain/specimen/pathology/specimen_details.rb +4 -10
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_grade.rb +4 -10
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_type.rb +6 -14
- data/lib/catissue/domain/specimen/pathology/specimen_histologic_variant_type.rb +5 -11
- data/lib/catissue/domain/specimen/pathology/specimen_invasion.rb +5 -11
- data/lib/catissue/domain/specimen.rb +113 -76
- data/lib/catissue/domain/specimen_array.rb +0 -3
- data/lib/catissue/domain/specimen_array_content.rb +1 -4
- data/lib/catissue/domain/specimen_array_type.rb +1 -4
- data/lib/catissue/domain/specimen_characteristics.rb +0 -3
- data/lib/catissue/domain/specimen_collection_group/pathology/base_pathology_annotation.rb +2 -4
- data/lib/catissue/domain/specimen_collection_group/pathology/base_solid_tissue_pathology_annotation.rb +2 -4
- data/lib/catissue/domain/specimen_collection_group.rb +43 -53
- data/lib/catissue/domain/specimen_event_parameters.rb +24 -32
- data/lib/catissue/domain/specimen_position.rb +8 -5
- data/lib/catissue/domain/specimen_protocol.rb +3 -6
- data/lib/catissue/domain/specimen_requirement.rb +22 -20
- data/lib/catissue/domain/storage_container.rb +9 -12
- data/lib/catissue/domain/storage_type.rb +6 -10
- data/lib/catissue/domain/transfer_event_parameters.rb +3 -6
- data/lib/catissue/domain/user.rb +22 -29
- data/lib/catissue/{util → helpers}/collectible.rb +23 -18
- data/lib/catissue/helpers/collectible_event_parameters.rb +68 -0
- data/lib/catissue/helpers/controlled_value.rb +35 -0
- data/lib/catissue/{domain → helpers}/hash_code.rb +0 -0
- data/lib/catissue/{util → helpers}/location.rb +6 -5
- data/lib/catissue/helpers/log.rb +4 -0
- data/lib/catissue/{util → helpers}/person.rb +1 -1
- data/lib/catissue/{util → helpers}/position.rb +10 -8
- data/lib/catissue/helpers/properties_loader.rb +143 -0
- data/lib/catissue/{util → helpers}/storable.rb +2 -1
- data/lib/catissue/{util → helpers}/storage_type_holder.rb +9 -3
- data/lib/catissue/{annotation/annotatable_class.rb → metadata.rb} +73 -95
- data/lib/catissue/migration/migratable.rb +93 -44
- data/lib/catissue/migration/migrator.rb +26 -42
- data/lib/catissue/migration/shims.rb +1 -1
- data/lib/catissue/migration/unique.rb +76 -0
- data/lib/catissue/resource.rb +16 -20
- data/lib/catissue/version.rb +1 -1
- data/lib/catissue/wustl/logger.rb +52 -32
- data/lib/catissue.rb +38 -20
- data/test/lib/catissue/database/controlled_values_test.rb +22 -27
- data/test/lib/catissue/database/database_test.rb +18 -0
- data/test/lib/catissue/domain/address_test.rb +9 -11
- data/test/lib/catissue/domain/ca_tissue_test_defaults_test.rb +5 -16
- data/test/lib/catissue/domain/capacity_test.rb +2 -2
- data/test/lib/catissue/domain/collection_event_parameters_test.rb +16 -8
- data/test/lib/catissue/domain/collection_protocol_event_test.rb +1 -1
- data/test/lib/catissue/domain/collection_protocol_registration_test.rb +26 -16
- data/test/lib/catissue/domain/collection_protocol_test.rb +2 -2
- data/test/lib/catissue/domain/container_position_test.rb +7 -4
- data/test/lib/catissue/domain/department_test.rb +3 -3
- data/test/lib/catissue/domain/disposal_event_parameters_test.rb +1 -1
- data/test/lib/catissue/domain/external_identifier_test.rb +5 -1
- data/test/lib/catissue/domain/location_test.rb +4 -4
- data/test/lib/catissue/domain/participant_medical_identifier_test.rb +3 -3
- data/test/lib/catissue/domain/participant_test.rb +33 -20
- data/test/lib/catissue/domain/received_event_parameters_test.rb +19 -0
- data/test/lib/catissue/domain/site_test.rb +2 -2
- data/test/lib/catissue/domain/specimen_array_test.rb +3 -3
- data/test/lib/catissue/domain/specimen_array_type_test.rb +6 -6
- data/test/lib/catissue/domain/specimen_characteristics_test.rb +1 -1
- data/test/lib/catissue/domain/specimen_collection_group_test.rb +49 -13
- data/test/lib/catissue/domain/specimen_event_parameters_test.rb +4 -4
- data/test/lib/catissue/domain/specimen_position_test.rb +1 -1
- data/test/lib/catissue/domain/specimen_requirement_test.rb +2 -2
- data/test/lib/catissue/domain/specimen_test.rb +58 -24
- data/test/lib/catissue/domain/storage_container_test.rb +3 -16
- data/test/lib/catissue/domain/storage_type_test.rb +3 -3
- data/test/lib/catissue/domain/transfer_event_parameters_test.rb +17 -17
- data/test/lib/catissue/domain/user_test.rb +32 -34
- data/test/lib/catissue/helpers/properties_loader_test.rb +19 -0
- data/test/lib/catissue/migration/{test_case.rb → helpers/test_case.rb} +30 -20
- data/test/lib/examples/galena/tissue/domain/examples_test.rb +28 -38
- data/test/lib/examples/galena/tissue/helpers/test_case.rb +24 -0
- metadata +175 -99
- data/bin/crtextract +0 -47
- data/examples/galena/conf/extract/simple_fields.yaml +0 -4
- data/examples/galena/conf/migration/annotation_defaults.yaml +0 -2
- data/examples/galena/conf/migration/filter_defaults.yaml +0 -1
- data/examples/galena/conf/migration/filter_values.yaml +0 -13
- data/examples/galena/conf/migration/participant_fields.yaml +0 -4
- data/examples/galena/conf/migration/registration_fields.yaml +0 -5
- data/examples/galena/data/participant.csv +0 -1
- data/examples/galena/lib/galena/tissue/migration/filter_shims.rb +0 -41
- data/examples/galena/lib/galena/tissue/seed/defaults.rb +0 -127
- data/examples/psbin/README.md +0 -45
- data/examples/psbin/conf/adjuvant_hormone_defaults.yaml +0 -2
- data/examples/psbin/conf/adjuvant_radiation_defaults.yaml +0 -3
- data/examples/psbin/conf/biopsy_defaults.yaml +0 -3
- data/examples/psbin/conf/biopsy_fields.yaml +0 -9
- data/examples/psbin/conf/neoadjuvant_hormone_defaults.yaml +0 -2
- data/examples/psbin/conf/neoadjuvant_radiation_defaults.yaml +0 -3
- data/examples/psbin/conf/patient_defaults.yaml +0 -3
- data/examples/psbin/conf/patient_fields.yaml +0 -5
- data/examples/psbin/conf/surgery_defaults.yaml +0 -4
- data/examples/psbin/conf/surgery_fields.yaml +0 -15
- data/examples/psbin/conf/t_stage_defaults.yaml +0 -1
- data/examples/psbin/conf/t_stage_fields.yaml +0 -4
- data/examples/psbin/conf/therapy_fields.yaml +0 -5
- data/examples/psbin/data/adjuvant_hormone.csv +0 -1
- data/examples/psbin/data/adjuvant_radiation.csv +0 -1
- data/examples/psbin/data/biopsy.csv +0 -1
- data/examples/psbin/data/neoadjuvant_hormone.csv +0 -1
- data/examples/psbin/data/neoadjuvant_radiation.csv +0 -1
- data/examples/psbin/data/patient.csv +0 -1
- data/examples/psbin/data/surgery.csv +0 -1
- data/examples/psbin/data/t_stage.csv +0 -1
- data/examples/psbin/lib/psbin/biopsy_shims.rb +0 -15
- data/examples/psbin/lib/psbin/surgery_shims.rb +0 -15
- data/lib/catissue/annotation/annotation_class.rb +0 -406
- data/lib/catissue/annotation/annotation_module.rb +0 -106
- data/lib/catissue/domain.rb +0 -26
- data/lib/catissue/extract/command.rb +0 -31
- data/lib/catissue/extract/delta.rb +0 -58
- data/lib/catissue/extract/extractor.rb +0 -99
- data/lib/catissue/migration/uniquify.rb +0 -2
- data/lib/catissue/util/collectible_event_parameters.rb +0 -71
- data/lib/catissue/util/controlled_value.rb +0 -29
- data/lib/catissue/util/uniquify.rb +0 -86
- data/test/fixtures/catissue/domain/conf/catissue_override.yaml +0 -9
- data/test/fixtures/catissue/extract/conf/scg_extract.yaml +0 -3
- data/test/fixtures/catissue/extract/conf/scg_fields.yaml +0 -3
- data/test/fixtures/catissue/extract/conf/spc_extract.yaml +0 -3
- data/test/fixtures/catissue/extract/conf/spc_fields.yaml +0 -4
- data/test/fixtures/lib/catissue/defaults_test_fixture.rb +0 -206
- data/test/fixtures/lib/examples/galena/migration/alt_key_shims.rb +0 -7
- data/test/lib/catissue/domain/base_haemotology_pathology_test.rb +0 -24
- data/test/lib/catissue/extract/delta_test.rb +0 -25
- data/test/lib/catissue/extract/extractor_test.rb +0 -43
- data/test/lib/catissue/import/importable_module_test.rb +0 -14
- data/test/lib/catissue/test_case.rb +0 -247
- data/test/lib/examples/galena/tissue/migration/annotation_test.rb +0 -29
- data/test/lib/examples/galena/tissue/migration/filter_test.rb +0 -29
- data/test/lib/examples/galena/tissue/migration/frozen_test.rb +0 -36
- data/test/lib/examples/galena/tissue/migration/general_test.rb +0 -56
- data/test/lib/examples/galena/tissue/migration/participant_test.rb +0 -61
- data/test/lib/examples/galena/tissue/migration/registration_test.rb +0 -17
- data/test/lib/examples/galena/tissue/migration/seedify.rb +0 -119
- data/test/lib/examples/galena/tissue/migration/simple_test.rb +0 -30
- data/test/lib/examples/galena/tissue/migration/test_case.rb +0 -72
- data/test/lib/examples/psbin/migration_test.rb +0 -153
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
3
|
+
|
4
|
+
group :development do
|
5
|
+
# The Galena example gem
|
6
|
+
gem 'galena', :path => File.dirname(__FILE__) + '/examples/galena'
|
7
|
+
|
8
|
+
# Uncomment the following lines as needed if there are changes to a
|
9
|
+
# dependency gem. Change the path option to your workspace location.
|
10
|
+
# Commit the changed Gemfile and Gemfile.lock to a local git branch
|
11
|
+
# rather than to the master branch. Do not check in the local change.
|
12
|
+
gem 'jinx', :path => File.dirname(__FILE__) + '/../../jinx/core'
|
13
|
+
gem 'jinx-json', :path => File.dirname(__FILE__) + '/../../jinx/json'
|
14
|
+
gem 'jinx-migrate', :path => File.dirname(__FILE__) + '/../../jinx/migrate'
|
15
|
+
gem 'caruby-core', :path => File.dirname(__FILE__) + '/../core', :require => 'caruby'
|
16
|
+
gem 'caruby-tissue', :path => File.dirname(__FILE__), :require => 'catissue'
|
17
|
+
end
|
data/History.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
This history lists major release themes. See the GitHub
|
1
|
+
This history lists major release themes. See the GitHub commits (https://github.com/caruby/tissue)
|
2
2
|
for change details.
|
3
3
|
|
4
|
+
2.1.1 / 2012-04-13
|
5
|
+
------------------
|
6
|
+
* Jinx-based refactoring.
|
7
|
+
|
4
8
|
1.5.6 / 2011-09-30
|
5
9
|
------------------
|
6
10
|
* Added validate function back into migrate.
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ caRuby Tissue: Simplifying caTissue
|
|
4
4
|
**Home**: [http://caruby.rubyforge.org/catissue.html](http://caruby.rubyforge.org/catissue.html)
|
5
5
|
**Git**: [http://github.com/caruby/tissue](http://github.com/caruby/tissue)
|
6
6
|
**Author**: OHSU Knight Cancer Institute
|
7
|
-
**Copyright**: 2010, 2011
|
7
|
+
**Copyright**: 2010, 2011, 2012
|
8
8
|
**License**: MIT License
|
9
9
|
|
10
10
|
Synopsis
|
@@ -41,6 +41,6 @@ The caRuby Tissue [FAQ](https://caruby.tenderapp.com/dashboard/sections/tissue)
|
|
41
41
|
Copyright
|
42
42
|
---------
|
43
43
|
|
44
|
-
caRuby © 2010, 2011 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer/index.cfm).
|
44
|
+
caRuby © 2010, 2011, 2012 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer/index.cfm).
|
45
45
|
caRuby is licensed under the MIT license. Please see the LICENSE and LEGAL
|
46
46
|
files for more information.
|
data/bin/crtdump
CHANGED
@@ -3,14 +3,7 @@
|
|
3
3
|
# crtdump: Dumps the content of a caTissue object to stdout
|
4
4
|
#
|
5
5
|
|
6
|
-
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'caruby-tissue'
|
9
|
-
|
10
|
-
# the default log file
|
11
|
-
DEF_LOG_FILE = 'log/catissue.log'
|
12
|
-
|
13
|
-
require 'catissue/cli/command'
|
6
|
+
require File.dirname(__FILE__) + '/../lib/catissue/cli/command'
|
14
7
|
|
15
8
|
SPECS = [
|
16
9
|
[:class, "class", "The class of the object"],
|
@@ -32,3 +25,4 @@ CaTissue::CLI::Command.new(SPECS).start do |opts|
|
|
32
25
|
# print the object graph
|
33
26
|
puts obj.database.lazy_loader.suspend { obj.dump }
|
34
27
|
end
|
28
|
+
exit 0
|
data/bin/crtexample
CHANGED
@@ -3,11 +3,8 @@
|
|
3
3
|
# crtexample: list and run caRuby Tissue examples
|
4
4
|
#
|
5
5
|
|
6
|
-
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'caruby-tissue'
|
9
|
-
|
10
|
-
require 'catissue/cli/example'
|
6
|
+
require File.dirname(__FILE__) + '/../lib/catissue/cli/example'
|
11
7
|
|
12
8
|
# run the command
|
13
9
|
CaTissue::CLI::Example.new.start
|
10
|
+
exit 0
|
data/bin/crtmigrate
CHANGED
@@ -3,10 +3,7 @@
|
|
3
3
|
# crtmigrate: migrates a source file to caTissue
|
4
4
|
#
|
5
5
|
|
6
|
-
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'caruby-tissue'
|
6
|
+
require File.dirname(__FILE__) + '/../lib/catissue/cli/migrate'
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
CaTissue::CLI::Migrate.new.start
|
8
|
+
CaTissue::CLI::Migrate.new.start
|
9
|
+
exit 0
|
data/bin/crtsmoke
CHANGED
@@ -8,15 +8,10 @@ quiet = ARGV.include?('--help') || ARGV.include?('--version')
|
|
8
8
|
|
9
9
|
puts "Starting the smoke test..." unless quiet
|
10
10
|
|
11
|
-
puts "Loading the
|
11
|
+
puts "Loading the caTissue Tissue client..." unless quiet
|
12
12
|
|
13
|
-
|
14
|
-
require 'rubygems'
|
15
|
-
gem 'caruby-tissue'
|
16
|
-
|
17
|
-
puts "Loading the caTissue client..." unless quiet
|
18
|
-
|
19
|
-
require 'catissue/cli/smoke'
|
13
|
+
require File.dirname(__FILE__) + '/../lib/catissue/cli/smoke'
|
20
14
|
|
21
15
|
# run the command
|
22
16
|
CaTissue::CLI::Smoke.new.start
|
17
|
+
exit 0
|
@@ -1,12 +1,12 @@
|
|
1
|
-
log4j.rootLogger
|
1
|
+
log4j.rootLogger=ERROR, clientLog, catissuecoreclientLog
|
2
2
|
|
3
3
|
log4j.appender.clientLog=org.apache.log4j.FileAppender
|
4
|
-
log4j.appender.clientLog.File
|
4
|
+
log4j.appender.clientLog.File=/dev/null
|
5
5
|
log4j.appender.clientLog.layout=org.apache.log4j.PatternLayout
|
6
6
|
log4j.appender.clientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
7
7
|
|
8
8
|
log4j.appender.catissuecoreclientLog=org.apache.log4j.FileAppender
|
9
|
-
log4j.appender.catissuecoreclientLog.File
|
9
|
+
log4j.appender.catissuecoreclientLog.File=/dev/null
|
10
10
|
log4j.appender.catissuecoreclientLog.layout=org.apache.log4j.PatternLayout
|
11
11
|
log4j.appender.catissuecoreclientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} - %m%n
|
12
12
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
log4j.rootLogger=ERROR, clientLog, catissuecoreclientLog
|
2
|
+
|
3
|
+
log4j.appender.clientLog=org.apache.log4j.FileAppender
|
4
|
+
log4j.appender.clientLog.File=NUL
|
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=NUL
|
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
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
3
|
+
|
4
|
+
group :development do
|
5
|
+
# The Galena example gem
|
6
|
+
gem 'galena', :path => File.dirname(__FILE__)
|
7
|
+
# Uncomment the following lines as needed if there are changes to a
|
8
|
+
# dependency gem. Change the path option to your workspace location.
|
9
|
+
# Commit the changed Gemfile and Gemfile.lock to a local git branch
|
10
|
+
# rather than to the master branch. Do not check in the local change.
|
11
|
+
gem 'jinx', :path => File.dirname(__FILE__) + '/../../../../jinx/core'
|
12
|
+
gem 'jinx-migrate', :path => File.dirname(__FILE__) + '/../../../../jinx/migrate'
|
13
|
+
gem 'jinx-json', :path => File.dirname(__FILE__) + '/../../../../jinx/json'
|
14
|
+
gem 'caruby-core', :path => File.dirname(__FILE__) + '/../../../core', :require => 'caruby'
|
15
|
+
gem 'caruby-tissue', :path => File.dirname(__FILE__) + '/../../../tissue', :require => 'catissue'
|
16
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/loneyf/workspace/caruby/core
|
3
|
+
specs:
|
4
|
+
caruby-core (2.1.1)
|
5
|
+
bundler
|
6
|
+
fastercsv
|
7
|
+
jinx (~> 2.1.1)
|
8
|
+
jinx-json (~> 2.1.1)
|
9
|
+
json_pure
|
10
|
+
rack
|
11
|
+
rdbi
|
12
|
+
|
13
|
+
PATH
|
14
|
+
remote: /Users/loneyf/workspace/caruby/tissue
|
15
|
+
specs:
|
16
|
+
caruby-tissue (2.1.1)
|
17
|
+
bundler
|
18
|
+
jinx (>= 2.1.1)
|
19
|
+
jinx-json (>= 2.1.1)
|
20
|
+
jinx-migrate (>= 2.1.1)
|
21
|
+
uom (>= 1.2.2)
|
22
|
+
|
23
|
+
PATH
|
24
|
+
remote: .
|
25
|
+
specs:
|
26
|
+
galena (2.1.1-java)
|
27
|
+
caruby-tissue (>= 2.1.1)
|
28
|
+
|
29
|
+
PATH
|
30
|
+
remote: /Users/loneyf/workspace/jinx/core
|
31
|
+
specs:
|
32
|
+
jinx (2.1.1)
|
33
|
+
bundler
|
34
|
+
|
35
|
+
PATH
|
36
|
+
remote: /Users/loneyf/workspace/jinx/json
|
37
|
+
specs:
|
38
|
+
jinx-json (2.1.1)
|
39
|
+
bundler
|
40
|
+
jinx
|
41
|
+
json_pure
|
42
|
+
|
43
|
+
PATH
|
44
|
+
remote: /Users/loneyf/workspace/jinx/migrate
|
45
|
+
specs:
|
46
|
+
jinx-migrate (2.1.1)
|
47
|
+
bundler
|
48
|
+
fastercsv
|
49
|
+
rack
|
50
|
+
|
51
|
+
GEM
|
52
|
+
remote: http://rubygems.org/
|
53
|
+
specs:
|
54
|
+
diff-lcs (1.1.3)
|
55
|
+
epoxy (0.3.1)
|
56
|
+
extensional (1.3.1)
|
57
|
+
fastercsv (1.5.4)
|
58
|
+
json_pure (1.6.5)
|
59
|
+
methlab (0.1.0)
|
60
|
+
rack (1.4.1)
|
61
|
+
rdbi (0.9.1)
|
62
|
+
epoxy (>= 0.3.1)
|
63
|
+
methlab (>= 0.0.9)
|
64
|
+
typelib
|
65
|
+
rspec (2.8.0)
|
66
|
+
rspec-core (~> 2.8.0)
|
67
|
+
rspec-expectations (~> 2.8.0)
|
68
|
+
rspec-mocks (~> 2.8.0)
|
69
|
+
rspec-core (2.8.0)
|
70
|
+
rspec-expectations (2.8.0)
|
71
|
+
diff-lcs (~> 1.1.2)
|
72
|
+
rspec-mocks (2.8.0)
|
73
|
+
typelib (0.1.0)
|
74
|
+
uom (1.2.2)
|
75
|
+
extensional
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
java
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
bundler
|
82
|
+
caruby-core!
|
83
|
+
caruby-tissue!
|
84
|
+
galena!
|
85
|
+
jinx!
|
86
|
+
jinx-json!
|
87
|
+
jinx-migrate!
|
88
|
+
rspec (>= 2.6)
|
data/examples/galena/README.md
CHANGED
@@ -35,9 +35,9 @@ Migration
|
|
35
35
|
The example migration input data resides in the `data` directory.
|
36
36
|
Each CSV input file holds one row for each specimen.
|
37
37
|
|
38
|
-
Each example has a field mapping configuration in the `conf
|
38
|
+
Each example has a field mapping configuration in the `conf/` directory.
|
39
39
|
For example, the `simple.csv` input file is migrated into caTissue using the
|
40
|
-
`
|
40
|
+
`simple/migration.yaml` configuration file.
|
41
41
|
|
42
42
|
Migrate the Galena `simple` example as follows:
|
43
43
|
|
@@ -52,10 +52,10 @@ Migrate the Galena `simple` example as follows:
|
|
52
52
|
|
53
53
|
3. Run the following:
|
54
54
|
|
55
|
-
`crtmigrate --target TissueSpecimen --mapping conf/
|
55
|
+
`crtmigrate --target TissueSpecimen --mapping conf/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
|
-
`TissueSpecimen` based on the `
|
58
|
+
`TissueSpecimen` based on the `simple/fields.yaml` mapping file.
|
59
59
|
Peruse the configuration and data files to see which data are migrated and
|
60
60
|
where this data ends up in caTissue.
|
61
61
|
|
@@ -65,29 +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
|
-
* <tt>
|
68
|
+
* <tt>registration</tt> - registers participants in a collection protocol
|
69
69
|
|
70
|
-
`crtmigrate --target
|
70
|
+
`crtmigrate --target CollectionProtocolRegistration --mapping conf/registration/fields.yaml --defaults conf/defaults.yaml data/registration.csv`
|
71
71
|
|
72
|
-
* <tt>
|
72
|
+
* <tt>simple</tt> - migrates one specimen with limited input fields
|
73
73
|
|
74
|
-
`crtmigrate --target TissueSpecimen --mapping conf/
|
74
|
+
`crtmigrate --target TissueSpecimen --mapping conf/simple/fields.yaml --defaults conf/defaults.yaml data/simple.csv`
|
75
75
|
|
76
|
-
* <tt>
|
76
|
+
* <tt>general</tt> - migrates specimens with lots of input fields and a minimal configuration
|
77
77
|
|
78
|
-
`crtmigrate --target TissueSpecimen --mapping conf/
|
78
|
+
`crtmigrate --target TissueSpecimen --mapping conf/general/fields.yaml data/general.csv`
|
79
79
|
|
80
|
-
* <tt>
|
80
|
+
* <tt>filter</tt> - applies a value filter and shim code to convert input values to caTissue values and reject an incomplete migration
|
81
81
|
|
82
|
-
`crtmigrate --target TissueSpecimen --mapping conf/
|
82
|
+
`crtmigrate --target TissueSpecimen --mapping conf/filter/fields.yaml --defaults conf/defaults.yaml --filters conf/filter/values.yaml --shims lib/galena/filter.rb --bad bad.csv data/filter.csv`
|
83
83
|
|
84
|
-
* <tt>
|
84
|
+
* <tt>frozen</tt> - adds a custom default and places specimens in storage locations
|
85
85
|
|
86
|
-
`crtmigrate --target TissueSpecimen --mapping conf/
|
86
|
+
`crtmigrate --target TissueSpecimen --mapping conf/frozen/fields.yaml --defaults conf/defaults.yaml,conf/frozen/defaults.yaml --shims lib/galena/frozen.rb data/frozen.csv`
|
87
87
|
|
88
|
-
* <tt>
|
88
|
+
* <tt>annotation</tt> - annotates the specimens with Dynamic Extensions
|
89
89
|
|
90
|
-
`crtmigrate --target SpecimenCollectionGroup --mapping conf/
|
90
|
+
`crtmigrate --target SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation --mapping conf/annotation/fields.yaml --defaults conf/defaults.yaml,conf/annotation/defaults.yaml data/annotation.csv`
|
91
91
|
|
92
92
|
Try running an example with the `--debug` flag and look at the `log/migration.log` file to see
|
93
93
|
what caRuby is up to behind the scenes (hint: a lot!).
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require File.expand_path('version', File.dirname(__FILE__) + '/lib/galena')
|
3
|
+
|
4
|
+
# the gem name
|
5
|
+
GEM = 'galena'
|
6
|
+
GEM_VERSION = Galena::VERSION
|
7
|
+
|
8
|
+
WINDOWS = (Config::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
|
9
|
+
SUDO = WINDOWS ? '' : 'sudo'
|
10
|
+
|
11
|
+
desc "Makes the API documentation"
|
12
|
+
task :doc do
|
13
|
+
FileUtils.rm_rf 'doc/api'
|
14
|
+
`yardoc`
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Builds the gem"
|
18
|
+
task :gem do
|
19
|
+
`jgem build #{GEM}.gemspec`
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Installs the gem"
|
23
|
+
task :install => :gem do
|
24
|
+
`#{SUDO} jgem install #{GEM}-#{GEM_VERSION}.gem`
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Runs all tests"
|
28
|
+
task :test do
|
29
|
+
`rspec examples/galena`
|
30
|
+
end
|
data/examples/galena/bin/seed
CHANGED
@@ -3,19 +3,13 @@
|
|
3
3
|
# seed: seeds the Galena example administrative objects in the database
|
4
4
|
#
|
5
5
|
|
6
|
-
#
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'caruby-tissue'
|
9
|
-
|
10
|
-
# add the Galena lib to the path
|
6
|
+
# Add the Galena lib to the path.
|
11
7
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
12
8
|
|
13
|
-
|
14
|
-
DEF_LOG_FILE = 'log/migration.log'
|
15
|
-
|
9
|
+
require 'rubygems'
|
16
10
|
require 'catissue'
|
17
11
|
require 'catissue/cli/command'
|
12
|
+
require 'galena/seed'
|
18
13
|
|
19
|
-
|
20
|
-
|
21
|
-
CaTissue::CLI::Command.new.start { Galena::Seed.defaults.ensure_exists }
|
14
|
+
CaTissue::CLI::Command.new.start { Galena.seed }
|
15
|
+
exit 0
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# This is the Galena annotation example migration field mapping file.
|
2
2
|
# This example extends the simple migration with annotation fields.
|
3
|
-
|
4
|
-
Protocol: CollectionProtocol.title
|
5
3
|
MRN: ParticipantMedicalIdentifier.medical_record_number, Participant.last_name
|
6
4
|
SPN: SpecimenCollectionGroup.surgical_pathology_number
|
7
|
-
Gleason:
|
8
|
-
Grade:
|
5
|
+
Gleason: GleasonScore.primary_pattern_score
|
6
|
+
Grade: HistologicGrade.grade
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This value filter configuration file demonstrates how to transform an input field value
|
2
|
+
# to a caTissue value. The specimen type input field is a string which can be a
|
3
|
+
# case-insensitive variation of TRUE, FALSE or missing. If the input value matches the
|
4
|
+
# case-insensitive regular expression /TRUE/i, then the input value is transformed to
|
5
|
+
# the caTissue value 'Frozen Tissue'. Otherwise, the specimen type is set to 'Fixed Tissue'.
|
6
|
+
TissueSpecimen.specimen_type:
|
7
|
+
/TRUE/i : 'Frozen Tissue'
|
8
|
+
/.*/ : 'Fixed Tissue'
|