Class: ODDB::Html::View::Drugs::Ajax::PackageInfos

Inherits:
HtmlGrid::Composite
  • Object
show all
Includes:
PackageMethods
Defined in:
lib/oddb/html/view/drugs/ajax/package_infos.rb

Constant Summary collapse

LABELS =
true
LEGACY_INTERFACE =
false
COMPONENTS =
{
  [0,0]   => :code_festbetragsgruppe,
  [0,1,0] => :code_festbetragsstufe,
  [1,1,0] => :opener_festbetragsstufe,
  [1,1,1] => :info_festbetragsstufe,
  [0,2,0] => :code_zuzahlungsbefreit,
  [1,2,0] => :opener_zuzahlungsbefreit,
  [1,2,1] => :info_zuzahlungsbefreit,
  [0,3]   => :code_prescription,
}
CSS_MAP =
{
  [0,1,1,2] => 'top',
}

Instance Method Summary collapse

Methods included from PackageMethods

#active_agents, #adjust_price, #code_boolean, #code_registration, #ddd_prices, #fachinfo_link, #feedback, #patinfo_link, #price_difference, #price_exfactory, #price_festbetrag, #price_public, #price_zuzahlung, #product, #product_local, #product_remote, #row_css, #size

Instance Method Details

#code_festbetragsgruppe(model) ⇒ Object



29
30
31
32
33
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 29

def code_festbetragsgruppe(model)
  if(code = super)
    link_festbetrag(code)
  end
end

#code_festbetragsstufe(model) ⇒ Object



34
35
36
37
38
39
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 34

def code_festbetragsstufe(model)
  if(code = super)
    link_festbetrag(sprintf("%s: %s", code, 
                    @lookandfeel.lookup("festbetragsstufe_#{code}")))
  end
end

#code_prescription(model) ⇒ Object



40
41
42
43
44
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 40

def code_prescription(model)
  value = HtmlGrid::Value.new(:prescription, model, @session, self) 
  value.value = super
  value
end

#code_zuzahlungsbefreit(model) ⇒ Object



45
46
47
48
49
50
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 45

def code_zuzahlungsbefreit(model)
  link = link_zuzahlungsbefreit(model)
  link.value = super
  link.label = true
  link
end

#info_festbetragsstufe(model) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 51

def info_festbetragsstufe(model)
  source = link_festbetrag('')
  source.value = source.href
  txt = @lookandfeel.lookup(:tt_code_festbetragsstufe).strip
  hidden = HtmlGrid::Div.new(model, @session, self)
  hidden.value = [ txt, source ]
  hidden.set_attribute('style', 'display:none')
  hidden.css_id = "info_festbetragsstufe#{model.code(:cid)}"
  hidden.css_class = "hidden"
  hidden
end

#info_zuzahlungsbefreit(model) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 62

def info_zuzahlungsbefreit(model)
  source = link_zuzahlungsbefreit(model)
  source.value = source.href
  txt = @lookandfeel.lookup(:tt_code_zuzahlungsbefreit).strip
  hidden = HtmlGrid::Div.new(model, @session, self)
  hidden.value = [ txt, source ]
  hidden.set_attribute('style', 'display:none')
  hidden.css_id = "info_zuzahlungsbefreit#{model.code(:cid)}"
  hidden.css_class = "hidden"
  hidden
end


73
74
75
76
77
78
79
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 73

def link_festbetrag(code)
  link = HtmlGrid::Link.new(:festbetrag, model, @session, self)
  link.value = code
  link.href = "http://www.die-gesundheitsreform.de/glossar/festbetraege.html"
  link.label = true
  link
end


80
81
82
83
84
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 80

def link_zuzahlungsbefreit(model)
  link = HtmlGrid::Link.new(:zuzahlungsbefreit, model, @session, self)
  link.href = "https://www.gkv-spitzenverband.de/Befreiungsliste_Arzneimittel_Versicherte.gkvnet"
  link
end

#opener(code, type) ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 85

def opener(code, type)
  span = HtmlGrid::Span.new(nil, @session, self)
  span.value = @lookandfeel.lookup(:more)
  widget = "package_infos#{code}_widget"
  hidden = "info_#{type}#{code}"
  span.onclick = "open_explanation('#{widget}', '#{hidden}', this)"
  span.css_class = 'opener'
  span
end

#opener_festbetragsstufe(model) ⇒ Object



94
95
96
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 94

def opener_festbetragsstufe(model)
  opener(@model.code(:cid), :festbetragsstufe)
end

#opener_zuzahlungsbefreit(model) ⇒ Object



97
98
99
# File 'lib/oddb/html/view/drugs/ajax/package_infos.rb', line 97

def opener_zuzahlungsbefreit(model)
  opener(@model.code(:cid), :zuzahlungsbefreit)
end