Module: ODDB::View::Admin::RegistrationSequenceList

Includes:
ODDB::View::AdditionalInformation
Included in:
AssignDeprivedSequenceForm, ComformPackages, OrphanedPatinfoSequences, RegistrationSequences, RootRegistrationSequences
Defined in:
src/view/admin/registration.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :seqnr,
  [1,0] =>  :name_base,
  [2,0] =>  :name_descr,
  [3,0] =>  :galenic_form,
  [4,0] =>  :atc_class,
  [5,0] =>  :patinfo,
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0,6] =>  'list',
}
DEFAULT_CLASS =
HtmlGrid::Value
DEFAULT_HEAD_CLASS =
'subheading'
EVENT =
:new_sequence
SORT_HEADER =
false
SORT_DEFAULT =
:seqnr
SYMBOL_MAP =
{
  :seqnr  => View::PointerLink,
}

Instance Method Summary (collapse)

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, #limitation_text, #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

Instance Method Details

- (Object) atc_class(model, session = @session)



43
44
45
46
47
# File 'src/view/admin/registration.rb', line 43

def atc_class(model, session=@session)
  if atc = model.atc_class
    atc.code
  end
end

- (Object) galenic_form(model, session = @session)



48
49
50
51
52
53
54
55
56
57
58
# File 'src/view/admin/registration.rb', line 48

def galenic_form(model, session=@session)
  lang = @session.language
  model.compositions.collect { |comp|
    galform = (gf = comp.galenic_form) ? gf.send(lang) : ''
    agents = comp.active_agents.collect { |act|
      substance = (sub = act.substance) ? sub.send(lang) : nil
      [substance, act.dose].compact.join ' '
    }.join ', '
    "#{galform} (#{agents})"
  }.join ' + '
end

- (Object) seqnr(model, session = @session)



59
60
61
62
63
64
65
66
67
68
69
70
# File 'src/view/admin/registration.rb', line 59

def seqnr(model, session=@session)
  if(@session.allowed?('edit', model))
    PointerLink.new(:seqnr, model, @session, self)
  else
    evt = @session.state.respond_to?(:suggest_choose) ? :suggest_choose : :show
    link = HtmlGrid::Link.new(:seqnr, model, @session, self)
    args = {:pointer => model.pointer}
    link.href = @lookandfeel.event_url(evt, args)
    link.value = model.seqnr
    link
  end
end