oddb2xml 2.6.9 → 2.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +40 -0
  3. data/.standard.yml +2 -0
  4. data/Elexis_Artikelstamm_v5.xsd +0 -3
  5. data/Gemfile +3 -3
  6. data/History.txt +28 -0
  7. data/README.md +3 -3
  8. data/Rakefile +24 -23
  9. data/bin/check_artikelstamm +11 -11
  10. data/bin/compare_v5 +23 -23
  11. data/bin/oddb2xml +14 -13
  12. data/lib/oddb2xml.rb +1 -1
  13. data/lib/oddb2xml/builder.rb +1075 -1048
  14. data/lib/oddb2xml/calc.rb +232 -233
  15. data/lib/oddb2xml/chapter_70_hack.rb +38 -32
  16. data/lib/oddb2xml/cli.rb +252 -235
  17. data/lib/oddb2xml/compare.rb +70 -59
  18. data/lib/oddb2xml/compositions_syntax.rb +448 -430
  19. data/lib/oddb2xml/compressor.rb +20 -20
  20. data/lib/oddb2xml/downloader.rb +156 -128
  21. data/lib/oddb2xml/extractor.rb +295 -302
  22. data/lib/oddb2xml/options.rb +34 -35
  23. data/lib/oddb2xml/parslet_compositions.rb +263 -269
  24. data/lib/oddb2xml/semantic_check.rb +39 -33
  25. data/lib/oddb2xml/util.rb +166 -164
  26. data/lib/oddb2xml/version.rb +1 -1
  27. data/lib/oddb2xml/xml_definitions.rb +32 -33
  28. data/oddb2xml.gemspec +32 -31
  29. data/spec/artikelstamm_spec.rb +116 -135
  30. data/spec/builder_spec.rb +495 -524
  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/refdata_NonPharma.xml +0 -3
  38. data/spec/data/refdata_Pharma.xml +0 -26
  39. data/spec/data/transfer.dat +1 -0
  40. data/spec/data/varia_De.htm +2 -2
  41. data/spec/data_helper.rb +47 -49
  42. data/spec/downloader_spec.rb +251 -260
  43. data/spec/extractor_spec.rb +172 -164
  44. data/spec/galenic_spec.rb +233 -256
  45. data/spec/options_spec.rb +116 -119
  46. data/spec/parslet_spec.rb +833 -861
  47. data/spec/spec_helper.rb +153 -153
  48. data/test_options.rb +39 -42
  49. data/tools/win_fetch_cacerts.rb +2 -3
  50. metadata +48 -5
  51. data/.travis.yml +0 -29
@@ -1,19 +1,19 @@
1
- # encoding: utf-8
1
+ require "spec_helper"
2
2
 
3
- require 'spec_helper'
4
-
5
- shared_examples_for 'any compressor' do
6
- it 'should create compress file' do
7
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_article.xml')
8
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_product.xml')
9
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_substance.xml')
10
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_limitation.xml')
11
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_fi.xml')
12
- @compressor.contents << File.join(Oddb2xml::SpecCompressor, 'oddb_fi_product.xml')
13
- expect(@compressor.finalize!).not_to be nil
3
+ shared_examples_for "any compressor" do
4
+ it "should create compress file" do
5
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_article.xml")
6
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_product.xml")
7
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_substance.xml")
8
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_limitation.xml")
9
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_fi.xml")
10
+ @compressor.contents << File.join(Oddb2xml::SpecCompressor, "oddb_fi_product.xml")
11
+ %(
12
+ expect{@compressor.finalize!}.not_to be nil
14
13
  compress_file = @compressor.instance_variable_get(:@compress_file)
15
- expect(File.exists?(compress_file)).to eq(true)
14
+ expect(File.exist?(compress_file)).to eq(true)
16
15
  @compressor = nil
16
+ )
17
17
  end
18
18
  end
19
19
 
@@ -22,96 +22,96 @@ describe Oddb2xml::Compressor do
22
22
  cleanup_compressor
23
23
  if @compress_file
24
24
  compress_file = @compressor.instance_variable_get(:@compress_file)
25
- FileUtils.rm_f(compress_file, :verbose => true)
25
+ FileUtils.rm_f(compress_file, verbose: true)
26
26
  end
27
27
  end
28
28
  after(:all) do
29
29
  cleanup_compressor
30
30
  end
31
- context 'at initialize' do
32
- context ' argment is given' do
31
+ context "at initialize" do
32
+ context " argment is given" do
33
33
  before(:each) do
34
34
  cleanup_directories_before_run
35
35
  @compressor = Oddb2xml::Compressor.new
36
36
  end
37
- it 'should have empty contents as array' do
37
+ it "should have empty contents as array" do
38
38
  expect(@compressor.contents).to be_a Array
39
39
  expect(@compressor.contents).to be_empty
40
40
  end
41
- it 'should have formated filename with datetime' do
42
- expect(@compressor.instance_variable_get(:@compress_file)).
43
- to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
41
+ it "should have formated filename with datetime" do
42
+ expect(@compressor.instance_variable_get(:@compress_file))
43
+ .to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
44
44
  end
45
45
  end
46
46
  context "when swiss prefix is given" do
47
47
  before(:each) do
48
48
  cleanup_directories_before_run
49
- @compressor = Oddb2xml::Compressor.new('swiss', {:compress_ext => 'tar.gz'})
49
+ @compressor = Oddb2xml::Compressor.new("swiss", {compress_ext: "tar.gz"})
50
50
  end
51
- it 'should have formated filename with datetime' do
52
- expect(@compressor.instance_variable_get(:@compress_file)).
53
- to match(/swiss_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
51
+ it "should have formated filename with datetime" do
52
+ expect(@compressor.instance_variable_get(:@compress_file))
53
+ .to match(/swiss_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
54
54
  end
55
55
  end
56
56
  context "when tar.gz ext is given" do
57
57
  before(:each) do
58
58
  cleanup_directories_before_run
59
- @compressor = Oddb2xml::Compressor.new('oddb', {:compress_ext => 'tar.gz'})
59
+ @compressor = Oddb2xml::Compressor.new("oddb", {compress_ext: "tar.gz"})
60
60
  end
61
- it 'should have formated filename with datetime' do
62
- expect(@compressor.instance_variable_get(:@compress_file)).
63
- to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
61
+ it "should have formated filename with datetime" do
62
+ expect(@compressor.instance_variable_get(:@compress_file))
63
+ .to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.tar\.gz/)
64
64
  end
65
65
  end
66
66
  context "when zip ext is given" do
67
67
  before(:each) do
68
68
  cleanup_directories_before_run
69
- @compressor = Oddb2xml::Compressor.new('oddb', {:compress_ext => 'zip'})
69
+ @compressor = Oddb2xml::Compressor.new("oddb", {compress_ext: "zip"})
70
70
  end
71
- it 'should have formated filename with datetime' do
72
- expect(@compressor.instance_variable_get(:@compress_file)).
73
- to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.zip/)
71
+ it "should have formated filename with datetime" do
72
+ expect(@compressor.instance_variable_get(:@compress_file))
73
+ .to match(/oddb_xml_\d{2}.\d{2}.\d{4}_\d{2}.\d{2}.zip/)
74
74
  end
75
75
  end
76
76
  end
77
- context 'when finalize! is called' do
78
- context 'unexpectedly' do
77
+ context "when finalize! is called" do
78
+ context "unexpectedly" do
79
79
  before(:each) do
80
80
  cleanup_directories_before_run
81
- @savedDir = Dir.pwd
81
+ @saved_dir = Dir.pwd
82
82
  Dir.chdir Oddb2xml::SpecCompressor
83
83
  @compressor = Oddb2xml::Compressor.new
84
84
  end
85
85
  after(:each) do
86
- Dir.chdir @savedDir if @savedDir and File.directory?(@savedDir)
86
+ Dir.chdir @saved_dir if @saved_dir && File.directory?(@saved_dir)
87
87
  end
88
- it 'should fail with no contents' do
88
+ it "should fail with no contents" do
89
89
  expect(@compressor.finalize!).to eq(false)
90
90
  end
91
- it 'should fail with invalid file' do
92
- @compressor.contents << '../invalid_file'
93
- expect(@compressor.finalize!).to eq(false)
91
+ it "should fail with invalid file" do
92
+ @compressor.contents << "../invalid_file"
93
+ expect { @compressor.finalize! }.to raise_error(RuntimeError)
94
94
  end
95
95
  end
96
- context 'successfully' do
97
- context 'with tar.gz' do
96
+ context "successfully" do
97
+ context "with tar.gz" do
98
98
  before(:each) do
99
99
  cleanup_directories_before_run
100
100
  @compressor = Oddb2xml::Compressor.new
101
101
  end
102
- it_behaves_like 'any compressor'
102
+ it_behaves_like "any compressor"
103
103
  end
104
- context 'with zip' do
104
+ context "with zip" do
105
105
  before(:each) do
106
106
  cleanup_directories_before_run
107
- @savedDir = Dir.pwd
107
+ @saved_dir = Dir.pwd
108
108
  Dir.chdir Oddb2xml::SpecCompressor
109
- @compressor = Oddb2xml::Compressor.new('oddb', {:compress_ext => 'zip'})
109
+ @compressor = Oddb2xml::Compressor.new("oddb", {compress_ext: "zip"})
110
110
  end
111
111
  after(:each) do
112
- Dir.chdir @savedDir if @savedDir and File.directory?(@savedDir)
112
+ Dir.chdir @saved_dir if @saved_dir && File.directory?(@saved_dir)
113
113
  end
114
- it_behaves_like 'any compressor' if true
114
+ it_behaves_like "any compressor"
115
115
  end
116
116
  end
117
117
  end
@@ -5,7 +5,6 @@
5
5
  <ITEM DT="2015-11-24 00:00:00 +000">
6
6
  <ATYPE>NONPHARMA</ATYPE>
7
7
  <GTIN>7611600441020</GTIN>
8
- <PHAR>0058519</PHAR>
9
8
  <NAME_DE>TUBEGAZE Verband weiss Nr 12 20m Finger gross</NAME_DE>
10
9
  <NAME_FR>TUBEGAZE pans tubul blanc Nr 12 20m doigts grands</NAME_FR>
11
10
  <AUTH_HOLDER_NAME>IVF HARTMANN AG</AUTH_HOLDER_NAME>
@@ -14,7 +13,6 @@
14
13
  <ITEM DT="2015-11-24 00:00:00 +000">
15
14
  <ATYPE>NONPHARMA</ATYPE>
16
15
  <GTIN>00040565124308</GTIN>
17
- <PHAR>4236863</PHAR>
18
16
  <NAME_DE>ACTICOAT Flex 7 Wundverband 10x12.5cm 5 Stk</NAME_DE>
19
17
  <NAME_FR>ACTICOAT Flex 7 pansement vulné 10x12.5cm 5 pce</NAME_FR>
20
18
  <AUTH_HOLDER_NAME>Smith &amp; Nephew Schweiz AG</AUTH_HOLDER_NAME>
@@ -32,7 +30,6 @@
32
30
  <ITEM DT="2018-03-16T00:00:00">
33
31
  <ATYPE>NONPHARMA</ATYPE>
34
32
  <GTIN>68711428066649</GTIN>
35
- <PHAR>5863450</PHAR>
36
33
  <NAME_DE>3M MEDIPORE+PAD Absorbtionsverb 10x15cm 8 x 25 Stk</NAME_DE>
37
34
  <NAME_FR>3M MEDIPORE+PAD compr absorb 10x15cm 8 x 25 pce</NAME_FR>
38
35
  <AUTH_HOLDER_NAME>3M (Schweiz) GmbH (Professional Health Care)</AUTH_HOLDER_NAME>
@@ -5,7 +5,6 @@
5
5
  <ITEM DT="2018-12-05T00:00:00">
6
6
  <ATYPE>PHARMA</ATYPE>
7
7
  <GTIN>7680005850010</GTIN>
8
- <PHAR>1770177</PHAR>
9
8
  <SWMC_AUTHNR>00585001</SWMC_AUTHNR>
10
9
  <NAME_DE>VARILRIX Trockensub c Solv Fertspr 0.5 ml</NAME_DE>
11
10
  <NAME_FR>VARILRIX subst sèche c solv ser pré 0.5 ml</NAME_FR>
@@ -16,7 +15,6 @@
16
15
  <ITEM DT="2017-12-14T00:00:00">
17
16
  <ATYPE>PHARMA</ATYPE>
18
17
  <GTIN>7680545340019</GTIN>
19
- <PHAR>6749124</PHAR>
20
18
  <SWMC_AUTHNR>54534001</SWMC_AUTHNR>
21
19
  <NAME_DE>TEBOKAN Filmtabl 240 mg 30 Stk</NAME_DE>
22
20
  <NAME_FR>TEBOKAN cpr pell 240 mg 30 pce</NAME_FR>
@@ -27,7 +25,6 @@
27
25
  <ITEM DT="2017-12-14T00:00:00">
28
26
  <ATYPE>PHARMA</ATYPE>
29
27
  <GTIN>7680540150118</GTIN>
30
- <PHAR>1882189</PHAR>
31
28
  <SWMC_AUTHNR>54015011</SWMC_AUTHNR>
32
29
  <NAME_DE>NAROPIN Inj Lös 0.2 % 10ml Duofit Amp 5 Stk</NAME_DE>
33
30
  <NAME_FR>NAROPIN sol inj 0.2 % 10ml amp duofit 5 pce</NAME_FR>
@@ -38,7 +35,6 @@
38
35
  <ITEM DT="2017-12-08T00:00:00">
39
36
  <ATYPE>PHARMA</ATYPE>
40
37
  <GTIN>7680563520172</GTIN>
41
- <PHAR>6477223</PHAR>
42
38
  <SWMC_AUTHNR>56352017</SWMC_AUTHNR>
43
39
  <NAME_DE>ADVATE Trockensub 250 IE c Solv 2 ml Durchstf</NAME_DE>
44
40
  <NAME_FR>ADVATE subst sèche 250 UI c solv 2 ml flac</NAME_FR>
@@ -49,7 +45,6 @@
49
45
  <ITEM DT="2018-09-20T00:00:00">
50
46
  <ATYPE>PHARMA</ATYPE>
51
47
  <GTIN>7680658560014</GTIN>
52
- <PHAR>7199565</PHAR>
53
48
  <SWMC_AUTHNR>65856001</SWMC_AUTHNR>
54
49
  <NAME_DE>DIBASE Tropfen 10000 IE/ml Fl 10 ml</NAME_DE>
55
50
  <NAME_FR>DIBASE gouttes 10000 UI/ml fl 10 ml</NAME_FR>
@@ -60,7 +55,6 @@
60
55
  <ITEM DT="2017-12-08T00:00:00">
61
56
  <ATYPE>PHARMA</ATYPE>
62
57
  <GTIN>7680555580054</GTIN>
63
- <PHAR>2465312</PHAR>
64
58
  <SWMC_AUTHNR>55558005</SWMC_AUTHNR>
65
59
  <NAME_DE>ZYVOXID Filmtabl 600 mg 10 Stk</NAME_DE>
66
60
  <NAME_FR>ZYVOXID cpr pell 600 mg 10 pce</NAME_FR>
@@ -71,7 +65,6 @@
71
65
  <ITEM DT="2017-12-08T00:00:00">
72
66
  <ATYPE>PHARMA</ATYPE>
73
67
  <GTIN>7680620690084</GTIN>
74
- <PHAR>5819012</PHAR>
75
68
  <SWMC_AUTHNR>62069008</SWMC_AUTHNR>
76
69
  <NAME_DE>LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk</NAME_DE>
77
70
  <NAME_FR>LEVETIRACETAM DESITIN mini cpr pel 250 mg 30 pce</NAME_FR>
@@ -82,7 +75,6 @@
82
75
  <ITEM DT="2017-12-08T00:00:00">
83
76
  <ATYPE>PHARMA</ATYPE>
84
77
  <GTIN>7680353660163</GTIN>
85
- <PHAR>0020273</PHAR>
86
78
  <SWMC_AUTHNR>35366016</SWMC_AUTHNR>
87
79
  <NAME_DE>KENDURAL Depottabl 30 Stk</NAME_DE>
88
80
  <NAME_FR>KENDURAL cpr dépôt 30 pce</NAME_FR>
@@ -93,7 +85,6 @@
93
85
  <ITEM DT="2017-12-08T00:00:00">
94
86
  <ATYPE>PHARMA</ATYPE>
95
87
  <GTIN>7680536620137</GTIN>
96
- <PHAR>1699947</PHAR>
97
88
  <SWMC_AUTHNR>53662013</SWMC_AUTHNR>
98
89
  <NAME_DE>3TC Filmtabl 150 mg 60 Stk</NAME_DE>
99
90
  <NAME_FR>3TC cpr pell 150 mg 60 pce</NAME_FR>
@@ -104,7 +95,6 @@
104
95
  <ITEM DT="2017-12-08T00:00:00">
105
96
  <ATYPE>PHARMA</ATYPE>
106
97
  <GTIN>7680161050583</GTIN>
107
- <PHAR>2731179</PHAR>
108
98
  <SWMC_AUTHNR>16105058</SWMC_AUTHNR>
109
99
  <NAME_DE>HIRUDOID Creme 3 mg/g 40 g</NAME_DE>
110
100
  <NAME_FR>HIRUDOID crème 3 mg/g 40 g</NAME_FR>
@@ -115,7 +105,6 @@
115
105
  <ITEM DT="2017-12-08T00:00:00">
116
106
  <ATYPE>PHARMA</ATYPE>
117
107
  <GTIN>7680324750190</GTIN>
118
- <PHAR>0023722</PHAR>
119
108
  <SWMC_AUTHNR>32475019</SWMC_AUTHNR>
120
109
  <NAME_DE>LANSOYL Gel 225 g</NAME_DE>
121
110
  <NAME_FR>LANSOYL gel 225 g</NAME_FR>
@@ -126,7 +115,6 @@
126
115
  <ITEM DT="2017-12-08T00:00:00">
127
116
  <ATYPE>PHARMA</ATYPE>
128
117
  <GTIN>7680573230016</GTIN>
129
- <PHAR>6824802</PHAR>
130
118
  <SWMC_AUTHNR>57323001</SWMC_AUTHNR>
131
119
  <NAME_DE>LANSOPRAZOL Mepha Kaps 15 mg Fl 60 Stk</NAME_DE>
132
120
  <NAME_FR>LANSOPRAZOL Mepha caps 15 mg fl 60 pce</NAME_FR>
@@ -137,7 +125,6 @@
137
125
  <ITEM DT="2017-12-08T00:00:00">
138
126
  <ATYPE>PHARMA</ATYPE>
139
127
  <GTIN>7680532900196</GTIN>
140
- <PHAR>1699999</PHAR>
141
128
  <SWMC_AUTHNR>53290019</SWMC_AUTHNR>
142
129
  <NAME_DE>HUMALOG Inj Lös 100 IE/ml Durchstf 10 ml</NAME_DE>
143
130
  <NAME_FR>HUMALOG sol inj 100 UI/ml flac 10 ml</NAME_FR>
@@ -148,7 +135,6 @@
148
135
  <ITEM DT="2017-12-01T00:00:00">
149
136
  <ATYPE>PHARMA</ATYPE>
150
137
  <GTIN>7680002770014</GTIN>
151
- <PHAR>0361815</PHAR>
152
138
  <SWMC_AUTHNR>00277001</SWMC_AUTHNR>
153
139
  <NAME_DE>SEROCYTOL Herz-Gefässe Supp 3 Stk</NAME_DE>
154
140
  <NAME_FR>SEROCYTOL Coeur-Vaisseaux supp 3 pce</NAME_FR>
@@ -159,7 +145,6 @@
159
145
  <ITEM DT="2017-12-01T00:00:00">
160
146
  <ATYPE>PHARMA</ATYPE>
161
147
  <GTIN>7680002780013</GTIN>
162
- <PHAR>0361821</PHAR>
163
148
  <SWMC_AUTHNR>00278001</SWMC_AUTHNR>
164
149
  <NAME_DE>SEROCYTOL Kolon Supp 3 Stk</NAME_DE>
165
150
  <NAME_FR>SEROCYTOL Côlon supp 3 pce</NAME_FR>
@@ -170,7 +155,6 @@
170
155
  <ITEM DT="2017-12-01T00:00:00">
171
156
  <ATYPE>PHARMA</ATYPE>
172
157
  <GTIN>7680406620144</GTIN>
173
- <PHAR>0769841</PHAR>
174
158
  <SWMC_AUTHNR>40662014</SWMC_AUTHNR>
175
159
  <NAME_DE>PEVISONE Creme 15 g</NAME_DE>
176
160
  <NAME_FR>PEVISONE crème 15 g</NAME_FR>
@@ -181,7 +165,6 @@
181
165
  <ITEM DT="2017-12-01T00:00:00">
182
166
  <ATYPE>PHARMA</ATYPE>
183
167
  <GTIN>7680406620229</GTIN>
184
- <PHAR>0863244</PHAR>
185
168
  <SWMC_AUTHNR>40662022</SWMC_AUTHNR>
186
169
  <NAME_DE>PEVISONE Creme 30 g</NAME_DE>
187
170
  <NAME_FR>PEVISONE crème 30 g</NAME_FR>
@@ -192,7 +175,6 @@
192
175
  <ITEM DT="2017-11-03T00:00:00">
193
176
  <ATYPE>PHARMA</ATYPE>
194
177
  <GTIN>7680587340015</GTIN>
195
- <PHAR>4153628</PHAR>
196
178
  <SWMC_AUTHNR>58734001</SWMC_AUTHNR>
197
179
  <NAME_DE>YONDELIS Trockensub 0.25 mg Durchstf</NAME_DE>
198
180
  <NAME_FR>YONDELIS subst sèche 0.25 mg flac</NAME_FR>
@@ -203,7 +185,6 @@
203
185
  <ITEM DT="2017-11-03T00:00:00">
204
186
  <ATYPE>PHARMA</ATYPE>
205
187
  <GTIN>7680627160016</GTIN>
206
- <PHAR>5301924</PHAR>
207
188
  <SWMC_AUTHNR>62716001</SWMC_AUTHNR>
208
189
  <NAME_DE>COOP VITALITY Bronchialpastillen 40 Stk</NAME_DE>
209
190
  <NAME_FR>COOP VITALITY pastilles bronchiques 40 pce</NAME_FR>
@@ -214,7 +195,6 @@
214
195
  <ITEM DT="2018-01-30T00:00:00">
215
196
  <ATYPE>PHARMA</ATYPE>
216
197
  <GTIN>7680651600014</GTIN>
217
- <PHAR>6571270</PHAR>
218
198
  <SWMC_AUTHNR>65160001</SWMC_AUTHNR>
219
199
  <NAME_DE>LYNPARZA Kaps 50 mg 448 Stk</NAME_DE>
220
200
  <NAME_FR>LYNPARZA caps 50 mg 448 pce</NAME_FR>
@@ -225,7 +205,6 @@
225
205
  <ITEM DT="2018-02-09T00:00:00">
226
206
  <ATYPE>PHARMA</ATYPE>
227
207
  <GTIN>7680316440115</GTIN>
228
- <PHAR>0020244</PHAR>
229
208
  <SWMC_AUTHNR>31644011</SWMC_AUTHNR>
230
209
  <NAME_DE>FERRO-GRADUMET Depottabl 30 Stk</NAME_DE>
231
210
  <NAME_FR>FERRO-GRADUMET cpr dépôt 30 pce</NAME_FR>
@@ -236,7 +215,6 @@
236
215
  <ITEM DT="2018-03-16T00:00:00">
237
216
  <ATYPE>PHARMA</ATYPE>
238
217
  <GTIN>7680581580011</GTIN>
239
- <PHAR>3656617</PHAR>
240
218
  <SWMC_AUTHNR>58158001</SWMC_AUTHNR>
241
219
  <NAME_DE>PRIORIX TETRA Trockensub c Solv Fertspr</NAME_DE>
242
220
  <NAME_FR>PRIORIX TETRA subst sèche c solv ser pré</NAME_FR>
@@ -247,7 +225,6 @@
247
225
  <ITEM DT="2018-03-23T00:00:00">
248
226
  <ATYPE>PHARMA</ATYPE>
249
227
  <GTIN>7680444470107</GTIN>
250
- <PHAR>0919766</PHAR>
251
228
  <SWMC_AUTHNR>44447010</SWMC_AUTHNR>
252
229
  <NAME_DE>LOPRESOR Retard Divitabs 200 mg 14 Stk</NAME_DE>
253
230
  <NAME_FR>LOPRESOR Retard Divitabs 200 mg 14 pce</NAME_FR>
@@ -258,7 +235,6 @@
258
235
  <ITEM DT="2018-03-23T00:00:00">
259
236
  <ATYPE>PHARMA</ATYPE>
260
237
  <GTIN>7680444470299</GTIN>
261
- <PHAR>0919772</PHAR>
262
238
  <SWMC_AUTHNR>44447029</SWMC_AUTHNR>
263
239
  <NAME_DE>LOPRESOR Retard Divitabs 200 mg 56 Stk</NAME_DE>
264
240
  <NAME_FR>LOPRESOR Retard Divitabs 200 mg 56 pce</NAME_FR>
@@ -269,7 +245,6 @@
269
245
  <ITEM DT="2018-03-23T00:00:00">
270
246
  <ATYPE>PHARMA</ATYPE>
271
247
  <GTIN>7680152190687</GTIN>
272
- <PHAR>0544042</PHAR>
273
248
  <SWMC_AUTHNR>15219068</SWMC_AUTHNR>
274
249
  <NAME_DE>ZYMAFLUOR Tabl 0.25 mg Ds 400 Stk</NAME_DE>
275
250
  <NAME_FR>ZYMAFLUOR cpr 0.25 mg bte 400 pce</NAME_FR>
@@ -280,7 +255,6 @@
280
255
  <ITEM DT="2018-03-23T00:00:00">
281
256
  <ATYPE>PHARMA</ATYPE>
282
257
  <GTIN>7680434540995</GTIN>
283
- <PHAR>2381532</PHAR>
284
258
  <SWMC_AUTHNR>43454099</SWMC_AUTHNR>
285
259
  <NAME_DE>KAMILLIN Medipharm Bad liq 10 Btl 40 ml</NAME_DE>
286
260
  <NAME_FR>KAMILLIN Medipharm bain liq 10 sach 40 ml</NAME_FR>
@@ -69,5 +69,6 @@
69
69
  1122069562EINF ARZNEI Urtinktur 1-10g/ml 0010040013401000000000025000005884712
70
70
  1122069639EINF ARZNEI Ceres Urtinktur spez 20ml 0023440031301000000000025000005885322
71
71
  1122069622EINF ARZNEI Ceres Urtinktur 20ml 0018870025201000000000025000005885252
72
+ 1130361821SEROCYTOL Kolon Supp 3 Stk 002275003960401B080700076800027800132
72
73
  1131770177VARILRIX Trockensub c Solv (alt) Fertspr 0.5 ml 004768006650101B080800076800058500102
73
74
  1127766692VARILRIX Trockensub c Solv Fertspr 0.5 ml 004767006650101B080800076800058500342
@@ -197,7 +197,7 @@
197
197
  <p>70.01.10</p>
198
198
  </td>
199
199
  <td width="52%">
200
- <p>Ceres Urtinkturen gem&auml;ss L2</p>
200
+ <p>Ceres Urtinkturen gem&auml;ss L2 mit -- im Kommentar</p>
201
201
  </td>
202
202
  <td align="right" width="10%">
203
203
  <p>20ml</p>
@@ -2438,4 +2438,4 @@ die Abrechnung zu erleichtern.<br>
2438
2438
 
2439
2439
  </body>
2440
2440
 
2441
- </html>
2441
+ </html>
data/spec/data_helper.rb CHANGED
@@ -1,47 +1,47 @@
1
1
  #!/usr/bin/env ruby
2
2
  $:.unshift File.join(File.dirname(__FILE__))
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
  module Oddb2xml
5
- # Small helper script to see, whether all files are correctly filled
6
- def Oddb2xml.fill
5
+ # Small helper script to see, whether all files are correctly filled
6
+ def self.fill
7
7
  start_keys = [
8
- 1125822801,
9
- 1125830700,
10
- 1122465312,
11
- 1120020209,
12
- 1120020244,
13
- 1130020646,
14
- 1120020652,
15
- 1130021806,
16
- 1130021976,
17
- 1130023722,
18
- 1130027447,
19
- 1130028470,
20
- 1135366964,
21
- 1122871437,
22
- 1122871443,
23
- 1122871466,
24
- 1122871472,
25
- 1132867163,
26
- 1138110429,
27
- 1130598003,
28
- 1125565072,
29
- 1126000923,
30
- 1128111222,
31
- 1128111718,
32
- 1128807890,
33
- 1117199565,
34
- 1128111611,
35
- ]
36
-
37
- gtins = GTINS_DRUGS + [ FERRO_GRADUMET_GTIN,
38
- HIRUDOID_GTIN,LANSOYL_GTIN, LEVETIRACETAM_GTIN,
39
- SOFRADEX_GTIN, THREE_TC_GTIN, ZYVOXID_GTIN]
40
- gtins.each{|gtin| Oddb2xml.check_gtin(gtin)}
8
+ 1125822801,
9
+ 1125830700,
10
+ 1122465312,
11
+ 1120020209,
12
+ 1120020244,
13
+ 1130020646,
14
+ 1120020652,
15
+ 1130021806,
16
+ 1130021976,
17
+ 1130023722,
18
+ 1130027447,
19
+ 1130028470,
20
+ 1135366964,
21
+ 1122871437,
22
+ 1122871443,
23
+ 1122871466,
24
+ 1122871472,
25
+ 1132867163,
26
+ 1138110429,
27
+ 1130598003,
28
+ 1125565072,
29
+ 1126000923,
30
+ 1128111222,
31
+ 1128111718,
32
+ 1128807890,
33
+ 1117199565,
34
+ 1128111611
35
+ ]
41
36
 
42
- ENV['LANG']= "de_CH.ISO-8859"
43
- outfile = 'spec/data/transfer.dat'
44
- FileUtils.rm_f(outfile, :verbose => true)
37
+ gtins = GTINS_DRUGS + [FERRO_GRADUMET_GTIN,
38
+ HIRUDOID_GTIN, LANSOYL_GTIN, LEVETIRACETAM_GTIN,
39
+ SOFRADEX_GTIN, THREE_TC_GTIN, ZYVOXID_GTIN]
40
+ gtins.each { |gtin| Oddb2xml.check_gtin(gtin) }
41
+
42
+ ENV["LANG"] = "de_CH.ISO-8859"
43
+ outfile = "spec/data/transfer.dat"
44
+ FileUtils.rm_f(outfile, verbose: true)
45
45
  start_keys.each do |key|
46
46
  cmd = "egrep '^#{key}' downloads/transfer.dat >> #{outfile}"
47
47
  system(cmd)
@@ -50,23 +50,21 @@ module Oddb2xml
50
50
  gtins.each do |key|
51
51
  cmd = "grep #{key} downloads/transfer.dat >> #{outfile}"
52
52
  system(cmd)
53
- iksnrs << key.to_s[4..8] if /^7680/i.match(key.to_s)
53
+ iksnrs << key.to_s[4..8] if /^7680/i.match?(key.to_s)
54
54
  end
55
55
  puts "Created #{outfile} #{File.size(outfile)} bytes"
56
- puts "Used IKSNRS are #{iksnrs.sort.uniq.join(' ')}"
56
+ puts "Used IKSNRS are #{iksnrs.sort.uniq.join(" ")}"
57
57
  end
58
-
59
- def Oddb2xml.check_gtin(gtin)
58
+
59
+ def self.check_gtin(gtin)
60
60
  files = `grep -l #{gtin} downloads/*.xml`.split("\n")
61
61
  files.each do |file|
62
- short = File.join(SpecData,File.basename(file))
63
- nrMatches = 0
64
- nrMatches = `grep -c #{gtin} #{short}`.to_i if File.exist?(short)
65
- puts "Could not find #{gtin} in #{short}" unless nrMatches > 0
62
+ short = File.join(SpecData, File.basename(file))
63
+ nr_matches = 0
64
+ nr_matches = `grep -c #{gtin} #{short}`.to_i if File.exist?(short)
65
+ puts "Could not find #{gtin} in #{short}" unless nr_matches > 0
66
66
  end
67
67
  end
68
68
  end
69
69
 
70
70
  Oddb2xml.fill
71
-
72
-