diff --git a/History.txt b/History.txt index 833d8c7..55116e0 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,6 @@ === 1.9.8 / 04.03.2015 +* Remove unnecessary spaces from ARTICLE.PKG_SIZE in oddb_calc.xml * Remove unnecessary spaces from ARTICLE.NAME in oddb_calc.xml * Emit comment for compositions, eg. 'Solvens: aqua ad iniectabilia.' * Renamed COMPOSITION to COMPONENT in COMPOSITIONS diff --git a/lib/oddb2xml/builder.rb b/lib/oddb2xml/builder.rb index eddf4f2..2852bbe 100644 --- a/lib/oddb2xml/builder.rb +++ b/lib/oddb2xml/builder.rb @@ -666,7 +666,7 @@ def build_calc xml.ARTICLE { xml.GTIN ean13 xml.NAME info.name - xml.PKG_SIZE package_size + xml.PKG_SIZE info.pkg_size xml.SELLING_UNITS info.selling_units # xml.COUNT info.count # xml.MULTI info.multi diff --git a/lib/oddb2xml/calc.rb b/lib/oddb2xml/calc.rb index d3a06c1..b1878af 100644 --- a/lib/oddb2xml/calc.rb +++ b/lib/oddb2xml/calc.rb @@ -185,7 +185,7 @@ def self.update_active_agent(name, part) public def initialize(name = nil, size = nil, unit = nil, active_substance = nil, composition= nil) @name = name ? name.gsub(/\s\s+/, ' ') : name - @pkg_size = size + @pkg_size = size ? size.to_s.gsub(/\s\s+/, ' ') : nil @unit = unit # @pkg_size, @galenic_group, @galenic_form = search_galenic_info diff --git a/spec/calc_spec.rb b/spec/calc_spec.rb index a620ef3..7bc58ae 100644 --- a/spec/calc_spec.rb +++ b/spec/calc_spec.rb @@ -260,6 +260,8 @@ def url expect(File.exists?(full)).to eq true } xml = File.read(File.join(Oddb2xml::WorkDir, 'oddb_calc.xml')) + m = />.* /.match(xml) + m.should eq nil doc = REXML::Document.new xml gtin = '7680540151009' ean12 = '7680' + sprintf('%05d',tst_naropin.iksnr_A) + sprintf('%03d',tst_naropin.pack_K) diff --git a/spec/data/swissmedic_package-galenic.xlsx b/spec/data/swissmedic_package-galenic.xlsx index 6c4d930..02c5272 100644 Binary files a/spec/data/swissmedic_package-galenic.xlsx and b/spec/data/swissmedic_package-galenic.xlsx differ