Class: ODDB::VaccinePlugin::ParsedSequence

Inherits:
Object
  • Object
show all
Defined in:
src/plugin/vaccines.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ParsedSequence) initialize

A new instance of ParsedSequence



78
79
80
81
# File 'src/plugin/vaccines.rb', line 78

def initialize
  @packages = {}
  @active_agents = []
end

Instance Attribute Details

- (Object) active_agents (readonly)

Returns the value of attribute active_agents



75
76
77
# File 'src/plugin/vaccines.rb', line 75

def active_agents
  @active_agents
end

- (Object) atc_class

Returns the value of attribute atc_class



74
75
76
# File 'src/plugin/vaccines.rb', line 74

def atc_class
  @atc_class
end

- (Object) dose



99
100
101
102
103
# File 'src/plugin/vaccines.rb', line 99

def dose
  @dose || if(match = DOSE_PATTERN.match(name.to_s))
    Dose.new(match[1], match[2])
  end
end

- (Object) name

Returns the value of attribute name



74
75
76
# File 'src/plugin/vaccines.rb', line 74

def name
  @name
end

- (Object) packages (readonly)

Returns the value of attribute packages



75
76
77
# File 'src/plugin/vaccines.rb', line 75

def packages
  @packages
end

- (Object) seqnr

Returns the value of attribute seqnr



74
75
76
# File 'src/plugin/vaccines.rb', line 74

def seqnr
  @seqnr
end

Instance Method Details

- (Object) assign_seqnr_by_ikscd(registration)



82
83
84
85
86
87
88
# File 'src/plugin/vaccines.rb', line 82

def assign_seqnr_by_ikscd(registration)
  @packages.each_key { |ikscd|
    if(pack = registration.package(ikscd))
      return @seqnr = pack.sequence.seqnr
    end
  }
end

- (Object) data



89
90
91
92
93
94
95
96
97
98
# File 'src/plugin/vaccines.rb', line 89

def data
  data = {
    :name  => @name,
    :dose  => self.dose,
  }
  if(@atc_class)
    data.store(:atc_class, @atc_class)
  end
  data
end

- (Object) dup



107
108
109
110
111
112
# File 'src/plugin/vaccines.rb', line 107

def dup
  dp = ParsedSequence.new
  dp.name = @name
  dp.atc_class = @atc_class
  dp
end

- (Object) ikscds



104
105
106
# File 'src/plugin/vaccines.rb', line 104

def ikscds
  @packages.keys
end