Class: ODDB::FiParse::FachinfoHpricot

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from TextinfoHpricot

#chapter, #extract

Instance Attribute Details

- (Object) amzv (readonly)

Returns the value of attribute amzv



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

def amzv
  @amzv
end

- (Object) composition (readonly)

Returns the value of attribute composition



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

def composition
  @composition
end

- (Object) contra_indications (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

- (Object) date (readonly)

Returns the value of attribute date



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

def date
  @date
end

- (Object) driving_ability (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

- (Object) effects (readonly)

Returns the value of attribute effects



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

def effects
  @effects
end

- (Object) galenic_form (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

- (Object) iksnrs (readonly)

Returns the value of attribute iksnrs



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

def iksnrs
  @iksnrs
end

- (Object) indications (readonly)

Returns the value of attribute indications



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

def indications
  @indications
end

- (Object) interactions (readonly)

Returns the value of attribute interactions



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

def interactions
  @interactions
end

- (Object) kinetic (readonly)

Returns the value of attribute kinetic



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

def kinetic
  @kinetic
end

- (Object) other_advice (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

- (Object) overdose (readonly)

Returns the value of attribute overdose



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

def overdose
  @overdose
end

- (Object) pregnancy (readonly)

Returns the value of attribute pregnancy



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

def pregnancy
  @pregnancy
end

- (Object) restrictions (readonly)

Returns the value of attribute restrictions



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

def restrictions
  @restrictions
end

- (Object) unwanted_effects (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

- (Object) usage (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

- (Object) identify_chapter(code, chapter)



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

- (Object) to_textinfo



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