oddb2xml 2.1.1 → 2.1.2
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/History.txt +4 -0
- data/lib/oddb2xml/parslet_compositions.rb +4 -7
- data/lib/oddb2xml/version.rb +1 -1
- data/spec/parslet_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd2bcecb959ae01393d121cc9df70f8f6edacea
|
4
|
+
data.tar.gz: c7c703884fd6a15a85482e121f9bb754f7798b2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29158f982e6bb02096eaad7c05fb1928338df4d7aef0db02336baca454486d661c062caf4e15338cf0ee8ddb559d9886255999dd0b87a44da068d551bb372720
|
7
|
+
data.tar.gz: b55dcb60e96a34f0c8bd8911fb27b20d035d2299c4fe2d2f4ad1eed042fcadeabeb646934c49af8db8516d184c95392dedb4d2c577db56060430699e39465774
|
data/History.txt
CHANGED
@@ -190,19 +190,17 @@ class CompositionTransformer < Parslet::Transform
|
|
190
190
|
info[:more_info] or
|
191
191
|
CompositionTransformer.get_ratio(dictionary)
|
192
192
|
CompositionTransformer.add_excipiens(info)
|
193
|
+
info
|
193
194
|
end
|
194
195
|
nil
|
195
196
|
}
|
196
197
|
rule(:composition => subtree(:composition),
|
197
198
|
) {
|
198
199
|
|dictionary|
|
199
|
-
|
200
|
+
puts "#{File.basename(__FILE__)}:#{__LINE__}: dictionary #{dictionary}" if VERBOSE_MESSAGES
|
200
201
|
info = dictionary[:composition].is_a?(Hash) ? dictionary[:composition] : dictionary[:composition].first
|
201
|
-
if info.is_a?(Hash)
|
202
|
-
|
203
|
-
else
|
204
|
-
info
|
205
|
-
end
|
202
|
+
CompositionTransformer.add_excipiens(info) if info.is_a?(Hash)
|
203
|
+
info
|
206
204
|
}
|
207
205
|
rule(:substance => simple(:substance),
|
208
206
|
:chemical_substance => simple(:chemical_substance),
|
@@ -453,7 +451,6 @@ class GalenicFormTransformer < CompositionTransformer
|
|
453
451
|
) {
|
454
452
|
|dictionary|
|
455
453
|
puts "#{File.basename(__FILE__)}:#{__LINE__}: dictionary #{dictionary}" if VERBOSE_MESSAGES
|
456
|
-
binding.pry
|
457
454
|
name = dictionary[:preparation_name] ? dictionary[:preparation_name].to_s : nil
|
458
455
|
form = dictionary[:galenic_form] ? dictionary[:galenic_form].to_s : nil
|
459
456
|
# name, form
|
data/lib/oddb2xml/version.rb
CHANGED
data/spec/parslet_spec.rb
CHANGED
@@ -26,7 +26,7 @@ to_add = %(
|
|
26
26
|
|
27
27
|
context "should handle failed" do
|
28
28
|
strings = [
|
29
|
-
|
29
|
+
]
|
30
30
|
strings.each{ |string|
|
31
31
|
composition = ParseComposition.from_string(string)
|
32
32
|
binding.pry if composition.substances.size == 0
|
@@ -196,10 +196,10 @@ describe ParseComposition do
|
|
196
196
|
end
|
197
197
|
|
198
198
|
context 'find unit for aqua q.s. ad emulsionem pro 250 ml' do
|
199
|
-
string = "q.s. ad emulsionem pro 250 ml."
|
199
|
+
string = "natrii oleas, aqua q.s. ad emulsionem pro 250 ml."
|
200
200
|
composition = ParseComposition.from_string(string)
|
201
201
|
specify { expect(composition.source).to eq string}
|
202
|
-
specify { expect(composition.substances.size).to eq
|
202
|
+
specify { expect(composition.substances.size).to eq 1}
|
203
203
|
specify { expect( composition.excipiens.dose.to_s).to eq "250 ml" }
|
204
204
|
specify { expect( composition.excipiens.name).to match /emulsionem/i }
|
205
205
|
end
|