Class: CaTissue::SpecimenCharacteristics

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/catissue/migration/shims.rb,
lib/catissue/domain/specimen_characteristics.rb

Defined Under Namespace

Classes: TissueSide

Constant Summary collapse

@@tissue_site_cv_finder =
nil

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

#database, included, #tolerant_match?

Methods included from Annotatable

#annotation_proxy, #create_proxy, #method_missing

Dynamic Method Handling

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

Class Method Details

.tissue_site_controlled_value(value) ⇒ Object

Returns the tissue site controlled value as follows:

  • If CV lookup is disabled, then this method returns value.

  • Otherwise, if the value is remapped via a configuration remap file, then this method returns the remapped CV.

  • Otherwise, if the value is a valid CV, then this method returns value.

  • Otherwise, this method returns nil.

Returns:

  • the caTissue tissue site permissible value



47
48
49
# File 'lib/catissue/migration/shims.rb', line 47

def self.tissue_site_controlled_value(value)
  @@tissue_site_cv_finder.nil? ? value : @@tissue_site_cv_finder.controlled_value(value)
end

.tissue_site_cv_finder=(finder) ⇒ Object

Sets this SpecimenCharacteristics tissue site ControlledValueFinder.



35
36
37
# File 'lib/catissue/migration/shims.rb', line 35

def self.tissue_site_cv_finder=(finder)
  @@tissue_site_cv_finder = finder
end

Instance Method Details

#migrate_tissue_site(value, row) ⇒ Object

Returns the #tissue_site_controlled_value.



52
53
54
# File 'lib/catissue/migration/shims.rb', line 52

def migrate_tissue_site(value, row)
  standard_cv_tissue_site(value) or variant_cv_tissue_site(value)
end