caruby-tissue 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/History.md +4 -0
  2. data/examples/galena/README.md +2 -11
  3. data/examples/galena/conf/migration/filter_defaults.yaml +1 -0
  4. data/examples/galena/conf/migration/filter_values.yaml +13 -0
  5. data/examples/galena/lib/galena/tissue/migration/filter_shims.rb +3 -15
  6. data/examples/galena/lib/galena/tissue/migration/frozen_shims.rb +3 -6
  7. data/examples/galena/lib/galena/tissue/seed/defaults.rb +2 -2
  8. data/lib/catissue/annotation/annotatable_class.rb +10 -8
  9. data/lib/catissue/annotation/annotation_class.rb +6 -3
  10. data/lib/catissue/annotation/annotation_module.rb +7 -2
  11. data/lib/catissue/cli/command.rb +11 -4
  12. data/lib/catissue/cli/migrate.rb +5 -16
  13. data/lib/catissue/database/annotation/annotation_service.rb +2 -2
  14. data/lib/catissue/database/annotation/entity_facade.rb +6 -11
  15. data/lib/catissue/database/annotation/record_entry_integrator.rb +4 -4
  16. data/lib/catissue/database/controlled_values.rb +2 -3
  17. data/lib/catissue/database.rb +64 -35
  18. data/lib/catissue/domain/abstract_specimen.rb +24 -26
  19. data/lib/catissue/domain/abstract_specimen_collection_group.rb +1 -1
  20. data/lib/catissue/domain/capacity.rb +1 -1
  21. data/lib/catissue/domain/collection_protocol.rb +12 -9
  22. data/lib/catissue/domain/collection_protocol_event.rb +9 -11
  23. data/lib/catissue/domain/collection_protocol_registration.rb +5 -5
  24. data/lib/catissue/domain/container.rb +3 -4
  25. data/lib/catissue/domain/container_type.rb +11 -12
  26. data/lib/catissue/domain/disposal_event_parameters.rb +1 -1
  27. data/lib/catissue/domain/new_specimen_array_order_item.rb +6 -5
  28. data/lib/catissue/domain/order_details.rb +4 -0
  29. data/lib/catissue/domain/participant.rb +17 -17
  30. data/lib/catissue/domain/participant_medical_identifier.rb +2 -3
  31. data/lib/catissue/domain/site.rb +7 -9
  32. data/lib/catissue/domain/specimen/pathology/prostate_specimen_gleason_score.rb +2 -3
  33. data/lib/catissue/domain/specimen/pathology/prostate_specimen_pathology_annotation.rb +4 -3
  34. data/lib/catissue/domain/specimen/pathology/specimen_additional_finding.rb +5 -7
  35. data/lib/catissue/domain/specimen/pathology/specimen_base_solid_tissue_pathology_annotation.rb +11 -11
  36. data/lib/catissue/domain/specimen/pathology/specimen_details.rb +2 -4
  37. data/lib/catissue/domain/specimen/pathology/specimen_histologic_grade.rb +2 -4
  38. data/lib/catissue/domain/specimen/pathology/specimen_histologic_type.rb +6 -6
  39. data/lib/catissue/domain/specimen/pathology/specimen_histologic_variant_type.rb +2 -4
  40. data/lib/catissue/domain/specimen/pathology/specimen_invasion.rb +2 -4
  41. data/lib/catissue/domain/specimen.rb +35 -45
  42. data/lib/catissue/domain/specimen_array.rb +1 -1
  43. data/lib/catissue/domain/specimen_collection_group/pathology/base_pathology_annotation.rb +4 -4
  44. data/lib/catissue/domain/specimen_collection_group/pathology/base_solid_tissue_pathology_annotation.rb +4 -4
  45. data/lib/catissue/domain/specimen_collection_group.rb +40 -46
  46. data/lib/catissue/domain/specimen_protocol.rb +4 -6
  47. data/lib/catissue/domain/specimen_requirement.rb +13 -16
  48. data/lib/catissue/domain/storage_container.rb +5 -2
  49. data/lib/catissue/domain/storage_type.rb +1 -1
  50. data/lib/catissue/domain/user.rb +16 -7
  51. data/lib/catissue/extract/command.rb +1 -1
  52. data/lib/catissue/extract/delta.rb +7 -15
  53. data/lib/catissue/migration/migratable.rb +106 -8
  54. data/lib/catissue/migration/migrator.rb +20 -12
  55. data/lib/catissue/migration/shims.rb +3 -3
  56. data/lib/catissue/util/collectible.rb +2 -2
  57. data/lib/catissue/util/collectible_event_parameters.rb +2 -2
  58. data/lib/catissue/util/position.rb +3 -3
  59. data/lib/catissue/version.rb +1 -1
  60. data/test/lib/catissue/domain/address_test.rb +3 -2
  61. data/test/lib/catissue/domain/participant_test.rb +11 -0
  62. data/test/lib/catissue/domain/specimen_collection_group_test.rb +62 -12
  63. data/test/lib/catissue/domain/specimen_test.rb +0 -1
  64. data/test/lib/catissue/test_case.rb +2 -2
  65. data/test/lib/examples/galena/tissue/migration/seedify.rb +5 -5
  66. data/test/lib/examples/galena/tissue/migration/test_case.rb +9 -5
  67. metadata +8 -17
  68. data/conf/extract/simple_fields.yaml +0 -4
  69. data/conf/migration/filter_fields.yaml +0 -7
  70. data/conf/migration/filter_migration.yaml +0 -9
  71. data/conf/migration/frozen_fields.yaml +0 -11
  72. data/conf/migration/frozen_migration.yaml +0 -9
  73. data/conf/migration/general_fields.yaml +0 -44
  74. data/conf/migration/general_migration.yaml +0 -9
  75. data/conf/migration/simple_fields.yaml +0 -30
  76. data/conf/migration/simple_migration.yaml +0 -7
  77. data/conf/migration/small_fields.yaml +0 -24
  78. data/conf/migration/small_migration.yaml +0 -9
@@ -47,9 +47,11 @@ module CaTissue
47
47
 
48
48
  set_attribute_type(:holds_storage_types, CaTissue::StorageType)
49
49
 
50
+ # @quirk caTissue Bug #64 - specimen positions is not initialized to an empty set
51
+ # in the Java constructor. Initialize it to a +LinkedHashSet+ in caRuby.
50
52
  def initialize
51
53
  super
52
- # @quirk JRuby specimen_positions is not recognized unless primed with respond_to? call
54
+ # @quirk JRuby specimen_positions is not recognized until respond_to? is called
53
55
  respond_to?(:specimen_positions)
54
56
  # work around caTissue Bug #64
55
57
  self.specimen_positions ||= Java::JavaUtil::LinkedHashSet.new
@@ -121,7 +123,8 @@ module CaTissue
121
123
  # {StorageTypeHolder#child_types} override allowed by caTissue.
122
124
  #
123
125
  # @param [Storable] (see #add)
124
- # @return [Boolean] whether this container is not full and can hold the given item's storable type
126
+ # @return [Boolean] whether this container is not full and can hold the given item's
127
+ # {CaTissue::StorableType}
125
128
  def can_hold_child?(storable)
126
129
  st = storable.storable_type
127
130
  not full? and child_types.any? { |ct| CaRuby::Resource.value_equal?(ct, st) }
@@ -58,7 +58,7 @@ module CaTissue
58
58
  #
59
59
  # @param other the object to compare
60
60
  # @return [Boolean] whether this StorageType has a non-nil name equal to the other name or
61
- # is the same as this StorageType
61
+ # is {#equal?} to this StorageType
62
62
  def ==(other)
63
63
  equal?(other) or (StorageType === other and name and name == other.name)
64
64
  end
@@ -9,7 +9,7 @@ module CaTissue
9
9
  # The User domain class.
10
10
  #
11
11
  # @quirk caTissue caTissue 1.2 User has an adminuser Java property, but caTissue throws an
12
- # UnsupportedOperationException if they are called.
12
+ # +UnsupportedOperationException+ if they are called.
13
13
  # @quirk caTissue clinical study is unsupported by 1.1.x caTissue, removed in 1.2.
14
14
  # @quirk caTissue obscure GUI artifact User page_of attribute pollutes the data layer as a
15
15
  # required attribute. Work-around is to simulate the GUI with a default value.
@@ -45,15 +45,18 @@ module CaTissue
45
45
  setRoleId(value_s)
46
46
  end
47
47
 
48
- remove_attribute(:adminuser) if attribute_defined?(:adminuser)
48
+ # @quirk caTissue caTissue 1.2 User has an adminuser Java property, but caTissue throws an
49
+ # UnsupportedOperationException if they are called.
50
+ if attribute_defined?(:adminuser) then remove_attribute(:adminuser) end
49
51
 
50
- # Makes the convenience +CaRuby::Person::Name+ name a first-class attribute.
52
+ # make the convenience {, CaRuby::Person::Name} name a first-class attribute
51
53
  add_attribute(:name, CaRuby::Person::Name)
52
54
 
53
- remove_attribute(:clinical_studies) if attribute_defined?(:clinical_studies)
55
+ # @quirk caTissue clinical study is unsupported by 1.1.x caTissue, removed in 1.2.
56
+ if attribute_defined?(:clinical_studies) then remove_attribute(:clinical_studies) end
54
57
 
55
- # Clarify that collection_protocols is a coordinator -> protocol association.
56
- # Make assigned protocol and site attribute names consistent.
58
+ # clarify that collection_protocols is a coordinator -> protocol association.
59
+ # make assigned protocol and site attribute names consistent.
57
60
  add_attribute_aliases(:coordinated_protocols => :collection_protocols, :protocols => :assigned_protocols, :assigned_sites => :sites)
58
61
 
59
62
  # login_name is a database unique key.
@@ -68,10 +71,16 @@ module CaTissue
68
71
  # * initial password is 'changeMe1'
69
72
  add_attribute_defaults(:activity_status => 'Active', :page_of => 'pageOfUserAdmin', :role_id => 7, :new_password => 'changeMe1')
70
73
 
74
+ # @quirk caTissue obscure GUI artifact User page_of attribute pollutes the data layer as a
75
+ # required attribute. Work-around is to simulate the GUI with a default value.
71
76
  add_mandatory_attributes(:activity_status, :address, :cancer_research_group, :department,
72
77
  :email_address, :first_name, :institution, :last_name, :page_of, :role_id)
73
78
 
74
- # Adding the :saved_fetch qualifier results in JRuby load_error. TODO - fix this.
79
+ # @quirk caTissue User address can be created but not updated in 1.2.
80
+ #
81
+ # @quirk caTissue User address is not fetched on create in 1.2.
82
+ #
83
+ # @quirk caRuby adding the :saved_fetch qualifier results in JRuby load_error. TODO - fix this.
75
84
  add_dependent_attribute(:address)
76
85
 
77
86
  # Password cannot be saved in 1.2.
@@ -9,7 +9,7 @@ module CaTissue
9
9
  # Creates a new ExtractCommand.
10
10
  # The delta range is given by the required :since option and optional :before option.
11
11
  # The default before value is the current DateTime. These are used to build a Delta
12
- # which is passed to +CaRuby::Command.initialize+ as the :ids option.
12
+ # which is passed to {CaRuby::Command#initialize} as the :ids option.
13
13
  # The :log option specifies a log file.
14
14
  # Other supported options are described in {Extractor#initialize}.
15
15
  def initialize
@@ -10,12 +10,9 @@ module CaTissue
10
10
  class Delta
11
11
  include Enumerable
12
12
 
13
- # Initializes this delta for objects of the given target type which changed
14
- # at or after the since date and earlier than the before date.
15
- #
16
- # @param [Class] target the type for which the delta is determined
17
- # @param [Date] since the delta start time
18
- # @param [Date, nil] since the delta end time (default now)
13
+ # Creates a new Delta for objects of the given target type which changed
14
+ # at or after the since Date and earlier but not at the before Date.
15
+ # The default before Date is now.
19
16
  def initialize(target, since, before=nil)
20
17
  # convert the required target to a CaTissue class if necessary
21
18
  @matcher = create_table_regex(target)
@@ -25,21 +22,17 @@ module CaTissue
25
22
 
26
23
  # Calls the given block on each caTissue identifier satisfying the delta condition.
27
24
  # This method submits the delta SQL and filters the result on the target class.
28
- # This method always submits the query; the caller is responsible for capturing
29
- # the result if necessary for a subsequent iteration.
30
- #
31
- # @yield [identifier] filters the Resources changed in the delta window
32
- # @yieldparam [Integer] identifier the Resource database id
25
+ # This method always submits the query; the caller is responsible for preserving
26
+ # the result if necessary using {#to_a}.
33
27
  def each(&block)
34
28
  execute_query(&block)
35
29
  end
36
30
 
37
31
  private
38
32
 
39
- # The parameterized SQL for determining
40
33
  SQL_FILE = File.join(File.dirname(__FILE__), '..', '..', '..', 'sql', 'delta.sql')
41
34
 
42
- # @return [<Resource>] the result of running the delta SQL on the target CaTissue domain class
35
+ # Returns the result of running the delta SQL on the target CaTissue domain class.
43
36
  def execute_query
44
37
  sql = File.open(SQL_FILE) { |file| file.read }
45
38
  logger.debug { "Executing identifier change set selection range #{@since} - #{@before}, SQL:\n#{sql}" }
@@ -51,8 +44,7 @@ module CaTissue
51
44
  end
52
45
  end
53
46
 
54
- # @param [Class] the target domain class
55
- # @return [RegularExpression, nil] the table match RE for the given target class, if any
47
+ # Returns the table match REs for the given target class.
56
48
  def create_table_regex(target)
57
49
  # The class => table RE hash. Make this hash rather than defining a constant in order to enable
58
50
  # logging before touching a domain class.
@@ -1,20 +1,118 @@
1
- require 'caruby/migration/migratable'
1
+ require 'caruby/migration/migrator'
2
+ require 'catissue/annotation/proxy'
2
3
 
3
4
  module CaTissue
4
- module CollectibleEventParameters
5
-
5
+ shims SpecimenCollectionGroup, CollectionProtocolRegistration, SpecimenCharacteristics,
6
+ SpecimenEventParameters, CollectionEventParameters, ReceivedEventParameters
7
+
8
+ class SpecimenCollectionGroup
9
+ @@diagnosis_cv_finder = nil
10
+
11
+ # Sets this SpecimenCollectionGroup diagnosis ControlledValueFinder.
12
+ def self.diagnosis_cv_finder=(finder)
13
+ @@diagnosis_cv_finder = finder
14
+ end
15
+
16
+ # Returns the diagnosis controlled value as follows:
17
+ # * If CV lookup is disabled, then this method returns value.
18
+ # * Otherwise, if the value is remapped via a configuration remap file,
19
+ # then this method returns the remapped CV.
20
+ # * Otherwise, if the value is a valid CV, then this method returns value.
21
+ # * Otherwise, this method returns nil.
22
+ #
23
+ # @param [String] value the input diagnosis
24
+ # @return [String] the mapped CV
25
+ def self.diagnosis_controlled_value(value)
26
+ @@diagnosis_cv_finder.nil? ? value : @@diagnosis_cv_finder.controlled_value(value)
27
+ end
28
+
29
+ # @return [String] the {diagnosis_controlled_value}
30
+ def migrate_clinical_diagnosis(value, row)
31
+ SpecimenCollectionGroup.diagnosis_controlled_value(value)
32
+ end
33
+ end
34
+
35
+ class SpecimenCharacteristics
36
+ @@tissue_site_cv_finder = nil
37
+
38
+ # Sets this SpecimenCharacteristics tissue site ControlledValueFinder.
39
+ def self.tissue_site_cv_finder=(finder)
40
+ @@tissue_site_cv_finder = finder
41
+ end
42
+
43
+ # Returns the tissue site controlled value as follows:
44
+ # * If CV lookup is disabled, then this method returns value.
45
+ # * Otherwise, if the value is remapped via a configuration remap file,
46
+ # then this method returns the remapped CV.
47
+ # * Otherwise, if the value is a valid CV, then this method returns value.
48
+ # * Otherwise, this method returns nil.
49
+ #
50
+ # @return [String] the caTissue tissue site permissible value
51
+ def self.tissue_site_controlled_value(value)
52
+ @@tissue_site_cv_finder.nil? ? value : @@tissue_site_cv_finder.controlled_value(value)
53
+ end
54
+
55
+ # @return [String] the {tissue_site_controlled_value}
56
+ def migrate_tissue_site(value, row)
57
+ standard_cv_tissue_site(value) or variant_cv_tissue_site(value)
58
+ end
59
+
6
60
  private
61
+
62
+ # Returns the {tissue_site_controlled_value}.
63
+ #
64
+ # @return the caTissue tissue site permissible value
65
+ def standard_cv_tissue_site(value)
66
+ SpecimenCharacteristics.tissue_site_controlled_value(value)
67
+ end
68
+
69
+ # Returns the {tissue_site_controlled_value} which adds the 'NOS' suffix to a value
70
+ # without one or removes 'NOS' from a value with the suffix.
71
+ #
72
+ # @return the caTissue tissue site permissible value
73
+ def variant_cv_tissue_site(value)
74
+ # try an NOS suffix variation
75
+ variation = value =~ /, NOS$/ ? value[0...-', NOS'.length] : value + ', NOS'
76
+ cv = SpecimenCharacteristics.tissue_site_controlled_value(variation)
77
+ logger.warn("Migrator substituted tissue site #{cv} for #{value}.") if cv
78
+ cv
79
+ end
80
+ end
81
+
82
+ class SpecimenEventParameters
83
+ # Returns nil by default, since only CollectibleEventParameters have a SCG owner.
84
+ # {CollectibleEventParameters#migrate_specimen_collection_group} overrides this method.
85
+ #
86
+ # @return nil
87
+ def migrate_specimen_collection_group(scg, row)
88
+ nil
89
+ end
90
+ end
91
+
92
+ module CollectibleEventParameters
93
+ #@param [SpecimenCollectionGroup] scg the migrated owner SCG
94
+ # @return [SpecimenCollectionGroup] scg
95
+ # @see SpecimenEventParameters#migrate_specimen_collection_group
96
+ def migrate_specimen_collection_group(scg, row)
97
+ # unset the specimen parent if necessary
98
+ self.specimen = nil if specimen and scg
99
+ scg
100
+ end
7
101
 
8
- # Overrides +CaRuby::Migratable.migratable__target_value+ to confer precedence to
102
+ # Returns the given Specimen spc unless this CollectibleEventParameters already has a SCG owner.
103
+ # A CollectibleEventParameters is preferentially set to a migrated SCG rather than a migrated
104
+ # Specimen.
105
+ #
106
+ # Overrides {CaRuby::Migratable#migratable__target_value} to confer precedence to
9
107
  # a SCG over a Specimen when setting this event parameters' owner. If the migrated
10
108
  # collection includes both a Specimen and a SCG, then this event parameters
11
109
  # +specimen+ reference is ambiguous, but the +specimen_collection_group+ reference
12
110
  # is not.
13
111
  #
14
- # @param (see CaRuby::Migratable#migratable__target_value)
15
- # @return (see CaRuby::Migratable#migratable__target_value)
16
- def migratable__ambiguous_owner?(attr_md, migrated)
17
- super and attr_md.to_sym != :specimen_collection_group
112
+ #@param [Specimen] spc the migrated owner specimen
113
+ # @return [Specimen, nil] spc unless there is already a SCG owner
114
+ def migrate_specimen(spc, row)
115
+ spc unless specimen_collection_group
18
116
  end
19
117
  end
20
118
  end
@@ -1,6 +1,5 @@
1
1
  require 'caruby/util/properties'
2
2
  require 'caruby/migration/migrator'
3
- require 'catissue/migration/migratable'
4
3
  require 'catissue/resource'
5
4
  require 'catissue/database/controlled_values'
6
5
  require 'catissue/database/controlled_value_finder'
@@ -11,12 +10,6 @@ module CaTissue
11
10
  # See the Galena Cancer Center Tissue Bank Migration Example for further information
12
11
  # about how the options tailor migration, esp. the use of the field mappings and shims.
13
12
  class Migrator < CaRuby::Migrator
14
- # The default name of this migrator.
15
- NAME = 'caTissue Migrator'
16
-
17
- # The built-in caTissue migration shims.
18
- SHIM_FILE = File.join(File.dirname(__FILE__), 'shims.rb')
19
-
20
13
  # Creates a new Migrator with the given options.
21
14
  #
22
15
  # This migrator must include sufficient information to build a well-formed migration target object.
@@ -25,7 +18,9 @@ module CaTissue
25
18
  # database or the migration must build a Participant and a CollectionProtocol.
26
19
  #
27
20
  # @option (see CaRuby::Migrator#initialize)
28
- # @option opts [String] :database target application database
21
+ # @option opts [String] :tissue_sites the tissue site mapping file
22
+ # @option opts [String] :diagnoses the diagnosis mapping file
23
+ # @option opts [String] :database target application {CaRuby::Database}
29
24
  # @option opts [String] :target required target domain class
30
25
  # @option opts [String] :input required source file to migrate
31
26
  # @option opts [String] :shims optional array of shim files to load
@@ -48,9 +43,15 @@ module CaTissue
48
43
  # tailor the options
49
44
  opts[:name] ||= NAME
50
45
  opts[:database] ||= CaTissue::Database.instance
51
- # prepend this migrator's shims
46
+
47
+ # the shims file(s)
48
+ opts[:shims] ||= []
52
49
  shims = opts[:shims] ||= []
53
- shims.unshift(SHIM_FILE)
50
+ # make a single shims file into an array
51
+ shims = opts[:shims] = [shims] unless shims.collection?
52
+ # prepend this migrator's shims
53
+ shims.unshift(MIGRATABLE_SHIM)
54
+
54
55
  # If the unique option is set, then append the CaTissue-specific uniquifier shim.
55
56
  if opts[:unique] then
56
57
  # add the uniquify shim
@@ -79,12 +80,19 @@ module CaTissue
79
80
  end
80
81
 
81
82
  private
83
+ # The default name of this migrator.
84
+ NAME = 'caTissue Migrator'
85
+
86
+ # The built-in caTissue migration shims.
87
+ MIGRATABLE_SHIM = File.join(File.dirname(__FILE__), 'migratable.rb')
82
88
 
83
89
  UNIQUIFY_SHIM = File.join(File.dirname(__FILE__), 'uniquify')
84
90
 
85
91
  # The context module is determined as follows:
86
- # * for an {Annotation} target class, the context module is the annotated class's {ResourceClass#domain_module}
87
- # * otherwise, delegate to +CaRuby::Migrator+.
92
+ # * For an {Annotation} target class, the context module is the annotated class's domain_module.
93
+ # * Otherwise, delegate to +CaRuby::Migrator+.
94
+ # * For an {Annotation} target class, the context module is the annotated class's {ResourceClass#domain_module}.
95
+ # * Otherwise, delegate to {CaRuby::Migrator}.
88
96
  #
89
97
  # @return (see CaRuby::Migrator#context_module)
90
98
  def context_module
@@ -25,7 +25,7 @@ module CaTissue
25
25
  @@diagnosis_cv_finder.nil? ? value : @@diagnosis_cv_finder.controlled_value(value)
26
26
  end
27
27
 
28
- # @return [String] the {diagnosis_controlled_value}
28
+ # @return [String] the {#diagnosis_controlled_value}
29
29
  def migrate_clinical_diagnosis(value, row)
30
30
  SpecimenCollectionGroup.diagnosis_controlled_value(value)
31
31
  end
@@ -46,12 +46,12 @@ module CaTissue
46
46
  # * Otherwise, if the value is a valid CV, then this method returns value.
47
47
  # * Otherwise, this method returns nil.
48
48
  #
49
- # @return [String] the caTissue tissue site permissible value
49
+ # @return the caTissue tissue site permissible value
50
50
  def self.tissue_site_controlled_value(value)
51
51
  @@tissue_site_cv_finder.nil? ? value : @@tissue_site_cv_finder.controlled_value(value)
52
52
  end
53
53
 
54
- # @return [String] the {tissue_site_controlled_value}
54
+ # Returns the {#tissue_site_controlled_value}.
55
55
  def migrate_tissue_site(value, row)
56
56
  standard_cv_tissue_site(value) or variant_cv_tissue_site(value)
57
57
  end
@@ -1,7 +1,7 @@
1
1
  require 'caruby/util/validation'
2
2
 
3
3
  module CaTissue
4
- # A Collectible mix-in instance can hold a #{ReceivedEventParameters} and a #{CollectionEventParameters}.
4
+ # A Collectible mix-in instance can hold a #{ReceivedEventParameters} and a #{CollectedEventParameters}.
5
5
  module Collectible
6
6
  # Builds this collectible domain object's SpecimenEventParameters from atomic parameters.
7
7
  #
@@ -71,7 +71,7 @@ module CaTissue
71
71
 
72
72
  private
73
73
 
74
- # Overrides +CaRuby::Resource.each_defaults_dependent+ to visit the {ReceivedEventParameters}.
74
+ # Overrides {CaRuby::Resource#each_defaults_dependent} to visit the {CaTissue::ReceivedEventParameters}.
75
75
  #
76
76
  # @yield (see CaRuby::Resource#each_defaults_dependent)
77
77
  def each_defaults_dependent
@@ -4,7 +4,7 @@ module CaTissue
4
4
  # or receival at the tissue bank.
5
5
  module CollectibleEventParameters
6
6
  # Returns the SpecimenEventParameters in others which matches this CollectibleEventParameters in the scope of an owner Specimen or SCG.
7
- # This method relaxes +CaRuby::Resource.match_in_owner_scope+ for a CollectibleEventParameters that matches any SpecimenEventParameters
7
+ # This method relaxes {CaRuby::Resource#match_in_owner_scope} for a CollectibleEventParameters that matches any SpecimenEventParameters
8
8
  # in others of the same class, since there can be at most one CollectibleEventParameters of a given class for a given SCG.
9
9
  def match_in_owner_scope(others)
10
10
  others.detect { |other| minimal_match?(other) }
@@ -44,7 +44,7 @@ module CaTissue
44
44
  end
45
45
  end
46
46
 
47
- # Overrides +CaRuby::Migratable.migratable__migrate_owner+ to give owner preference to a migrated SCG
47
+ # Overrides {CaRuby::Migratable#migratable__migrate_owner} to give owner preference to a migrated SCG
48
48
  # over a migrated Specimen.
49
49
  #
50
50
  # @param (see CaRuby::Migratable#migratable__migrate_owner)
@@ -15,12 +15,12 @@ module CaTissue
15
15
  self.class === other and occupant == other.occupant and location == other.location
16
16
  end
17
17
 
18
- # @return [Coordinate] the read-only coordinate with this position's row and column.
18
+ # @return [Coordinate] the read-only coordinate with this AbstractPosition's #row and {#column}.
19
19
  def coordinate
20
20
  location.coordinate
21
21
  end
22
22
 
23
- # @return [Location] the location of this position
23
+ # @return [Location] the location of this Position
24
24
  def location
25
25
  @location ||= Location.new
26
26
  # always ensure that the location is consistent with the Java state
@@ -43,7 +43,7 @@ module CaTissue
43
43
  column.nil? or row.nil?
44
44
  end
45
45
 
46
- # @return [(Integer, Integer)] this Position's zero-based (column, row) tuple.
46
+ # @return [(Integer, Integer)] this Position's zero-based ({#column}, {#row}) tuple.
47
47
  def to_a
48
48
  [column, row]
49
49
  end
@@ -1,6 +1,6 @@
1
1
  module CaTissue
2
2
  # The version of this caRuby Tissue release.
3
- VERSION = "1.5.4"
3
+ VERSION = "1.5.5"
4
4
 
5
5
  # The supported caTissue release versions.
6
6
  CATISSUE_VERSIONS = "1.1.2-1.2"
@@ -21,11 +21,12 @@ class AddressTest < Test::Unit::TestCase
21
21
  end
22
22
 
23
23
  def test_save
24
- assert_raises(CaRuby::DatabaseError, "Address save without owner incorrectly saved") { @addr.save }
25
- @addr.user = @user
24
+ # Create the address.
26
25
  verify_save(@addr)
26
+ # Modify the address.
27
27
  expected = @addr.street = "#{Uniquifier.qualifier} Elm"
28
28
  verify_save(@addr)
29
+ # Find the address.
29
30
  fetched = @addr.copy(:identifier).find
30
31
  assert_equal(expected, fetched.street, "Address street not saved")
31
32
  end