oddb2xml 2.0.5 → 2.0.6
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 +13 -5
- data/Gemfile.lock +26 -19
- data/History.txt +5 -0
- data/dokumentation_calc.textile +50 -0
- data/lib/oddb2xml/builder.rb +9 -4
- data/lib/oddb2xml/calc.rb +1 -1
- data/lib/oddb2xml/cli.rb +1 -0
- data/lib/oddb2xml/compositions_syntax.rb +368 -0
- data/lib/oddb2xml/extractor.rb +13 -4
- data/lib/oddb2xml/parslet_compositions.rb +598 -0
- data/lib/oddb2xml/version.rb +1 -1
- data/oddb2xml.gemspec +1 -0
- data/spec/builder_spec.rb +1 -1
- data/spec/calc_spec.rb +102 -121
- data/spec/composition_syntax_spec.rb +502 -0
- data/spec/data/compositions.txt +8937 -0
- data/spec/data/swissmedic_package-galenic.xlsx +0 -0
- data/spec/data/zurrose_transfer.dat +5 -0
- data/spec/extractor_spec.rb +40 -0
- data/spec/parslet_spec.rb +1268 -0
- data/spec/spec_helper.rb +8 -0
- metadata +56 -34
- data/lib/oddb2xml/parse_compositions.rb +0 -106
data/spec/spec_helper.rb
CHANGED
@@ -13,7 +13,12 @@ Bundler.require
|
|
13
13
|
|
14
14
|
require 'rspec'
|
15
15
|
require 'webmock/rspec'
|
16
|
+
require 'pp'
|
16
17
|
|
18
|
+
begin # load pry if is available
|
19
|
+
require 'pry'
|
20
|
+
rescue LoadError
|
21
|
+
end
|
17
22
|
|
18
23
|
module Oddb2xml
|
19
24
|
# we override here a few directories to make input/output when running specs to
|
@@ -24,6 +29,9 @@ module Oddb2xml
|
|
24
29
|
SpecCompressor = File.join(Oddb2xml::SpecData, 'compressor')
|
25
30
|
end
|
26
31
|
|
32
|
+
ExcipiensIs_a_Substance = false # might change later
|
33
|
+
AllCompositionLines = File.expand_path("#{__FILE__}/../data/compositions.txt")
|
34
|
+
|
27
35
|
require 'oddb2xml'
|
28
36
|
|
29
37
|
module ServerMockHelper
|
metadata
CHANGED
@@ -1,195 +1,209 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oddb2xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
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-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.1.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: archive-tar-minitar
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.5.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.5.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mechanize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.5.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.5.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.5.10
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.5.10
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: savon
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 2.4.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.4.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: spreadsheet
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.0.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubyXL
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 3.3.1
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.3.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sax-machine
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 0.1.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.1.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: parslet
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.7.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.7.0
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: bundler
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- -
|
143
|
+
- - ! '>='
|
130
144
|
- !ruby/object:Gem::Version
|
131
145
|
version: '0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- -
|
150
|
+
- - ! '>='
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: rake
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
|
-
- -
|
157
|
+
- - ! '>='
|
144
158
|
- !ruby/object:Gem::Version
|
145
159
|
version: '0'
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
|
-
- -
|
164
|
+
- - ! '>='
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rspec
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
|
-
- -
|
171
|
+
- - ! '>='
|
158
172
|
- !ruby/object:Gem::Version
|
159
173
|
version: '0'
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
|
-
- -
|
178
|
+
- - ! '>='
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: webmock
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
|
-
- -
|
185
|
+
- - ! '>='
|
172
186
|
- !ruby/object:Gem::Version
|
173
187
|
version: '0'
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
|
-
- -
|
192
|
+
- - ! '>='
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: rdoc
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
|
-
- -
|
199
|
+
- - ! '>='
|
186
200
|
- !ruby/object:Gem::Version
|
187
201
|
version: '0'
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
|
-
- -
|
206
|
+
- - ! '>='
|
193
207
|
- !ruby/object:Gem::Version
|
194
208
|
version: '0'
|
195
209
|
description: oddb2xml creates xml files using swissINDEX, BAG-XML and Swissmedic.
|
@@ -199,9 +213,9 @@ executables:
|
|
199
213
|
extensions: []
|
200
214
|
extra_rdoc_files: []
|
201
215
|
files:
|
202
|
-
-
|
203
|
-
-
|
204
|
-
-
|
216
|
+
- .gitignore
|
217
|
+
- .rspec
|
218
|
+
- .travis.yml
|
205
219
|
- Gemfile
|
206
220
|
- Gemfile.lock
|
207
221
|
- History.txt
|
@@ -213,15 +227,17 @@ files:
|
|
213
227
|
- bin/oddb2xml
|
214
228
|
- data/gal_forms.yaml
|
215
229
|
- data/gal_groups.yaml
|
230
|
+
- dokumentation_calc.textile
|
216
231
|
- lib/oddb2xml.rb
|
217
232
|
- lib/oddb2xml/builder.rb
|
218
233
|
- lib/oddb2xml/calc.rb
|
219
234
|
- lib/oddb2xml/cli.rb
|
235
|
+
- lib/oddb2xml/compositions_syntax.rb
|
220
236
|
- lib/oddb2xml/compressor.rb
|
221
237
|
- lib/oddb2xml/downloader.rb
|
222
238
|
- lib/oddb2xml/extractor.rb
|
223
239
|
- lib/oddb2xml/options.rb
|
224
|
-
- lib/oddb2xml/
|
240
|
+
- lib/oddb2xml/parslet_compositions.rb
|
225
241
|
- lib/oddb2xml/util.rb
|
226
242
|
- lib/oddb2xml/version.rb
|
227
243
|
- lib/oddb2xml/xml_definitions.rb
|
@@ -230,6 +246,7 @@ files:
|
|
230
246
|
- spec/builder_spec.rb
|
231
247
|
- spec/calc_spec.rb
|
232
248
|
- spec/cli_spec.rb
|
249
|
+
- spec/composition_syntax_spec.rb
|
233
250
|
- spec/compressor_spec.rb
|
234
251
|
- spec/data/GL_Diff_SB.xml
|
235
252
|
- spec/data/ItCodes.xml
|
@@ -238,6 +255,7 @@ files:
|
|
238
255
|
- spec/data/Preparation.xml
|
239
256
|
- spec/data/Preparations.xml
|
240
257
|
- spec/data/XMLPublications.zip
|
258
|
+
- spec/data/compositions.txt
|
241
259
|
- spec/data/compressor/oddb2xml_files_bm_update.txt
|
242
260
|
- spec/data/compressor/oddb2xml_files_lppv.txt
|
243
261
|
- spec/data/compressor/oddb2xml_files_nonpharma.xls
|
@@ -276,6 +294,7 @@ files:
|
|
276
294
|
- spec/downloader_spec.rb
|
277
295
|
- spec/extractor_spec.rb
|
278
296
|
- spec/options_spec.rb
|
297
|
+
- spec/parslet_spec.rb
|
279
298
|
- spec/spec_helper.rb
|
280
299
|
- test_options.rb
|
281
300
|
- tools/cacert.pem
|
@@ -291,12 +310,12 @@ require_paths:
|
|
291
310
|
- lib
|
292
311
|
required_ruby_version: !ruby/object:Gem::Requirement
|
293
312
|
requirements:
|
294
|
-
- -
|
313
|
+
- - ! '>='
|
295
314
|
- !ruby/object:Gem::Version
|
296
315
|
version: '0'
|
297
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
317
|
requirements:
|
299
|
-
- -
|
318
|
+
- - ! '>='
|
300
319
|
- !ruby/object:Gem::Version
|
301
320
|
version: '0'
|
302
321
|
requirements: []
|
@@ -309,6 +328,7 @@ test_files:
|
|
309
328
|
- spec/builder_spec.rb
|
310
329
|
- spec/calc_spec.rb
|
311
330
|
- spec/cli_spec.rb
|
331
|
+
- spec/composition_syntax_spec.rb
|
312
332
|
- spec/compressor_spec.rb
|
313
333
|
- spec/data/GL_Diff_SB.xml
|
314
334
|
- spec/data/ItCodes.xml
|
@@ -317,6 +337,7 @@ test_files:
|
|
317
337
|
- spec/data/Preparation.xml
|
318
338
|
- spec/data/Preparations.xml
|
319
339
|
- spec/data/XMLPublications.zip
|
340
|
+
- spec/data/compositions.txt
|
320
341
|
- spec/data/compressor/oddb2xml_files_bm_update.txt
|
321
342
|
- spec/data/compressor/oddb2xml_files_lppv.txt
|
322
343
|
- spec/data/compressor/oddb2xml_files_nonpharma.xls
|
@@ -355,4 +376,5 @@ test_files:
|
|
355
376
|
- spec/downloader_spec.rb
|
356
377
|
- spec/extractor_spec.rb
|
357
378
|
- spec/options_spec.rb
|
379
|
+
- spec/parslet_spec.rb
|
358
380
|
- spec/spec_helper.rb
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# This file is shared since oddb2xml 2.0.0 (lib/oddb2xml/parse_compositions.rb)
|
4
|
-
# with oddb.org src/plugin/parse_compositions.rb
|
5
|
-
#
|
6
|
-
# It allows an easy parsing of the column P Zusammensetzung of the swissmedic packages.xlsx file
|
7
|
-
#
|
8
|
-
|
9
|
-
module ParseUtil
|
10
|
-
SCALE_P = %r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u
|
11
|
-
ParseComposition = Struct.new("ParseComposition", :source, :label, :label_description, :substances, :galenic_form, :route_of_administration)
|
12
|
-
ParseSubstance = Struct.new("ParseSubstance", :name, :qty, :unit, :chemical_substance, :chemical_qty, :chemical_unit, :is_active_agent, :dose, :cdose)
|
13
|
-
def ParseUtil.capitalize(string)
|
14
|
-
string.split(/\s+/u).collect { |word| word.capitalize }.join(' ')
|
15
|
-
end
|
16
|
-
|
17
|
-
def ParseUtil.dose_to_qty_unit(string, filler=nil)
|
18
|
-
return nil unless string
|
19
|
-
dose = string.split(/\b\s*(?![.,\d\-]|Mio\.?)/u, 2)
|
20
|
-
if dose && (scale = SCALE_P.match(filler)) && dose[1] && !dose[1].include?('/')
|
21
|
-
unit = dose[1] << '/'
|
22
|
-
num = scale[:qty].to_f
|
23
|
-
if num <= 1
|
24
|
-
unit << scale[:unit]
|
25
|
-
else
|
26
|
-
unit << scale[:scale]
|
27
|
-
end
|
28
|
-
dose[1] = unit
|
29
|
-
elsif dose and dose.size == 2
|
30
|
-
unit = dose[1]
|
31
|
-
end
|
32
|
-
dose
|
33
|
-
end
|
34
|
-
|
35
|
-
def ParseUtil.parse_compositions(composition, active_agents_string = '')
|
36
|
-
rep_1 = '----'; to_1 = '('
|
37
|
-
rep_2 = '-----'; to_2 = ')'
|
38
|
-
rep_3 = '------'; to_3 = ','
|
39
|
-
active_agents = active_agents_string ? active_agents_string.downcase.split(/,\s+/) : []
|
40
|
-
comps = []
|
41
|
-
label_pattern = /^(?<label>A|I|B|II|C|III|D|IV|E|V|F|VI)(\):|\))\s*(?<description>[^:]+)/
|
42
|
-
composition_text = composition.gsub(/\r\n?/u, "\n")
|
43
|
-
puts "composition_text for #{name}: #{composition_text}" if composition_text.split(/\n/u).size > 1 and $VERBOSE
|
44
|
-
lines = composition_text.split(/\n/u)
|
45
|
-
idx = 0
|
46
|
-
compositions = lines.select do |line|
|
47
|
-
if match = label_pattern.match(line)
|
48
|
-
label = match[:label]
|
49
|
-
label_description = match[:description]
|
50
|
-
else
|
51
|
-
label = nil
|
52
|
-
label_description = nil
|
53
|
-
end
|
54
|
-
idx += 1
|
55
|
-
next if idx > 1 and /^(?<label>A|I|B|II|C|III|D|IV|E|V|F|VI)[)]\s*(et)/.match(line) # avoid lines like 'I) et II)'
|
56
|
-
next if idx > 1 and /^Corresp\./i.match(line) # avoid lines like 'Corresp. mineralia: '
|
57
|
-
substances = []
|
58
|
-
filler = line.split(',')[-1].sub(/\.$/, '')
|
59
|
-
filler_match = /^(?<name>[^,\d]+)\s*(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))))/.match(filler)
|
60
|
-
components = line.gsub(/(\d),(\d+)/, "\\1.\\2").split(/([^\(]+\([^)]+\)[^,]+|),/).each {
|
61
|
-
|component|
|
62
|
-
next unless component.size > 0
|
63
|
-
next if /^ratio:/i.match(component.strip)
|
64
|
-
to_consider = component.strip.split(':')[-1].gsub(to_1, rep_1).gsub(to_2, rep_2).gsub(to_3, rep_3) # remove label
|
65
|
-
# very ugly hack to ignore ,()
|
66
|
-
ptrn1 = /^(?<name>.+)(\s+|$)(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))))/
|
67
|
-
m = /^(?<name>.+)(\s+|$)/.match(to_consider)
|
68
|
-
m_with_dose = ptrn1.match(to_consider)
|
69
|
-
m = m_with_dose if m_with_dose
|
70
|
-
if m2 = /^(|[^:]+:\s)(E\s+\d+)$/.match(component.strip)
|
71
|
-
to_add = ParseSubstance.new(m2[2], '', nil, nil, nil, nil, active_agents.index(m2[2].downcase) ? true : false)
|
72
|
-
substances << to_add
|
73
|
-
elsif m
|
74
|
-
ptrn = /(?<name>.+)\s+(?<dose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))))(\s*(?:ut|corresp\.?)\s+(?<chemical>[^\d,]+)\s*(?<cdose>[\d\-.]+(\s*(?:(Mio\.?\s*)?(U\.\s*Ph\.\s*Eur\.|[^\s,]+))(\s*[mv]\/[mv])?))?)/
|
75
|
-
m_with_chemical = ptrn.match(to_consider)
|
76
|
-
m = m_with_chemical if m_with_chemical
|
77
|
-
name = m[:name].strip
|
78
|
-
chemical = m_with_chemical ? m[:chemical] : nil
|
79
|
-
cdose = m_with_chemical ? m[:cdose] : nil
|
80
|
-
dose = m_with_dose ? m[:dose] : nil
|
81
|
-
if m_with_chemical and active_agents.index(m_with_chemical[:chemical].strip)
|
82
|
-
is_active_agent = true
|
83
|
-
name = m[:chemical].strip
|
84
|
-
dose = m[:cdose]
|
85
|
-
chemical = m[:name].strip
|
86
|
-
cdose = m[:dose]
|
87
|
-
else
|
88
|
-
is_active_agent = active_agents.index(m[:name].strip) != nil
|
89
|
-
end
|
90
|
-
unit = nil
|
91
|
-
name = name.gsub(rep_3, to_3).gsub(rep_2, to_2).gsub(rep_1, to_1)
|
92
|
-
emulsion_pattern = /\s+pro($|\s+)|emulsion|solution/i
|
93
|
-
next if emulsion_pattern.match(name)
|
94
|
-
name = name.split(/\s/).collect{ |x| x.capitalize }.join(' ').strip
|
95
|
-
chemical = chemical.split(/\s/).collect{ |x| x.capitalize }.join(' ').strip if chemical
|
96
|
-
qty, unit = ParseUtil.dose_to_qty_unit(dose, filler)
|
97
|
-
cqty, cunit = ParseUtil.dose_to_qty_unit(cdose, filler)
|
98
|
-
dose = "#{qty} #{unit}" if unit and unit.match(/\//)
|
99
|
-
substances << ParseSubstance.new(name, qty, unit, chemical, cqty, cunit, is_active_agent, dose, cdose)
|
100
|
-
end
|
101
|
-
}
|
102
|
-
comps << ParseComposition.new(line, label, label_description, substances) if substances.size > 0
|
103
|
-
end
|
104
|
-
comps
|
105
|
-
end
|
106
|
-
end
|