oddb2xml 2.6.6 → 2.6.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caafd3b48a18d05d29249b82717da28ca795d2c5003c69ce06ee10a7c7d6ecee
4
- data.tar.gz: 7429e7b06a997e04aa5be4ab0883a9dbc4c6638a5c7421899d115c5196b8f853
3
+ metadata.gz: 070625b76250b6816b761d5e4f37474326218067dcdbd0a59824c2667e62e9b7
4
+ data.tar.gz: 04af7deafbe8160ad3283b6edb9bae596d9782bad4c7a4be8facda175f062ac8
5
5
  SHA512:
6
- metadata.gz: 5ec16fedb1d2185ae3a44c1f1e1ac1a333f162bb27cfcd3a46f4efb34a3ca8fb87de9a9e650aaabfa992145015db8c7ad4a8498597bbdf7d8ca528c595fb4b5a
7
- data.tar.gz: 96bb2e0f902808245e8e5b58d012e785790feff065608bfada73ddaaf35a27e23ba4c3cbc3ba3afbee09f77c1bd53e99e3b691ea9d8f75c34a1baa01d896d0f8
6
+ metadata.gz: 3616fc763495253e24a1176ccd5d2907e08b96860e87d79c5577b14b38826bf57aaa3aebbf7777fcde28cb2d243b379e25697ba943b1df921ea6cbe6ea16edca
7
+ data.tar.gz: dba061cc87bd89396f38b792f51c9918a23f55d9452c9df9472b5a1e208859f729cbba868097763fc0364791fbb0900a6df97319525dc9721515ad921527c18c
@@ -11,17 +11,16 @@ before_install:
11
11
  script: bundle exec rspec
12
12
 
13
13
  rvm:
14
- - 2.2.7
15
- - 2.3.4
16
- - 2.4.1
17
- - 2.5.0
14
+ # Building on Versions 2.4 or earlier of Ruby fail, because URI.open was priveate
15
+ # - 2.4
16
+ - 2.5
17
+ - 2.6
18
+ - 2.7
18
19
  - ruby-head
19
20
 
20
21
  matrix:
21
22
  allow_failures:
22
23
  - rvm: ruby-head
23
- - rvm: 2.2.7
24
- - rvm: 2.3.4
25
24
 
26
25
  notifications:
27
26
  email:
@@ -1,11 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- Copyright (c) 2016 MEDEVIT. All rights reserved. This program and the
3
- accompanying materials are made available under the terms of the Eclipse
4
- Public License v1.0 which accompanies this distribution, and is available
5
- at http://www.eclipse.org/legal/epl-v10.html v002 - Ergänzung K Komplementärprodukt
6
- bei generic type, Consider ATC code of length 8 (on vet.med. articles) Relax
7
- ADDSCR occurence to 0 .. 1 v003 - PRODNO hinzugefügt LIMNAMEBAG zur formal-kennzeichnung
8
- von identen limitations v4 - Major refactoring, see https://redmine.medelexis.ch/issues/4405
2
+ <!-- Copyright (c) 2016 MEDEVIT. All rights reserved. This program and the
3
+ accompanying materials are made available under the terms of the Eclipse
4
+ Public License v1.0 which accompanies this distribution, and is available
5
+ at http://www.eclipse.org/legal/epl-v10.html v002 - Ergänzung K Komplementärprodukt
6
+ bei generic type, Consider ATC code of length 8 (on vet.med. articles) Relax
7
+ ADDSCR occurence to 0 .. 1 v003 - PRODNO hinzugefügt LIMNAMEBAG zur formal-kennzeichnung
8
+ von identen limitations v4 - Major refactoring, see https://redmine.medelexis.ch/issues/4405
9
9
  Contributors: MEDEVIT <office@medevit.at> - initial API and implementation -->
10
10
  <xs:schema targetNamespace="http://elexis.ch/Elexis_Artikelstamm_v5"
11
11
  elementFormDefault="qualified" attributeFormDefault="unqualified"
@@ -339,7 +339,6 @@
339
339
  </xs:element>
340
340
  <xs:element name="GENERIC_TYPE"
341
341
  maxOccurs="1" minOccurs="0">
342
-
343
342
  <xs:simpleType>
344
343
  <xs:annotation>
345
344
  <xs:documentation>
@@ -359,6 +358,9 @@
359
358
  <xs:enumeration
360
359
  value="K">
361
360
  </xs:enumeration>
361
+ <xs:enumeration
362
+ value="C"> <!-- BAG 9.6.2020: BDer Buchstabe C bei «Original Generika Code» steht für Co-Marketing Arzneimittel -->
363
+ </xs:enumeration>
362
364
  </xs:restriction>
363
365
  </xs:simpleType>
364
366
  </xs:element>
@@ -429,6 +431,9 @@
429
431
  </xs:documentation>
430
432
  </xs:annotation>
431
433
  </xs:element>
434
+ <xs:element name="Chapter70_HACK"
435
+ type="xs:string" minOccurs="0" maxOccurs="1">
436
+ </xs:element>
432
437
  </xs:sequence>
433
438
 
434
439
 
@@ -1,3 +1,8 @@
1
+ === 2.6.7 / 25.06.2020
2
+ * Added value 'C' (Co-marketing) for field GENERIC_TYPE Elexis_Artikelstamm_v5.xsd from BAG Preparations.xml
3
+ * Fixed limitations coming from the chapte 70 hack
4
+ * Ruby 2.7 compatible (No URI.open warning)
5
+
1
6
  === 2.6.6 / 11.01.2020
2
7
  * Fix link for varia_De.htm
3
8
 
@@ -130,7 +135,7 @@
130
135
 
131
136
  === 2.4.1 / 2.12.2016
132
137
 
133
- * Update oddb2xml.gemspec to add GPL-3.0 as correct license for Rubygems as stated in LICENSE file
138
+ * Update oddb2xml.gemspec to add GPL-3.0 as correct license for Rubygems as stated in LICENSE file
134
139
  * Added a hack for 24 globulina equina which commas between brackets
135
140
 
136
141
  === 2.4.0 /25.08.2016
@@ -568,7 +573,7 @@
568
573
 
569
574
  * Improve NINCD detection
570
575
  - Update timeout handling
571
- - Improve pharmacode detection
576
+ - Improve pharmacode detection
572
577
 
573
578
  === 1.5.1 / 10.06.2013
574
579
 
@@ -16,7 +16,7 @@ require 'optimist'
16
16
  #{File.basename(__FILE__)} xml_file_to_check
17
17
  EOS
18
18
  end
19
- $stdout.sync = false
19
+ $stdout.sync = true
20
20
 
21
21
  args = ARGV
22
22
  if args.size != 1
@@ -1571,8 +1571,6 @@ module Oddb2xml
1571
1571
  end
1572
1572
  end
1573
1573
  else # non pharma
1574
- @csv_file << [ ean13, (obj[:desc_de] || obj[:description]), '', '',
1575
- obj[:price], obj[:pub_price], '', '', '', '', '', '' ]
1576
1574
  if @@emitted_v5_gtins.index(ean13)
1577
1575
  next
1578
1576
  else
@@ -1591,17 +1589,38 @@ module Oddb2xml
1591
1589
  xml.GTIN ean13.to_s.rjust(13, '0')
1592
1590
  xml.PHAR obj[:pharmacode]
1593
1591
  emit_salecd(xml, ean13, obj)
1594
- xml.DSCR(obj[:desc_de] || obj[:description]) # for description for zur_rose
1592
+ description = obj[:desc_de] || obj[:description] # for description for zur_rose
1593
+ xml.DSCR(description)
1595
1594
  xml.DSCRF(obj[:desc_fr] || '--missing--')
1596
1595
  xml.COMP do
1597
1596
  xml.GLN obj[:company_ean]
1598
1597
  end if obj[:company_ean] && !obj[:company_ean].empty?
1599
- xml.PEXF obj[:price] if obj[:price] && !obj[:price].empty?
1600
- xml.PPUB obj[:pub_price] if obj[:pub_price] && !obj[:pub_price].empty?
1598
+ if !(obj[:price] && !obj[:price].empty?) || !(obj[:pub_price] && !obj[:pub_price].empty?)
1599
+ zur_rose_detail = @infos_zur_rose.values.find{|x| x[:ean13].to_i == ean13.to_i}
1600
+ end
1601
+ ppub = nil; pexf=nil
1602
+ if obj[:price] && !obj[:price].empty?
1603
+ xml.PEXF (pexf = obj[:price])
1604
+ elsif zur_rose_detail
1605
+ if zur_rose_detail[:price] && !zur_rose_detail[:price].empty? && !zur_rose_detail[:price].eql?('0.00')
1606
+ Oddb2xml.log "NonPharma: #{ean13} adding PEXF #{zur_rose_detail[:price]} #{description}"
1607
+ xml.PEXF (pexf = zur_rose_detail[:price])
1608
+ end
1609
+ end
1610
+ if obj[:pub_price] && !obj[:pub_price].empty?
1611
+ xml.PPUB (ppub = obj[:pub_price])
1612
+ elsif zur_rose_detail
1613
+ if zur_rose_detail[:pub_price] && !zur_rose_detail[:pub_price].empty? && !zur_rose_detail[:pub_price].eql?('0.00')
1614
+ Oddb2xml.log "NonPharma: #{ean13} adding PPUB #{zur_rose_detail[:pub_price]} #{description}"
1615
+ xml.PPUB (ppub = zur_rose_detail[:pub_price])
1616
+ end
1617
+ end
1618
+ @csv_file << [ ean13, description, '', '', pexf, ppub, '', '', '', '', '', '' ]
1601
1619
  if chap70
1602
- xml.comment "Chapter70 hack"
1620
+ xml.comment "Chapter70 hack"
1603
1621
  xml.SL_ENTRY 'true'
1604
1622
  xml.PRODNO obj[:pharmacode]
1623
+ xml.Chapter70_HACK 'true'
1605
1624
  end
1606
1625
  end
1607
1626
  end
@@ -1665,7 +1684,7 @@ module Oddb2xml
1665
1684
  myPack = @packs.values.find{ |x| x[:iksnr].to_i == obj[:seq][:swissmedic_number5].to_i } if obj[:seq]
1666
1685
  if myPack && !prodno
1667
1686
  prodno ||= myPack[:prodno]
1668
- puts "Setting prodno #{prodno} for #{ean13} Varilrix"
1687
+ puts "Setting prodno #{prodno} for #{ean13} #{myPack[:sequence_name]}"
1669
1688
  end
1670
1689
  next unless prodno
1671
1690
  next if emitted_prodno.index(prodno)
@@ -1703,12 +1722,14 @@ module Oddb2xml
1703
1722
  used_limitations << lim_code unless used_limitations.index(lim_code)
1704
1723
  xml.LIMNAMEBAG lim_code
1705
1724
  elsif obj[:chapter70]
1706
- used_limitations << obj[:code]
1707
1725
  xml.comment "Chapter70 hack"
1708
1726
  xml.SALECD('A') # these products are always active!
1709
1727
  xml.DSCR obj[:description]
1710
1728
  xml.DSCRF ''
1711
- xml.LIMNAMEBAG obj[:code]
1729
+ if @limitations.index(obj[:code])
1730
+ xml.LIMNAMEBAG obj[:code]
1731
+ used_limitations << obj[:code]
1732
+ end
1712
1733
  end
1713
1734
  if sequence && sequence[:substances]
1714
1735
  value = nil
@@ -12,7 +12,7 @@ module Oddb2xml
12
12
  puts "parse_td returns: #{res}" if $VERBOSE
13
13
  rescue => exc
14
14
  puts "Unable to pars #{elem} #{exc}"
15
- binding.pry
15
+ # binding.pry
16
16
  return nil
17
17
  end
18
18
  res.flatten # .join("\t")
@@ -33,7 +33,7 @@ module Oddb2xml
33
33
  effort: :tolerant,
34
34
  smart: true
35
35
  }
36
- res = Ox.load(open(html_file).read, mode: :hash_no_attrs).values.first['body']
36
+ res = Ox.load(URI.open(html_file).read, mode: :hash_no_attrs).values.first['body']
37
37
  result = []
38
38
  idx = 0
39
39
  @@items = {}
@@ -50,15 +50,16 @@ module Oddb2xml
50
50
  data = {}
51
51
  pharma_code = entry.first
52
52
  ean13 = (Oddb2xml::FAKE_GTIN_START + pharma_code.to_s)
53
- german = entry[2].force_encoding('ISO-8859-1').encode('UTF-8')
54
- while !german.eql?(HTMLEntities.new.decode(german))
55
- german = HTMLEntities.new.decode(german)
53
+ if entry[2].encoding.to_s.eql?('ASCII-8BIT')
54
+ german = CGI.unescape(entry[2].force_encoding('ISO-8859-1'))
55
+ else
56
+ german = entry[2]
56
57
  end
57
58
  @@items[ean13] = {
58
59
  :data_origin => 'Chapter70',
59
60
  :line => entry.join(","),
60
61
  :ean13 => ean13,
61
- :description => Oddb2xml.html_decode(entry[2]),
62
+ :description => german,
62
63
  :quantity => entry[3],
63
64
  :pharmacode => pharma_code,
64
65
  :pub_price => entry[4],
@@ -70,5 +71,3 @@ module Oddb2xml
70
71
  end
71
72
  end
72
73
  end
73
-
74
-
@@ -23,7 +23,7 @@ module Oddb2xml
23
23
  else
24
24
  begin
25
25
  io = File.open(file, option)
26
- data = open(@url).read
26
+ data = URI.open(@url).read
27
27
  io.write(data)
28
28
  rescue => error
29
29
  puts "error #{error} while fetching #{@url}"
@@ -283,7 +283,7 @@ module Oddb2xml
283
283
  include DownloadMethod
284
284
  def initialize(type=:orphan, options = {})
285
285
  url = BASE_URL + '/swissmedic/de/home/services/listen_neu.html'
286
- doc = Nokogiri::HTML(open(url))
286
+ doc = Nokogiri::HTML(URI.open(url))
287
287
  @type = type
288
288
  @options = options
289
289
  case @type
@@ -64,7 +64,7 @@ module Oddb2xml
64
64
  end
65
65
  end
66
66
  end
67
-
67
+
68
68
  def everyPharmaArticleHasAProductItem
69
69
  result = true
70
70
  puts "#{Time.now.strftime("%H:%M:%S")}: everyPharmaArticleHasAProductItem"
@@ -74,7 +74,7 @@ module Oddb2xml
74
74
  unless allProductNumbers.index(item[:PRODNO])
75
75
  puts "Item #{item[:GTIN]} has no Product #{item[:PRODNO]} #{item[:DSCR]}"
76
76
  result = false
77
- end
77
+ end unless item[:Chapter70_HACK]
78
78
  end
79
79
  result
80
80
  end
@@ -91,17 +91,19 @@ module Oddb2xml
91
91
  end
92
92
  result
93
93
  end
94
-
94
+
95
95
  def everyReferencedLimitationIsIncluded
96
+ result = true
96
97
  puts "#{Time.now.strftime("%H:%M:%S")}: everyReferencedLimitationIsIncluded"
97
98
  allLimitations = limitations.collect{ |lim| lim[:LIMNAMEBAG] }
98
99
  products.each do |product|
99
100
  next unless product[:LIMNAMEBAG]
100
101
  unless allLimitations.index(product[:LIMNAMEBAG])
101
102
  puts "product #{product[:PRODNO]} has no limitation #{product[:LIMNAMEBAG]} #{product[:DSCR]}"
102
- return false
103
+ result = false
103
104
  end
104
105
  end
106
+ result
105
107
  end
106
108
 
107
109
  def checkPackageSize
@@ -34,7 +34,7 @@ module Oddb2xml
34
34
  end
35
35
  Oddb2xml.patch_some_utf8(german).gsub('<br>',"\n")
36
36
  end
37
-
37
+
38
38
  def Oddb2xml.patch_some_utf8(line)
39
39
  begin
40
40
  line = line.encode('utf-8')
@@ -86,7 +86,7 @@ module Oddb2xml
86
86
  def Oddb2xml.skip_download?
87
87
  @options[:skip_download]
88
88
  end
89
-
89
+
90
90
  def Oddb2xml.skip_download(file)
91
91
  return false if defined?(VCR)
92
92
  dest = "#{Downloads}/#{File.basename(file)}"
@@ -96,7 +96,7 @@ module Oddb2xml
96
96
  end
97
97
  false
98
98
  end
99
-
99
+
100
100
  def Oddb2xml.download_finished(file, remove_file = true)
101
101
  src = "#{WorkDir}/#{File.basename(file)}"
102
102
  dest = "#{Downloads}/#{File.basename(file)}"
@@ -232,7 +232,7 @@ COLUMNS_FEBRUARY_2019= {
232
232
  @@ean13_to_no8 = {}
233
233
  def Oddb2xml.setEan13forProdno(prodno, ean13)
234
234
  if ean13.to_i == 7680006660045 || ean13.to_i == 7680006660014
235
- puts "setEan13forProdno #{prodno} ean13 #{ean13}"
235
+ Oddb2xml.log "setEan13forProdno #{prodno} ean13 #{ean13}"
236
236
  end
237
237
  @@prodno_to_ean13[prodno] ||= []
238
238
  @@prodno_to_ean13[prodno] << ean13
@@ -240,13 +240,13 @@ COLUMNS_FEBRUARY_2019= {
240
240
  end
241
241
  def Oddb2xml.setEan13forNo8(no8, ean13)
242
242
  if ean13.to_i == 7680006660045 || ean13.to_i == 7680006660014
243
- puts "setEan13forNo8 #{no8} ean13 #{ean13}"
243
+ Oddb2xml.log "setEan13forNo8 #{no8} ean13 #{ean13}"
244
244
  end
245
245
  if @@no8_to_ean13[no8].nil?
246
246
  @@no8_to_ean13[no8] = ean13
247
247
  @@ean13_to_no8[ean13] = no8
248
248
  elsif !@@no8_to_ean13[no8].eql?(ean13)
249
- puts "@@no8_to_ean13[no8] #{@@no8_to_ean13[no8]} not overridden by #{ean13}"
249
+ Oddb2xml.log "@@no8_to_ean13[no8] #{@@no8_to_ean13[no8]} not overridden by #{ean13}"
250
250
  end
251
251
  end
252
252
  def Oddb2xml.getEan13forProdno(prodno)
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.6.6"
2
+ VERSION = "2.6.7"
3
3
  end
@@ -24,7 +24,7 @@ describe Oddb2xml::Builder do
24
24
  unless @inhalt.index(expected_value)
25
25
  puts expected_value
26
26
  end
27
- # binding.pry unless @inhalt.index(expected_value)
27
+ binding.pry unless @inhalt.index(expected_value)
28
28
  expect(@inhalt.index(expected_value)).not_to be nil
29
29
  end
30
30
  def common_run_init(options = {})
@@ -184,7 +184,7 @@ describe Oddb2xml::Builder do
184
184
  @inhalt = IO.read(@artikelstamm_name)
185
185
  expect(@inhalt.index('BIOMARIS Voll Meersalz 500 g')).not_to be nil
186
186
  end
187
-
187
+
188
188
  it 'Should not contain PHAR 8809544 Sildenavil with pexf and ppub 0.0' do
189
189
  #1128809544Sildenafil Suspension 7mg/ml 100ml 0030850045801000000000000000000000002
190
190
  @inhalt = IO.read(@artikelstamm_name)
@@ -211,7 +211,7 @@ describe Oddb2xml::Builder do
211
211
  it 'shoud contain GENERIC_TYPE' do
212
212
  expect(@inhalt.index('<GENERIC_TYPE')).not_to be nil
213
213
  end
214
-
214
+
215
215
  it 'should contain DIBASE with phar' do
216
216
  expected = %(<ITEM PHARMATYPE="P">
217
217
  <GTIN>7680658560014</GTIN>
@@ -237,7 +237,7 @@ describe Oddb2xml::Builder do
237
237
  </ITEM)
238
238
  expect(@inhalt.index(expected)).not_to be nil
239
239
  end
240
-
240
+
241
241
  it 'should contain PEVISONE Creme 30 g' do
242
242
  expect(@inhalt.index('Pevisone Creme 15 g')).not_to be nil # 7680406620144
243
243
  expect(@inhalt.index('Pevisone Creme 30 g')).not_to be nil # 7680406620229
@@ -349,7 +349,7 @@ describe Oddb2xml::Builder do
349
349
  <SL_ENTRY>true</SL_ENTRY>
350
350
  <IKSCAT>D</IKSCAT>
351
351
  <DEDUCTIBLE>10</DEDUCTIBLE>
352
- </ITEM>),
352
+ </ITEM>),
353
353
  'item 7680284860144 ANCOPIR' =>'<ITEM PHARMATYPE="P">
354
354
  <GTIN>7680284860144</GTIN>
355
355
  <PHAR>0177804</PHAR>
@@ -391,7 +391,7 @@ describe Oddb2xml::Builder do
391
391
  <DOSAGE_FORMF>Compresse</DOSAGE_FORMF>
392
392
  <IKSCAT>C</IKSCAT>
393
393
  <PRODNO>3164402</PRODNO>
394
- </ITEM>),
394
+ </ITEM>),
395
395
  'product 3TC Filmtabl' => %(<PRODUCT>
396
396
  <PRODNO>5366201</PRODNO>
397
397
  <SALECD>A</SALECD>
@@ -439,20 +439,12 @@ describe Oddb2xml::Builder do
439
439
  <DEDUCTIBLE>20</DEDUCTIBLE>
440
440
  <PRODNO>5329001</PRODNO>
441
441
  </ITEM>),
442
- 'Chapter 70 limitation' => %(<LIMITATION>
443
- <!--Chapter70 hack-->
444
- <LIMNAMEBAG>L1, L2</LIMNAMEBAG>
445
- <DSCR>Eine Flasche zu 20 ml Urtinktur einer bestimmten Pflanze pro Monat. Für Aesculus, Carduus Marianus, Ginkgo, Hedera helix, Hypericum perforatum, Lavandula, Rosmarinus officinalis, Taraxacum officinale.</DSCR>
446
- <DSCRF/>
447
- <LIMITATION_PTS>1</LIMITATION_PTS>
448
- </LIMITATION>),
449
442
  'Chapter 70 product' => %(<PRODUCT>
450
443
  <PRODNO>2069639</PRODNO>
451
444
  <!--Chapter70 hack-->
452
445
  <SALECD>A</SALECD>
453
446
  <DSCR>Ceres Urtinkturen gemäss L2</DSCR>
454
447
  <DSCRF/>
455
- <LIMNAMEBAG>L1, L2</LIMNAMEBAG>
456
448
  </PRODUCT>),
457
449
  'Chapter 70 item' => %(<ITEM PHARMATYPE="P">
458
450
  <GTIN>2500000588532</GTIN>
@@ -465,6 +457,7 @@ describe Oddb2xml::Builder do
465
457
  <!--Chapter70 hack-->
466
458
  <SL_ENTRY>true</SL_ENTRY>
467
459
  <PRODNO>2069639</PRODNO>
460
+ <Chapter70_HACK>true</Chapter70_HACK>
468
461
  </ITEM>),
469
462
  '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.
470
463
 
@@ -59,7 +59,7 @@ ARTICLE_NAROPIN = %(1
59
59
  <BCSTAT>A</BCSTAT>
60
60
  </ARTBAR>
61
61
  </ART>)
62
-
62
+
63
63
  ARTICLE_COMMON_ELEMENTS = [
64
64
  ['ARTICLE/ART/REF_DATA', '1'],
65
65
  ['ARTICLE/ART/SMCAT', 'A'],
@@ -256,7 +256,7 @@ def check_result(inhalt, nbr_record)
256
256
  expect(inhalt.index('<ERROR_CODE/>')).to be > 0
257
257
  m = /<NBR_RECORD>(\d+)<\/NBR_RECORD>/.match(inhalt)
258
258
  expect(m).not_to be nil
259
- expect(m[1].to_i).to eq nbr_record
259
+ expect(m[1].to_i).to eq nbr_record
260
260
  end
261
261
 
262
262
  def checkItemForRefdata(doc, pharmacode, isRefdata)
@@ -476,7 +476,7 @@ describe Oddb2xml::Builder do
476
476
  NrExtendedArticles = 76
477
477
  NrSubstances = 27
478
478
  NrLimitations = 14
479
-
479
+
480
480
  NrInteractions = 2
481
481
  NrCodes = 5
482
482
  NrProdno = 31
@@ -532,7 +532,7 @@ describe Oddb2xml::Builder do
532
532
 
533
533
  check_attributes(oddb_article_xml, ARTICLE_ATTRIBUTE_TESTS)
534
534
  check_elements(oddb_article_xml, ARTICLE_COMMON_ELEMENTS)
535
-
535
+
536
536
  it 'should validate XSD article' do
537
537
  @inhalt = File.read(oddb_article_xml)
538
538
  # This fails on Ruby < 2.4 as NAROPIN INJ LÖS 0.2 % 10 is wrongly encoded
@@ -552,7 +552,7 @@ describe Oddb2xml::Builder do
552
552
  end
553
553
 
554
554
  it 'should have a correct insulin (gentechnik) for 7680532900196' do
555
- expect(XPath.match( @rexml, "//ART/[BC='7680532900196']").size).to eq 1
555
+ expect(@inhalt.match(/.*<BC>7680532900196<\/BC>.*/).class).to be MatchData
556
556
  expect(XPath.match( @rexml, "//ART//GEN_PRODUCTION").size).to be >= 1
557
557
  expect(XPath.match( @rexml, "//ART//GEN_PRODUCTION").first.text).to eq 'X'
558
558
  expect(XPath.match( @rexml, "//ART//INSULIN_CATEGORY").size).to eq 1
@@ -568,7 +568,7 @@ describe Oddb2xml::Builder do
568
568
  ean_with_drug_index = 7680555610041
569
569
  it "should have a correct drug information for #{ean_with_drug_index}" do
570
570
  doc = REXML::Document.new IO.read(checkAndGetArticleXmlName)
571
- expect(XPath.match( @rexml, "//ART/[BC='#{ean_with_drug_index}']").size).to eq 1
571
+ expect(@inhalt.match(/.*<BC>#{ean_with_drug_index}<\/BC>.*/).class).to be MatchData
572
572
  expect(XPath.match( @rexml, "//ART//DRUG_INDEX").size).to eq 1
573
573
  expect(XPath.match( @rexml, "//ART//DRUG_INDEX").first.text).to eq 'd'
574
574
  found = false
@@ -605,11 +605,11 @@ describe Oddb2xml::Builder do
605
605
  <CPT/>)
606
606
  expect(oddb_product_xml.index(text2)).to be >= 1
607
607
  end
608
-
608
+
609
609
  it 'should generate SALECD A for swissmedic packages' do
610
610
  expect(IO.read(oddb_article_xml).index('<SALECD>A<!--Overriding status I nincd 10 for 7680658560014 as in refdata_pharma--></SALECD>')).to be >= 1
611
611
  end
612
-
612
+
613
613
  end
614
614
 
615
615
  context 'when -o for fachinfo is given' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.6
4
+ version: 2.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-13 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -486,8 +486,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
486
486
  - !ruby/object:Gem::Version
487
487
  version: '0'
488
488
  requirements: []
489
- rubyforge_project:
490
- rubygems_version: 2.7.6.2
489
+ rubygems_version: 3.1.2
491
490
  signing_key:
492
491
  specification_version: 4
493
492
  summary: oddb2xml creates xml files.