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/bin/crtextract
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/usr/bin/env jruby
|
2
|
-
#
|
3
|
-
# crtextract: extracts caTissue records which changed during a time interval
|
4
|
-
#
|
5
|
-
# == Usage
|
6
|
-
#
|
7
|
-
# catissue-extract.rb [options]
|
8
|
-
#
|
9
|
-
# --help, -h:
|
10
|
-
# print this help message and exit
|
11
|
-
# --target, -t class:
|
12
|
-
# target class to extract (default Specimen)
|
13
|
-
# --log file, -l file:
|
14
|
-
# log file (default ./log/migration.log)
|
15
|
-
# --since date, -s date:
|
16
|
-
# earliest change date selection condition (optional)
|
17
|
-
# --before date, -b date:
|
18
|
-
# latest change date selection condition (optional)
|
19
|
-
# --on date, -b date:
|
20
|
-
# change date selection condition (optional)
|
21
|
-
# --debug, -d:
|
22
|
-
# print debug messages to log (optional)
|
23
|
-
#
|
24
|
-
# See the ohsu distribution doc/extract.html file for more information.
|
25
|
-
#
|
26
|
-
# == License
|
27
|
-
#
|
28
|
-
# This program is licensed under the terms of the +LEGAL+ file in
|
29
|
-
# the source distribution.
|
30
|
-
#
|
31
|
-
# load the required gems
|
32
|
-
require 'rubygems'
|
33
|
-
gem 'caruby-tissue'
|
34
|
-
|
35
|
-
require 'catissue/cli/command'
|
36
|
-
require 'catissue/extract/delta'
|
37
|
-
require 'catissue/extract/extractor'
|
38
|
-
|
39
|
-
# the command line specification
|
40
|
-
spec = [
|
41
|
-
[:version, "--version", "prints the version of caRuby Tissue and the supported caTissue releases"],
|
42
|
-
]
|
43
|
-
|
44
|
-
# run the command
|
45
|
-
CaRuby::Command.new(spec).execute do |opts|
|
46
|
-
if opts[:version] then puts "#{CaTissue::VERSION} for caTissue v#{CaTissue::CATISSUE_VERSIONS}" end
|
47
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
TissueSpecimen.specimen_type: Fixed Tissue
|
@@ -1,13 +0,0 @@
|
|
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 TRUE, FALSE
|
3
|
-
# or missing. If the input value matches the case-insensitive regular expression /TRUE/i,
|
4
|
-
# then the input value is transformed to the caTissue value 'Frozen Tissue'. A missing
|
5
|
-
# input value is set to 'Fixed Tissue' by the filter_defaults.yaml configuration.
|
6
|
-
#
|
7
|
-
# A straight-forward value => value mapping would be expressed as:
|
8
|
-
# 'TRUE' : 'Frozen Tissue'
|
9
|
-
# 'FALSE' : 'Fixed Tissue'
|
10
|
-
#
|
11
|
-
TissueSpecimen.specimen_type:
|
12
|
-
!ruby/regexp '/TRUE/i' : 'Frozen Tissue'
|
13
|
-
!ruby/regexp '/FALSE/i' : 'Fixed Tissue'
|
@@ -1 +0,0 @@
|
|
1
|
-
SSN,First,Middle,Last
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'uom'
|
2
|
-
|
3
|
-
module CaTissue
|
4
|
-
# Declares the classes modified for migration.
|
5
|
-
shims Participant, TissueSpecimen, SpecimenCollectionGroup
|
6
|
-
|
7
|
-
class Participant
|
8
|
-
# Extracts the Participant first name from the +Initials+ input field.
|
9
|
-
def migrate_first_name(value, row)
|
10
|
-
value[0, 1]
|
11
|
-
end
|
12
|
-
|
13
|
-
# Extracts the Participant last name from the +Initials+ input field.
|
14
|
-
def migrate_last_name(value, row)
|
15
|
-
value[-1, 1]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class TissueSpecimen
|
20
|
-
# Transforms the +Frozen?+ flag input field to the caTissue specimen type +Frozen Tissue+ value.
|
21
|
-
def migrate_specimen_type(value, row)
|
22
|
-
value =~ /TRUE/i ? 'Frozen Tissue' : 'Fixed Tissue'
|
23
|
-
end
|
24
|
-
# Parses the source field as a UOM::Measurement if it is a string.
|
25
|
-
# Otherwises, returns the source value.
|
26
|
-
def migrate_initial_quantity(value, row)
|
27
|
-
# if value is not a string, then use it as is
|
28
|
-
return value unless value.is_a?(String)
|
29
|
-
# the value has a unit qualifier; parse the measurement.
|
30
|
-
# the unit is normalized to the Specimen standard unit.
|
31
|
-
value.to_measurement_quantity(standard_unit)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class SpecimenCollectionGroup
|
36
|
-
# Returns whether this SCG has a SPN.
|
37
|
-
def migration_valid?
|
38
|
-
surgical_pathology_number
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require 'singleton'
|
2
|
-
require 'catissue'
|
3
|
-
|
4
|
-
module Galena
|
5
|
-
# Creates the {Galena::Seed::Defaults} administrative objects as necessary.
|
6
|
-
def self.seed
|
7
|
-
Seed.defaults.ensure_exists
|
8
|
-
end
|
9
|
-
|
10
|
-
# Galena example utility module to populate the database with pre-defined administrative objects.
|
11
|
-
module Seed
|
12
|
-
# @return [Defaults] the defaults instance
|
13
|
-
def self.defaults
|
14
|
-
Defaults.instance
|
15
|
-
end
|
16
|
-
|
17
|
-
# Pre-defined Galena example administrative objects. If the Galena example is already set up
|
18
|
-
# in the caTissue database, then the default object secondary key attributes can be used as a
|
19
|
-
# {CaRuby::Persistable#find} template to retrieve the existing objects. Otherwise, the Defaults
|
20
|
-
# attributes can be created by calling {CaRuby::Persistable#create}.
|
21
|
-
#
|
22
|
-
# In a real-world use case, the administrative objects are typically built in the UI before-hand.
|
23
|
-
# In that case, it is only necessary to define the object secondary key rather than content, e.g.:
|
24
|
-
# pcl = CaTissue::CollectionProtocol.new(:title => 'Galena CP')
|
25
|
-
# The complete definitions are included in this method for convenience in order to seed the
|
26
|
-
# example in a test database. A real-world migration might find it useful to create a similar
|
27
|
-
# defaults file in order to rapidly seed an empty test or staging database.
|
28
|
-
class Defaults
|
29
|
-
include Singleton
|
30
|
-
|
31
|
-
attr_reader :protocols, :hospital, :tissue_bank, :freezer_type, :box_type
|
32
|
-
|
33
|
-
# Creates the Galena example Defaults singleton and populates the attributes.
|
34
|
-
def initialize
|
35
|
-
super
|
36
|
-
@protocols = []
|
37
|
-
populate
|
38
|
-
end
|
39
|
-
|
40
|
-
# Creates the Galena example administrative objects as necessary.
|
41
|
-
def ensure_exists
|
42
|
-
@protocols.each { |pcl| pcl.find(:create) }
|
43
|
-
@hospital.find(:create)
|
44
|
-
@surgeon.find(:create)
|
45
|
-
unless @box.find then
|
46
|
-
frz = @freezer_type.find_available(@tissue_bank, :create)
|
47
|
-
frz << @box
|
48
|
-
@box.create
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# @return [CaTissue::CollectionProtocol] the primary example protocol
|
53
|
-
def protocol
|
54
|
-
@protocols.first
|
55
|
-
end
|
56
|
-
|
57
|
-
private
|
58
|
-
|
59
|
-
# Sets the Galena example Defaults attributes to new objects.
|
60
|
-
def populate
|
61
|
-
galena = CaTissue::Institution.new(:name => 'Galena University')
|
62
|
-
|
63
|
-
addr = CaTissue::Address.new(
|
64
|
-
:city => 'Galena', :state => 'Illinois', :country => 'United States', :zipCode => '37544',
|
65
|
-
:street => '411 Basin St', :phoneNumber => '311-555-5555')
|
66
|
-
|
67
|
-
dept = CaTissue::Department.new(:name => 'Pathology')
|
68
|
-
|
69
|
-
crg = CaTissue::CancerResearchGroup.new(:name => 'Don Thomas Cancer Center')
|
70
|
-
|
71
|
-
coord = CaTissue::User.new(
|
72
|
-
:email_address => 'corey.nator@galena.edu',
|
73
|
-
:last_name => 'Nator', :first_name => 'Corey', :address => addr.copy,
|
74
|
-
:institution => galena, :department => dept, :cancer_research_group => crg)
|
75
|
-
|
76
|
-
@hospital = CaTissue::Site.new(
|
77
|
-
:site_type => CaTissue::Site::SiteType::COLLECTION, :name => 'Galena Hospital',
|
78
|
-
:address => addr.copy, :coordinator => coord)
|
79
|
-
|
80
|
-
@tissue_bank = CaTissue::Site.new(
|
81
|
-
:site_type => CaTissue::Site::SiteType::REPOSITORY, :name => 'Galena Tissue Bank',
|
82
|
-
:address => addr.copy, :coordinator => coord)
|
83
|
-
|
84
|
-
pi = CaTissue::User.new(
|
85
|
-
:email_address => 'vesta.gator@galena.edu',
|
86
|
-
:last_name => 'Gator', :first_name => 'Vesta', :address => addr.copy,
|
87
|
-
:institution => galena, :department => dept, :cancer_research_group => crg)
|
88
|
-
|
89
|
-
@surgeon = CaTissue::User.new(
|
90
|
-
:email_address => 'serge.on@galena.edu',
|
91
|
-
:first_name => 'Serge', :last_name => 'On', :address => addr.copy,
|
92
|
-
:institution => galena, :department => dept, :cancer_research_group => crg)
|
93
|
-
|
94
|
-
@protocols << pcl = CaTissue::CollectionProtocol.new(:title => 'Galena Migration',
|
95
|
-
:principal_investigator => pi, :sites => [@tissue_bank])
|
96
|
-
|
97
|
-
# CPE has default 1.0 event point and label
|
98
|
-
cpe = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl, :event_point => 1.0, :label => 'Galena Migration_1')
|
99
|
-
|
100
|
-
# The sole specimen requirement. Setting the requirement collection_event attribute to a CPE automatically
|
101
|
-
# sets the CPE requirement inverse attribute in caRuby.
|
102
|
-
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe, :specimen_type => 'Fixed Tissue')
|
103
|
-
|
104
|
-
@protocols << pcl2 = CaTissue::CollectionProtocol.new(:title => 'Galena Migration 2',
|
105
|
-
:principal_investigator => pi, :sites => [@tissue_bank])
|
106
|
-
cpe2 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl2, :event_point => 2.0, :label => 'Galena Migration_2')
|
107
|
-
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe2, :specimen_type => 'Frozen Tissue')
|
108
|
-
|
109
|
-
@protocols << pcl3 = CaTissue::CollectionProtocol.new(:title => 'Galena Migration 3',
|
110
|
-
:principal_investigator => pi, :sites => [@tissue_bank])
|
111
|
-
cpe3 = CaTissue::CollectionProtocolEvent.new(:collection_protocol => pcl3, :event_point => 3.0, :label => 'Galena Migration_3')
|
112
|
-
CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe3, :specimen_type => 'Frozen Tissue')
|
113
|
-
|
114
|
-
# the storage container type hierarchy
|
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)
|
118
|
-
@freezer_type << rack_type
|
119
|
-
rack_type << @box_type
|
120
|
-
@box_type << 'Tissue'
|
121
|
-
|
122
|
-
# the example tissue box
|
123
|
-
@box = @box_type.new_container(:name => 'Galena Box 1')
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
data/examples/psbin/README.md
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
PSBIN caRuby Tissue example
|
2
|
-
============================
|
3
|
-
|
4
|
-
Synopsis
|
5
|
-
--------
|
6
|
-
This directory contains the caRuby Tissue example for the **P**rostate **S**PORE **B**io**I**nformatics **N**etwork
|
7
|
-
(PSBIN) initiative.
|
8
|
-
The PSBIN initiative shares participant cancer center data in caTissue instances with common
|
9
|
-
data elements. The official PSBIN import utility is a Java program which operates on a
|
10
|
-
special-purpose input XML file and calls caRuby to create annotations. The example shown
|
11
|
-
here is a caRuby Tissue Migrator import which operates on CSV files.
|
12
|
-
|
13
|
-
The migration input files are in the `data` directory. The input maps to caTissue entities as follows:
|
14
|
-
|
15
|
-
* `patient` => `Participant`
|
16
|
-
|
17
|
-
* `biopsy` => prostate biopsy `SpecimenCollectionGroup`
|
18
|
-
|
19
|
-
* `surgery` => prostatectomy `SpecimenCollectionGroup`
|
20
|
-
|
21
|
-
* `t_stage` => the tumor stage as a lab annotation
|
22
|
-
|
23
|
-
* (`neo`)`adjuvant_hormone` => (neo)adjuvant hormone therapy annotation
|
24
|
-
|
25
|
-
* (`neo`)`adjuvant_radiation` => (neo)adjuvant radiation therapy annotation
|
26
|
-
|
27
|
-
Setup
|
28
|
-
-----
|
29
|
-
Configure caRuby and copy the PSBIN example as described in the Galena examples
|
30
|
-
[Setup](https://github.com/caruby/tissue/blob/master/examples/galena/README.md).
|
31
|
-
|
32
|
-
Create a simple `Prostate SPORE` caTissue collection protocol in a test database.
|
33
|
-
|
34
|
-
Migration
|
35
|
-
---------
|
36
|
-
Run the following commands in the copied example location:
|
37
|
-
|
38
|
-
crtmigrate --target Participant --mapping conf/patient_fields.yaml --defaults conf/patient_defaults.yaml data/patient.csv
|
39
|
-
crtmigrate --target SpecimenCollectionGroup --mapping conf/biopsy_fields.yaml --defaults conf/biopsy_defaults.yaml data/biopsy.csv
|
40
|
-
crtmigrate --target SpecimenCollectionGroup --mapping conf/surgery_fields.yaml --defaults conf/surgery_defaults.yaml data/surgery.csv
|
41
|
-
crtmigrate --target Participant::Clinical::LabAnnotation --mapping conf/t_stage_fields.yaml --defaults conf/t_stage_defaults.yaml data/t_stage.csv
|
42
|
-
crtmigrate --target Participant::Clinical::TreatmentAnnotation --mapping conf/therapy_fields.yaml --defaults conf/neoadjuvant_hormone_defaults.yaml data/neoadjuvant_hormone.csv
|
43
|
-
crtmigrate --target Participant::Clinical::RadRXAnnotation --mapping conf/therapy_fields.yaml --defaults conf/neoadjuvant_radiation_defaults.yaml data/neoadjuvant_radiation.csv
|
44
|
-
crtmigrate --target Participant::Clinical::TreatmentAnnotation --mapping conf/therapy_fields.yaml --defaults conf/adjuvant_hormone_defaults.yaml data/adjuvant_hormone.csv
|
45
|
-
crtmigrate --target Participant::Clinical::RadRXAnnotation --mapping conf/therapy_fields.yaml --defaults conf/adjuvant_radiation_defaults.yaml data/adjuvant_radiation.csv
|
@@ -1,9 +0,0 @@
|
|
1
|
-
Protocol: CollectionProtocol.title
|
2
|
-
Patient: CollectionProtocolRegistration.protocol_participant_identifier
|
3
|
-
Specimen Type: TissueSpecimen.specimen_type
|
4
|
-
Year of Diagnosis: Participant::Clinical::NewDiagnosisHealthAnnotation.date_of_examination
|
5
|
-
# Age requires a custom DE
|
6
|
-
#Age at Diagnosis: Participant::Clinical::NewDiagnosisHealthAnnotation.age_at_diagnosis
|
7
|
-
Gleason Primary: SpecimenCollectionGroup::Pathology::NeedleBiopsyProstatePathologyAnnotation.gleason_score.primary_pattern_score
|
8
|
-
Gleason Secondary: SpecimenCollectionGroup::Pathology::NeedleBiopsyProstatePathologyAnnotation.gleason_score.secondary_pattern_score
|
9
|
-
Gleason Tertiary: SpecimenCollectionGroup::Pathology::NeedleBiopsyProstatePathologyAnnotation.gleason_score.tertiary_pattern_score
|
@@ -1,3 +0,0 @@
|
|
1
|
-
Participant::Clinical::LabAnnotation.lab_test_name: 2857-1 ~ Prostate specific Ag - Serum/Plasma - Quantitative - Mass Concentration - Point in time
|
2
|
-
Participant::Clinical::LabAnnotation.other_lab_test_name: Pre-Treatment PSA
|
3
|
-
Participant::Clinical::LabAnnotation.result_units: ng/ml
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Protocol: CollectionProtocol.title
|
2
|
-
Patient: CollectionProtocolRegistration.protocol_participant_identifier
|
3
|
-
Specimen Type: TissueSpecimen.specimen_type
|
4
|
-
Year of Surgery: Participant::Clinical::Duration.start_date
|
5
|
-
# Age requires a custom DE
|
6
|
-
#Age at Surgery: SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation.age_at_surgery
|
7
|
-
Gleason Primary: SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation.gleason_score.primary_pattern_score
|
8
|
-
Gleason Secondary: SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation.gleason_score.secondary_pattern_score
|
9
|
-
Gleason Tertiary: SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation.gleason_score.tertiary_pattern_score
|
10
|
-
Surgical Margin Status: SpecimenCollectionGroup::Pathology::RadicalProstatectomyMargin.margin_status
|
11
|
-
Seminal Vesicle Involvement: SpecimenCollectionGroup::Pathology::RadicalProstatectomyPathologyAnnotation.seminal_vesicle_invasion
|
12
|
-
Extra-Prostatic Extension Focal?: SpecimenCollectionGroup::Pathology::ExtraprostaticExtension.is_focal
|
13
|
-
Extra-Prostatic Extension Status: SpecimenCollectionGroup::Pathology::ExtraprostaticExtension.status
|
14
|
-
Lymph Node Metastases: SpecimenCollectionGroup::Pathology::Invasion.lymphatic_invasion
|
15
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
Participant::Clinical::LabAnnotation.other_lab_test_name: TNM
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Protocol: CollectionProtocol.title
|
2
|
-
Patient: CollectionProtocolRegistration.protocol_participant_identifier
|
3
|
-
Agent: Participant::Clinical::TreatmentAnnotation.agent
|
4
|
-
Dose: Participant::Clinical::TreatmentAnnotation.dose
|
5
|
-
Units: Participant::Clinical::TreatmentAnnotation.dose_units
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Agent,Dose,Units
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Agent,Dose,Units
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Specimen Type,Year of Diagnosis,Age at Diagnosis,Gleason Primary,Gleason Secondary,Gleason Tertiary
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Agent,Dose,Units
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Agent,Dose,Units
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Race,Ethnicity,Pre-treatment PSA
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Specimen Type,Year of Surgery,Age at Surgery,Gleason Primary,Gleason Secondary,Gleason Tertiary,Surgical Margin Status,Seminal Vesicle Involvement,Extra-Prostatic Extension Focal?,Extra-Prostatic Extension Status,Lymph Node Metastases
|
@@ -1 +0,0 @@
|
|
1
|
-
Protocol,Patient,Clinical Staging System,Clinical T Stage
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module CaTissue
|
2
|
-
# Declares the classes modified for migration.
|
3
|
-
shims Participant
|
4
|
-
|
5
|
-
class Participant::Clinical::NewDiagnosisHealthAnnotation
|
6
|
-
# Makes a non-PHI date field from the year input value.
|
7
|
-
#
|
8
|
-
# @param [Integer] year the diagnosis year
|
9
|
-
# @param row (see CaRuby::Migratable#migrate)
|
10
|
-
# @return [Date] July 2 of the given year
|
11
|
-
def migrate_date_of_examination(year, row)
|
12
|
-
Date.new(year, 7, 2)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module CaTissue
|
2
|
-
# Declares the classes modified for migration.
|
3
|
-
shims Participant, SpecimenCollectionGroup
|
4
|
-
|
5
|
-
class Participant::Clinical::Duration
|
6
|
-
# Makes a non-PHI date field from the year input value.
|
7
|
-
#
|
8
|
-
# @param [Integer] year the diagnosis year
|
9
|
-
# @param row (see CaRuby::Migratable#migrate)
|
10
|
-
# @return [Date] July 2 of the given year
|
11
|
-
def migrate_start_date(year, row)
|
12
|
-
Date.new(year, 7, 2)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|