oddb2xml 2.7.1 → 2.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -2
  3. data/.standard.yml +2 -0
  4. data/Gemfile +3 -3
  5. data/History.txt +24 -0
  6. data/README.md +3 -3
  7. data/Rakefile +24 -23
  8. data/bin/check_artikelstamm +11 -11
  9. data/bin/compare_v5 +23 -23
  10. data/bin/oddb2xml +14 -13
  11. data/lib/oddb2xml/builder.rb +1070 -1038
  12. data/lib/oddb2xml/calc.rb +232 -233
  13. data/lib/oddb2xml/chapter_70_hack.rb +38 -32
  14. data/lib/oddb2xml/cli.rb +252 -236
  15. data/lib/oddb2xml/compare.rb +70 -59
  16. data/lib/oddb2xml/compositions_syntax.rb +451 -430
  17. data/lib/oddb2xml/compressor.rb +20 -20
  18. data/lib/oddb2xml/downloader.rb +157 -129
  19. data/lib/oddb2xml/extractor.rb +295 -295
  20. data/lib/oddb2xml/options.rb +34 -35
  21. data/lib/oddb2xml/parslet_compositions.rb +265 -269
  22. data/lib/oddb2xml/semantic_check.rb +39 -33
  23. data/lib/oddb2xml/util.rb +163 -163
  24. data/lib/oddb2xml/version.rb +1 -1
  25. data/lib/oddb2xml/xml_definitions.rb +32 -33
  26. data/lib/oddb2xml.rb +1 -1
  27. data/oddb2xml.gemspec +34 -34
  28. data/shell.nix +17 -0
  29. data/spec/artikelstamm_spec.rb +111 -110
  30. data/spec/builder_spec.rb +490 -505
  31. data/spec/calc_spec.rb +552 -593
  32. data/spec/check_artikelstamm_spec.rb +26 -26
  33. data/spec/cli_spec.rb +173 -174
  34. data/spec/compare_spec.rb +9 -11
  35. data/spec/composition_syntax_spec.rb +390 -409
  36. data/spec/compressor_spec.rb +48 -48
  37. data/spec/data/transfer.dat +1 -0
  38. data/spec/data_helper.rb +47 -49
  39. data/spec/downloader_spec.rb +251 -260
  40. data/spec/extractor_spec.rb +171 -159
  41. data/spec/fixtures/vcr_cassettes/oddb2xml.json +1 -1
  42. data/spec/galenic_spec.rb +233 -256
  43. data/spec/options_spec.rb +116 -119
  44. data/spec/parslet_spec.rb +896 -863
  45. data/spec/spec_helper.rb +153 -153
  46. data/test_options.rb +39 -42
  47. data/tools/win_fetch_cacerts.rb +2 -3
  48. metadata +42 -12
@@ -1,22 +1,10 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
1
+ require "spec_helper"
4
2
  require "rexml/document"
5
- require 'webmock/rspec'
6
- include REXML
7
- RUN_ALL = true
3
+ require "webmock/rspec"
8
4
 
9
5
  describe Oddb2xml::Builder do
10
- raise "Cannot rspec in directroy containing a spac" if / /.match(Oddb2xml::SpecData)
11
- NrExtendedArticles = 34
12
- NrSubstances = 14
13
- NrLimitations = 5
14
- NrInteractions = 5
15
- NrCodes = 5
16
- NrProdno = 23
17
- NrPackages = 24
18
- NrProducts = 19
19
- RegExpDesitin = /1125819012LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk/
6
+ include REXML
7
+ raise "Cannot rspec in directroy containing a spac" if / /.match?(Oddb2xml::SpecData)
20
8
  include ServerMockHelper
21
9
  def check_artikelstamm_xml(key, expected_value)
22
10
  expect(@artikelstamm_name).not_to be nil
@@ -24,53 +12,54 @@ describe Oddb2xml::Builder do
24
12
  unless @inhalt.index(expected_value)
25
13
  puts expected_value
26
14
  end
27
- binding.pry if defined?(Pry) && !@inhalt.index(expected_value)
15
+ # binding.pry if defined?(Pry) && !@inhalt.index(expected_value)
28
16
  expect(@inhalt.index(expected_value)).not_to be nil
29
17
  end
18
+
30
19
  def common_run_init(options = {})
31
- @savedDir = Dir.pwd
32
- @oddb2xml_xsd = File.expand_path(File.join(File.dirname(__FILE__), '..', 'oddb2xml.xsd'))
33
- @oddb_calc_xsd = File.expand_path(File.join(File.dirname(__FILE__), '..', 'oddb_calc.xsd'))
34
- @elexis_v5_xsd = File.expand_path(File.join(__FILE__, '..', '..', 'Elexis_Artikelstamm_v5.xsd'))
35
- @elexis_v5_csv = File.join(Oddb2xml::WorkDir, "artikelstamm_#{Date.today.strftime('%d%m%Y')}_v5.csv")
20
+ @saved_dir = Dir.pwd
21
+ @oddb2xml_xsd = File.expand_path(File.join(File.dirname(__FILE__), "..", "oddb2xml.xsd"))
22
+ @oddb_calc_xsd = File.expand_path(File.join(File.dirname(__FILE__), "..", "oddb_calc.xsd"))
23
+ @elexis_v5_xsd = File.expand_path(File.join(__FILE__, "..", "..", "Elexis_Artikelstamm_v5.xsd"))
24
+ @elexis_v5_csv = File.join(Oddb2xml::WORK_DIR, "artikelstamm_#{Date.today.strftime("%d%m%Y")}_v5.csv")
36
25
 
37
26
  expect(File.exist?(@oddb2xml_xsd)).to eq true
38
27
  expect(File.exist?(@oddb_calc_xsd)).to eq true
39
28
  expect(File.exist?(@elexis_v5_xsd)).to eq true
40
29
  cleanup_directories_before_run
41
- FileUtils.makedirs(Oddb2xml::WorkDir)
42
- Dir.chdir(Oddb2xml::WorkDir)
30
+ FileUtils.makedirs(Oddb2xml::WORK_DIR)
31
+ Dir.chdir(Oddb2xml::WORK_DIR)
43
32
  mock_downloads
44
33
  end
45
34
 
46
35
  after(:all) do
47
- Dir.chdir @savedDir if @savedDir and File.directory?(@savedDir)
36
+ Dir.chdir @saved_dir if @saved_dir && File.directory?(@saved_dir)
48
37
  end
49
- context 'when artikelstamm option is given' do
38
+ context "when artikelstamm option is given" do
50
39
  before(:all) do
51
40
  common_run_init
52
- options = Oddb2xml::Options.parse(['--artikelstamm']) # , '--log'])
41
+ options = Oddb2xml::Options.parse(["--artikelstamm"]) # , '--log'])
53
42
  # @res = buildr_capture(:stdout){ Oddb2xml::Cli.new(options).run }
54
43
  Oddb2xml::Cli.new(options).run # to debug
55
- @artikelstamm_name = File.join(Oddb2xml::WorkDir, "artikelstamm_#{Date.today.strftime('%d%m%Y')}_v5.xml")
44
+ @artikelstamm_name = File.join(Oddb2xml::WORK_DIR, "artikelstamm_#{Date.today.strftime("%d%m%Y")}_v5.xml")
56
45
  @doc = Nokogiri::XML(File.open(@artikelstamm_name))
57
46
  # @rexml = REXML::Document.new File.read(@artikelstamm_name)
58
47
  @inhalt = IO.read(@artikelstamm_name)
59
48
  end
60
49
 
61
- it 'should exist' do
62
- expect(File.exists?(@artikelstamm_name)).to eq true
50
+ it "should exist" do
51
+ expect(File.exist?(@artikelstamm_name)).to eq true
63
52
  end
64
53
 
65
- it 'should create transfer.ut8' do
66
- expect(File.exists?(File.join(Oddb2xml::Downloads, 'transfer.utf8'))).to eq true
54
+ it "should create transfer.ut8" do
55
+ expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "transfer.utf8"))).to eq true
67
56
  end
68
57
 
69
- it 'should have a comment' do
70
- expect(@inhalt).to match /<!--Produced by/
58
+ it "should have a comment" do
59
+ expect(@inhalt).to match(/<!--Produced by/)
71
60
  end
72
61
 
73
- it 'should have a GTIN and a public price with 14 chars (ean14)' do
62
+ it "should have a GTIN and a public price with 14 chars (ean14)" do
74
63
  # Till January 2021 it was possible to find a price via transfer.dat
75
64
  # as the pharmacode was given in the refdata_NonPharma.xml
76
65
  expected = %(<ITEM PHARMATYPE="N">
@@ -85,7 +74,7 @@ describe Oddb2xml::Builder do
85
74
  expect(@inhalt.index(expected)).not_to be nil
86
75
  end
87
76
 
88
- it 'should have a ATC for product PRIORIX TETRA' do
77
+ it "should have a ATC for product PRIORIX TETRA" do
89
78
  expected = %(<PRODUCT>
90
79
  <PRODNO>5815801</PRODNO>
91
80
  <SALECD>A</SALECD>
@@ -96,35 +85,35 @@ describe Oddb2xml::Builder do
96
85
  expect(@inhalt.index(expected)).not_to be nil
97
86
  end
98
87
 
99
- it 'should produce a Elexis_Artikelstamm_v5.csv' do
100
- expect(File.exists?(@elexis_v5_csv)).to eq true
101
- inhalt = File.open(@elexis_v5_csv, 'r+').read
88
+ it "should produce a Elexis_Artikelstamm_v5.csv" do
89
+ expect(File.exist?(@elexis_v5_csv)).to eq true
90
+ inhalt = File.open(@elexis_v5_csv, "r+").read
102
91
  expect(inhalt.size).to be > 0
103
- expect(inhalt).to match /7680284860144/
92
+ expect(inhalt).to match(/7680284860144/)
104
93
  end
105
94
 
106
- it 'should NOT generate a v3 nonpharma xml' do
107
- v3_name = @artikelstamm_name.sub('_v5.xml', '_v3.xml').sub('artikelstamm_', 'artikelstamm_N_')
95
+ it "should NOT generate a v3 nonpharma xml" do
96
+ v3_name = @artikelstamm_name.sub("_v5.xml", "_v3.xml").sub("artikelstamm_", "artikelstamm_N_")
108
97
  expect(File.exist?(v3_name)).to eq false
109
98
  end
110
99
 
111
- it 'should NOT generate a vx pharma xml' do
112
- v3_name = @artikelstamm_name.sub('_v5.xml', '_v3.xml').sub('artikelstamm_', 'artikelstamm_P_')
100
+ it "should NOT generate a vx pharma xml" do
101
+ v3_name = @artikelstamm_name.sub("_v5.xml", "_v3.xml").sub("artikelstamm_", "artikelstamm_P_")
113
102
  expect(File.exist?(v3_name)).to eq false
114
103
  end
115
104
 
116
- it 'should contain a LIMITATION_PTS' do
117
- expect(@inhalt.index('<LIMITATION_PTS>40</LIMITATION_PTS>')).not_to be nil
105
+ it "should contain a LIMITATION_PTS" do
106
+ expect(@inhalt.index("<LIMITATION_PTS>40</LIMITATION_PTS>")).not_to be nil
118
107
  end
119
108
 
120
- it 'should find price from Preparations.xml by setting' do
121
- expect(File.exists?(@elexis_v5_csv)).to eq true
122
- inhalt = File.open(@elexis_v5_csv, 'r+').read
109
+ it "should find price from Preparations.xml by setting" do
110
+ expect(File.exist?(@elexis_v5_csv)).to eq true
111
+ inhalt = File.open(@elexis_v5_csv, "r+").read
123
112
  expected = %(7680658560014,Dibase 10'000 Tropfen 10000 IE/ml Fl 10 ml,,Flasche(n),5,9.25,6585601,A11CC05,,"",,SL)
124
113
  expect(inhalt.index(expected)).to be > 0
125
114
  end
126
115
 
127
- it 'should contain a PRODUCT which was not in refdata' do
116
+ it "should contain a PRODUCT which was not in refdata" do
128
117
  expected = %(<PRODUCT>
129
118
  <PRODNO>5559401</PRODNO>
130
119
  <SALECD>A</SALECD>
@@ -135,12 +124,12 @@ describe Oddb2xml::Builder do
135
124
  expect(@inhalt.index(expected)).not_to be nil
136
125
  end
137
126
 
138
- it 'should have a price for Lynparza' do
139
- expect(File.exists?(@elexis_v5_csv)).to eq true
140
- inhalt = File.open(@elexis_v5_csv, 'r+').read
127
+ it "should have a price for Lynparza" do
128
+ expect(File.exist?(@elexis_v5_csv)).to eq true
129
+ inhalt = File.open(@elexis_v5_csv, "r+").read
141
130
  expect(inhalt.index('7680651600014,Lynparza Kaps 50 mg 448 Stk,,Kapsel(n),5562.48,5947.55,6516001,L01XX46,,"",,S')).not_to be nil
142
131
  end
143
- it 'should trim the ean13 to 13 length' do
132
+ it "should trim the ean13 to 13 length" do
144
133
  gtin14 = "00040565124346"
145
134
  expect(gtin14.length).to eq 14
146
135
  expected14 = %(<GTIN>#{gtin14}</GTIN>)
@@ -151,35 +140,35 @@ describe Oddb2xml::Builder do
151
140
  expect(@inhalt.index(expected13)).not_to be nil
152
141
  end
153
142
 
154
- it 'should not contain a GTIN=0' do
155
- expect(@inhalt.index('GTIN>0</GTIN')).to be nil
143
+ it "should not contain a GTIN=0" do
144
+ expect(@inhalt.index("GTIN>0</GTIN")).to be nil
156
145
  end
157
146
 
158
- it 'should contain a GTIN starting 0' do
159
- expect(@inhalt.index('GTIN>0')).to be > 0
147
+ it "should contain a GTIN starting 0" do
148
+ expect(@inhalt.index("GTIN>0")).to be > 0
160
149
  end
161
150
 
162
- it 'should a DSCRF for 4042809018288 TENSOPLAST Kompressionsbinde 5cmx4.5m' do
151
+ it "should a DSCRF for 4042809018288 TENSOPLAST Kompressionsbinde 5cmx4.5m" do
163
152
  skip("Where does the DSCR for 4042809018288 come from. It should be TENSOPLAST bande compression 5cmx4.5m")
164
153
  end
165
154
 
166
- it 'should NOT add GTIN 7680172330414 SELSUN and ean13 start with 7680 (Swissmedic) which is marked as inactive in transfer.dat' do
155
+ it "should NOT add GTIN 7680172330414 SELSUN and ean13 start with 7680 (Swissmedic) which is marked as inactive in transfer.dat" do
167
156
  @inhalt = IO.read(@artikelstamm_name)
168
- expect(@inhalt.index('7680172330414')).to be nil
157
+ expect(@inhalt.index("7680172330414")).to be nil
169
158
  end
170
159
 
171
- it 'should add GTIN 3605520301605 Armani Attitude which is marked as inactive in transfer.dat' do
160
+ it "should add GTIN 3605520301605 Armani Attitude which is marked as inactive in transfer.dat" do
172
161
  @inhalt = IO.read(@artikelstamm_name)
173
- expect(@inhalt.index('3605520301605')).not_to be nil
162
+ expect(@inhalt.index("3605520301605")).not_to be nil
174
163
  end
175
164
 
176
- it 'should add BIOMARIS Voll Meersalz which is marked as inactive in transfer.dat but has PPUB and PEXF' do
165
+ it "should add BIOMARIS Voll Meersalz which is marked as inactive in transfer.dat but has PPUB and PEXF" do
177
166
  @inhalt = IO.read(@artikelstamm_name)
178
- expect(@inhalt.index('BIOMARIS Voll Meersalz 500 g')).not_to be nil
167
+ expect(@inhalt.index("BIOMARIS Voll Meersalz 500 g")).not_to be nil
179
168
  end
180
169
 
181
- it 'Should not contain PHAR 8809544 Sildenavil with pexf and ppub 0.0' do
182
- #1128809544Sildenafil Suspension 7mg/ml 100ml 0030850045801000000000000000000000002
170
+ it "Should not contain PHAR 8809544 Sildenavil with pexf and ppub 0.0" do
171
+ # 1128809544Sildenafil Suspension 7mg/ml 100ml 0030850045801000000000000000000000002
183
172
  @inhalt = IO.read(@artikelstamm_name)
184
173
  expected = %(<ITEM PHARMATYPE="N">
185
174
  <GTIN>9999998809544</GTIN>
@@ -193,19 +182,19 @@ describe Oddb2xml::Builder do
193
182
  expect(@inhalt.index(expected)).to be nil
194
183
  end
195
184
 
196
- it 'should a company EAN for 4042809018288 TENSOPLAST Kompressionsbinde 5cmx4.5m' do
185
+ it "should a company EAN for 4042809018288 TENSOPLAST Kompressionsbinde 5cmx4.5m" do
197
186
  skip("Where does the COMP GLN for 4042809018288 come from. It should be 7601003468441")
198
187
  end
199
188
 
200
- it 'shoud contain Lamivudinum as 3TC substance' do
201
- expect(@inhalt.index('<SUBSTANCE>Lamivudinum</SUBSTANCE>')).not_to be nil
189
+ it "shoud contain Lamivudinum as 3TC substance" do
190
+ expect(@inhalt.index("<SUBSTANCE>Lamivudinum</SUBSTANCE>")).not_to be nil
202
191
  end
203
192
 
204
- it 'shoud contain GENERIC_TYPE' do
205
- expect(@inhalt.index('<GENERIC_TYPE')).not_to be nil
193
+ it "shoud contain GENERIC_TYPE" do
194
+ expect(@inhalt.index("<GENERIC_TYPE")).not_to be nil
206
195
  end
207
196
 
208
- it 'should contain DIBASE with phar' do
197
+ it "should contain DIBASE with phar" do
209
198
  expected = %(<ITEM PHARMATYPE="P">
210
199
  <GTIN>7680658560014</GTIN>
211
200
  <SALECD>A</SALECD>
@@ -229,16 +218,16 @@ describe Oddb2xml::Builder do
229
218
  expect(@inhalt.index(expected)).not_to be nil
230
219
  end
231
220
 
232
- it 'should contain PEVISONE Creme 30 g' do
233
- expect(@inhalt.index('Pevisone Creme 15 g')).not_to be nil # 7680406620144
234
- expect(@inhalt.index('Pevisone Creme 30 g')).not_to be nil # 7680406620229
221
+ it "should contain PEVISONE Creme 30 g" do
222
+ expect(@inhalt.index("Pevisone Creme 15 g")).not_to be nil # 7680406620144
223
+ expect(@inhalt.index("Pevisone Creme 30 g")).not_to be nil # 7680406620229
235
224
  # Should also check for price!
236
225
  end
237
- it 'should validate against artikelstamm.xsd' do
226
+ it "should validate against artikelstamm.xsd" do
238
227
  validate_via_xsd(@elexis_v5_xsd, @artikelstamm_name)
239
228
  end
240
- tests = { 'item 7680403330459 CARBADERM only in Preparations(SL) with public price' =>
241
- %(<ITEM PHARMATYPE="P">
229
+ tests = {"item 7680403330459 CARBADERM only in Preparations(SL) with public price" =>
230
+ %(<ITEM PHARMATYPE="P">
242
231
  <GTIN>7680403330459</GTIN>
243
232
  <SALECD>A</SALECD>
244
233
  <DSCR>Carbaderm Creme Tb 300 ml</DSCR>
@@ -249,8 +238,8 @@ describe Oddb2xml::Builder do
249
238
  <IKSCAT>D</IKSCAT>
250
239
  <DEDUCTIBLE>10</DEDUCTIBLE>
251
240
  </ITEM>),
252
- 'item 4042809018288 TENSOPLAST' =>
253
- %(<ITEM PHARMATYPE="N">
241
+ "item 4042809018288 TENSOPLAST" =>
242
+ %(<ITEM PHARMATYPE="N">
254
243
  <GTIN>4042809018288</GTIN>
255
244
  <PHAR>0055805</PHAR>
256
245
  <SALECD>A</SALECD>
@@ -259,7 +248,7 @@ describe Oddb2xml::Builder do
259
248
  <PEXF>0.00</PEXF>
260
249
  <PPUB>22.95</PPUB>
261
250
  </ITEM>),
262
- 'product 3247501 LANSOYL' => '<ITEM PHARMATYPE="P">
251
+ "product 3247501 LANSOYL" => '<ITEM PHARMATYPE="P">
263
252
  <GTIN>7680324750190</GTIN>
264
253
  <SALECD>A</SALECD>
265
254
  <DSCR>LANSOYL Gel 225 g</DSCR>
@@ -268,6 +257,8 @@ describe Oddb2xml::Builder do
268
257
  <NAME>Actipharm SA</NAME>
269
258
  <GLN>7601001002012</GLN>
270
259
  </COMP>
260
+ <PEXF>10.54</PEXF>
261
+ <PPUB>16.25</PPUB>
271
262
  <PKG_SIZE>225</PKG_SIZE>
272
263
  <MEASURE>g</MEASURE>
273
264
  <MEASUREF>g</MEASUREF>
@@ -276,8 +267,8 @@ describe Oddb2xml::Builder do
276
267
  <LPPV>true</LPPV>
277
268
  <PRODNO>3247501</PRODNO>
278
269
  </ITEM>',
279
- 'product 5366201 3TC' =>
280
- %(<ITEM PHARMATYPE="P">
270
+ "product 5366201 3TC" =>
271
+ %(<ITEM PHARMATYPE="P">
281
272
  <GTIN>7680536620137</GTIN>
282
273
  <SALECD>A</SALECD>
283
274
  <DSCR>3TC Filmtabl 150 mg 60 Stk</DSCR>
@@ -299,8 +290,8 @@ describe Oddb2xml::Builder do
299
290
  <DEDUCTIBLE>10</DEDUCTIBLE>
300
291
  <PRODNO>5366201</PRODNO>
301
292
  </ITEM>),
302
- 'item 7680161050583 HIRUDOID 40g' =>
303
- %(<ITEM PHARMATYPE="P">
293
+ "item 7680161050583 HIRUDOID 40g" =>
294
+ %(<ITEM PHARMATYPE="P">
304
295
  <GTIN>7680161050583</GTIN>
305
296
  <SALECD>A</SALECD>
306
297
  <DSCR>Hirudoid Creme 3 mg/g 40 g</DSCR>
@@ -320,8 +311,8 @@ describe Oddb2xml::Builder do
320
311
  <DEDUCTIBLE>10</DEDUCTIBLE>
321
312
  <PRODNO>1610501</PRODNO>
322
313
  </ITEM>),
323
- 'item 7680161050743 Hirudoid Creme 3 mg/g 100 g' =>
324
- %( <ITEM PHARMATYPE="P">
314
+ "item 7680161050743 Hirudoid Creme 3 mg/g 100 g" =>
315
+ %( <ITEM PHARMATYPE="P">
325
316
  <GTIN>7680161050743</GTIN>
326
317
  <SALECD>A</SALECD>
327
318
  <DSCR>Hirudoid Creme 3 mg/g 100 g</DSCR>
@@ -336,7 +327,7 @@ describe Oddb2xml::Builder do
336
327
  <IKSCAT>D</IKSCAT>
337
328
  <DEDUCTIBLE>10</DEDUCTIBLE>
338
329
  </ITEM>),
339
- 'item 7680284860144 ANCOPIR' =>'<ITEM PHARMATYPE="P">
330
+ "item 7680284860144 ANCOPIR" => '<ITEM PHARMATYPE="P">
340
331
  <GTIN>7680284860144</GTIN>
341
332
  <SALECD>A</SALECD>
342
333
  <DSCR>ANCOPIR Inj Lös 5 Amp 2 ml</DSCR>
@@ -357,7 +348,7 @@ describe Oddb2xml::Builder do
357
348
  <DEDUCTIBLE>10</DEDUCTIBLE>
358
349
  <PRODNO>2848601</PRODNO>
359
350
  </ITEM>',
360
- 'FERRO-GRADUMET price from ZurRose ' => %(<ITEM PHARMATYPE="P">
351
+ "FERRO-GRADUMET price from ZurRose " => %(<ITEM PHARMATYPE="P">
361
352
  <GTIN>7680316440115</GTIN>
362
353
  <SALECD>A</SALECD>
363
354
  <DSCR>FERRO-GRADUMET Depottabl 30 Stk</DSCR>
@@ -376,7 +367,7 @@ describe Oddb2xml::Builder do
376
367
  <IKSCAT>C</IKSCAT>
377
368
  <PRODNO>3164402</PRODNO>
378
369
  </ITEM>),
379
- 'product 3TC Filmtabl' => %(<PRODUCT>
370
+ "product 3TC Filmtabl" => %(<PRODUCT>
380
371
  <PRODNO>5366201</PRODNO>
381
372
  <SALECD>A</SALECD>
382
373
  <DSCR>3TC Filmtabl 150 mg</DSCR>
@@ -384,7 +375,7 @@ describe Oddb2xml::Builder do
384
375
  <ATC>J05AF05</ATC>
385
376
  <SUBSTANCE>Lamivudinum</SUBSTANCE>
386
377
  </PRODUCT>),
387
- 'nur aus Packungen Coeur-Vaisseaux Sérocytol,' => %(<ITEM PHARMATYPE="P">
378
+ "nur aus Packungen Coeur-Vaisseaux Sérocytol," => %(<ITEM PHARMATYPE="P">
388
379
  <GTIN>7680002770014</GTIN>
389
380
  <SALECD>A</SALECD>
390
381
  <DSCR>SEROCYTOL Herz-Gefässe Supp 3 Stk</DSCR>
@@ -400,7 +391,7 @@ describe Oddb2xml::Builder do
400
391
  <IKSCAT>B</IKSCAT>
401
392
  <PRODNO>0027701</PRODNO>
402
393
  </ITEM>),
403
- 'HUMALOG (Richter)' => %(<ITEM PHARMATYPE="P">
394
+ "HUMALOG (Richter)" => %(<ITEM PHARMATYPE="P">
404
395
  <GTIN>7680532900196</GTIN>
405
396
  <SALECD>A</SALECD>
406
397
  <DSCR>Humalog Inj Lös Durchstf 10 ml</DSCR>
@@ -421,7 +412,19 @@ describe Oddb2xml::Builder do
421
412
  <DEDUCTIBLE>20</DEDUCTIBLE>
422
413
  <PRODNO>5329001</PRODNO>
423
414
  </ITEM>),
424
- 'Varilrix product' => %(<PRODUCT>
415
+ "Kolon with Pharmacode for EAN 7680002780013" => %(<ITEM PHARMATYPE="P">
416
+ <GTIN>7680002780013</GTIN>
417
+ <PHAR>0361821</PHAR>
418
+ <SALECD>I</SALECD>
419
+ <DSCR>SEROCYTOL Kolon Supp 3 Stk</DSCR>
420
+ <DSCRF>SEROCYTOL Côlon supp 3 pce</DSCRF>
421
+ <COMP>
422
+ <GLN>7640128710004</GLN>
423
+ </COMP>
424
+ <PEXF>22.75</PEXF>
425
+ <PPUB>39.60</PPUB>
426
+ </ITEM>),
427
+ "Varilrix product" => %(<PRODUCT>
425
428
  <PRODNO>0058501</PRODNO>
426
429
  <SALECD>A</SALECD>
427
430
  <DSCR>Varilrix Trockensub c solv</DSCR>
@@ -430,7 +433,7 @@ describe Oddb2xml::Builder do
430
433
  <LIMNAMEBAG>0808</LIMNAMEBAG>
431
434
  <SUBSTANCE>Vaccinum virus varicellae vivus attenuat. (Stamm OKA)</SUBSTANCE>
432
435
  </PRODUCT>),
433
- 'Varilrix item' => %(<ITEM PHARMATYPE="P">
436
+ "Varilrix item" => %(<ITEM PHARMATYPE="P">
434
437
  <GTIN>7680005850010</GTIN>
435
438
  <SALECD>A</SALECD>
436
439
  <DSCR>Varilrix Trockensub c solv Fertspr 0.500 ml</DSCR>
@@ -446,14 +449,14 @@ describe Oddb2xml::Builder do
446
449
  <DEDUCTIBLE>10</DEDUCTIBLE>
447
450
  <PRODNO>0058501</PRODNO>
448
451
  </ITEM),
449
- 'Chapter 70 product' => %(<PRODUCT>
452
+ "Chapter 70 product" => %(<PRODUCT>
450
453
  <PRODNO>2069639</PRODNO>
451
454
  <!--Chapter70 hack prodno 2069639 Ceres Urtinkturen gemäss L2 mit - im Kommentar-->
452
455
  <SALECD>A</SALECD>
453
456
  <DSCR>Ceres Urtinkturen gemäss L2 mit -- im Kommentar</DSCR>
454
457
  <DSCRF/>
455
458
  </PRODUCT>),
456
- 'Chapter 70 item' => %(<ITEM PHARMATYPE="P">
459
+ "Chapter 70 item" => %(<ITEM PHARMATYPE="P">
457
460
  <GTIN>2500000588532</GTIN>
458
461
  <PHAR>2069639</PHAR>
459
462
  <SALECD>A</SALECD>
@@ -465,33 +468,31 @@ describe Oddb2xml::Builder do
465
468
  <SL_ENTRY>true</SL_ENTRY>
466
469
  <PRODNO>2069639</PRODNO>
467
470
  </ITEM>),
468
- 'HTML-encoded limitation' => %(<DSCR>Zur Erhaltungstherapie (Monotherapie) bei erwachsenen Patientinnen mit rezidiviertem, fortgeschrittenem Ovarialkarzinom mit BRCA Mutation im Anschluss an eine platinhaltige Chemotherapie bei Vorliegen einer kompletten oder partiellen Remission.
471
+ "HTML-encoded limitation" => %(<DSCR>Zur Erhaltungstherapie (Monotherapie) bei erwachsenen Patientinnen mit rezidiviertem, fortgeschrittenem Ovarialkarzinom mit BRCA Mutation im Anschluss an eine platinhaltige Chemotherapie bei Vorliegen einer kompletten oder partiellen Remission.
469
472
 
470
473
  Der behandelnde Arzt ist verpflichtet, die erforderlichen Daten laufend im vorgegebenen Internettool des Registers, abrufbar auf http://www.olaparib-registry.ch, zu erfassen. Eine schriftliche Einwilligung der Patientin muss vorliegen. Es sind folgende Daten zu erfassen:
471
474
 
472
475
  1\) Geburtsjahr, sowie Vortherapien für das OC
473
476
 
474
477
  2\) Datum Therapiestart, Dosierung, Dosisanpassungen, Datum Therapieende.
475
- </DSCR>),
476
- }
478
+ </DSCR>)}
477
479
 
478
- tests.each do |key, expected|
479
- it "should a valid entry for #{key}" do
480
- check_artikelstamm_xml(key, expected)
481
- end
480
+ tests.each do |key, expected|
481
+ it "should a valid entry for #{key}" do
482
+ check_artikelstamm_xml(key, expected)
482
483
  end
484
+ end
483
485
  end
484
- context 'chapter 70 hack' do
486
+ context "chapter 70 hack" do
485
487
  before(:all) do
486
488
  mock_downloads
487
489
  end
488
- it 'parsing' do
489
- require 'oddb2xml/chapter_70_hack'
490
- result = Oddb2xml::Chapter70xtractor.parse()
490
+ it "parsing" do
491
+ require "oddb2xml/chapter_70_hack"
492
+ result = Oddb2xml::Chapter70xtractor.parse
491
493
  expect(result.class).to eq Array
492
494
  expect(result.first).to eq ["2069562", "70.01.10", "Urtinktur", "1--10 g/ml", "13.40", ""]
493
- expect(result.last).to eq ["6516727", "70.02", "Allergenorum extractum varium / Inj. Susp. \tFortsetzungsbehandlung", "1 Durchstfl 1.5 ml", "311.85", "L"]
495
+ expect(result.last).to eq ["6516727", "70.02", "Allergenorum extractum varium / Inj. Susp. \tFortsetzungsbehandlung", "1 Durchstfl 1.5 ml", "311.85", "L"]
494
496
  end
495
-
496
497
  end
497
498
  end