Class: CaTissue::CollectionProtocolEvent

Inherits:
Object
  • Object
show all
Includes:
HashCode, Resource
Defined in:
lib/catissue/domain/collection_protocol_event.rb

Overview

The CollectionProtocolRegistration domain class.

Constant Summary collapse

DEFAULT_EVENT_POINT =

The event point used for saving this CollectionProtocolEvent if none other is set.

1.0

Instance Method Summary collapse

Methods included from Resource

#database, included, #tolerant_match?

Methods included from Annotatable

#annotation_proxy, #create_proxy, #method_missing

Methods included from HashCode

#==, #hash

Constructor Details

#initialize(params = nil) ⇒ CollectionProtocolEvent

Returns a new instance of CollectionProtocolEvent.



43
44
45
46
47
48
# File 'lib/catissue/domain/collection_protocol_event.rb', line 43

def initialize(params=nil)
  super
  respond_to?(:specimen_collection_groups)
  # work around caTissue Bug #64
  self.specimen_collection_groups ||= Java::JavaUtil::LinkedHashSet.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CaTissue::Annotatable

Instance Method Details

#deleteObject

Removes associations to this registration



51
52
53
# File 'lib/catissue/domain/collection_protocol_event.rb', line 51

def delete
  protocol.events.delete(self) if protocol
end

#direct_dependents(attribute) ⇒ Object

Overrides CaRuby::Resource#references in the case of the specimen_requirements attribute to select only top-level SpecimenRequirements not derived from another SpecimenRequirement.



57
58
59
60
61
62
63
# File 'lib/catissue/domain/collection_protocol_event.rb', line 57

def direct_dependents(attribute)
  if attribute == :specimen_requirements then
    super.reject { |spc| spc.parent }
  else
    super
  end
end

#specimen_collection_groupsJava::JavaUtil::Set

caTissue alert - Bug #64: Some domain collection properties not initialized. Initialize specimen_collection_groups if necessary.

Returns:

  • (Java::JavaUtil::Set)

    the SCGs



16
17
18
# File 'lib/catissue/domain/collection_protocol_event.rb', line 16

def specimen_collection_groups
  getSpecimenCollectionGroupCollection or (self.specimen_collection_groups = Java::JavaUtil::LinkedHashSet.new)
end