Class: CaTissue::CollectionProtocolRegistration
- Inherits:
-
Object
- Object
- CaTissue::CollectionProtocolRegistration
- Includes:
- CaRuby::Resource::Unique, Resource
- Defined in:
- lib/catissue/domain/collection_protocol_registration.rb,
lib/catissue/domain/uniquify.rb
Overview
The CollectionProtocolRegistration domain class.
Instance Method Summary collapse
-
#consent_available ⇒ Object
Returns whether the consent available flag is equal to the String ‘true’.
-
#consent_available=(value) ⇒ Object
Sets the consent available flag to the specified value.
-
#consent_tier_responses ⇒ Java::JavaUtil::Set
caTissue alert - Bug #64: Some domain collection properties not initialized.
-
#delete ⇒ Object
Removes associations to this registration.
-
#initialize(params = nil) ⇒ CollectionProtocolRegistration
constructor
A new instance of CollectionProtocolRegistration.
-
#protocol_participant_identifier=(value) ⇒ Object
Sets the consent available flag to the specified value.
-
#specimens ⇒ Object
All specimens collected for this CollectionProtocolRegistration.
-
#uniquify ⇒ Object
Makes this CPR’s PPI unique.
Methods included from Resource
#database, included, #tolerant_match?
Methods included from Annotatable
#annotation_proxy, #create_proxy, #method_missing
Constructor Details
#initialize(params = nil) ⇒ CollectionProtocolRegistration
Returns a new instance of CollectionProtocolRegistration.
77 78 79 80 81 82 83 84 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 77 def initialize(params=nil) super # following line works around an obscure problem whereby CPR init could not call consent_tier_responses below; # TODO - verify that it is still necessary respond_to?(:consent_tier_responses) # work around caTissue Bug #64 self. ||= 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
#consent_available ⇒ Object
Returns whether the consent available flag is equal to the String ‘true’. This method converts the caTissue String to a Boolean.
21 22 23 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 21 def getIsConsentAvailable == 'true' end |
#consent_available=(value) ⇒ Object
Sets the consent available flag to the specified value. A Boolean value is converted to a String.
26 27 28 29 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 26 def (value) value = value.to_s if value setIsConsentAvailable(value) end |
#consent_tier_responses ⇒ Java::JavaUtil::Set
caTissue alert - Bug #64: Some domain collection properties not initialized. Initialize consent_tier_responses if necessary.
15 16 17 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 15 def getConsentTierResponseCollection or (self. = Java::JavaUtil::LinkedHashSet.new) end |
#delete ⇒ Object
Removes associations to this registration
87 88 89 90 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 87 def delete participant.collection_registrations.delete(self) if participant protocol.registrations.delete(self) if protocol end |
#protocol_participant_identifier=(value) ⇒ Object
Sets the consent available flag to the specified value. An Integer value is converted to a String.
32 33 34 35 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 32 def protocol_participant_identifier=(value) value = value.to_s if value setProtocolParticipantIdentifier(value) end |
#specimens ⇒ Object
Returns all specimens collected for this CollectionProtocolRegistration.
93 94 95 |
# File 'lib/catissue/domain/collection_protocol_registration.rb', line 93 def specimens Flattener.new(specimen_collection_groups.map { |group| group.specimens }) end |
#uniquify ⇒ Object
Makes this CPR’s PPI unique.
32 33 34 35 36 37 |
# File 'lib/catissue/domain/uniquify.rb', line 32 def uniquify oldval = protocol_participant_identifier || return newval = uniquify_value(oldval) self.protocol_participant_identifier = newval logger.debug { "Reset #{qp} PPI from #{oldval} to unique value #{newval}." } end |