Class: ODDB::FiParse::FachinfoHpricot

Inherits:
TextinfoHpricot show all
Defined in:
ext/fiparse/src/fachinfo_hpricot.rb

Instance Attribute Summary collapse

Attributes inherited from TextinfoHpricot

#company, #name

Instance Method Summary collapse

Methods inherited from TextinfoHpricot

#chapter, #extract

Instance Attribute Details

#amzvObject (readonly)

Returns the value of attribute amzv.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def amzv
  @amzv
end

#compositionObject (readonly)

Returns the value of attribute composition.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def composition
  @composition
end

#contra_indicationsObject (readonly)

Returns the value of attribute contra_indications.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def contra_indications
  @contra_indications
end

#dateObject (readonly)

Returns the value of attribute date.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def date
  @date
end

#driving_abilityObject (readonly)

Returns the value of attribute driving_ability.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def driving_ability
  @driving_ability
end

#effectsObject (readonly)

Returns the value of attribute effects.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def effects
  @effects
end

#galenic_formObject (readonly)

Returns the value of attribute galenic_form.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def galenic_form
  @galenic_form
end

#iksnrsObject (readonly)

Returns the value of attribute iksnrs.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def iksnrs
  @iksnrs
end

#indicationsObject (readonly)

Returns the value of attribute indications.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def indications
  @indications
end

#interactionsObject (readonly)

Returns the value of attribute interactions.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def interactions
  @interactions
end

#kineticObject (readonly)

Returns the value of attribute kinetic.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def kinetic
  @kinetic
end

#other_adviceObject (readonly)

Returns the value of attribute other_advice.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def other_advice
  @other_advice
end

#overdoseObject (readonly)

Returns the value of attribute overdose.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def overdose
  @overdose
end

#pregnancyObject (readonly)

Returns the value of attribute pregnancy.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def pregnancy
  @pregnancy
end

#restrictionsObject (readonly)

Returns the value of attribute restrictions.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def restrictions
  @restrictions
end

#unwanted_effectsObject (readonly)

Returns the value of attribute unwanted_effects.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def unwanted_effects
  @unwanted_effects
end

#usageObject (readonly)

Returns the value of attribute usage.



10
11
12
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 10

def usage
  @usage
end

Instance Method Details

#identify_chapter(code, chapter) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 14

def identify_chapter(code, chapter)
  case code
  when '6900'
    @amzv = chapter
  when '3300', '7000'
    @composition = chapter
  when '7050'
    @galenic_form = chapter
  when '7100'
    @indications = chapter
  when '7200'
    @contra_indications = chapter
  when '4400', '7250'
    @restrictions = chapter
  when '3500', '7550'
    @effects = chapter
  when '4000', '7100'
    @indications = chapter
  when '4200', '7150'
    @usage = chapter
  when '3700', '7600'
    @kinetic = chapter
  when '4700', '7450'
    @unwanted_effects = chapter
  when '4800', '7300'
    @interactions = chapter
  when '7350'
    @pregnancy = chapter
  when '7400'
    @driving_ability = chapter
  when '5000', '7500'
    @overdose = chapter
  when '5200', '7700'
    @other_advice = chapter
  when '5998', '7750'
    @iksnrs = chapter
  when '6100', '8000'
    @date = chapter
  when '7650'
    @preclinic = chapter
  when '7850'
    @registration_owner = chapter
  when '5610', '7860'
    @fabrication = chapter
  when '7870'
    @delivery = chapter
  when '5595'
    @distribution = chapter
  when nil # special chapers without heading
    @galenic_form ||= chapter
  else
    raise "Unknown chapter-code #{code}, while parsing #{@name}"
  end
end

#to_textinfoObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'ext/fiparse/src/fachinfo_hpricot.rb', line 68

def to_textinfo
  fi = if(@amzv)
    fi = FachinfoDocument2001.new
    fi.amzv = @amzv
    fi.contra_indications = @contra_indications
    fi.pregnancy = @pregnancy
    fi.registration_owner = @registration_owner
    fi.driving_ability = @driving_ability
    fi.preclinic = @preclinic
    fi
  else
    fi = FachinfoDocument.new
    fi
  end
  fi.name = @name
  fi.galenic_form = @galenic_form
  fi.effects = @effects
  fi.kinetic = @kinetic
  fi.indications = @indications
  fi.usage	= @usage
  fi.restrictions = @restrictions
  fi.unwanted_effects = @unwanted_effects
  fi.interactions = @interactions
  fi.overdose = @overdose
  fi.other_advice = @other_advice
  fi.composition	= @composition
  fi.packages = @packages
  fi.reference = @reference
  fi.delivery = @delivery
  fi.distribution = @distribution
  fi.fabrication = @fabrication
  fi.iksnrs = @iksnrs
  fi.date = @date
  fi
end