Class: ODDB::GalenicForm

Inherits:
Object show all
Includes:
Comparable, ODBA::Persistable, Language, OddbYaml, SequenceObserver
Defined in:
src/model/galenicform.rb,
ext/export/src/oddb_yaml.rb,
test/test_model/galenicform.rb

Constant Summary

ODBA_SERIALIZABLE =
[ '@descriptions', '@synonyms' ]
EXPORT_PROPERTIES =
[
  '@oid',
  '@descriptions',
  '@galenic_group',
]

Constants included from OddbYaml

EXPORT_PROPERTIES, YAML_URI

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from OddbYaml

#to_yaml_properties, #to_yaml_type

Methods included from SequenceObserver

#add_sequence, #empty?, #initialize, #remove_sequence

Methods included from Language

#all_descriptions, #has_description?, #init, #synonyms, #synonyms=

Methods included from SimpleLanguage

#description, #descriptions, #has_description?, #match, #method_missing, #respond_to?, #search_text, #to_s, #update_values

Methods included from Persistence

#initialize

Methods included from PersistenceMethods

#checkout, #data_origin, #data_origins, #diff, #init, #nil_if_empty, #parent, #pointer_descr, #structural_ancestors, #undiffable?, #update_values

Constructor Details

This class inherits a constructor from ODDB::SequenceObserver

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ODDB::SimpleLanguage

Instance Attribute Details

- (Object) galenic_group

Returns the value of attribute galenic_group



9
10
11
# File 'src/model/galenicform.rb', line 9

def galenic_group
  @galenic_group
end

- (Object) sequences=(value) (writeonly)

Sets the attribute sequences

Parameters:

  • value

    the value to set the attribute sequences to.



14
15
16
# File 'test/test_model/galenicform.rb', line 14

def sequences=(value)
  @sequences = value
end

Instance Method Details

- (Object) <=>(other)



42
43
44
# File 'src/model/galenicform.rb', line 42

def <=>(other)
  to_s <=> other.to_s
end

- (Object) adjust_types(values, app = nil)



46
47
48
49
50
51
52
53
54
55
# File 'src/model/galenicform.rb', line 46

def adjust_types(values, app=nil)
  values = values.dup
  values.each { |key, value|
    case(key)
    when :galenic_group
      values[key] = value.resolve(app)
    end
  }
  values
end

- (Boolean) equivalent_to?(other)

Returns:

  • (Boolean)


16
17
18
# File 'src/model/galenicform.rb', line 16

def equivalent_to?(other)
  (self == other) || (@galenic_group == other.galenic_group)
end

- (Object) merge(other)



25
26
27
28
29
30
31
32
33
34
35
# File 'src/model/galenicform.rb', line 25

def merge(other)
  other.sequences.dup.each { |seq|
    seq.compositions.each do |comp|
      if comp.galenic_form == other
        comp.galenic_form = self
        comp.odba_isolated_store
      end
    end
  }
  self.synonyms += other.all_descriptions - self.all_descriptions
end

- (Object) route_of_administration



36
37
38
# File 'src/model/galenicform.rb', line 36

def route_of_administration
  @galenic_group.route_of_administration if(@galenic_group)
end

- (Object) sequence_count



39
40
41
# File 'src/model/galenicform.rb', line 39

def sequence_count
  @sequences.size
end

- (Object) sequences (writeonly)