oddb2xml 1.8.6 → 1.8.7
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.
- data/.travis.yml +1 -1
- data/Gemfile.lock +1 -1
- data/History.txt +4 -0
- data/lib/oddb2xml/builder.rb +3 -2
- data/lib/oddb2xml/version.rb +1 -1
- data/oddb2xml.xsd +13 -0
- data/spec/builder_spec.rb +19 -10
- data/spec/data/swissindex_NonPharma_DE.xml +65 -0
- data/spec/data/swissindex_NonPharma_FR.xml +65 -0
- data/spec/data/swissindex_Pharma_DE.xml +82 -0
- data/spec/data/swissindex_Pharma_FR.xml +82 -0
- data/spec/spec_helper.rb +24 -25
- data/test_options.rb +1 -1
- metadata +10 -4
- data/spec/data/wsdl.xml +0 -55
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/lib/oddb2xml/builder.rb
CHANGED
@@ -632,7 +632,8 @@ module Oddb2xml
|
|
632
632
|
xml.VAT info_zur_rose[:vat]
|
633
633
|
end
|
634
634
|
|
635
|
-
|
635
|
+
nincd = detect_nincd(de_idx)
|
636
|
+
(nincd and nincd == 13) ? xml.SALECD('A') : xml.SALECD( (info_zur_rose && info_zur_rose[:cmut] != '3') ? 'A' : 'I') # XML_OPTIONS
|
636
637
|
if pac and pac[:limitation_points]
|
637
638
|
#xml.INSLIM
|
638
639
|
xml.LIMPTS pac[:limitation_points] unless pac[:limitation_points].empty?
|
@@ -750,7 +751,7 @@ module Oddb2xml
|
|
750
751
|
#xml.ARTLIM {
|
751
752
|
# xml.LIMCD
|
752
753
|
#}
|
753
|
-
if nincd
|
754
|
+
if nincd
|
754
755
|
xml.ARTINS {
|
755
756
|
#xml.VDAT
|
756
757
|
#xml.INCD
|
data/lib/oddb2xml/version.rb
CHANGED
data/oddb2xml.xsd
CHANGED
@@ -158,6 +158,14 @@
|
|
158
158
|
</xs:element>
|
159
159
|
<xs:element name="SALECD">
|
160
160
|
<xs:simpleType>
|
161
|
+
<xs:annotation>
|
162
|
+
<xs:documentation xml:lang="de">
|
163
|
+
Bedeutung ist 'A' = Aktiv,'I' = inaktiv == Ausser Handel
|
164
|
+
</xs:documentation>
|
165
|
+
<xs:documentation xml:lang="en">
|
166
|
+
meaning is 'A' = active,'I' = inactive == out of trade
|
167
|
+
</xs:documentation>
|
168
|
+
</xs:annotation>
|
161
169
|
<xs:restriction base="xs:string">
|
162
170
|
<xs:enumeration value="A" />
|
163
171
|
<xs:enumeration value="I" />
|
@@ -257,6 +265,11 @@
|
|
257
265
|
</xs:element>
|
258
266
|
<xs:element name="NINCD">
|
259
267
|
<xs:simpleType>
|
268
|
+
<xs:annotation>
|
269
|
+
<xs:documentation xml:lang="en">
|
270
|
+
possible values are 10 => BAG-XML (SL/LS), 13 -> MiGel, 20 => (LPPV) Limitation, empty => NonPharma)
|
271
|
+
</xs:documentation>
|
272
|
+
</xs:annotation>
|
260
273
|
<xs:restriction base="xs:byte">
|
261
274
|
<xs:enumeration value="10" />
|
262
275
|
<xs:enumeration value="20" />
|
data/spec/builder_spec.rb
CHANGED
@@ -25,25 +25,26 @@ def check_validation_via_xsd
|
|
25
25
|
xsd = Nokogiri::XML::Schema(File.read(@oddb2xml_xsd))
|
26
26
|
files.each{
|
27
27
|
|file|
|
28
|
-
|
28
|
+
$stderr.puts "Validating file #{file} with #{File.size(file)} bytes" if $VERBOSE
|
29
|
+
doc = Nokogiri::XML(File.read(file))
|
29
30
|
xsd.validate(doc).each do |error| error.message.should be_nil end
|
30
31
|
}
|
31
32
|
end
|
32
33
|
describe Oddb2xml::Builder do
|
33
|
-
NrExtendedArticles =
|
34
|
-
NrPharmaAndNonPharmaArticles =
|
34
|
+
NrExtendedArticles = 73
|
35
|
+
NrPharmaAndNonPharmaArticles = 60
|
35
36
|
NrPharmaArticles = 5
|
36
37
|
include ServerMockHelper
|
37
38
|
before(:each) do
|
38
39
|
@savedDir = Dir.pwd
|
39
40
|
cleanup_directories_before_run
|
40
41
|
setup_server_mocks
|
41
|
-
setup_swiss_index_server_mock(types = ['NonPharma', 'Pharma'])
|
42
42
|
Dir.chdir Oddb2xml::WorkDir
|
43
43
|
end
|
44
44
|
after(:each) do
|
45
45
|
Dir.chdir @savedDir if @savedDir and File.directory?(@savedDir)
|
46
46
|
end
|
47
|
+
|
47
48
|
context 'XSD-generation: ' do
|
48
49
|
let(:cli) do
|
49
50
|
opts = {}
|
@@ -53,7 +54,7 @@ describe Oddb2xml::Builder do
|
|
53
54
|
Oddb2xml::Cli.new(opts)
|
54
55
|
end
|
55
56
|
|
56
|
-
it 'should return true when validating
|
57
|
+
it 'should return true when validating xml against oddb2xml.xsd' do
|
57
58
|
res = buildr_capture(:stdout){ cli.run }
|
58
59
|
File.exists?(@article_xml).should be_true
|
59
60
|
File.exists?(@product_xml).should be_true
|
@@ -127,7 +128,6 @@ describe Oddb2xml::Builder do
|
|
127
128
|
end
|
128
129
|
|
129
130
|
it 'should contain the correct values fo CMUT from zurrose_transfer.dat' do
|
130
|
-
puts Oddb2xml::WorkDir
|
131
131
|
res = buildr_capture(:stdout){ cli.run }
|
132
132
|
res.should match(/products/)
|
133
133
|
dat_filename = File.join(Oddb2xml::WorkDir, 'oddb.dat')
|
@@ -188,14 +188,14 @@ describe Oddb2xml::Builder do
|
|
188
188
|
smno = article.elements['SMNO'] ? article.elements['SMNO'].text : 'nil'
|
189
189
|
puts "checking doc for pharmacode #{pharmacode} isRefdata #{isRefdata} == #{refdata}. SMNO: #{smno} #{name}" if $VERBOSE
|
190
190
|
article.elements['REF_DATA'].text.should == isRefdata.to_s
|
191
|
+
|
191
192
|
end
|
192
193
|
|
193
194
|
it 'should generate the flag non-refdata' do
|
194
195
|
res = buildr_capture(:stdout){ cli.run }
|
195
196
|
@article_xml = File.expand_path(File.join(Oddb2xml::WorkDir, 'oddb_article.xml'))
|
196
|
-
puts @article_xml
|
197
197
|
File.exists?(@article_xml).should be_true
|
198
|
-
FileUtils.cp(@article_xml, '
|
198
|
+
FileUtils.cp(@article_xml, File.join(Oddb2xml::WorkDir, 'tst-non-refdata.xml'))
|
199
199
|
article_xml = IO.read(@article_xml)
|
200
200
|
doc = REXML::Document.new File.new(@article_xml)
|
201
201
|
XPath.match( doc, "//REF_DATA" ).size.should > 0
|
@@ -205,6 +205,16 @@ describe Oddb2xml::Builder do
|
|
205
205
|
checkItemForRefdata(doc, "5366964", 1) # 1-DAY ACUVUE moist jour
|
206
206
|
end
|
207
207
|
|
208
|
+
it 'should generate SALECD A for migel (NINCD 13)' do
|
209
|
+
res = buildr_capture(:stdout){ cli.run }
|
210
|
+
@article_xml = File.expand_path(File.join(Oddb2xml::WorkDir, 'oddb_article.xml'))
|
211
|
+
doc = REXML::Document.new File.new(@article_xml)
|
212
|
+
article = XPath.match( doc, "//ART[ARTINS/NINCD=13]").first
|
213
|
+
article = XPath.match( doc, "//ART[PHAR=5366964]").first
|
214
|
+
article.elements['SALECD'].text.should == 'A'
|
215
|
+
article.elements['ARTINS/NINCD'].text.should == '13'
|
216
|
+
end
|
217
|
+
|
208
218
|
it 'should pass validating via oddb2xml.xsd' do
|
209
219
|
check_validation_via_xsd
|
210
220
|
end
|
@@ -360,9 +370,8 @@ describe Oddb2xml::Builder do
|
|
360
370
|
it 'should generate the flag SALECD' do
|
361
371
|
res = buildr_capture(:stdout){ cli.run }
|
362
372
|
@article_xml = File.expand_path(File.join(Oddb2xml::WorkDir, 'oddb_article.xml'))
|
363
|
-
puts @article_xml
|
364
373
|
File.exists?(@article_xml).should be_true
|
365
|
-
FileUtils.cp(@article_xml, '
|
374
|
+
FileUtils.cp(@article_xml, File.join(Oddb2xml::WorkDir, 'tst-SALECD.xml'))
|
366
375
|
article_xml = IO.read(@article_xml)
|
367
376
|
doc = REXML::Document.new File.new(@article_xml)
|
368
377
|
XPath.match( doc, "//REF_DATA" ).size.should > 0
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope
|
3
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
6
|
+
<soap:Body>
|
7
|
+
<NONPHARMA
|
8
|
+
CREATION_DATETIME="2012-10-18T06:31:19.4687619+02:00"
|
9
|
+
xmlns="http://example.com/test">
|
10
|
+
<ITEM DT="2013-06-22T00:00:00">
|
11
|
+
<GTIN>733905577161</GTIN>
|
12
|
+
<PHAR>5366964</PHAR>
|
13
|
+
<STATUS>A</STATUS>
|
14
|
+
<STDATE>2012-08-22T00:00:00</STDATE>
|
15
|
+
<LANG>FR</LANG>
|
16
|
+
<DSCR>1-DAY ACUVUE moist jour -2.00dpt BC 8.5</DSCR>
|
17
|
+
<ADDSCR>30 pce</ADDSCR>
|
18
|
+
<COMP>
|
19
|
+
<NAME>Johnson & Johnson Consumer (Health Care / OTC)</NAME>
|
20
|
+
</COMP>
|
21
|
+
</ITEM>
|
22
|
+
<ITEM DT="2012-10-18T00:00:00">
|
23
|
+
<GTIN>0000000000000</GTIN>
|
24
|
+
<PHAR>00000</PHAR>
|
25
|
+
<STATUS>A</STATUS>
|
26
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
27
|
+
<LANG>DE</LANG>
|
28
|
+
<DSCR>Foo 1000 mg</DSCR>
|
29
|
+
<ADDSCR>Amp</ADDSCR>
|
30
|
+
<COMP>
|
31
|
+
<NAME>EXAMPLE.COM AG</NAME>
|
32
|
+
<GLN>0000000000000</GLN>
|
33
|
+
</COMP>
|
34
|
+
</ITEM>
|
35
|
+
<ITEM DT="2012-10-18T00:00:00">
|
36
|
+
<GTIN>0000000000001</GTIN>
|
37
|
+
<PHAR>00001</PHAR>
|
38
|
+
<STATUS>A</STATUS>
|
39
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
40
|
+
<LANG>DE</LANG>
|
41
|
+
<DSCR>Bar 10 Stk</DSCR>
|
42
|
+
<ADDSCR>10 Stk</ADDSCR>
|
43
|
+
<COMP>
|
44
|
+
<NAME>EXAMPLE.ORG AG</NAME>
|
45
|
+
</COMP>
|
46
|
+
</ITEM>
|
47
|
+
<ITEM DT="2012-10-18T00:00:00">
|
48
|
+
<GTIN>0000000000002</GTIN>
|
49
|
+
<PHAR>00002</PHAR>
|
50
|
+
<STATUS>A</STATUS>
|
51
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
52
|
+
<LANG>DE</LANG>
|
53
|
+
<DSCR>Baz 10 Tablet</DSCR>
|
54
|
+
<ADDSCR>5 Stk</ADDSCR>
|
55
|
+
<COMP>
|
56
|
+
<NAME>EXAMPLE.AC AG</NAME>
|
57
|
+
</COMP>
|
58
|
+
</ITEM>
|
59
|
+
<RESULT>
|
60
|
+
<OK_ERROR>OK</OK_ERROR>
|
61
|
+
<NBR_RECORD>3</NBR_RECORD>
|
62
|
+
</RESULT>
|
63
|
+
</NONPHARMA>
|
64
|
+
</soap:Body>
|
65
|
+
</soap:Envelope>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope
|
3
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
6
|
+
<soap:Body>
|
7
|
+
<NONPHARMA
|
8
|
+
CREATION_DATETIME="2012-10-18T06:31:19.4687619+02:00"
|
9
|
+
xmlns="http://example.com/test">
|
10
|
+
<ITEM DT="2013-06-22T00:00:00">
|
11
|
+
<GTIN>733905577161</GTIN>
|
12
|
+
<PHAR>5366964</PHAR>
|
13
|
+
<STATUS>A</STATUS>
|
14
|
+
<STDATE>2012-08-22T00:00:00</STDATE>
|
15
|
+
<LANG>FR</LANG>
|
16
|
+
<DSCR>1-DAY ACUVUE moist jour -2.00dpt BC 8.5</DSCR>
|
17
|
+
<ADDSCR>30 pce</ADDSCR>
|
18
|
+
<COMP>
|
19
|
+
<NAME>Johnson & Johnson Consumer (Health Care / OTC)</NAME>
|
20
|
+
</COMP>
|
21
|
+
</ITEM>
|
22
|
+
<ITEM DT="2012-10-18T00:00:00">
|
23
|
+
<GTIN>0000000000000</GTIN>
|
24
|
+
<PHAR>00000</PHAR>
|
25
|
+
<STATUS>A</STATUS>
|
26
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
27
|
+
<LANG>DE</LANG>
|
28
|
+
<DSCR>Foo 1000 mg</DSCR>
|
29
|
+
<ADDSCR>Amp</ADDSCR>
|
30
|
+
<COMP>
|
31
|
+
<NAME>EXAMPLE.COM AG</NAME>
|
32
|
+
<GLN>0000000000000</GLN>
|
33
|
+
</COMP>
|
34
|
+
</ITEM>
|
35
|
+
<ITEM DT="2012-10-18T00:00:00">
|
36
|
+
<GTIN>0000000000001</GTIN>
|
37
|
+
<PHAR>00001</PHAR>
|
38
|
+
<STATUS>A</STATUS>
|
39
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
40
|
+
<LANG>DE</LANG>
|
41
|
+
<DSCR>Bar 10 Stk</DSCR>
|
42
|
+
<ADDSCR>10 Stk</ADDSCR>
|
43
|
+
<COMP>
|
44
|
+
<NAME>EXAMPLE.ORG AG</NAME>
|
45
|
+
</COMP>
|
46
|
+
</ITEM>
|
47
|
+
<ITEM DT="2012-10-18T00:00:00">
|
48
|
+
<GTIN>0000000000002</GTIN>
|
49
|
+
<PHAR>00002</PHAR>
|
50
|
+
<STATUS>A</STATUS>
|
51
|
+
<STDATE>2002-05-23T00:00:00</STDATE>
|
52
|
+
<LANG>DE</LANG>
|
53
|
+
<DSCR>Baz 10 Tablet</DSCR>
|
54
|
+
<ADDSCR>5 Stk</ADDSCR>
|
55
|
+
<COMP>
|
56
|
+
<NAME>EXAMPLE.AC AG</NAME>
|
57
|
+
</COMP>
|
58
|
+
</ITEM>
|
59
|
+
<RESULT>
|
60
|
+
<OK_ERROR>OK</OK_ERROR>
|
61
|
+
<NBR_RECORD>3</NBR_RECORD>
|
62
|
+
</RESULT>
|
63
|
+
</NONPHARMA>
|
64
|
+
</soap:Body>
|
65
|
+
</soap:Envelope>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<soap:Body>
|
4
|
+
<PHARMA xmlns="http://swissindex.e-mediat.net/SwissindexPharma_out_V101" CREATION_DATETIME="2013-12-10T10:09:26.8198427+01:00">
|
5
|
+
<!-- spec/data/swissindex_pharma.xml. Values for spec/builder_spec.rb -->
|
6
|
+
CREATION_DATETIME="2012-10-18T06:31:19.4687619+02:00"
|
7
|
+
xmlns="http://example.com/test">
|
8
|
+
<ITEM DT="2013-06-22T00:00:00">
|
9
|
+
<GTIN>733905577161</GTIN>
|
10
|
+
<PHAR>5366964</PHAR>
|
11
|
+
<STATUS>A</STATUS>
|
12
|
+
<STDATE>2012-08-22T00:00:00</STDATE>
|
13
|
+
<LANG>FR</LANG>
|
14
|
+
<DSCR>1-DAY ACUVUE moist jour -2.00dpt BC 8.5</DSCR>
|
15
|
+
<ADDSCR>30 pce</ADDSCR>
|
16
|
+
<COMP>
|
17
|
+
<NAME>Johnson & Johnson Consumer (Health Care / OTC)</NAME>
|
18
|
+
</COMP>
|
19
|
+
</ITEM>
|
20
|
+
<ITEM DT="2013-06-22T00:00:00">
|
21
|
+
<GTIN>7680536620137</GTIN>
|
22
|
+
<PHAR>1699947</PHAR>
|
23
|
+
<STATUS>A</STATUS>
|
24
|
+
<STDATE>1996-03-20T00:00:00</STDATE>
|
25
|
+
<LANG>DE</LANG>
|
26
|
+
<DSCR>3TC Filmtabl 150 mg</DSCR>
|
27
|
+
<ADDSCR>60 Stk</ADDSCR>
|
28
|
+
<ATC>J05AF05</ATC>
|
29
|
+
<COMP>
|
30
|
+
<NAME>ViiV Healthcare GmbH</NAME>
|
31
|
+
<GLN>7601001392175</GLN>
|
32
|
+
</COMP>
|
33
|
+
</ITEM>
|
34
|
+
<ITEM DT="2013-12-06T00:00:00">
|
35
|
+
<GTIN>7680620690084</GTIN>
|
36
|
+
<PHAR>5819012</PHAR>
|
37
|
+
<STATUS>A</STATUS>
|
38
|
+
<STDATE>2013-10-26T00:00:00</STDATE>
|
39
|
+
<LANG>DE</LANG>
|
40
|
+
<DSCR>LEVETIRACETAM DESITIN Filmtabl 250 mg</DSCR>
|
41
|
+
<ADDSCR>30 Stk</ADDSCR>
|
42
|
+
<ATC>N03AX14</ATC>
|
43
|
+
<COMP>
|
44
|
+
<NAME>Desitin Pharma GmbH</NAME>
|
45
|
+
<GLN>7601001320451</GLN>
|
46
|
+
</COMP>
|
47
|
+
</ITEM>
|
48
|
+
<ITEM DT="2013-06-22T00:00:00">
|
49
|
+
<GTIN>7680555580054</GTIN>
|
50
|
+
<PHAR>2465312</PHAR>
|
51
|
+
<STATUS>A</STATUS>
|
52
|
+
<STDATE>2002-01-16T00:00:00</STDATE>
|
53
|
+
<LANG>DE</LANG>
|
54
|
+
<DSCR>ZYVOXID Filmtabl 600 mg</DSCR>
|
55
|
+
<ADDSCR>10 Stk</ADDSCR>
|
56
|
+
<ATC>J01XX08</ATC>
|
57
|
+
<COMP>
|
58
|
+
<NAME>Pfizer AG</NAME>
|
59
|
+
<GLN>7601001010604</GLN>
|
60
|
+
</COMP>
|
61
|
+
</ITEM>
|
62
|
+
<ITEM DT="2013-12-06T00:00:00">
|
63
|
+
<GTIN>7680316950157</GTIN>
|
64
|
+
<PHAR>598003</PHAR>
|
65
|
+
<STATUS>A</STATUS>
|
66
|
+
<STDATE>2012-04-13T00:00:00</STDATE>
|
67
|
+
<LANG>DE</LANG>
|
68
|
+
<DSCR>SOFRADEX Gtt Auric</DSCR>
|
69
|
+
<ADDSCR>8 ml</ADDSCR>
|
70
|
+
<ATC>S02CA06</ATC>
|
71
|
+
<COMP>
|
72
|
+
<NAME>Sanofi-Aventis (Suisse) SA</NAME>
|
73
|
+
<GLN>7601001002340</GLN>
|
74
|
+
</COMP>
|
75
|
+
</ITEM>
|
76
|
+
<RESULT>
|
77
|
+
<OK_ERROR>OK</OK_ERROR>
|
78
|
+
<NBR_RECORD>2</NBR_RECORD>
|
79
|
+
</RESULT>
|
80
|
+
</PHARMA>
|
81
|
+
</soap:Body>
|
82
|
+
</soap:Envelope>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<soap:Body>
|
4
|
+
<PHARMA xmlns="http://swissindex.e-mediat.net/SwissindexPharma_out_V101" CREATION_DATETIME="2013-12-10T10:09:26.8198427+01:00">
|
5
|
+
<!-- spec/data/swissindex_pharma.xml. Values for spec/builder_spec.rb -->
|
6
|
+
CREATION_DATETIME="2012-10-18T06:31:19.4687619+02:00"
|
7
|
+
xmlns="http://example.com/test">
|
8
|
+
<ITEM DT="2013-06-22T00:00:00">
|
9
|
+
<GTIN>733905577161</GTIN>
|
10
|
+
<PHAR>5366964</PHAR>
|
11
|
+
<STATUS>A</STATUS>
|
12
|
+
<STDATE>2012-08-22T00:00:00</STDATE>
|
13
|
+
<LANG>FR</LANG>
|
14
|
+
<DSCR>1-DAY ACUVUE moist jour -2.00dpt BC 8.5</DSCR>
|
15
|
+
<ADDSCR>30 pce</ADDSCR>
|
16
|
+
<COMP>
|
17
|
+
<NAME>Johnson & Johnson Consumer (Health Care / OTC)</NAME>
|
18
|
+
</COMP>
|
19
|
+
</ITEM>
|
20
|
+
<ITEM DT="2013-06-22T00:00:00">
|
21
|
+
<GTIN>7680536620137</GTIN>
|
22
|
+
<PHAR>1699947</PHAR>
|
23
|
+
<STATUS>A</STATUS>
|
24
|
+
<STDATE>1996-03-20T00:00:00</STDATE>
|
25
|
+
<LANG>DE</LANG>
|
26
|
+
<DSCR>3TC Filmtabl 150 mg</DSCR>
|
27
|
+
<ADDSCR>60 Stk</ADDSCR>
|
28
|
+
<ATC>J05AF05</ATC>
|
29
|
+
<COMP>
|
30
|
+
<NAME>ViiV Healthcare GmbH</NAME>
|
31
|
+
<GLN>7601001392175</GLN>
|
32
|
+
</COMP>
|
33
|
+
</ITEM>
|
34
|
+
<ITEM DT="2013-12-06T00:00:00">
|
35
|
+
<GTIN>7680620690084</GTIN>
|
36
|
+
<PHAR>5819012</PHAR>
|
37
|
+
<STATUS>A</STATUS>
|
38
|
+
<STDATE>2013-10-26T00:00:00</STDATE>
|
39
|
+
<LANG>DE</LANG>
|
40
|
+
<DSCR>LEVETIRACETAM DESITIN Filmtabl 250 mg</DSCR>
|
41
|
+
<ADDSCR>30 Stk</ADDSCR>
|
42
|
+
<ATC>N03AX14</ATC>
|
43
|
+
<COMP>
|
44
|
+
<NAME>Desitin Pharma GmbH</NAME>
|
45
|
+
<GLN>7601001320451</GLN>
|
46
|
+
</COMP>
|
47
|
+
</ITEM>
|
48
|
+
<ITEM DT="2013-06-22T00:00:00">
|
49
|
+
<GTIN>7680555580054</GTIN>
|
50
|
+
<PHAR>2465312</PHAR>
|
51
|
+
<STATUS>A</STATUS>
|
52
|
+
<STDATE>2002-01-16T00:00:00</STDATE>
|
53
|
+
<LANG>DE</LANG>
|
54
|
+
<DSCR>ZYVOXID Filmtabl 600 mg</DSCR>
|
55
|
+
<ADDSCR>10 Stk</ADDSCR>
|
56
|
+
<ATC>J01XX08</ATC>
|
57
|
+
<COMP>
|
58
|
+
<NAME>Pfizer AG</NAME>
|
59
|
+
<GLN>7601001010604</GLN>
|
60
|
+
</COMP>
|
61
|
+
</ITEM>
|
62
|
+
<ITEM DT="2013-12-06T00:00:00">
|
63
|
+
<GTIN>7680316950157</GTIN>
|
64
|
+
<PHAR>598003</PHAR>
|
65
|
+
<STATUS>A</STATUS>
|
66
|
+
<STDATE>2012-04-13T00:00:00</STDATE>
|
67
|
+
<LANG>DE</LANG>
|
68
|
+
<DSCR>SOFRADEX Gtt Auric</DSCR>
|
69
|
+
<ADDSCR>8 ml</ADDSCR>
|
70
|
+
<ATC>S02CA06</ATC>
|
71
|
+
<COMP>
|
72
|
+
<NAME>Sanofi-Aventis (Suisse) SA</NAME>
|
73
|
+
<GLN>7601001002340</GLN>
|
74
|
+
</COMP>
|
75
|
+
</ITEM>
|
76
|
+
<RESULT>
|
77
|
+
<OK_ERROR>OK</OK_ERROR>
|
78
|
+
<NBR_RECORD>2</NBR_RECORD>
|
79
|
+
</RESULT>
|
80
|
+
</PHARMA>
|
81
|
+
</soap:Body>
|
82
|
+
</soap:Envelope>
|
data/spec/spec_helper.rb
CHANGED
@@ -71,34 +71,33 @@ module ServerMockHelper
|
|
71
71
|
:headers => {'Content-Type' => 'application/zip; charset=utf-8'},
|
72
72
|
:body => stub_response)
|
73
73
|
end
|
74
|
-
def setup_swiss_index_server_mock(types =
|
74
|
+
def setup_swiss_index_server_mock(types =['NonPharma', 'Pharma'], languages=['DE', 'FR'])
|
75
75
|
types.each do |type|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
:headers => {'Content-Type' => 'text/xml; chaprset=utf-8'},
|
99
|
-
:body => stub_response)
|
76
|
+
languages.each do |language|
|
77
|
+
# wsdl
|
78
|
+
stub_wsdl_url = "https://index.ws.e-mediat.net/Swissindex/#{type}/ws_#{type}_V101.asmx?WSDL"
|
79
|
+
first_file = File.join(Oddb2xml::SpecData, "wsdl_#{type.downcase}.xml")
|
80
|
+
stub_response_wsdl = File.read(File.join(Oddb2xml::SpecData, "wsdl_#{type.downcase}.xml"))
|
81
|
+
stub_request(:get, stub_wsdl_url).
|
82
|
+
with(:headers => {
|
83
|
+
'Accept' => '*/*',
|
84
|
+
}).
|
85
|
+
to_return(
|
86
|
+
:status => 200,
|
87
|
+
:headers => {'Content-Type' => 'text/xml; charset=utf-8'},
|
88
|
+
:body => stub_response_wsdl)
|
89
|
+
# soap (dummy)
|
90
|
+
stub_soap_url = 'https://example.com/test'
|
91
|
+
stub_file = File.join(Oddb2xml::SpecData, "swissindex_#{type}_#{language}.xml")
|
92
|
+
stub_response = File.read(stub_file)
|
93
|
+
stub_request(:post, "https://example.com/test").
|
94
|
+
with(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n<soap:Body>\n <lang xmlns=\"http://swissindex.e-mediat.net/Swissindex#{type}_out_V101\">#{language}</lang>\n</soap:Body>\n</soap:Envelope>\n",
|
95
|
+
:headers => {'Accept'=>'*/*', 'Content-Type'=>'text/xml;charset=UTF-8', 'Soapaction'=>'"http://example.com/DownloadAll"', 'User-Agent'=>'Ruby'}).
|
96
|
+
to_return(:status => 200, :body => stub_response, :headers => {})
|
97
|
+
end
|
100
98
|
end
|
101
99
|
end
|
100
|
+
|
102
101
|
def setup_swissmedic_server_mock
|
103
102
|
host = 'www.swissmedic.ch'
|
104
103
|
{
|
data/test_options.rb
CHANGED
@@ -54,6 +54,6 @@ unless 'localhost.localdomain'.eql?(Socket.gethostbyname(Socket.gethostname).fir
|
|
54
54
|
end
|
55
55
|
test_one_call('oddb2xml -t md -c tar.gz')
|
56
56
|
test_one_call('oddb2xml -f xml')
|
57
|
-
test_one_call('oddb2xml -x address')
|
58
57
|
test_one_call('oddb2xml -f dat')
|
59
58
|
test_one_call('oddb2xml -t md')
|
59
|
+
test_one_call('oddb2xml -x address')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oddb2xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyzip
|
@@ -275,6 +275,10 @@ files:
|
|
275
275
|
- spec/data/oddb2xml_files_lppv.txt
|
276
276
|
- spec/data/oddb2xml_files_nonpharma.xls
|
277
277
|
- spec/data/swissindex.xml
|
278
|
+
- spec/data/swissindex_NonPharma_DE.xml
|
279
|
+
- spec/data/swissindex_NonPharma_FR.xml
|
280
|
+
- spec/data/swissindex_Pharma_DE.xml
|
281
|
+
- spec/data/swissindex_Pharma_FR.xml
|
278
282
|
- spec/data/swissindex_nonpharma.xml
|
279
283
|
- spec/data/swissindex_pharma.xml
|
280
284
|
- spec/data/swissmedic_fridge.xlsx
|
@@ -286,7 +290,6 @@ files:
|
|
286
290
|
- spec/data/swissmedic_orphans.html
|
287
291
|
- spec/data/swissmedic_package.xlsx
|
288
292
|
- spec/data/swissmedic_packages.html
|
289
|
-
- spec/data/wsdl.xml
|
290
293
|
- spec/data/wsdl_nonpharma.xml
|
291
294
|
- spec/data/wsdl_pharma.xml
|
292
295
|
- spec/data/zurrose_transfer.dat
|
@@ -349,6 +352,10 @@ test_files:
|
|
349
352
|
- spec/data/oddb2xml_files_lppv.txt
|
350
353
|
- spec/data/oddb2xml_files_nonpharma.xls
|
351
354
|
- spec/data/swissindex.xml
|
355
|
+
- spec/data/swissindex_NonPharma_DE.xml
|
356
|
+
- spec/data/swissindex_NonPharma_FR.xml
|
357
|
+
- spec/data/swissindex_Pharma_DE.xml
|
358
|
+
- spec/data/swissindex_Pharma_FR.xml
|
352
359
|
- spec/data/swissindex_nonpharma.xml
|
353
360
|
- spec/data/swissindex_pharma.xml
|
354
361
|
- spec/data/swissmedic_fridge.xlsx
|
@@ -360,7 +367,6 @@ test_files:
|
|
360
367
|
- spec/data/swissmedic_orphans.html
|
361
368
|
- spec/data/swissmedic_package.xlsx
|
362
369
|
- spec/data/swissmedic_packages.html
|
363
|
-
- spec/data/wsdl.xml
|
364
370
|
- spec/data/wsdl_nonpharma.xml
|
365
371
|
- spec/data/wsdl_pharma.xml
|
366
372
|
- spec/data/zurrose_transfer.dat
|
data/spec/data/wsdl.xml
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<wsdl:definitions
|
3
|
-
xmlns:s="http://www.w3.org/2001/XMLSchema"
|
4
|
-
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
|
5
|
-
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
6
|
-
xmlns:tns="http://example.com/test"
|
7
|
-
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
8
|
-
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
9
|
-
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
|
10
|
-
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
11
|
-
targetNamespace="http://example.com/test"
|
12
|
-
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
13
|
-
<wsdl:types>
|
14
|
-
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/test">
|
15
|
-
</s:schema>
|
16
|
-
</wsdl:types>
|
17
|
-
<wsdl:message name="DownloadAllSoapIn">
|
18
|
-
<wsdl:part name="lang" element="tns:lang" />
|
19
|
-
</wsdl:message>
|
20
|
-
<wsdl:message name="DownloadAllSoapOut">
|
21
|
-
<wsdl:part name="DownloadAllResult" element="tns:PHARMA" />
|
22
|
-
</wsdl:message>
|
23
|
-
<wsdl:binding name="ws_Pharma_V101Soap" type="tns:ws_Pharma_V101Soap">
|
24
|
-
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
25
|
-
<wsdl:operation name="DownloadAll">
|
26
|
-
<soap:operation soapAction="http://example.com/DownloadAll" style="document" />
|
27
|
-
<wsdl:input>
|
28
|
-
<soap:body use="literal" />
|
29
|
-
</wsdl:input>
|
30
|
-
<wsdl:output>
|
31
|
-
<soap:body use="literal" />
|
32
|
-
</wsdl:output>
|
33
|
-
</wsdl:operation>
|
34
|
-
</wsdl:binding>
|
35
|
-
<wsdl:binding name="ws_Pharma_V101Soap12" type="tns:ws_Pharma_V101Soap">
|
36
|
-
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
37
|
-
<wsdl:operation name="DownloadAll">
|
38
|
-
<soap12:operation soapAction="http://example.com/DownloadAll" style="document" />
|
39
|
-
<wsdl:input>
|
40
|
-
<soap12:body use="literal" />
|
41
|
-
</wsdl:input>
|
42
|
-
<wsdl:output>
|
43
|
-
<soap12:body use="literal" />
|
44
|
-
</wsdl:output>
|
45
|
-
</wsdl:operation>
|
46
|
-
</wsdl:binding>
|
47
|
-
<wsdl:service name="ws_Pharma_V101">
|
48
|
-
<wsdl:port name="ws_Pharma_V101Soap" binding="tns:ws_Pharma_V101Soap">
|
49
|
-
<soap:address location="https://example.com/test" />
|
50
|
-
</wsdl:port>
|
51
|
-
<wsdl:port name="ws_Pharma_V101Soap12" binding="tns:ws_Pharma_V101Soap12">
|
52
|
-
<soap12:address location="https://example.com/test" />
|
53
|
-
</wsdl:port>
|
54
|
-
</wsdl:service>
|
55
|
-
</wsdl:definitions>
|