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
@@ -1,20 +1,14 @@
|
|
1
|
-
require '
|
2
|
-
require 'catissue/domain/hash_code'
|
1
|
+
require 'jinx/helpers/collections'
|
3
2
|
|
4
|
-
|
5
|
-
# import the Java class
|
6
|
-
resource_import Java::edu.wustl.catissuecore.domain.CollectionProtocolEvent
|
3
|
+
require 'catissue/helpers/hash_code'
|
7
4
|
|
8
|
-
|
5
|
+
module CaTissue
|
6
|
+
# The CollectionProtocolEvent domain class.
|
9
7
|
class CollectionProtocolEvent
|
10
8
|
include HashCode
|
11
9
|
|
12
10
|
# @quirk caTissue Bug #64: Some domain collection properties not initialized.
|
13
11
|
# Initialize specimen_collection_groups if necessary.
|
14
|
-
# @quirk caTissue The +specimen_collection_groups+ is unnecessary and expensive to maintain inverse integrity.
|
15
|
-
# The SCG event attribute is required, but adding the SCG to the event SCG inverse attribute value requires
|
16
|
-
# loading all of the SCGs. +specimen_collection_groups+ is not used in practice. The event SCGs can be
|
17
|
-
# easily obtained by a query.
|
18
12
|
#
|
19
13
|
# @return [Java::JavaUtil::Set] the SCGs
|
20
14
|
def specimen_collection_groups
|
@@ -41,6 +35,10 @@ module CaTissue
|
|
41
35
|
# CollectionProtocol create cascades through each dependent CPE to each SpecimenRequirement.
|
42
36
|
add_dependent_attribute(:specimen_requirements, :unfetched)
|
43
37
|
|
38
|
+
# @quirk caTissue The +specimen_collection_groups+ is unnecessary and expensive to maintain inverse integrity.
|
39
|
+
# The SCG event attribute is required, but adding the SCG to the event SCG inverse attribute value requires
|
40
|
+
# loading all of the SCGs. +specimen_collection_groups+ is not used in practice. The event SCGs can be
|
41
|
+
# easily obtained by a query.
|
44
42
|
remove_attribute(:specimen_collection_groups)
|
45
43
|
|
46
44
|
# The event point used for saving this CollectionProtocolEvent if none other is set.
|
@@ -51,7 +49,7 @@ module CaTissue
|
|
51
49
|
protocol.events.delete(self) if protocol
|
52
50
|
end
|
53
51
|
|
54
|
-
# Overrides
|
52
|
+
# Overrides +Jinx::Resource.references+ in the case of the _specimen_requirements_ attribute to select
|
55
53
|
# only top-level SpecimenRequirements not derived from another SpecimenRequirement.
|
56
54
|
def direct_dependents(attribute)
|
57
55
|
if attribute == :specimen_requirements then
|
@@ -70,7 +68,16 @@ module CaTissue
|
|
70
68
|
end
|
71
69
|
|
72
70
|
def default_label
|
73
|
-
|
71
|
+
pcl = protocol_label_component
|
72
|
+
if pcl and event_point then
|
73
|
+
"#{pcl}_#{event_point}"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def protocol_label_component
|
78
|
+
return if protocol.nil?
|
79
|
+
pcl = protocol.short_title || protocol.title || return
|
80
|
+
pcl.sub(' ', '_')
|
74
81
|
end
|
75
82
|
end
|
76
83
|
end
|
@@ -1,10 +1,8 @@
|
|
1
|
-
require '
|
2
|
-
require 'caruby/util/validation'
|
1
|
+
require 'jinx/helpers/collections'
|
3
2
|
|
4
|
-
|
5
|
-
# import the Java class
|
6
|
-
resource_import Java::edu.wustl.catissuecore.domain.CollectionProtocolRegistration
|
3
|
+
require 'jinx/helpers/validation'
|
7
4
|
|
5
|
+
module CaTissue
|
8
6
|
# The CollectionProtocolRegistration domain class.
|
9
7
|
class CollectionProtocolRegistration
|
10
8
|
# @quirk caTissue Bug #64: Some domain collection properties not initialized.
|
@@ -36,9 +34,7 @@ module CaTissue
|
|
36
34
|
add_attribute_aliases("consented?".to_sym => :is_consent_available, :protocol => :collection_protocol,
|
37
35
|
:participant_identifier => :protocol_participant_identifier, :consent_responses => :consent_tier_responses)
|
38
36
|
|
39
|
-
set_secondary_key_attributes(:collection_protocol, :
|
40
|
-
|
41
|
-
set_alternate_key_attributes(:collection_protocol, :protocol_participant_identifier)
|
37
|
+
set_secondary_key_attributes(:collection_protocol, :protocol_participant_identifier)
|
42
38
|
|
43
39
|
add_attribute_defaults(:activity_status => 'Active')
|
44
40
|
|
@@ -67,7 +63,7 @@ module CaTissue
|
|
67
63
|
# must exist. This is checked in the special purpose {#validate_local} method.
|
68
64
|
qualify_attribute(:protocol_participant_identifier, :optional)
|
69
65
|
|
70
|
-
# @quirk caTissue Augment the standard metadata
|
66
|
+
# @quirk caTissue Augment the standard metadata savable reference attributes to work around caTissue Bug #150:
|
71
67
|
# Create CollectionProtocol in API ignores startDate.
|
72
68
|
qualify_attribute(:registration_date, :update_only)
|
73
69
|
|
@@ -89,7 +85,7 @@ module CaTissue
|
|
89
85
|
|
90
86
|
# @return all specimens collected for this CollectionProtocolRegistration
|
91
87
|
def specimens
|
92
|
-
Flattener.new(specimen_collection_groups.map { |
|
88
|
+
Jinx::Flattener.new(specimen_collection_groups.map { |scg| scg.specimens })
|
93
89
|
end
|
94
90
|
|
95
91
|
private
|
@@ -97,7 +93,7 @@ module CaTissue
|
|
97
93
|
def validate_local
|
98
94
|
super
|
99
95
|
if participant.nil? and protocol_participant_identifier.nil? then
|
100
|
-
raise ValidationError.new("#{qp} requires a participant or a protocol participant identifier.")
|
96
|
+
raise Jinx::ValidationError.new("#{qp} requires a participant or a protocol participant identifier.")
|
101
97
|
end
|
102
98
|
end
|
103
99
|
|
@@ -107,7 +103,7 @@ module CaTissue
|
|
107
103
|
def add_defaults_local
|
108
104
|
super
|
109
105
|
self.registration_date ||= Java.now
|
110
|
-
self.protocol_participant_identifier ||= Uniquifier.qualifier.to_s
|
106
|
+
self.protocol_participant_identifier ||= Jinx::Uniquifier.qualifier.to_s
|
111
107
|
end
|
112
108
|
end
|
113
109
|
end
|
@@ -1,13 +1,9 @@
|
|
1
1
|
module CaTissue
|
2
|
-
# import the Java class
|
3
|
-
resource_import Java::edu.wustl.catissuecore.domain.ConsentTierResponse
|
4
|
-
|
5
2
|
class ConsentTierResponse
|
6
3
|
add_mandatory_attributes(:consent_tier, :response)
|
7
4
|
|
8
5
|
add_attribute_defaults(:response => 'Not Specified')
|
9
6
|
|
10
7
|
qualify_attribute(:consent_tier, :fetched)
|
11
|
-
|
12
8
|
end
|
13
9
|
end
|
@@ -1,7 +1,4 @@
|
|
1
1
|
module CaTissue
|
2
|
-
# import the Java class
|
3
|
-
resource_import Java::edu.wustl.catissuecore.domain.ConsentTierStatus
|
4
|
-
|
5
2
|
class ConsentTierStatus
|
6
3
|
add_mandatory_attributes(:consent_tier, :status)
|
7
4
|
|
@@ -23,7 +20,7 @@ module CaTissue
|
|
23
20
|
def statement_match?(other)
|
24
21
|
ct = consent_tier
|
25
22
|
oct = other.consent_tier
|
26
|
-
|
23
|
+
ct.nil? or oct.nil? or ct.identifier == oct.identifier or ct.statement == oct.statement
|
27
24
|
end
|
28
25
|
end
|
29
26
|
end
|
@@ -1,12 +1,10 @@
|
|
1
|
-
require '
|
2
|
-
require 'caruby/
|
3
|
-
require '
|
4
|
-
require 'catissue/
|
1
|
+
require 'jinx/helpers/validation'
|
2
|
+
require 'caruby/helpers/coordinate'
|
3
|
+
require 'jinx/resource/reference_visitor'
|
4
|
+
require 'catissue/helpers/storable'
|
5
|
+
require 'catissue/helpers/location'
|
5
6
|
|
6
7
|
module CaTissue
|
7
|
-
# import the Java class
|
8
|
-
resource_import Java::edu.wustl.catissuecore.domain.Container
|
9
|
-
|
10
8
|
# The +caTissue+ +Container+ domain class wrapper.
|
11
9
|
# Each Container subclass is required to implement the {#container_type} method.
|
12
10
|
class Container
|
@@ -16,6 +14,8 @@ module CaTissue
|
|
16
14
|
|
17
15
|
set_secondary_key_attributes(:name)
|
18
16
|
|
17
|
+
set_alternate_key_attributes(:barcode)
|
18
|
+
|
19
19
|
add_attribute_defaults(:activity_status => 'Active', :full => false)
|
20
20
|
|
21
21
|
# @quirk caTissue container capacity was auto-generated in 1.1.2, but is not in 1.2.
|
@@ -172,16 +172,16 @@ module CaTissue
|
|
172
172
|
private
|
173
173
|
|
174
174
|
# Subcontainer visitor.
|
175
|
-
SUBCTR_VISITOR =
|
175
|
+
SUBCTR_VISITOR = Jinx::ReferenceVisitor.new { [:subcontainers] }
|
176
176
|
|
177
177
|
# @param [Storable] the item to store
|
178
178
|
# @raise [TypeError] if this container cannot hold the storable
|
179
179
|
def validate_type(storable)
|
180
180
|
unless container_type then
|
181
|
-
raise ValidationError.new("Container #{self} is missing a type")
|
181
|
+
raise Jinx::ValidationError.new("Container #{self} is missing a type")
|
182
182
|
end
|
183
183
|
unless container_type.can_hold_child?(storable) then
|
184
|
-
raise ValidationError.new("Container #{self} cannot hold an item of the #{storable} type #{storable.container_type}")
|
184
|
+
raise Jinx::ValidationError.new("Container #{self} cannot hold an item of the #{storable} type #{storable.container_type}")
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
@@ -1,10 +1,7 @@
|
|
1
|
-
require '
|
1
|
+
require 'jinx/helpers/validation'
|
2
2
|
|
3
3
|
module CaTissue
|
4
|
-
|
5
|
-
resource_import Java::edu.wustl.catissuecore.domain.ContainerPosition
|
6
|
-
|
7
|
-
class ContainerPosition < CaTissue::AbstractPosition
|
4
|
+
class ContainerPosition
|
8
5
|
add_mandatory_attributes(:parent_container)
|
9
6
|
|
10
7
|
add_attribute_aliases(:parent => :parent_container, :holder => :parent_container, :occupant => :occupied_container)
|
@@ -20,11 +17,11 @@ module CaTissue
|
|
20
17
|
|
21
18
|
private
|
22
19
|
|
23
|
-
# @raise [ValidationError] if the parent is the same as the occupant
|
20
|
+
# @raise [Jinx::ValidationError] if the parent is the same as the occupant
|
24
21
|
def validate_local
|
25
22
|
super
|
26
23
|
if parent == occupant or (parent.identifier and parent.identifier == occupant.identifier) then
|
27
|
-
raise ValidationError.new("#{self} has a circular containment reference to subcontainer #{occupant}")
|
24
|
+
raise Jinx::ValidationError.new("#{self} has a circular containment reference to subcontainer #{occupant}")
|
28
25
|
end
|
29
26
|
end
|
30
27
|
end
|
@@ -1,9 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'jinx/helpers/options'
|
2
2
|
|
3
3
|
module CaTissue
|
4
|
-
# import the Java class
|
5
|
-
resource_import Java::edu.wustl.catissuecore.domain.ContainerType
|
6
|
-
|
7
4
|
# The caTissue ContainerType domain class wrapper.
|
8
5
|
# Each {ContainerType} subclass is required to implement the container_class method.
|
9
6
|
#
|
@@ -15,7 +12,7 @@ module CaTissue
|
|
15
12
|
#
|
16
13
|
# This conceptual model is implemented in caTissue as follows:
|
17
14
|
# * The specimen collection container type, e.g. +Citrate Vacutainer+, is captured
|
18
|
-
# as a {CaTissue::CollectionEventParameters
|
15
|
+
# as a {CaTissue::CollectionEventParameters} +container+ String. There is no separate
|
19
16
|
# collection container instance or container type instance.
|
20
17
|
# * A tissue specimen storage box is captured as a {CaTissue::StorageContainer}
|
21
18
|
# instance constrained to a {CaTissue::StorageType} instance. Boxes with different
|
@@ -75,7 +72,7 @@ module CaTissue
|
|
75
72
|
# ContainerType is created.
|
76
73
|
add_dependent_attribute(:capacity)
|
77
74
|
|
78
|
-
# Override default
|
75
|
+
# Override default +Jinx::Resource.merge_attributes+ to support the Capacity :rows and +:columns+
|
79
76
|
# pseudo-attributes.
|
80
77
|
#
|
81
78
|
# @quirk JRuby Subclasses do not pick up this class's Resource method overrides.
|
@@ -83,7 +80,7 @@ module CaTissue
|
|
83
80
|
# not pick up ContainerType Resource overrides. Work-around is that each ContainerType
|
84
81
|
# subclass must alias +merge_attributes+ to this method.
|
85
82
|
#
|
86
|
-
# @param (see #merge_attributes)
|
83
|
+
# @param (see CaRuby::Mergeable#merge_attributes)
|
87
84
|
def merge_attributes(other, attributes=nil)
|
88
85
|
if Hash === other then
|
89
86
|
# partition the other hash into the Capacity attributes and ContainerType attributes
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module CaTissue
|
2
|
-
|
3
|
-
resource_import Java::edu.wustl.catissuecore.domain.DisposalEventParameters
|
4
|
-
|
5
|
-
class DisposalEventParameters < CaTissue::SpecimenEventParameters
|
2
|
+
class DisposalEventParameters
|
6
3
|
add_attribute_defaults(:activity_status => 'Closed')
|
7
4
|
|
8
5
|
# @quirk caTissue DisposalEventParameters activity status is transient.
|
9
|
-
|
6
|
+
#
|
7
|
+
# @quirk caTissue DisposalEventParameters activity status is not set in a create.
|
8
|
+
# The work-around is to perform a subsequent update on the created event.
|
9
|
+
qualify_attribute(:activity_status, :unfetched, :update_only)
|
10
10
|
end
|
11
11
|
end
|
@@ -1,8 +1,5 @@
|
|
1
1
|
module CaTissue
|
2
|
-
|
3
|
-
resource_import Java::edu.wustl.catissuecore.domain.EmbeddedEventParameters
|
4
|
-
|
5
|
-
class EmbeddedEventParameters < CaTissue::SpecimenEventParameters
|
2
|
+
class EmbeddedEventParameters
|
6
3
|
add_attribute_aliases(:medium => :embedding_medium)
|
7
4
|
end
|
8
5
|
end
|
@@ -1,18 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
module CaTissue
|
4
|
-
# import the Java class
|
5
|
-
resource_import Java::edu.wustl.catissuecore.domain.ExternalIdentifier
|
6
|
-
|
7
2
|
# The ExternalIdentifier domain class.
|
8
3
|
class ExternalIdentifier
|
9
|
-
# Sets this ExternalIdentifier value to the given value.
|
10
|
-
# A Numeric value is converted to a String.
|
11
|
-
def value=(value)
|
12
|
-
value = value.to_s if value
|
13
|
-
setValue(value)
|
14
|
-
end
|
15
|
-
|
16
4
|
add_mandatory_attributes(:value)
|
17
5
|
|
18
6
|
set_secondary_key_attributes(:specimen, :name)
|
@@ -1,8 +1,5 @@
|
|
1
1
|
module CaTissue
|
2
|
-
|
3
|
-
resource_import Java::edu.wustl.catissuecore.domain.FrozenEventParameters
|
4
|
-
|
5
|
-
class FrozenEventParameters < CaTissue::SpecimenEventParameters
|
2
|
+
class FrozenEventParameters
|
6
3
|
add_attribute_aliases(:freeze_method => :frozen_event_parameters_method)
|
7
4
|
end
|
8
5
|
end
|
@@ -1,9 +1,4 @@
|
|
1
|
-
require 'catissue/resource'
|
2
|
-
|
3
1
|
module CaTissue
|
4
|
-
# import the Java class
|
5
|
-
resource_import Java::edu.wustl.catissuecore.domain.NewSpecimenArrayOrderItem
|
6
|
-
|
7
2
|
# The NewSpecimenArrayOrderItem domain class.
|
8
3
|
class NewSpecimenArrayOrderItem
|
9
4
|
# @quirk caTissue Bug #64: order items collection property is not initialized to an empty set
|
@@ -1,9 +1,7 @@
|
|
1
1
|
module CaTissue
|
2
2
|
class Participant
|
3
|
-
|
3
|
+
module Clinical
|
4
4
|
begin
|
5
|
-
resource_import Java::clinical_annotation.Chemotherapy
|
6
|
-
|
7
5
|
# @quirk caTissue The Chemotherapy DE class is not a primary entity with an entity id.
|
8
6
|
# ChemoRXAnnotation is used instead. The purpose of the caTissue Chemotherapy class is unknown,
|
9
7
|
# since it adds nothing to ChemoRXAnnotation.
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module CaTissue
|
2
2
|
class Participant
|
3
|
-
|
3
|
+
module Clinical
|
4
4
|
begin
|
5
|
-
|
6
|
-
|
7
|
-
# @quirk caTissue The RadiationTherapy DE class is not a primary entity with an entity id.
|
5
|
+
# @quirk caTissue The RadiationTherapy DE class is not a primary entity with an entity id.
|
8
6
|
# RadRXAnnotation is used instead. The purpose of the caTissue RadiationTherapy class is unknown,
|
9
7
|
# since it adds nothing to RadRXAnnotation.
|
10
8
|
class RadiationTherapy
|
@@ -1,11 +1,7 @@
|
|
1
|
-
require '
|
2
|
-
require 'catissue/
|
3
|
-
require 'catissue/util/person'
|
1
|
+
require 'jinx/helpers/validation'
|
2
|
+
require 'catissue/helpers/person'
|
4
3
|
|
5
4
|
module CaTissue
|
6
|
-
# import the Java class
|
7
|
-
resource_import Java::edu.wustl.catissuecore.domain.Participant
|
8
|
-
|
9
5
|
# The Participant domain class.
|
10
6
|
class Participant
|
11
7
|
include Person
|
@@ -15,7 +11,7 @@ module CaTissue
|
|
15
11
|
add_attribute(:name, CaRuby::Person::Name)
|
16
12
|
|
17
13
|
# @quirk caTissue clinical study is unsupported by 1.1.x caTissue, removed in 1.2.
|
18
|
-
if
|
14
|
+
if property_defined?(:clinical_study_registrations) then remove_attribute(:clinical_study_registrations) end
|
19
15
|
|
20
16
|
add_attribute_aliases(:collection_registrations => :collection_protocol_registrations,
|
21
17
|
:registrations => :collection_protocol_registrations,
|
@@ -44,25 +40,23 @@ module CaTissue
|
|
44
40
|
# @quirk caTissue Participant PMI is fetched but not cascaded. However, the Participant bizlogic
|
45
41
|
# simulates PMI cascade. The bizlogic doesn't document why this is done, but it appears that the
|
46
42
|
# reason is to inject an empty PMI if necessary in order to work around a caTissue query bug
|
47
|
-
# (see merge_attribute comment). At any rate,
|
43
|
+
# (see merge_attribute comment). At any rate, PMI is marked as cascaded in the caRuby metadata
|
48
44
|
# to reflect the bizlogic simulation. However, this designation should be revisited with each
|
49
45
|
# release, since if the bizlogic hack is removed then caRuby Participant PMI save will break.
|
46
|
+
# In other words, fixing the caTissue bug will break this caRuby work-around.
|
50
47
|
add_dependent_attribute(:participant_medical_identifiers)
|
51
48
|
|
52
49
|
# SSN is a key, if present, but is not required.
|
53
50
|
qualify_attribute(:social_security_number, :optional)
|
54
51
|
|
55
|
-
# The Participant proxy class.
|
56
|
-
self.annotation_proxy_class_name = 'ParticipantRecordEntry'
|
57
|
-
|
58
52
|
# The clinicial annotation.
|
59
53
|
add_annotation('Clinical', :package => 'clinical_annotation', :service => 'CA')
|
60
54
|
|
61
|
-
#
|
62
|
-
#
|
55
|
+
# Overrides +CaRuby::Mergable.merge_attribute+ to work around the caTissue
|
56
|
+
# bugs described in {CaTissue::Participant.remove_phantom_medical_identifier}.
|
63
57
|
def merge_attribute(attribute, newval, matches=nil)
|
64
58
|
if attribute == :participant_medical_identifiers and newval then
|
65
|
-
CaTissue::Participant.
|
59
|
+
CaTissue::Participant.remove_phantom_medical_identifier(newval)
|
66
60
|
end
|
67
61
|
super
|
68
62
|
end
|
@@ -88,7 +82,7 @@ module CaTissue
|
|
88
82
|
|
89
83
|
# @return [<CTissue::Specimen>] all specimens collected from this participant
|
90
84
|
def specimens
|
91
|
-
Flattener.new(registrations.
|
85
|
+
Jinx::Flattener.new(registrations.map { |cpr| cpr.specimens })
|
92
86
|
end
|
93
87
|
|
94
88
|
# Returns this Participant's CollectionProtocolRegistration protocols.
|
@@ -118,16 +112,20 @@ module CaTissue
|
|
118
112
|
|
119
113
|
protected
|
120
114
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
115
|
+
# @quirk caTissue auto-generates a phantom Participant PMI.
|
116
|
+
# cf. https://cabig-kc.nci.nih.gov/Biospecimen/forums/viewtopic.php?f=19&t=436&sid=ef98f502fc0ab242781b7759a0eaff36
|
117
|
+
#
|
118
|
+
# @param [<CaTissue::ParticipantMedicalIdentifier>] pmis the PMIs to clean up
|
119
|
+
def self.remove_phantom_medical_identifier(pmis)
|
120
|
+
phantom = pmis.detect { |pmi| pmi.medical_record_number.nil? }
|
121
|
+
if phantom then
|
122
|
+
logger.debug { "Work around caTissue bug by removing the phantom fetched #{phantom.participant.qp} #{phantom.qp}..." }
|
125
123
|
# dissociate the participant
|
126
|
-
|
127
|
-
# remove the
|
128
|
-
|
124
|
+
phantom.participant = nil
|
125
|
+
# remove the phantom medical identifier
|
126
|
+
pmis.delete(phantom)
|
129
127
|
end
|
130
|
-
|
128
|
+
pmis
|
131
129
|
end
|
132
130
|
|
133
131
|
private
|
@@ -136,7 +134,7 @@ module CaTissue
|
|
136
134
|
def alternate_key
|
137
135
|
return if medical_identifiers.empty?
|
138
136
|
pmi = medical_identifiers.first
|
139
|
-
pmi.
|
137
|
+
pmi.secondary_key if pmi
|
140
138
|
end
|
141
139
|
|
142
140
|
# Adds a default Unknown Race, if necessary. Although Race is not strictly mandatory in the caTissue
|