oddb2xml 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 721c2d137c7dbaaed24ff52acfe254adc280b954
4
- data.tar.gz: 67e7cc0025f8e76d9e6ae64d9877055f4c0d4788
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGNmNGQ3MWQ2ODJmZWU1NTQ0NTlhNjMxZTM2ZDQwMDNhMDQxZTVmOQ==
5
+ data.tar.gz: !binary |-
6
+ ZmIzODJjZTg3MjUyMjFjNTY2YmViMWNlZmZkMGU0OTE0YTc0NzVkNA==
5
7
  SHA512:
6
- metadata.gz: 0debbdf566d2180e15c345a1b7d7faa3fdf4013a8ada0204bc01d92a29a5d246fd53f3a9288cc50c44a36373d69a4412b7447129b9a99f7e495ce115b3368f6b
7
- data.tar.gz: 5f75349fbf9ec7bd2b05cc6e6fec4c1efd0028210a9e49497813edc44f701dbf5cc274bd0c95c4ac2b3531927be9533f9fd072de2697a5ec6ed9e6c49fc911b7
8
+ metadata.gz: !binary |-
9
+ MWYzZWFiMDkwYzJkYTdkY2E2ZjNkNjE1ZDM4MjEyYzcyMmFhYWJjMDVlNjJl
10
+ MWE2MmU2M2UxZTdjZDRmOTIxNDZkNzA3OTQwNjZmZWQ1MGUxZjlhMWIyMzdh
11
+ MGNjZWUxZTYwM2U0NjZkMjlhYTllYTk1MThjNmU4NmNlMDI0YWM=
12
+ data.tar.gz: !binary |-
13
+ NzhiNzFkNWM0MWM2MDA4MWNkNTA0Zjc1NWJmYWQzNjA0ZjlkZTI5M2U3YWRi
14
+ NWVmZmE5ZDJjNzk1YThiOGMxODIzM2JhYTM5MDkxY2E3YzQ4ZDc3NTVhYzMz
15
+ NzcyMjRkNzRmYmQyMjU0NDMxODBiYmMzOTA2MDlkMTFkMDQwMjU=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (1.9.8)
4
+ oddb2xml (1.9.9)
5
5
  archive-tar-minitar (~> 0.5.2)
6
6
  mechanize (~> 2.5.1)
7
7
  nokogiri (~> 1.5.10)
@@ -20,15 +20,16 @@ GEM
20
20
  nokogiri
21
21
  archive-tar-minitar (0.5.2)
22
22
  builder (3.2.2)
23
- byebug (3.5.1)
24
- columnize (~> 0.8)
25
- debugger-linecache (~> 1.2)
26
- slop (~> 3.6)
27
23
  coderay (1.1.0)
28
24
  columnize (0.9.0)
29
25
  crack (0.4.2)
30
26
  safe_yaml (~> 1.0.0)
27
+ debugger (1.6.8)
28
+ columnize (>= 0.3.1)
29
+ debugger-linecache (~> 1.2.0)
30
+ debugger-ruby_core_source (~> 1.3.5)
31
31
  debugger-linecache (1.2.0)
32
+ debugger-ruby_core_source (1.3.7)
32
33
  diff-lcs (1.2.5)
33
34
  domain_name (0.5.23)
34
35
  unf (>= 0.0.5, < 1.0.0)
@@ -56,9 +57,9 @@ GEM
56
57
  coderay (~> 1.1.0)
57
58
  method_source (~> 0.8.1)
58
59
  slop (~> 3.4)
59
- pry-byebug (3.0.1)
60
- byebug (~> 3.4)
61
- pry (~> 0.10)
60
+ pry-debugger (0.2.3)
61
+ debugger (~> 1.3)
62
+ pry (>= 0.9.10, < 0.11.0)
62
63
  rack (1.6.0)
63
64
  rake (10.4.2)
64
65
  rdoc (4.2.0)
@@ -112,7 +113,7 @@ PLATFORMS
112
113
  DEPENDENCIES
113
114
  bundler
114
115
  oddb2xml!
115
- pry-byebug
116
+ pry-debugger
116
117
  rake
117
118
  rdoc
118
119
  rspec
@@ -1,3 +1,9 @@
1
+ === 1.9.9 / 13.03.2015
2
+
3
+ * Rename NAME -> COMPOSITION_NAME in calc.xml for composition
4
+ * Handle Handle ( in compostion names
5
+ * Emit all components mentioned in column_M Zusammensetzung
6
+
1
7
  === 1.9.8 / 04.03.2015
2
8
 
3
9
  * Remove unnecessary spaces from ARTICLE.GALENIC_FORM in oddb_calc.xml
@@ -684,7 +684,7 @@ module Oddb2xml
684
684
  info.compositions.each {
685
685
  |composition|
686
686
  xml.COMPONENT {
687
- xml.NAME composition.name
687
+ xml.COMPOSITION_NAME composition.name
688
688
  if composition.unit
689
689
  xml.QTY composition.qty
690
690
  xml.UNIT composition.unit
@@ -92,7 +92,7 @@ module Oddb2xml
92
92
  'ovale Körper',
93
93
  'tube(s)',
94
94
  ]
95
- Mesurements = [ 'g', 'kg', 'l', 'mg', 'ml', 'cm', 'GBq']
95
+ Measurements = [ 'g', 'kg', 'l', 'mg', 'ml', 'cm', 'GBq']
96
96
  Others = ['Kombipackung', 'emballage combiné' ]
97
97
  UnknownGalenicForm = 140
98
98
  UnknownGalenicGroup = 1
@@ -153,35 +153,6 @@ module Oddb2xml
153
153
  end
154
154
  public
155
155
  SCALE_P = %r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u
156
- def self.update_active_agent(name, part)
157
- units = 'U\.\s*Ph\.\s*Eur\.'
158
- ptrn = %r{(?ix)
159
- (^|[[:punct:]]|\bet|\bex)\s*#{Regexp.escape name}(?![:\-])
160
- (\s*(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(#{units}|[^\s,]+))
161
- (\s*[mv]/[mv])?)))?
162
- (\s*(?:ut|corresp\.?)\s+(?<chemical>[^\d,]+)
163
- \s*(?<cdose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(#{units}|[^\s,]+))
164
- (\s*[mv]/[mv])?))?)?
165
- }u
166
- if(match = ptrn.match(part.sub(/\.$/, '')))
167
- dose = match[:dose].split(/\b\s*(?![.,\d\-]|Mio\.?)/u, 2) if match[:dose]
168
- cdose = match[:cdose].split(/\b\s*(?![.,\d\-]|Mio\.?)/u, 2) if match[:cdose]
169
- if dose && (scale = SCALE_P.match(part)) && !dose[1].include?('/')
170
- unit = dose[1] << '/'
171
- num = scale[:qty].to_f
172
- if num <= 1
173
- unit << scale[:unit]
174
- else
175
- unit << scale[:scale]
176
- end
177
- end
178
- if(chemical = match[:chemical])
179
- chemical = capitalize(chemical)
180
- chemical = nil if chemical.empty?
181
- end if false # TODO:
182
- [name, dose ? [dose[0], dose[1]] : [nil, nil] ].flatten
183
- end
184
- end
185
156
  private
186
157
  def remove_duplicated_spaces(string)
187
158
  string ? string.to_s.gsub(/\s\s+/, ' ') : nil
@@ -229,11 +200,59 @@ public
229
200
  end
230
201
  agents = []
231
202
  comps = []
203
+ units = 'U\.\s*Ph\.\s*Eur\.'
204
+ name = 'dummy'
205
+ ptrn = %r{(?ix)
206
+ (^|[[:punct:]]|\bet|\bex)\s*#{Regexp.escape name}(?![:\-])
207
+ (\s*(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(#{units}|[^\s,]+))
208
+ (\s*[mv]/[mv])?)))?
209
+ (\s*(?:ut|corresp\.?)\s+(?<chemical>[^\d,]+)
210
+ \s*(?<cdose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(#{units}|[^\s,]+))
211
+ (\s*[mv]/[mv])?))?)?
212
+ }u
213
+ rep_1 = '----'; to_1 = '('
214
+ rep_2 = '-----'; to_2 = ')'
215
+ rep_3 = '------'; to_3 = ','
232
216
  compositions.each_with_index do |composition, idx|
233
217
  composition.gsub!(/'/, '')
234
- @active_substances.each { |name|
235
- name, qty, unit = Calc.update_active_agent(name, composition)
236
- res << Composition.new(name, qty.to_f, unit, labels[idx] ? labels[idx].join('') : nil) if name
218
+ label = nil
219
+ composition_text.split(/\n/u).each {
220
+ |line|
221
+ if m = /^(?<part_id>A|I|B|II|C|III|D|IV|E|V|F|VI)\)\s+(?<part_name>[^\s:, ]+):/.match(line)
222
+ label = "#{m[:part_id]} #{m[:part_name]}"
223
+ end
224
+ filler = line.split(',')[-1].sub(/\.$/, '')
225
+ filler_match = /^(?<name>[^,\d]+)\s*(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))))/.match(filler)
226
+ components = line.split(/([^\(]+\([^)]+\)[^,]+|),/).each {
227
+ |component|
228
+ next unless component.size > 0
229
+ to_consider = component.strip.split(':')[-1] # remove label
230
+ # very ugly hack to ignore ,()
231
+ m = /^(?<name>[^,\d()]+)\s*(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))))/.match(to_consider
232
+ .gsub(to_1, rep_1).gsub(to_2, rep_2).gsub(to_3, rep_3))
233
+ if m2 = /^(|[^:]+:\s)(E\s+\d+)$/.match(component.strip)
234
+ to_add = Composition.new(m2[2], '', '', nil)
235
+ res << to_add
236
+ elsif m
237
+ dose = nil
238
+ unit = nil
239
+ name = m[:name].split(/\s/).collect{ |x| x.capitalize }.join(' ').strip.gsub(rep_3, to_3).gsub(rep_2, to_2).gsub(rep_1, to_1)
240
+ dose = m[:dose].split(/\b\s*(?![.,\d\-]|Mio\.?)/u, 2) if m[:dose]
241
+ if dose && (scale = SCALE_P.match(filler)) && dose[1] && !dose[1].include?('/')
242
+ unit = dose[1] << '/'
243
+ num = scale[:qty].to_f
244
+ if num <= 1
245
+ unit << scale[:unit]
246
+ else
247
+ unit << scale[:scale]
248
+ end
249
+ elsif dose.size == 2
250
+ unit = dose[1]
251
+ end
252
+ to_add = Composition.new(name, dose ? dose[0].to_f : nil, unit ? unit.gsub(rep_3, to_3).gsub(rep_2, to_2).gsub(rep_1, to_1) : nil, label)
253
+ res << to_add
254
+ end
255
+ }
237
256
  }
238
257
  end
239
258
  @compositions = res
@@ -276,7 +295,7 @@ public
276
295
  begin
277
296
  return pkg_size_to_int(pkg_size_L) unless part_from_name_C
278
297
  part_from_name_C = part_from_name_C.gsub(/[()]/, '_')
279
- Mesurements.each{ |x|
298
+ Measurements.each{ |x|
280
299
  if einheit_M and /^#{x}$/i.match(einheit_M)
281
300
  puts "measurement in einheit_M #{einheit_M} matched: #{x}" if $VERBOSE
282
301
  update_rule('measurement einheit_M')
@@ -317,7 +336,7 @@ public
317
336
  return pkg_size_to_int(pkg_size_L, true)
318
337
  end
319
338
  }
320
- Mesurements.each{ |x|
339
+ Measurements.each{ |x|
321
340
  if pkg_size_L and pkg_size_L.split(' ').index(x)
322
341
  puts "measurement in pkg_size_L #{pkg_size_L} matched: #{x}" if $VERBOSE
323
342
  update_rule('measurement pkg_size_L')
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "1.9.8"
2
+ VERSION = "1.9.9"
3
3
  end
@@ -26,6 +26,17 @@ describe Oddb2xml::Calc do
26
26
  TestExample = Struct.new("TestExample", :test_description, :iksnr_A, :seqnr_B, :pack_K, :name_C, :package_size_L, :einheit_M, :active_substance_0, :composition_P,
27
27
  :values_to_compare)
28
28
 
29
+ tst_cardio_pumal = TestExample.new('Cardio-Pulmo-Rénal Sérocytol',
30
+ 274, 1, 1, "Cardio-Pulmo-Rénal Sérocytol, suppositoire",
31
+ '3', 'Suppositorien',
32
+ 'globulina equina (immunisé avec coeur, tissu pulmonaire, reins de porcins)',
33
+ 'globulina equina (immunisé avec coeur, tissu pulmonaire, reins de porcins) 8 mg, propylenglycolum, conserv.: E 216, E 218, excipiens pro suppositorio.',
34
+ { :selling_units => 3,
35
+ :measure => 'Suppositorien',
36
+ # :count => 10, :multi => 1, :dose => ''
37
+ }
38
+ )
39
+
29
40
  tst_fluorglukose = TestExample.new('Fluorglukose',
30
41
  51908, 2, 16, "2-Fluorglukose (18-F), Injektionslösung",
31
42
  '0,1 - 80', 'GBq',
@@ -285,7 +296,6 @@ Corresp. 5300 kJ.",
285
296
  puts "Testing key #{key.inspect} #{value.inspect} against #{result} seems to fail" unless result == value.to_s
286
297
  result.should eq value.to_s
287
298
  }
288
- XPath.match( doc, "//ARTICLE[GTIN='7680006790124']/COMPOSITIONS/COMPONENT/NAME").last.text.should eq 'Bifidobacterium Infantis'
289
299
  XPath.match( doc, "//ARTICLE[GTIN='7680545250363']/COMPOSITIONS/COMPONENT/NAME").last.text.should eq 'Alprostadilum'
290
300
  XPath.match( doc, "//ARTICLE[GTIN='7680458820202']/NAME").last.text.should eq 'Magnesiumchlorid 0,5 molar B. Braun, Zusatzampulle für Infusionslösungen'
291
301
  end
@@ -322,16 +332,6 @@ Corresp. 5300 kJ.",
322
332
  # specify { expect(info.galenic_form.description).to eq "Infusionsemulsion" }
323
333
  end
324
334
 
325
- context 'find correct result compositions' do
326
- result = Calc.new(nil, nil, nil, 'rutosidum trihydricum, aescinum', 'rutosidum trihydricum 20 mg, aescinum 25 mg, aromatica, excipiens pro compresso.')
327
- specify { expect(result.compositions.first.name).to eq 'Rutosidum Trihydricum' }
328
- specify { expect(result.compositions.first.qty).to eq 20}
329
- specify { expect(result.compositions.first.unit).to eq 'mg'}
330
- specify { expect(result.compositions[1].name).to eq 'Aescinum' }
331
- specify { expect(result.compositions[1].qty).to eq 25}
332
- specify { expect(result.compositions[1].unit).to eq 'mg'}
333
- end
334
-
335
335
  context 'should handle CFU' do
336
336
  result = Calc.new(nil, nil, nil, 'lactobacillus acidophilus cryodesiccatus, bifidobacterium infantis',
337
337
  'lactobacillus acidophilus cryodesiccatus min. 10^9 CFU, bifidobacterium infantis min. 10^9 CFU, color.: E 127, E 132, E 104, excipiens pro capsula.')
@@ -339,26 +339,102 @@ Corresp. 5300 kJ.",
339
339
  end
340
340
 
341
341
  context 'find correct result compositions' do
342
- result = Calc.new('Nutriflex Lipid peri, Infusionsemulsion, 1250ml', nil, nil,
343
- 'glucosum anhydricum, zinci acetas dihydricus, isoleucinum, leucinum, lysinum anhydricum, methioninum, phenylalaninum, threoninum, tryptophanum, valinum, argininum, histidinum, alaninum, acidum asparticum, acidum glutamicum, glycinum, prolinum, serinum, magnesii acetas tetrahydricus, chloridum, phosphas, acetas, sojae oleum, triglycerida saturata media',
344
- 'I) Glucoselösung: glucosum anhydricum 80 g ut glucosum monohydricum, natrii dihydrogenophosphas dihydricus 1.17 g, zinci acetas dihydricus 6.625 mg, acidum citricum q.s. ad pH, aqua ad iniectabilia q.s. ad solutionem pro 500 ml.
342
+ text = 'I) Glucoselösung: glucosum anhydricum 80 g ut glucosum monohydricum, natrii dihydrogenophosphas dihydricus 1.17 g glycerolum, zinci acetas dihydricus 6.625 mg, natrii oleas, aqua q.s. ad emulsionem pro 250 ml.
345
343
  II) Fettemulsion: sojae oleum 25 g, triglycerida saturata media 25 g, lecithinum ex ovo 3 g, glycerolum, natrii oleas, aqua q.s. ad emulsionem pro 250 ml.
346
- III) Aminosäurenlösung: isoleucinum 2.34 g, leucinum 3.13 g, lysinum anhydricum 2.26 g ut lysini hydrochloridum, methioninum 1.96 g, phenylalaninum 3.51 g, threoninum 1.82 g, tryptophanum 0.57 g, valinum 2.6 g, argininum 2.7 g, histidinum 1.25 g ut histidini hydrochloridum monohydricum, alaninum 4.85 g, acidum asparticum 1.5 g, acidum glutamicum 3.5 g, glycinum 1.65 g, prolinum 3.4 g, serinum 3 g, natrii hydroxidum 0.8 g, natrii chloridum 1.081 g, natrii acetas trihydricus 0.544 g, kalii acetas 2.943 g, magnesii acetas tetrahydricus 0.644 g, calcii chloridum dihydricum 0.441 g, aqua ad iniectabilia q.s. ad solutionem pro 500 ml.
344
+ III) Aminosäurenlösung: isoleucinum 2.34 g, leucinum 3.13 g, lysinum anhydricum 2.26 g ut lysini hydrochloridum, methioninum 1.96 g, aqua ad iniectabilia q.s. ad solutionem pro 400 ml.
347
345
  .
348
- I) et II) et III) corresp.: aminoacida 32 g/l, carbohydrata 64 g/l, materia crassa 40 g/l, natrium 40 mmol/l, kalium 24 mmol/l, calcium 2.4 mmol/l, magnesium 2.4 mmol, zincum 0.024 mmol/l, chloridum 38.4 mmol/l, phosphas 6 mmol/l, acetas 32 mmol/l, acidum citricum monohydricum, in emulsione recenter mixta 1250 ml.
349
- Corresp. 4000 kJ.')
346
+ I) et II) et III) corresp.: aminoacida 32 g/l, acetas 32 mmol/l, acidum citricum monohydricum, in emulsione recenter mixta 1250 ml.
347
+ Corresp. 4000 kJ.'
348
+ result = Calc.new('Nutriflex Lipid peri, Infusionsemulsion, 1250ml', nil, nil,
349
+ 'glucosum anhydricum, zinci acetas dihydricus, isoleucinum, leucinum',
350
+ text
351
+ )
350
352
  specify { expect(result.compositions.first.name).to eq 'Glucosum Anhydricum' }
351
353
  specify { expect(result.compositions.first.qty).to eq 80.0}
352
- specify { expect(result.compositions.first.unit).to eq 'g/500 ml'}
353
- zinci = result.compositions.find{ |x| x.name == 'Zinci Acetas Dihydricus' }
354
- specify { expect(zinci.name).to eq 'Zinci Acetas Dihydricus' }
355
- specify { expect(zinci.qty).to eq 6.625}
356
- specify { expect(zinci.unit).to eq 'mg/500 ml'}
357
- zinci = result.compositions.find{ |x| x.name == 'Zinci Acetas Dihydricus' }
358
- natrii = result.compositions.find{ |x| x.name == 'Natrii Dihydrogenophosphas Dihydricus' }
359
- specify { expect(zinci).not_to eq nil}
360
- skip 'Is Natrii Dihydrogenophosphas Dihydricus a real error or not?'
361
- # specify { expect(natrii).not_to eq nil }
354
+ specify { expect(result.compositions.first.unit).to eq 'g/250 ml'}
355
+ specify { expect(result.compositions.first.label).to eq 'I Glucoselösung' }
356
+
357
+ # from II)
358
+ lecithinum = result.compositions.find{ |x| x.name.match(/lecithinum/i) }
359
+ specify { expect(lecithinum).not_to eq nil}
360
+ if lecithinum
361
+ specify { expect(lecithinum.name).to eq 'Lecithinum Ex Ovo' }
362
+ specify { expect(lecithinum.qty).to eq 3.0}
363
+ specify { expect(lecithinum.unit).to eq 'g/250 ml'}
364
+ specify { expect(lecithinum.label).to eq 'II Fettemulsion' }
365
+ end
366
+
367
+ # From III
368
+ leucinum = result.compositions.find{ |x| x.name.eql?('Leucinum') and x.label.match(/^III /) }
369
+ specify { expect(leucinum).not_to eq nil}
370
+ if leucinum
371
+ specify { expect(leucinum.name).to eq 'Leucinum' }
372
+ specify { expect(leucinum.qty).to eq 3.13}
373
+ specify { expect(leucinum.unit).to eq 'g/400 ml'}
374
+ specify { expect(leucinum.label).to eq 'III Aminosäurenlösung' }
375
+ end
376
+ leucinum_I = result.compositions.find{ |x| x.name.eql?('Leucinum') and x.label.match(/^I /) }
377
+ specify { expect(leucinum_I).to eq nil}
378
+ leucinum_II = result.compositions.find{ |x| x.name.eql?('Leucinum') and x.label.match(/^II /) }
379
+ specify { expect(leucinum_II).to eq nil}
380
+ end
381
+
382
+ context 'find correct result compositions' do
383
+ result = Calc.new(nil, nil, nil, 'rutosidum trihydricum, aescinum', 'rutosidum trihydricum 20 mg, aescinum 25 mg, aromatica, excipiens pro compresso.')
384
+ specify { expect(result.compositions.first.name).to eq 'Rutosidum Trihydricum' }
385
+ specify { expect(result.compositions.first.qty).to eq 20}
386
+ specify { expect(result.compositions.first.unit).to eq 'mg'}
387
+ specify { expect(result.compositions[1].name).to eq 'Aescinum' }
388
+ specify { expect(result.compositions[1].qty).to eq 25}
389
+ specify { expect(result.compositions[1].unit).to eq 'mg'}
390
+ end
391
+
392
+ context 'find correct result for Inflora, capsule' do
393
+ info = Calc.new(tst_infloran.name_C, tst_infloran.package_size_L, tst_infloran.einheit_M, tst_infloran.active_substance_0, tst_infloran.composition_P)
394
+ # specify { expect(tst_infloran.url).to eq 'http://ch.oddb.org/de/gcc/drug/reg/00679/seq/02/pack/012' }
395
+ specify { expect(info.galenic_form.description).to eq 'capsule' }
396
+ skip { expect(info.galenic_group.description).to eq 'Injektion/Infusion' }
397
+ specify { expect(info.pkg_size).to eq '2x10' }
398
+ specify { expect(info.selling_units).to eq 20 }
399
+ skip { expect(info.measure).to eq '0' }
400
+ bifidobacterium = info.compositions.find{ |x| x.name.match(/Bifidobacterium/i) }
401
+ specify { expect(bifidobacterium).not_to eq nil}
402
+ if bifidobacterium
403
+ specify { expect(bifidobacterium.name).to eq 'Bifidobacterium Infantis Min.' }
404
+ skip { expect(bifidobacterium.qty).to eq '10^9'}
405
+ skip { expect(bifidobacterium.unit).to eq 'CFU'}
406
+ end
407
+ e_127 = info.compositions.find{ |x| x.name.match(/E 127/i) }
408
+ skip { expect(e_127).not_to eq nil}
409
+ if e_127
410
+ specify { expect(e_127.name).to eq 'E 127' }
411
+ specify { expect(e_127.unit).to eq ''}
412
+ end
413
+ end
362
414
 
415
+ context 'find correct result for Cardio-Pulmo-Rénal Sérocytol, suppositoire' do
416
+ info = Calc.new(tst_cardio_pumal.name_C, tst_cardio_pumal.package_size_L, tst_cardio_pumal.einheit_M, tst_cardio_pumal.active_substance_0, tst_cardio_pumal.composition_P)
417
+ specify { expect(info.galenic_form.description).to eq 'suppositoire' }
418
+ specify { expect(info.galenic_group.description).to eq 'unbekannt' }
419
+ specify { expect(info.pkg_size).to eq '3' }
420
+ specify { expect(info.selling_units).to eq 3 }
421
+ specify { expect(info.name).to eq 'Cardio-Pulmo-Rénal Sérocytol, suppositoire'}
422
+ specify { expect(info.measure).to eq 'Suppositorien' }
423
+ globulina = info.compositions.find{ |x| x.name.match(/porcins|globulina/i) }
424
+ specify { expect(globulina).not_to eq nil}
425
+ if globulina
426
+ specify { expect(globulina.name).to eq 'Globulina Equina (immunisé Avec Coeur, Tissu Pulmonaire, Reins De Porcins)' }
427
+ specify { expect(globulina.qty).to eq 8.0}
428
+ specify { expect(globulina.unit).to eq 'mg'}
429
+ end
430
+ e_216 = info.compositions.find{ |x| x.name.match(/E 216/i) }
431
+ specify { expect(e_216).not_to eq nil}
432
+ if e_216
433
+ specify { expect(e_216.name).to eq 'E 216' }
434
+ specify { expect(e_216.unit).to eq ''}
435
+ end
436
+ e_218 = info.compositions.find{ |x| x.name.match(/E 218/i) }
437
+ specify { expect(e_218).not_to eq nil}
363
438
  end
439
+
364
440
  end
metadata CHANGED
@@ -1,195 +1,195 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.8
4
+ version: 1.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: archive-tar-minitar
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.5.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.5.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mechanize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.5.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.5.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.5.10
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.5.10
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: savon
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.4.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: spreadsheet
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.0.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubyXL
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: 3.3.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 3.3.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sax-machine
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 0.1.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.1.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - ! '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - ! '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rake
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - ! '>='
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - ! '>='
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - ! '>='
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: webmock
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - ! '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rdoc
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - ! '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - ! '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  description: oddb2xml creates xml files using swissINDEX, BAG-XML and Swissmedic.
@@ -199,9 +199,9 @@ executables:
199
199
  extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
- - ".gitignore"
203
- - ".rspec"
204
- - ".travis.yml"
202
+ - .gitignore
203
+ - .rspec
204
+ - .travis.yml
205
205
  - Gemfile
206
206
  - Gemfile.lock
207
207
  - History.txt
@@ -290,12 +290,12 @@ require_paths:
290
290
  - lib
291
291
  required_ruby_version: !ruby/object:Gem::Requirement
292
292
  requirements:
293
- - - ">="
293
+ - - ! '>='
294
294
  - !ruby/object:Gem::Version
295
295
  version: '0'
296
296
  required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  requirements:
298
- - - ">="
298
+ - - ! '>='
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
301
  requirements: []