Class: ODDB::FiParse::TestFachinfoPDFWriter

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
ext/fiparse/test/fachinfo_pdf_test.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



21
22
23
24
25
26
27
28
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 21

def setup
  @writer = FachinfoPDFWriter.new
 #        @parser = Rpdf2txt::Parser.new(File.read(File.expand_path("../fiparse/test/data/pdf/test_file1.pdf")))
 #    @parser.extract_text(@fachinfo_pdf)
  path = File.expand_path('../test/data/method_calls.rb',File.dirname(__FILE__))
  eval(File.read(path))
  @fachinfo = @writer.to_fachinfo
end

- (Object) test_composition



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 33

def test_composition
  chapter = @fachinfo.composition
  assert_equal('Zusammensetzung', chapter.heading)

  section1 = chapter.sections.first
  assert_equal('Wirkstoffe:', section1.subheading)
  assert_equal(1, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = 'Chlorphenamini maleas, Phenylephrini hydrochloridum.'
  assert_equal(expected, paragraph1.text)
  section2 = chapter.sections.last
  assert_equal('Hilfsstoffe:', section2.subheading)
  assert_equal(1, section2.paragraphs.size)
  paragraph2 = section2.paragraphs.first
  expected = 'Saccharum 253,4 mg; Color.: E 127, E 132; Excip. pro caps. gelat.'
  assert_equal(expected, paragraph2.text)
end

- (Object) test_contra_indications



74
75
76
77
78
79
80
81
82
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 74

def test_contra_indications
  chapter = @fachinfo.contra_indications
  assert_equal('Kontraindikationen',chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Einnahme von MAO-Hemmern.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_date



294
295
296
297
298
299
300
301
302
303
304
305
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 294

def test_date
  chapter = @fachinfo.date
  assert_equal('Stand der Information', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Oktober 2003.'
  assert_equal(expected, paragraph1.text)
  paragraph2 = section1.paragraphs.at(1)
  paragraph3 = section1.paragraphs.at(2)
  assert_equal(nil, paragraph3)
end

- (Object) test_driving_ability



123
124
125
126
127
128
129
130
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 123

def test_driving_ability
  chapter = @fachinfo.driving_ability
  assert_equal('Wirkung auf die Fahrtüchtigkeit und auf das Bedienen von Maschinen', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  assert_equal('Wenn auch die sedierende Wirkung des Antihistaminikums nur gering ist, dies um so mehr als es in Retard-Form angewandt wird, kann Rhinopront N die Reaktionsfähigkeit vermindern: beim Autofahren und Bedienen von Maschinen ist Vorsicht geboten.', paragraph1.text)
end

- (Object) test_effects



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 210

def test_effects
  chapter = @fachinfo.effects
  assert_equal('Eigenschaften/Wirkungen',chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'ATC-Code: R01BA53'
  assert_equal(expected, paragraph1.text)
  section2 = chapter.sections.at(1)
  assert_equal("Wirkungsmechanismus\n", section2.subheading)
  paragraph1 = section2.paragraphs.first
  expected = 'Rhinopront N vereinigt die Wirkung von:'
  assert_equal(expected, paragraph1.text)
  paragraph2 = section2.paragraphs.at(1)
  expected = 'einem Antihistaminikum, Chlorphenaminmaleat. Es ist gut verträglich und bringt rasche Linderung der lästigen Erscheinungen des Schnupfens wie Nasenrinnen, Niesen, Kribbeln und Tränenfluss;'
  assert_equal(expected, paragraph2.text)
  paragraph3 = section2.paragraphs.at(2)
  expected = "einem Vasokonstriktor, Phenylephrinhydrochlorid, der abschwellend auf entz\374ndete Nasenschleimhaut wirkt, die verstopften Naseng\344nge befreit und dadurch die Atmung erleichtert."
  assert_equal(expected, paragraph3.text)
  paragraph4 = section2.paragraphs.at(3)
  expected = "Die 10-12 Stunden anhaltende Langzeitwirkung von Rhinopront N beruht auf der Dialyse der Wirkstoffe (Diffucap\256), welche in den Hunderten von Mikrogranula jeder Kapsel enthalten sind. Somit verschafft eine Kapsel, morgens beim Aufstehen eingenommen, eine w\344hrend des ganzen Tages gleichm\344ssig anhaltende Erleichterung; eine zweite, vor dem Schlafengehen, gew\344hrleistet eine ungest\366rte Nachtruhe und am n\344chsten Morgen ein Aufwachen ohne Verstopfung der Nase."
  assert_equal(expected, paragraph4.text)
end

- (Object) test_format



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 306

def test_format
  writer = FachinfoPDFWriter.new
  chapter = Text::Chapter.new 
  section = chapter.next_section
  paragraph = section.next_paragraph
  writer.instance_variable_set('@chapter', chapter)
  writer.instance_variable_set('@section', section)
  writer.instance_variable_set('@paragraph', paragraph)
  font = YAML.load "--- !ruby/object:Rpdf2txt::Font\nattributes:\n!ruby/sym subtype: \"/TrueType\"\n!ruby/sym widths:\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"889\"\n- \"0\"\n- \"0\"\n- \"333\"\n- \"333\"\n- \"0\"\n- \"0\"\n- \"278\"\n- \"333\"\n- \"278\"\n- \"278\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"278\"\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"667\"\n- \"667\"\n- \"722\"\n- \"722\"\n- \"667\"\n- \"611\"\n- \"778\"\n- \"722\"\n- \"278\"\n- \"500\"\n- \"667\"\n- \"556\"\n- \"833\"\n- \"722\"\n- \"778\"\n- \"667\"\n- \"0\"\n- \"722\"\n- \"667\"\n- \"611\"\n- \"722\"\n- \"667\"\n- \"944\"\n- \"0\"\n- \"0\"\n- \"611\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"556\"\n- \"500\"\n- \"556\"\n- \"556\"\n- \"278\"\n- \"556\"\n- \"556\"\n- \"222\"\n- \"222\"\n- \"500\"\n- \"222\"\n- \"833\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"333\"\n- \"500\"\n- \"278\"\n- \"556\"\n- \"500\"\n- \"722\"\n- \"500\"\n- \"500\"\n- \"500\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"737\"\n- \"0\"\n- \"400\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"722\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n!ruby/sym basefont: \"/JEMPEI+Arial\"\n!ruby/sym lastchar: \"252\"\n!ruby/sym fontdescriptor: 199 0 R\n!ruby/sym encoding: \"/WinAnsiEncoding\"\n!ruby/sym firstchar: \"32\"\n!ruby/sym type: \"/Font\"\noid: 200\nsrc: \"200 0 obj\\r<< \\r/Type /Font \\r/Subtype /TrueType \\r/FirstChar 32 \\r/LastChar 252 \\r/Widths [ 278 0 0 0 0 889 0 0 333 333 0 0 278 333 278 278 556 556 556 556 556 \\r556 556 556 556 0 278 278 0 0 0 0 0 667 667 722 722 667 611 778 \\r722 278 500 667 556 833 722 778 667 0 722 667 611 722 667 944 0 \\r0 611 0 0 0 0 0 0 556 556 500 556 556 278 556 556 222 222 500 222 \\r833 556 556 556 0 333 500 278 556 500 722 500 500 500 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 556 0 0 737 0 400 0 0 0 0 0 0 0 0 0 0 556 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r722 0 0 0 0 0 0 0 556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 556 0 0 \\r0 0 0 556 ] \\r/Encoding /WinAnsiEncoding \\r/BaseFont /JEMPEI+Arial \\r/FontDescriptor 199 0 R \\r>> \\rendobj\\r\"\ntarget_encoding: latin1\n"
  writer.new_font(font)
  writer.send_flowing_data("Normaler ")
  writer.send_flowing_data("text ")
  font = YAML.load "--- !ruby/object:Rpdf2txt::Font\nattributes:\n!ruby/sym subtype: \"/TrueType\"\n!ruby/sym widths:\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"278\"\n- \"333\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"667\"\n- \"667\"\n- \"722\"\n- \"722\"\n- \"667\"\n- \"0\"\n- \"778\"\n- \"722\"\n- \"0\"\n- \"500\"\n- \"667\"\n- \"556\"\n- \"833\"\n- \"722\"\n- \"0\"\n- \"667\"\n- \"0\"\n- \"722\"\n- \"667\"\n- \"0\"\n- \"0\"\n- \"667\"\n- \"944\"\n- \"0\"\n- \"0\"\n- \"611\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"556\"\n- \"500\"\n- \"556\"\n- \"556\"\n- \"278\"\n- \"556\"\n- \"556\"\n- \"222\"\n- \"0\"\n- \"500\"\n- \"222\"\n- \"833\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"333\"\n- \"500\"\n- \"278\"\n- \"556\"\n- \"500\"\n- \"722\"\n- \"0\"\n- \"500\"\n- \"500\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n!ruby/sym basefont: \"/JENBGD+Arial,Italic\"\n!ruby/sym lastchar: \"246\"\n!ruby/sym fontdescriptor: 208 0 R\n!ruby/sym encoding: \"/WinAnsiEncoding\"\n!ruby/sym firstchar: \"32\"\n!ruby/sym type: \"/Font\"\noid: 207\nsrc: \"207 0 obj\\r<< \\r/Type /Font \\r/Subtype /TrueType \\r/FirstChar 32 \\r/LastChar 246 \\r/Widths [ 278 0 0 0 0 0 0 0 0 0 0 0 278 333 0 0 0 556 556 0 0 0 0 0 0 0 278 \\r0 0 0 0 0 0 667 667 722 722 667 0 778 722 0 500 667 556 833 722 \\r0 667 0 722 667 0 0 667 944 0 0 611 0 0 0 0 0 0 556 556 500 556 \\r556 278 556 556 222 0 500 222 833 556 556 556 0 333 500 278 556 \\r500 722 0 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 556 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 556 ] \\r/Encoding /WinAnsiEncoding \\r/BaseFont /JENBGD+Arial,Italic \\r/FontDescriptor 208 0 R \\r>> \\rendobj\\r\"\ntarget_encoding: latin1\n"
  writer.new_font(font)
  writer.send_flowing_data("ich bin ")
  writer.send_flowing_data("kursiv ")
  font = YAML.load "--- !ruby/object:Rpdf2txt::Font\nattributes:\n!ruby/sym subtype: \"/TrueType\"\n!ruby/sym widths:\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"889\"\n- \"0\"\n- \"0\"\n- \"333\"\n- \"333\"\n- \"0\"\n- \"0\"\n- \"278\"\n- \"333\"\n- \"278\"\n- \"278\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"278\"\n- \"278\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"667\"\n- \"667\"\n- \"722\"\n- \"722\"\n- \"667\"\n- \"611\"\n- \"778\"\n- \"722\"\n- \"278\"\n- \"500\"\n- \"667\"\n- \"556\"\n- \"833\"\n- \"722\"\n- \"778\"\n- \"667\"\n- \"0\"\n- \"722\"\n- \"667\"\n- \"611\"\n- \"722\"\n- \"667\"\n- \"944\"\n- \"0\"\n- \"0\"\n- \"611\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"556\"\n- \"500\"\n- \"556\"\n- \"556\"\n- \"278\"\n- \"556\"\n- \"556\"\n- \"222\"\n- \"222\"\n- \"500\"\n- \"222\"\n- \"833\"\n- \"556\"\n- \"556\"\n- \"556\"\n- \"0\"\n- \"333\"\n- \"500\"\n- \"278\"\n- \"556\"\n- \"500\"\n- \"722\"\n- \"500\"\n- \"500\"\n- \"500\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"737\"\n- \"0\"\n- \"400\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"722\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"0\"\n- \"556\"\n!ruby/sym basefont: \"/JEMPEI+Arial\"\n!ruby/sym lastchar: \"252\"\n!ruby/sym fontdescriptor: 199 0 R\n!ruby/sym encoding: \"/WinAnsiEncoding\"\n!ruby/sym firstchar: \"32\"\n!ruby/sym type: \"/Font\"\noid: 200\nsrc: \"200 0 obj\\r<< \\r/Type /Font \\r/Subtype /TrueType \\r/FirstChar 32 \\r/LastChar 252 \\r/Widths [ 278 0 0 0 0 889 0 0 333 333 0 0 278 333 278 278 556 556 556 556 556 \\r556 556 556 556 0 278 278 0 0 0 0 0 667 667 722 722 667 611 778 \\r722 278 500 667 556 833 722 778 667 0 722 667 611 722 667 944 0 \\r0 611 0 0 0 0 0 0 556 556 500 556 556 278 556 556 222 222 500 222 \\r833 556 556 556 0 333 500 278 556 500 722 500 500 500 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r0 0 0 0 0 0 0 0 0 0 0 556 0 0 737 0 400 0 0 0 0 0 0 0 0 0 0 556 \\r0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \\r722 0 0 0 0 0 0 0 556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 556 0 0 \\r0 0 0 556 ] \\r/Encoding /WinAnsiEncoding \\r/BaseFont /JEMPEI+Arial \\r/FontDescriptor 199 0 R \\r>> \\rendobj\\r\"\ntarget_encoding: latin1\n"
  writer.new_font(font)
  writer.send_flowing_data("wieder normaler text ")
  writer.send_paragraph
  section1 = chapter.sections.first
  assert_equal(section, section1)
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  assert_equal(3, paragraph1.formats.size)
  assert_equal([:italic], paragraph1.formats.at(1).values)
  expected = 'Normaler text ich bin kursiv wieder normaler text'  
  assert_equal(expected, paragraph1.text)
end

- (Object) test_galenic_form



50
51
52
53
54
55
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 50

def test_galenic_form
  chapter = @fachinfo.galenic_form
  assert_equal('Galenische Form und Wirkstoffmenge pro Einheit', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
end

- (Object) test_iksnrs



275
276
277
278
279
280
281
282
283
284
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 275

def test_iksnrs
  chapter = @fachinfo.iksnrs
  assert_equal('Zulassungsvermerk', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  assert_equal(1, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = '57183 (Swissmedic).'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_indications



56
57
58
59
60
61
62
63
64
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 56

def test_indications
  chapter = @fachinfo.indications
  assert_equal('Indikationen/Anwendungsmöglichkeiten', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Entzündliche und allergische Erkrankungen der oberen Atemwege wie Schnupfen, Heuschnupfen, chronisches Nasenrinnen, vasomotorische bzw. allergische Rhinitis, Rhinopharyngitis, allergische Sinusitis. Als Adjuvans bei Grippe und Erkältungen.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_interaction



102
103
104
105
106
107
108
109
110
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 102

def test_interaction
  chapter = @fachinfo.interactions
  assert_equal('Interaktionen',chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = "MAO-Hemmer und trizyklische Antidepressiva verst\344rken den Vasokonstriktoreffekt des Phenylephrins. Antihistaminika verst\344rken die Wirkung von Alkohol und von zentralwirkenden Beruhigungsmitteln (z.B. Barbiturate, Sedativa, Analgetika, Hypnotika)."
  assert_equal(expected, paragraph1.text)
end

- (Object) test_kinetic



233
234
235
236
237
238
239
240
241
242
243
244
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 233

def test_kinetic
  chapter = @fachinfo.kinetic
  assert_equal('Pharmakokinetik',chapter.heading)
  section1 = chapter.sections.first
  assert_equal("Absorption, Distribution, Metabolismus, Elimination\n", section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = "Chlorphenamin wird nach oraler Verabreichung gut resorbiert und w\344hrend seiner Resorption durch die gastrointestinale Schleimhaut und in der Leber (First-pass-Effekt) metabolisiert. Es erscheint nach 30-60 Min. im Plasma, wobei die maximale Plasmakonzentration nach 2-6 Std. erreicht wird. Es geht in den Speichel \374ber. Die Ausscheidung erfolgt haupts\344chlich \374ber die Nieren."
  assert_equal(expected, paragraph1.text)
  paragraph2 = section1.paragraphs.at(1)
  expected = 'Phenylephrin wird unregelmässig aus dem Magen-Darm-Trakt resorbiert und bewirkt nach 15-20 Min. ein Abschwellen der Nasenschleimhäute, das 2-4 Std. anhält. Es wird über die MAO in der Leber und im Darm rasch metabolisiert. Einzelheiten über die Verteilung in der Muttermilch und die Ausscheidung sind nicht bekannt.'
  assert_equal(expected, paragraph2.text)
end

- (Object) test_name



29
30
31
32
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 29

def test_name
  name = @fachinfo.name
  assert_equal("Rhinopront\256 N", name)
end

- (Object) test_other_advice



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 256

def test_other_advice
  chapter = @fachinfo.other_advice
  assert_equal('Sonstige Hinweise', chapter.heading)

  section1 = chapter.sections.first
  assert_equal("Haltbarkeit\n", section1.subheading)
  assert_equal(1, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = 'Verfalldatum auf der Packung beachten.'
  assert_equal(expected, paragraph1.text)


  section2 = chapter.sections.last
  assert_equal("Besondere Lagerungshinweise\n", section2.subheading)
  assert_equal(1, section2.paragraphs.size)
  paragraph2 = section2.paragraphs.first
  expected = 'Bei Raumtemperatur (15-25 °C) und vor Licht geschützt aufbewahren.'
  assert_equal(expected, paragraph2.text)
end

- (Object) test_overdose



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 191

def test_overdose
  chapter = @fachinfo.overdose
  assert_equal('Überdosierung',chapter.heading)
  section1 = chapter.sections.first
  assert_equal("Symptome in Zusammenhang mit Chlorphenamin\n", section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Stimulierung (Kinder) oder Dämpfung (Erwachsene) des ZNS.'
  assert_equal(expected, paragraph1.text)
  section2 = chapter.sections.at(1)
  assert_equal("Symptome in Zusammenhang mit Phenylephrin\n", section2.subheading)
  paragraph1 = section2.paragraphs.first
  expected = 'Hohe Hypertonie und Bradykardie.'
  assert_equal(expected, paragraph1.text)
  section3 = chapter.sections.at(2)
  assert_equal("Behandlung:", section3.subheading)
  paragraph1 = section3.paragraphs.first
  expected = 'Symptomatisch.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_preclinic



245
246
247
248
249
250
251
252
253
254
255
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 245

def test_preclinic
  chapter = @fachinfo.preclinic
  assert_equal('Präklinische Daten', chapter.heading)

  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  assert_equal(1, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = 'Es sind keine für die Anwendung relevanten präklinischen Daten der im Arzneimittel enthaltenen Wirkstoffkombination vorhanden.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_pregnancy



111
112
113
114
115
116
117
118
119
120
121
122
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 111

def test_pregnancy
  chapter = @fachinfo.pregnancy
  assert_equal('Schwangerschaft/Stillzeit',chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected =  "Die Sicherheit von Chlorphenamin und Phenylephrin oder ihrer Kombination w\344hrend der ersten beiden Schwangerschaftstrimester wurde nicht erwiesen. Im letzten Schwangerschaftstrimester und w\344hrend der Stillzeit bergen diese Pr\344parate das Risiko schwerer unerw\374nschter Wirkungen, wie z.B. durch Chlorphenamin bewirkte Kr\344mpfe beim F\366tus und beim Neugeborenen. Folglich sind sie in diesem Stadium der Schwangerschaft kontraindiziert."
  assert_equal(expected, paragraph1.text)
  paragraph2 = section1.paragraphs.last
  expected = 'Die Anwendung während der Stillzeit ist zu vermeiden.'
  assert_equal(expected, paragraph2.text)
end

- (Object) test_registration_owner



285
286
287
288
289
290
291
292
293
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 285

def test_registration_owner
  chapter = @fachinfo.registration_owner
  assert_equal('Zulassungsinhaberin', chapter.heading)
  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Pfizer AG, Zürich.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_restrictions



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 83

def test_restrictions
  chapter = @fachinfo.restrictions
  assert_equal('Warnhinweise und Vorsichtsmassnahmen', chapter.heading)
  section1 = chapter.sections.first
  assert_equal("Relative Kontraindikationen\n", section1.subheading)
  assert_equal(2, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = 'Bei schwerer Krankheit der Koronargefässe oder stark erhöhtem Blutdruck darf Rhinopront N nur nach Rücksprache mit einem Arzt eingenommen werden.'
  assert_equal(expected, paragraph1.text)
  paragraph2 = section1.paragraphs.at(1)
  expected = "Siehe \253Schwangerschaft/Stillzeit\273."
  assert_equal(expected, paragraph2.text)
  section2 = chapter.sections.at(1)
  assert_equal("Warnhinweise und Vorsichtsmassnahmen\n", section2.subheading)
  assert_equal(1, section2.paragraphs.size)
  paragraph1 = section2.paragraphs.first
  expected = 'Vorsicht ist geboten bei: Engwinkelglaukom, Zuckerkrankheit, Prostata-Hypertrophie, Hyperthyreose, Asthma bronchiale.'
  assert_equal(expected, paragraph1.text)
end

- (Object) test_unwanted_effects



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 131

def test_unwanted_effects
  chapter = @fachinfo.unwanted_effects
  assert_equal('Unerwünschte Wirkungen', chapter.heading)

  section1 = chapter.sections.first
  assert_equal('', section1.subheading)
  assert_equal(1, section1.paragraphs.size)
  paragraph1 = section1.paragraphs.first
  expected = 'Je nach individueller Empfindlichkeit kann Rhinopront N folgende Nebenwirkungen verursachen:'
  assert_equal(expected, paragraph1.text)

  section2 = chapter.sections.at(1)
  assert_equal("Störungen des Blut- und Lymphsystems\n", section2.subheading)
  assert_equal(0, section2.paragraphs.size)
  section3 = chapter.sections.at(2)
  assert_equal('Sehr selten:', section3.subheading)
  paragraph1 = section3.paragraphs.first
  expected = 'Veränderungen des Blutbildes.'
  assert_equal(expected, paragraph1.text)
  section4 = chapter.sections.at(3)
  assert_equal("Augenleiden\n", section4.subheading)
  section5 = chapter.sections.at(4)
  assert_equal('Gelegentlich:',section5.subheading)
  paragraph1 = section5.paragraphs.first
  expected = 'Verschwommenes Sehen.'
  assert_equal(expected, paragraph1.text)
  section6 = chapter.sections.at(5)
  assert_equal("St\366rungen des Nervensystem\n",section6.subheading)
  section7 = chapter.sections.at(6)
  assert_equal('Häufig:',section7.subheading)
  paragraph1 = section7.paragraphs.first
  expected = "Vor\374bergehende Schl\344frigkeit (10-25%) oder eine Verminderung der Aufmerksamkeit."
  assert_equal(expected, paragraph1.text)
  section8 = chapter.sections.at(7)
  assert_equal("Gastrointestinale St\366rungen\n",section8.subheading)
  section9 = chapter.sections.at(8)
  assert_equal('Gelegentlich:',section9.subheading)
  paragraph1 = section9.paragraphs.first
  expected = "Mundtrockenheit."
  assert_equal(expected, paragraph1.text)

  section10 = chapter.sections.at(9)
  assert_equal("Haut\n",section10.subheading)
  section11 = chapter.sections.at(10)
  assert_equal("Ausnahmsweise:",section11.subheading)
  paragraph1 = section11.paragraphs.first
  expected = "Rash."
  assert_equal(expected, paragraph1.text)
  section12 = chapter.sections.at(11)
  assert_equal("St\366rungen des muskuloskelettalen Systems\n", section12.subheading)
  assert_equal(expected, paragraph1.text)
  sectionlast = chapter.sections.last
  assert_equal('Vereinzelt:', sectionlast.subheading)
  paragraph1 = sectionlast.paragraphs.first
  expected = 'Knochenmarkdepression.'
  assert_equal(expected, paragraph1.text)
  #paragraph2 = section2.paragraphs.first
  #expected = ''
  #assert_equal(expected, paragraph2.text)
end

- (Object) test_usage



65
66
67
68
69
70
71
72
73
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 65

def test_usage
  chapter = @fachinfo.usage
  assert_equal('Dosierung/Anwendung',chapter.heading)
  section1 = chapter.sections.first
  assert_equal('Erwachsene und Kinder ab 12 Jahren:', section1.subheading)
  paragraph1 = section1.paragraphs.first
  expected = 'Beim Auftreten der Symptome 1 Kapsel alle 12 Stunden, d.h. 1 Kapsel morgens und 1 Kapsel abends.'
  assert_equal(expected, paragraph1.text)
end