Class: ODDB::View::Analysis::PositionInnerComposite

Inherits:
HtmlGrid::Composite show all
Includes:
ODDB::View::AdditionalInformation, DataFormat
Defined in:
src/view/analysis/position.rb

Constant Summary

SYMBOL_MAP =
{
  :feedback_label =>  HtmlGrid::LabelText,
}
COMPONENTS =
{
  [0,0]   => :code,
  [0,1]   => :anonymous,
  [0,2]   => :analysis_revision,
  [0,3,0] =>  :description,
  [1,3,0] =>  "nbsp",
  [1,3,1] =>  :google_search,
  [0,4]   => :taxpoints,
  [0,5]   => :lab_areas,
  [0,6]   => :limitation_text,
  [0,7]   => :finding,
  [0,8]   => :taxnote, 
#   [0,7]    =>  :feedback_label,
#   [1,7]    =>  :feedback,
  [0,9]   => :footnote,
}
CSS_CLASS =
''
CSS_MAP =
{
  [0,0,1,10]    =>  'list top',
  [1,0,1,10]    =>  'list',
}
LABELS =
true
DEFAULT_CLASS =
HtmlGrid::Value
LEGACY_INTERFACE =
false

Instance Method Summary (collapse)

Methods included from DataFormat

#breakline, #company_name, #most_precise_dose, #name_base, #price, #price_exfactory, #price_public

Methods included from ExternalLinks

#contact_link, #data_declaration, #external_link, #faq_link, #generic_definition, #help_link, #legal_note, #meddrugs_update, #wiki_link

Methods included from ODDB::View::AdditionalInformation

#_fachinfo, #atc_ddd_link, #atc_description, #comarketing, #complementary_type, #compositions, #ddd_price, #deductible, #fachinfo, #feedback, #google_search, #ikscat, #limitation_link, #minifi, #narcotic, #notify, #patent, #patinfo, #qty_unit, #square, #twitter_share

Methods included from PartSize

#comparable_size, #part_size

Methods included from Drugs::AtcDddLink

#atc_ddd_link

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) anonymous(model, key = :anonymous)



110
111
112
113
114
115
116
# File 'src/view/analysis/position.rb', line 110

def anonymous(model, key = :anonymous)
    value = HtmlGrid::Value.new(key, model, @session, self)
    if(model.anonymous)
      value.value = [model.anonymousgroup.dup, model.anonymouspos].join('.')
    end
    value
end

- (Object) description(model, key = :description)



117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'src/view/analysis/position.rb', line 117

def description(model, key = :description)
  value = HtmlGrid::Value.new(key, model, @session, self)
  if(model && (str = model.send(@session.language)))
    value.value = str.gsub(/(\d{4})\.(\d{2})/u) {
      group_code = $~[1]
      pos_code = $~[2]
      ptr = Persistence::Pointer.new([:analysis_group, group_code])
      ptr += [:position, pos_code]
      args = {:pointer => ptr}
      '<a class="list" href="' << @lookandfeel._event_url(:resolve, args) << '">' << $~[0] << '</a>'
    }
  end
  value
end

- (Object) footnote(model)



137
138
139
# File 'src/view/analysis/position.rb', line 137

def footnote(model)
  description(model.footnote, :footnote)
end

- (Object) limitation_text(model)



131
132
133
# File 'src/view/analysis/position.rb', line 131

def limitation_text(model)
  description(model.limitation_text, :limitation)
end

- (Object) taxnote(model)



134
135
136
# File 'src/view/analysis/position.rb', line 134

def taxnote(model)
  description(model.taxnote, :taxnote)
end

- (Object) taxpoints(model, key = :taxpoints)



140
141
142
143
144
145
146
# File 'src/view/analysis/position.rb', line 140

def taxpoints(model, key = :taxpoints)
  value = HtmlGrid::Value.new(key, model, @session, self)
  effective_tax = sprintf("%1.2f", (model.taxpoints.to_i * 0.9).to_s)
  
  value.value = model.taxpoints.to_s + ' (' + model.taxpoints.to_s + ' x 0.90 CHF = ' + effective_tax  + ' CHF)'
  value
end