oddb2xml 2.1.2 → 2.1.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/History.txt +4 -0
- data/lib/oddb2xml/parslet_compositions.rb +5 -4
- data/lib/oddb2xml/version.rb +1 -1
- data/spec/calc_spec.rb +6 -2
- data/spec/data/swissmedic_package-galenic.xlsx +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12904cf51c69c49aecda97c93bdb269532b7d7ea
|
4
|
+
data.tar.gz: dccb51dcc69f94ba4ccff505abd35c2a47fc37d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b955af367c78f85b7ec1599f603d5120c0ecfa601ef1adb0183fab34096934f8225b3751c439056dbf33b6ea4c77ffd31a4f04ab019fc25b4f0b8ce21d27694
|
7
|
+
data.tar.gz: aa8139d20ac1c3fccb7d7c3b0374afcea22f2a6f9229006d26e4ce95af48a1d2ae5289916774dcf1a0495246c3405352742f47453f332044529509b2bc2a9212
|
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
@@ -366,6 +366,7 @@ class ParseComposition
|
|
366
366
|
/ U\.: (excipiens) / => ' U. \1 ',
|
367
367
|
/ U\.: (alnus|betula|betula|betulae) / => ' U., \1 ',
|
368
368
|
/^(acari allergeni extractum (\(acarus siro\)|).+\s+U\.\:)/ => 'A): \1',
|
369
|
+
'Solvens: alprostadilum' => 'alprostadilum',
|
369
370
|
}
|
370
371
|
@@errorHandler = ParseUtil::HandleSwissmedicErrors.new( ErrorsToFix )
|
371
372
|
|
@@ -396,15 +397,15 @@ class ParseComposition
|
|
396
397
|
puts "ParseComposition.new cleaned #{cleaned}" if VERBOSE_MESSAGES and not cleaned.eql?(stripped)
|
397
398
|
CompositionTransformer.clear_substances
|
398
399
|
result = ParseComposition.new(cleaned)
|
399
|
-
|
400
|
-
|
400
|
+
parser = CompositionParser.new
|
401
|
+
transf = CompositionTransformer.new
|
401
402
|
begin
|
402
403
|
if defined?(RSpec)
|
403
|
-
ast =
|
404
|
+
ast = transf.apply(parser.parse_with_debug(cleaned))
|
404
405
|
puts "#{File.basename(__FILE__)}:#{__LINE__}: ==> " if VERBOSE_MESSAGES
|
405
406
|
pp ast if VERBOSE_MESSAGES
|
406
407
|
else
|
407
|
-
ast =
|
408
|
+
ast = transf.apply(parser.parse(cleaned))
|
408
409
|
end
|
409
410
|
rescue Parslet::ParseFailed => error
|
410
411
|
@@errorHandler.nrParsingErrors += 1
|
data/lib/oddb2xml/version.rb
CHANGED
data/spec/calc_spec.rb
CHANGED
@@ -141,6 +141,7 @@ Corresp. 5300 kJ.",
|
|
141
141
|
}
|
142
142
|
)
|
143
143
|
|
144
|
+
if RunAllTests
|
144
145
|
context 'handle E substances correctly' do
|
145
146
|
e_200_examples =
|
146
147
|
{
|
@@ -163,7 +164,6 @@ Corresp. 5300 kJ.",
|
|
163
164
|
}
|
164
165
|
end
|
165
166
|
|
166
|
-
if RunAllTests
|
167
167
|
context 'should return correct value for liquid' do
|
168
168
|
pkg_size_L = '1 x 5 x 200'
|
169
169
|
einheit_M = 'ml'
|
@@ -369,6 +369,10 @@ if RunAllTests
|
|
369
369
|
|
370
370
|
XPath.match( doc, "//ARTICLE[GTIN='7680589430011']/NAME").first.text.should eq 'Apligraf'
|
371
371
|
XPath.match( doc, "//ARTICLE[GTIN='7680589430011']/GALENIC_FORM").last.text.should eq 'Unbekannt' # TODO?? 'Scheibe(n)/disque(s)'
|
372
|
+
|
373
|
+
XPath.match( doc, "//ARTICLE[GTIN='7680556740075']/NAME").first.text.should eq "Caverject DC 20, Injektionspräparat"
|
374
|
+
XPath.match( doc, "//ARTICLE[GTIN='7680556740075']/COMPOSITIONS/COMPOSITION/SUBSTANCES/SUBSTANCE").size.should eq 5
|
375
|
+
XPath.match( doc, "//ARTICLE[GTIN='7680556740075']/COMPOSITIONS/COMPOSITION/EXCIPIENS/SUBSTANCE_NAME").first.text.should eq "aqua ad iniectabilia q.s. ad solutionem"
|
372
376
|
end
|
373
377
|
end
|
374
378
|
|
@@ -691,4 +695,4 @@ Die HILFSSTOFFE sind Aqua ad iniectabilia und Natrii chloridum.
|
|
691
695
|
end
|
692
696
|
end
|
693
697
|
end
|
694
|
-
|
698
|
+
end
|
Binary file
|
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.1.
|
4
|
+
version: 2.1.3
|
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-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|