Skip to content

Commit

Permalink
Remove unnecessary spaces from ARTICLE.NAME in oddb_calc.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Mar 4, 2015
1 parent ed956f1 commit 3a6c278
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions History.txt
@@ -1,5 +1,6 @@
=== 1.9.8 / 04.03.2015

* 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

Expand Down
2 changes: 1 addition & 1 deletion lib/oddb2xml/builder.rb
Expand Up @@ -665,7 +665,7 @@ def build_calc
items[ean13] = info
xml.ARTICLE {
xml.GTIN ean13
xml.NAME name
xml.NAME info.name
xml.PKG_SIZE package_size
xml.SELLING_UNITS info.selling_units
# xml.COUNT info.count
Expand Down
2 changes: 1 addition & 1 deletion lib/oddb2xml/calc.rb
Expand Up @@ -184,7 +184,7 @@ def self.update_active_agent(name, part)
end
public
def initialize(name = nil, size = nil, unit = nil, active_substance = nil, composition= nil)
@name = name
@name = name ? name.gsub(/\s\s+/, ' ') : name
@pkg_size = size
@unit = unit
# @pkg_size, @galenic_group, @galenic_form =
Expand Down
1 change: 1 addition & 0 deletions spec/calc_spec.rb
Expand Up @@ -285,6 +285,7 @@ def url
}
XPath.match( doc, "//ARTICLE[GTIN='7680006790124']/COMPOSITIONS/COMPONENT/NAME").last.text.should eq 'Bifidobacterium Infantis'
XPath.match( doc, "//ARTICLE[GTIN='7680545250363']/COMPOSITIONS/COMPONENT/NAME").last.text.should eq 'Alprostadilum'
XPath.match( doc, "//ARTICLE[GTIN='7680458820202']/NAME").last.text.should eq 'Magnesiumchlorid 0,5 molar B. Braun, Zusatzampulle für Infusionslösungen'
end
end

Expand Down
Binary file modified spec/data/swissmedic_package-galenic.xlsx
Binary file not shown.

0 comments on commit 3a6c278

Please sign in to comment.