Module: ODDB::View::Companies::FiPiMethods

Included in:
FiPiCsv, FiPiOverviewList
Defined in:
src/view/companies/fipi_overview.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) date_fi_de(model)



20
21
22
# File 'src/view/companies/fipi_overview.rb', line 20

def date_fi_de(model)
  info_date(model, :fachinfo, :de)
end

- (Object) date_fi_fr(model)



23
24
25
# File 'src/view/companies/fipi_overview.rb', line 23

def date_fi_fr(model)
  info_date(model, :fachinfo, :fr)
end

- (Object) date_pi_de(model)



26
27
28
# File 'src/view/companies/fipi_overview.rb', line 26

def date_pi_de(model)
  info_date(model, :patinfo, :de)
end

- (Object) date_pi_fr(model)



29
30
31
# File 'src/view/companies/fipi_overview.rb', line 29

def date_pi_fr(model)
  info_date(model, :patinfo, :fr)
end

- (Object) info_date(model, type, language)



13
14
15
16
17
18
19
# File 'src/view/companies/fipi_overview.rb', line 13

def info_date(model, type, language)
  if((info = model.send(type)) \
     && (lang = info.descriptions[language.to_s]) \
     && (chapter = lang.date))
    chapter.sections.first.to_s[/\S+\s\d{4}/u]
  end
end

- (Object) swissmedic_numbers(model)



32
33
34
35
36
37
38
# File 'src/view/companies/fipi_overview.rb', line 32

def swissmedic_numbers(model)
  if(fi = model.fachinfo)
    fi.iksnrs.join(', ')
  else
    model.iksnr
  end
end