Class: ODDB::Sequence

Inherits:
SequenceCommon show all
Includes:
OddbYaml
Defined in:
ext/export/src/oddb_yaml.rb,
src/model/sequence.rb,
test/test_util/oddbapp.rb

Overview

< SequenceCommon

Constant Summary

ACTIVE_AGENT =
ActiveAgent
ODBA_PREFETCH =
true
PACKAGE =
Package
EXPORT_PROPERTIES =
[
  '@seqnr',
  '@name_base',
  '@name_descr',
  '@atc_class',
  '@composition_text',
  '@compositions',
  '@packages',
]

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 inherited from SequenceCommon

#_violates_patent?, #active?, #active_agents, #active_package_count, #active_packages, #active_patinfo, #adjust_types, #basename, #checkout, #comparable?, #comparables, #composition, #create_composition, #create_package, #delete_composition, #delete_package, #doses, #each_package, #factored_compositions, #fix_pointers, #galenic_forms, #galenic_group, #galenic_groups, #has_patinfo?, #has_public_packages?, #indication, #indication=, #initialize, #limitation_text, #limitation_text_count, #localized_name, #match, #name, #name=, #out_of_trade, #package, #package_count, #patinfo_active?, #public?, #public_package_count, #public_packages, registration_data, #route_of_administration, #search_terms, #substance_names, #substances, #violates_patent?

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::SequenceCommon

Instance Attribute Details

- (Object) packages

Returns the value of attribute packages



39
40
41
# File 'test/test_util/oddbapp.rb', line 39

def packages
  @packages
end

- (Object) patinfo_shadow

Returns the value of attribute patinfo_shadow



339
340
341
# File 'src/model/sequence.rb', line 339

def patinfo_shadow
  @patinfo_shadow
end

Instance Method Details

- (Object) atc_class=(atc_class)



343
344
345
346
347
# File 'src/model/sequence.rb', line 343

def atc_class=(atc_class)
  unless(atc_class.nil?)
    @atc_class = replace_observer(@atc_class, atc_class)
  end
end

- (Object) composition_text



360
361
362
363
364
# File 'src/model/sequence.rb', line 360

def composition_text
  @composition_text || @packages.collect { |cd, pac|
    (src = pac.swissmedic_source) && src[:composition] 
  }.compact.first
end

- (Object) patinfo=(patinfo)



348
349
350
# File 'src/model/sequence.rb', line 348

def patinfo=(patinfo)
  @patinfo = replace_observer(@patinfo, patinfo)
end

- (Object) replace_observer(target, value)



351
352
353
354
355
356
357
358
359
# File 'src/model/sequence.rb', line 351

def replace_observer(target, value)
  if(target.respond_to?(:remove_sequence))
    target.remove_sequence(self)
  end
  if(value.respond_to?(:add_sequence))
    value.add_sequence(self)
  end
  target = value
end