oddb2xml 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,3 +16,8 @@
16
16
  1132867163TOTALIN Plv ad us. vet. 5 kg 000535000900400C000000000000000000002
17
17
  1138110429Forthyron 400 mcg 50 Tabl (vet) 0081120015800000000000000000000000002
18
18
  1130598003SOFRADEX Gtt Auric 8 ml 000718001545300B120130076803169501572
19
+ 1125565072SEMPER Cookie-O�s glutenfrei 150 g 0004450007054000000000073101005542602
20
+ 1126000923CER�8 after sting Roll-on 20 ml 0005900008204000000000000000000000001
21
+ 1128111222DermaSilk Set Body + Strumpfh�schen 24�36 Mon (98)0154250164800000000000000000000000002
22
+ 1128111718Inkosport Activ Pro 80 Himbeer � Joghurt Ds 750g 0038970055000000000000000000000000002
23
+ 1128807890Ethacridin lactat 1� 100ml 0009290013701000000000000000000000002
@@ -119,6 +119,7 @@ describe Oddb2xml::MedregbmExtractor do
119
119
  end
120
120
 
121
121
  describe Oddb2xml::ZurroseExtractor do
122
+ if false
122
123
  context 'when transfer.dat is empty' do
123
124
  subject { Oddb2xml::ZurroseExtractor.new("") }
124
125
  it { expect(subject.to_hash).to be_empty }
@@ -186,5 +187,44 @@ describe Oddb2xml::ZurroseExtractor do
186
187
  end
187
188
  #it { expect(subject.to_hash.keys.first).to eq("7680316950157") }
188
189
  it "should set the correct SALECD cmut code" do expect(subject.to_hash.values.first[:cmut]).to eq("3") end
190
+ it "should set the correct SALECD description" do expect(subject.to_hash.values.first[:description]).to eq("SOFRADEX Gtt Auric 8 ml") end
189
191
  end
192
+ context 'when Ethacridin is given' do
193
+ subject do
194
+ dat = <<-DAT
195
+ 1128807890Ethacridin lactat 1\069 100ml 0009290013701000000000000000000000002\r\n
196
+ DAT
197
+ Oddb2xml::ZurroseExtractor.new(dat, true)
198
+ end
199
+ #it { expect(subject.to_hash.keys.first).to eq("7680316950157") }
200
+ it "should set the correct SALECD cmut code" do expect(subject.to_hash.values.first[:cmut]).to eq("2") end
201
+ it "should set the correct SALECD description" do expect(subject.to_hash.values.first[:description]).to eq("Ethacridin lactat 1‰ 100ml") end
202
+ end if false
203
+ end
204
+ context 'when parsing examples' do
205
+ subject do
206
+ filename = File.expand_path(File.join(__FILE__, '..', 'data', 'zurrose_transfer.dat'))
207
+ puts "filename #{filename} #{File.exists?(filename)}"
208
+ Oddb2xml::ZurroseExtractor.new(filename, true)
209
+ end
210
+ it "should set the correct Ethacridin description" do
211
+ ethacridin = subject.to_hash.values.find{ |x| /Ethacridin/i.match(x[:description])}
212
+ expect(ethacridin[:description]).to eq("Ethacridin lactat 1‰ 100ml")
213
+ end
214
+ specials = { 'SEMPER Cookie' => 'SEMPER Cookie-O’s glutenfrei 150 g',
215
+ 'DermaSilk' => 'DermaSilk Set Body + Strumpfhöschen 24-36 Mon (98)',
216
+ 'after sting Roll-on' => 'CER’8 after sting Roll-on 20 ml',
217
+ 'Inkosport' => 'Inkosport Activ Pro 80 Himbeer - Joghurt Ds 750g',
218
+ 'Ethacridin' => "Ethacridin lactat 1‰ 100ml",}.
219
+ each{ | key, value |
220
+ it "should set the correct #{key} description" do
221
+ item = subject.to_hash.values.find{ |x| /#{key}/i.match(x[:description])}
222
+ expect(item[:description]).to eq(value)
223
+ end
224
+ }
225
+
226
+ end
227
+
228
+
229
+
190
230
  end