Class: ODDB::View::Drugs::DDDComposite

Inherits:
HtmlGrid::Composite show all
Defined in:
src/view/drugs/ddd.rb

Constant Summary

CSS_CLASS =
'composite'
COMPONENTS =
{
  [0,0] =>  :description,
}
CSS_MAP =
{
  [0,0] =>  'subheading',  
}
DEFAULT_CLASS =
HtmlGrid::Value

Instance Method Summary (collapse)

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) chapter(model)

stay with the official WHO english Version:



56
57
58
# File 'src/view/drugs/ddd.rb', line 56

def chapter(model)
  View::Chapter.new(:en, model, @session, self)
end

- (Object) ddd_guidelines(model, session)



65
66
67
# File 'src/view/drugs/ddd.rb', line 65

def ddd_guidelines(model, session)
  chapter(model.ddd_guidelines)
end

- (Object) ddds(model, session)



62
63
64
# File 'src/view/drugs/ddd.rb', line 62

def ddds(model, session)
  View::Drugs::DDDList.new(model.ddds.values, session, self)
end

- (Object) description(model, session)



59
60
61
# File 'src/view/drugs/ddd.rb', line 59

def description(model, session)
  [ model.code, model.en ].join(' - ')
end

- (Object) guidelines(model, session)



68
69
70
# File 'src/view/drugs/ddd.rb', line 68

def guidelines(model, session)
  chapter(model.guidelines)
end

- (Object) init



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'src/view/drugs/ddd.rb', line 36

def init
  y = 1
  if(@model.guidelines)
    pos = [0,y]
    components.store(pos, :guidelines)
    css_map.store(pos, 'list')
    y += 1
  end
  unless(@model.ddds.empty?)
    components.store([0,y], :ddds)
    y += 1
  end
  if(@model.ddd_guidelines)
    pos = [0,y]
    components.store(pos, :ddd_guidelines)
    css_map.store(pos, 'list bg')
  end
  super
end