oddb2xml 1.4.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/lib/oddb2xml/builder.rb +5 -3
- data/lib/oddb2xml/cli.rb +9 -3
- data/lib/oddb2xml/extractor.rb +1 -0
- data/lib/oddb2xml/version.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/lib/oddb2xml/builder.rb
CHANGED
@@ -665,12 +665,14 @@ module Oddb2xml
|
|
665
665
|
#xml.ARTLIM {
|
666
666
|
# xml.LIMCD
|
667
667
|
#}
|
668
|
+
seq = @items[de_idx[:pharmacode]]
|
668
669
|
nincd = if @lppvs[de_idx[:ean]] # LPPV
|
669
670
|
20
|
670
|
-
elsif
|
671
|
-
13
|
672
|
-
elsif no8 # BAG-XML (SL/LS)
|
671
|
+
elsif seq # BAG-XML (SL/LS)
|
673
672
|
10
|
673
|
+
elsif (de_idx[:migel] or # MiGel (xls)
|
674
|
+
de_idx[:_type] == :nonpharma) # MiGel (swissindex)
|
675
|
+
13
|
674
676
|
else
|
675
677
|
nil
|
676
678
|
end
|
data/lib/oddb2xml/cli.rb
CHANGED
@@ -289,10 +289,16 @@ module Oddb2xml
|
|
289
289
|
LANGUAGES.each do |lang|
|
290
290
|
lines << lang
|
291
291
|
types.each do |type|
|
292
|
-
key = (type == :nonpharma ? 'NonPharma' : 'Pharma')
|
293
292
|
if @index[lang][type]
|
294
|
-
|
295
|
-
|
293
|
+
indices = @index[lang][type].values.flatten.length
|
294
|
+
if type == :nonpharma
|
295
|
+
migel_xls = @migel.values.compact.select{|m| !m[:pharmacode].empty? }.map{|m| m[:pharmacode] }
|
296
|
+
nonpharmas = @index[lang][type].keys
|
297
|
+
indices += (migel_xls - nonpharmas).length # ignore duplicates, null
|
298
|
+
lines << sprintf("\tNonPharma products: %i", indices)
|
299
|
+
else
|
300
|
+
lines << sprintf("\tPharma products: %i", indices)
|
301
|
+
end
|
296
302
|
end
|
297
303
|
end
|
298
304
|
end
|
data/lib/oddb2xml/extractor.rb
CHANGED
@@ -161,6 +161,7 @@ module Oddb2xml
|
|
161
161
|
doc.remove_namespaces!
|
162
162
|
doc.xpath("//Envelope/Body/#{@type}/ITEM").each do |pac|
|
163
163
|
item = {}
|
164
|
+
item[:_type] = @type.downcase.intern
|
164
165
|
item[:ean] = (gtin = pac.at_xpath('.//GTIN')) ? gtin.text : ''
|
165
166
|
item[:pharmacode] = (phar = pac.at_xpath('.//PHAR')) ? phar.text : ''
|
166
167
|
item[:status] = (stat = pac.at_xpath('.//STATUS')) ? stat.text : ''
|
data/lib/oddb2xml/version.rb
CHANGED