oddb2xml 2.6.5 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/Elexis_Artikelstamm_v5.xsd +10 -8
- data/History.txt +25 -2
- data/bin/check_artikelstamm +1 -1
- data/lib/oddb2xml/builder.rb +44 -13
- data/lib/oddb2xml/chapter_70_hack.rb +8 -9
- data/lib/oddb2xml/cli.rb +4 -1
- data/lib/oddb2xml/downloader.rb +2 -2
- data/lib/oddb2xml/parslet_compositions.rb +5 -1
- data/lib/oddb2xml/semantic_check.rb +6 -4
- data/lib/oddb2xml/util.rb +15 -7
- data/lib/oddb2xml/version.rb +1 -1
- data/oddb2xml.gemspec +1 -0
- data/spec/artikelstamm_spec.rb +35 -17
- data/spec/builder_spec.rb +13 -13
- data/spec/cli_spec.rb +26 -0
- data/spec/data/Preparations.xml +139 -3
- data/spec/data/refdata_Pharma.xml +11 -0
- data/spec/data/swissmedic_package.xlsx +0 -0
- data/spec/data/transfer.dat +2 -1
- data/spec/data/varia_De.htm +2 -2
- data/spec/extractor_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09c85343784bea903af64ee40b29749dfdfc2af55000673244129510276c88a
|
4
|
+
data.tar.gz: 7a8cbd05765da37ec1d582c13bb71758c05a0ddd73773aea5084fa211ebf98d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5be02fa2ec4dff0aa6f8c4a4dbfba9cc0f272831fd0b10b6a1af1a18fd3cff3956ad0884de9e81c19c31d60984cc5d234586372aa7a0d34acdab9015cf7252d8
|
7
|
+
data.tar.gz: ea9317a80ad372959d59f0a13614a9a5a8a1f5da3befa9202f5dadbcb23a41523580184c9a769fb512ba7256f5d36b97dffc214424d4d70df499cb35b6c9371e
|
data/.travis.yml
CHANGED
@@ -11,17 +11,15 @@ before_install:
|
|
11
11
|
script: bundle exec rspec
|
12
12
|
|
13
13
|
rvm:
|
14
|
-
- 2.
|
15
|
-
- 2.
|
16
|
-
- 2.
|
17
|
-
- 2.
|
14
|
+
- 2.4
|
15
|
+
- 2.5
|
16
|
+
- 2.6
|
17
|
+
- 2.7
|
18
18
|
- ruby-head
|
19
19
|
|
20
20
|
matrix:
|
21
21
|
allow_failures:
|
22
22
|
- rvm: ruby-head
|
23
|
-
- rvm: 2.2.7
|
24
|
-
- rvm: 2.3.4
|
25
23
|
|
26
24
|
notifications:
|
27
25
|
email:
|
data/Elexis_Artikelstamm_v5.xsd
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Copyright (c) 2016 MEDEVIT. All rights reserved. This program and the
|
3
|
-
accompanying materials are made available under the terms of the Eclipse
|
4
|
-
Public License v1.0 which accompanies this distribution, and is available
|
5
|
-
at http://www.eclipse.org/legal/epl-v10.html v002 - Ergänzung K Komplementärprodukt
|
6
|
-
bei generic type, Consider ATC code of length 8 (on vet.med. articles) Relax
|
7
|
-
ADDSCR occurence to 0 .. 1 v003 - PRODNO hinzugefügt LIMNAMEBAG zur formal-kennzeichnung
|
8
|
-
von identen limitations v4 - Major refactoring, see https://redmine.medelexis.ch/issues/4405
|
2
|
+
<!-- Copyright (c) 2016 MEDEVIT. All rights reserved. This program and the
|
3
|
+
accompanying materials are made available under the terms of the Eclipse
|
4
|
+
Public License v1.0 which accompanies this distribution, and is available
|
5
|
+
at http://www.eclipse.org/legal/epl-v10.html v002 - Ergänzung K Komplementärprodukt
|
6
|
+
bei generic type, Consider ATC code of length 8 (on vet.med. articles) Relax
|
7
|
+
ADDSCR occurence to 0 .. 1 v003 - PRODNO hinzugefügt LIMNAMEBAG zur formal-kennzeichnung
|
8
|
+
von identen limitations v4 - Major refactoring, see https://redmine.medelexis.ch/issues/4405
|
9
9
|
Contributors: MEDEVIT <office@medevit.at> - initial API and implementation -->
|
10
10
|
<xs:schema targetNamespace="http://elexis.ch/Elexis_Artikelstamm_v5"
|
11
11
|
elementFormDefault="qualified" attributeFormDefault="unqualified"
|
@@ -339,7 +339,6 @@
|
|
339
339
|
</xs:element>
|
340
340
|
<xs:element name="GENERIC_TYPE"
|
341
341
|
maxOccurs="1" minOccurs="0">
|
342
|
-
|
343
342
|
<xs:simpleType>
|
344
343
|
<xs:annotation>
|
345
344
|
<xs:documentation>
|
@@ -359,6 +358,9 @@
|
|
359
358
|
<xs:enumeration
|
360
359
|
value="K">
|
361
360
|
</xs:enumeration>
|
361
|
+
<xs:enumeration
|
362
|
+
value="C"> <!-- BAG 9.6.2020: BDer Buchstabe C bei «Original Generika Code» steht für Co-Marketing Arzneimittel -->
|
363
|
+
</xs:enumeration>
|
362
364
|
</xs:restriction>
|
363
365
|
</xs:simpleType>
|
364
366
|
</xs:element>
|
data/History.txt
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
=== 2.7.0 / 05.11.2020
|
2
|
+
* Chapter70 hack nur als Kommentar
|
3
|
+
* Avoid double hyphen in comment
|
4
|
+
|
5
|
+
=== 2.6.9 / 29.06.2020
|
6
|
+
|
7
|
+
* Fix problem when running bin/oddb2xml -a -f dat. Thanks to Lukas Furre for reporting the problem
|
8
|
+
* Fix warning with regular expression thas has ']'
|
9
|
+
|
10
|
+
=== 2.6.8 / 26.06.2020
|
11
|
+
|
12
|
+
* Re-Add support for Ruby Version 2.4
|
13
|
+
* Specified minimal ruby version in gemspec
|
14
|
+
* Patch artikelstamm build to emit a product for Varilrix
|
15
|
+
|
16
|
+
=== 2.6.7 / 25.06.2020
|
17
|
+
* Added value 'C' (Co-marketing) for field GENERIC_TYPE Elexis_Artikelstamm_v5.xsd from BAG Preparations.xml
|
18
|
+
* Fixed limitations coming from the chapte 70 hack
|
19
|
+
* Ruby 2.7 compatible (No URI.open warning)
|
20
|
+
|
21
|
+
=== 2.6.6 / 11.01.2020
|
22
|
+
* Fix link for varia_De.htm
|
23
|
+
|
1
24
|
=== 2.6.5 / 11.01.2020
|
2
25
|
* Fix issue #37: Update BAG Download Link
|
3
26
|
** Pending problem: varia_De.htm for Artikelstamm cannot be found anymore
|
@@ -127,7 +150,7 @@
|
|
127
150
|
|
128
151
|
=== 2.4.1 / 2.12.2016
|
129
152
|
|
130
|
-
* Update oddb2xml.gemspec to add GPL-3.0 as correct license for Rubygems as stated in LICENSE file
|
153
|
+
* Update oddb2xml.gemspec to add GPL-3.0 as correct license for Rubygems as stated in LICENSE file
|
131
154
|
* Added a hack for 24 globulina equina which commas between brackets
|
132
155
|
|
133
156
|
=== 2.4.0 /25.08.2016
|
@@ -565,7 +588,7 @@
|
|
565
588
|
|
566
589
|
* Improve NINCD detection
|
567
590
|
- Update timeout handling
|
568
|
-
- Improve pharmacode detection
|
591
|
+
- Improve pharmacode detection
|
569
592
|
|
570
593
|
=== 1.5.1 / 10.06.2013
|
571
594
|
|
data/bin/check_artikelstamm
CHANGED
data/lib/oddb2xml/builder.rb
CHANGED
@@ -1337,7 +1337,7 @@ module Oddb2xml
|
|
1337
1337
|
else
|
1338
1338
|
('0' * DAT_LEN[:ITHE])
|
1339
1339
|
end.to_i
|
1340
|
-
row << "%0#{DAT_LEN[:CEAN]}d" % (sprintf('%013d', ean).match(/^000000/) ? 0 : ean.to_i)
|
1340
|
+
row << "%0#{DAT_LEN[:CEAN]}d" % (sprintf('%013d', ean.to_i).match(/^000000/) ? 0 : ean.to_i)
|
1341
1341
|
row << "%#{DAT_LEN[:CMWS]}s" % '2' # pharma
|
1342
1342
|
rows << row
|
1343
1343
|
end
|
@@ -1557,9 +1557,20 @@ module Oddb2xml
|
|
1557
1557
|
when 'N'; xml.DEDUCTIBLE 10; # 10%
|
1558
1558
|
end if item && item[:deductible]
|
1559
1559
|
prodno = Oddb2xml.getProdnoForEan13(pkg_gtin)
|
1560
|
-
xml.PRODNO prodno if prodno
|
1561
1560
|
atc = package[:atc_code]
|
1562
1561
|
atc ||= @refdata[pkg_gtin][:seq][:atc_code] if @refdata[pkg_gtin]
|
1562
|
+
unless prodno # find a prodno from packages for vaccinations
|
1563
|
+
if atc && /^J07/.match(atc) && !/^J07AX/.match(atc)
|
1564
|
+
pack = @packs.values.find{ |v| v && v[:atc_code].eql?(atc)}
|
1565
|
+
if pack
|
1566
|
+
prodno = pack[:prodno]
|
1567
|
+
Oddb2xml.log "Patching vaccination for #{pkg_gtin} #{atc} #{name} via prodno #{prodno}"
|
1568
|
+
else
|
1569
|
+
Oddb2xml.log "unable to find a pack/prodno for vaccination for #{pkg_gtin} #{atc} #{name}"
|
1570
|
+
end
|
1571
|
+
end
|
1572
|
+
end
|
1573
|
+
xml.PRODNO prodno if prodno
|
1563
1574
|
csv = []
|
1564
1575
|
@csv_file << [pkg_gtin, name, package[:unit], measure,
|
1565
1576
|
pexf ? pexf : '',
|
@@ -1571,8 +1582,6 @@ module Oddb2xml
|
|
1571
1582
|
end
|
1572
1583
|
end
|
1573
1584
|
else # non pharma
|
1574
|
-
@csv_file << [ ean13, (obj[:desc_de] || obj[:description]), '', '',
|
1575
|
-
obj[:price], obj[:pub_price], '', '', '', '', '', '' ]
|
1576
1585
|
if @@emitted_v5_gtins.index(ean13)
|
1577
1586
|
next
|
1578
1587
|
else
|
@@ -1591,15 +1600,35 @@ module Oddb2xml
|
|
1591
1600
|
xml.GTIN ean13.to_s.rjust(13, '0')
|
1592
1601
|
xml.PHAR obj[:pharmacode]
|
1593
1602
|
emit_salecd(xml, ean13, obj)
|
1594
|
-
|
1603
|
+
description = obj[:desc_de] || obj[:description] # for description for zur_rose
|
1604
|
+
xml.DSCR(description)
|
1595
1605
|
xml.DSCRF(obj[:desc_fr] || '--missing--')
|
1596
1606
|
xml.COMP do
|
1597
1607
|
xml.GLN obj[:company_ean]
|
1598
1608
|
end if obj[:company_ean] && !obj[:company_ean].empty?
|
1599
|
-
|
1600
|
-
|
1609
|
+
if !(obj[:price] && !obj[:price].empty?) || !(obj[:pub_price] && !obj[:pub_price].empty?)
|
1610
|
+
zur_rose_detail = @infos_zur_rose.values.find{|x| x[:ean13].to_i == ean13.to_i}
|
1611
|
+
end
|
1612
|
+
ppub = nil; pexf=nil
|
1613
|
+
if obj[:price] && !obj[:price].empty?
|
1614
|
+
xml.PEXF (pexf = obj[:price])
|
1615
|
+
elsif zur_rose_detail
|
1616
|
+
if zur_rose_detail[:price] && !zur_rose_detail[:price].empty? && !zur_rose_detail[:price].eql?('0.00')
|
1617
|
+
Oddb2xml.log "NonPharma: #{ean13} adding PEXF #{zur_rose_detail[:price]} #{description}"
|
1618
|
+
xml.PEXF (pexf = zur_rose_detail[:price])
|
1619
|
+
end
|
1620
|
+
end
|
1621
|
+
if obj[:pub_price] && !obj[:pub_price].empty?
|
1622
|
+
xml.PPUB (ppub = obj[:pub_price])
|
1623
|
+
elsif zur_rose_detail
|
1624
|
+
if zur_rose_detail[:pub_price] && !zur_rose_detail[:pub_price].empty? && !zur_rose_detail[:pub_price].eql?('0.00')
|
1625
|
+
Oddb2xml.log "NonPharma: #{ean13} adding PPUB #{zur_rose_detail[:pub_price]} #{description}"
|
1626
|
+
xml.PPUB (ppub = zur_rose_detail[:pub_price])
|
1627
|
+
end
|
1628
|
+
end
|
1629
|
+
@csv_file << [ ean13, description, '', '', pexf, ppub, '', '', '', '', '', '' ]
|
1601
1630
|
if chap70
|
1602
|
-
xml.comment "Chapter70 hack"
|
1631
|
+
xml.comment "Chapter70 hack #{ean13.to_s.rjust(13, '0')} #{description.encode(:xml => :text).gsub('--','-')}"
|
1603
1632
|
xml.SL_ENTRY 'true'
|
1604
1633
|
xml.PRODNO obj[:pharmacode]
|
1605
1634
|
end
|
@@ -1665,7 +1694,7 @@ module Oddb2xml
|
|
1665
1694
|
myPack = @packs.values.find{ |x| x[:iksnr].to_i == obj[:seq][:swissmedic_number5].to_i } if obj[:seq]
|
1666
1695
|
if myPack && !prodno
|
1667
1696
|
prodno ||= myPack[:prodno]
|
1668
|
-
puts "Setting prodno #{prodno} for #{ean13}
|
1697
|
+
puts "Setting prodno #{prodno} for #{ean13} #{myPack[:sequence_name]}"
|
1669
1698
|
end
|
1670
1699
|
next unless prodno
|
1671
1700
|
next if emitted_prodno.index(prodno)
|
@@ -1703,12 +1732,14 @@ module Oddb2xml
|
|
1703
1732
|
used_limitations << lim_code unless used_limitations.index(lim_code)
|
1704
1733
|
xml.LIMNAMEBAG lim_code
|
1705
1734
|
elsif obj[:chapter70]
|
1706
|
-
|
1707
|
-
xml.comment "Chapter70 hack"
|
1735
|
+
xml.comment "Chapter70 hack prodno #{prodno} #{obj[:description].encode(:xml => :text).gsub('--','-')}"
|
1708
1736
|
xml.SALECD('A') # these products are always active!
|
1709
1737
|
xml.DSCR obj[:description]
|
1710
1738
|
xml.DSCRF ''
|
1711
|
-
|
1739
|
+
if @limitations.index(obj[:code])
|
1740
|
+
xml.LIMNAMEBAG obj[:code]
|
1741
|
+
used_limitations << obj[:code]
|
1742
|
+
end
|
1712
1743
|
end
|
1713
1744
|
if sequence && sequence[:substances]
|
1714
1745
|
value = nil
|
@@ -1734,7 +1765,7 @@ module Oddb2xml
|
|
1734
1765
|
end
|
1735
1766
|
emitted_lim_code << lim[:code]
|
1736
1767
|
xml.LIMITATION do
|
1737
|
-
xml.comment "Chapter70 hack" if lim[:chap70]
|
1768
|
+
xml.comment "Chapter70 2 hack" if lim[:chap70]
|
1738
1769
|
xml.LIMNAMEBAG lim[:code] # original LIMCD
|
1739
1770
|
xml.DSCR Oddb2xml.html_decode(lim[:desc_de])
|
1740
1771
|
xml.DSCRF Oddb2xml.html_decode(lim[:desc_fr])
|
@@ -12,7 +12,7 @@ module Oddb2xml
|
|
12
12
|
puts "parse_td returns: #{res}" if $VERBOSE
|
13
13
|
rescue => exc
|
14
14
|
puts "Unable to pars #{elem} #{exc}"
|
15
|
-
binding.pry
|
15
|
+
# binding.pry
|
16
16
|
return nil
|
17
17
|
end
|
18
18
|
res.flatten # .join("\t")
|
@@ -26,14 +26,14 @@ module Oddb2xml
|
|
26
26
|
def self.items
|
27
27
|
@@items
|
28
28
|
end
|
29
|
-
def self.parse(html_file = 'http://
|
29
|
+
def self.parse(html_file = 'http://www.spezialitaetenliste.ch/varia_De.htm')
|
30
30
|
data = Hash.new{|h,k| h[k] = [] }
|
31
31
|
Ox.default_options = {
|
32
32
|
mode: :generic,
|
33
33
|
effort: :tolerant,
|
34
34
|
smart: true
|
35
35
|
}
|
36
|
-
res = Ox.load(
|
36
|
+
res = Ox.load(Oddb2xml.uri_open(html_file).read, mode: :hash_no_attrs).values.first['body']
|
37
37
|
result = []
|
38
38
|
idx = 0
|
39
39
|
@@items = {}
|
@@ -50,15 +50,16 @@ module Oddb2xml
|
|
50
50
|
data = {}
|
51
51
|
pharma_code = entry.first
|
52
52
|
ean13 = (Oddb2xml::FAKE_GTIN_START + pharma_code.to_s)
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
if entry[2].encoding.to_s.eql?('ASCII-8BIT')
|
54
|
+
german = CGI.unescape(entry[2].force_encoding('ISO-8859-1'))
|
55
|
+
else
|
56
|
+
german = entry[2]
|
56
57
|
end
|
57
58
|
@@items[ean13] = {
|
58
59
|
:data_origin => 'Chapter70',
|
59
60
|
:line => entry.join(","),
|
60
61
|
:ean13 => ean13,
|
61
|
-
:description =>
|
62
|
+
:description => german,
|
62
63
|
:quantity => entry[3],
|
63
64
|
:pharmacode => pharma_code,
|
64
65
|
:pub_price => entry[4],
|
@@ -70,5 +71,3 @@ module Oddb2xml
|
|
70
71
|
end
|
71
72
|
end
|
72
73
|
end
|
73
|
-
|
74
|
-
|
data/lib/oddb2xml/cli.rb
CHANGED
@@ -88,6 +88,7 @@ module Oddb2xml
|
|
88
88
|
puts "Validatied #{@_files[:artikelstamm]}"
|
89
89
|
else
|
90
90
|
puts "Validating failed using #{cmd}"
|
91
|
+
raise "Validating failed using #{cmd}"
|
91
92
|
exit(2)
|
92
93
|
end
|
93
94
|
end
|
@@ -157,7 +158,9 @@ module Oddb2xml
|
|
157
158
|
end
|
158
159
|
end
|
159
160
|
if @options[:calc]
|
160
|
-
|
161
|
+
ext = File.extname(file)
|
162
|
+
dest = File.join(WorkDir, file.sub(ext, '_'+Time.now.strftime("%d.%m.%Y_%H.%M")+ext))
|
163
|
+
FileUtils.cp(File.join(WorkDir, file), dest, :verbose => false)
|
161
164
|
end
|
162
165
|
end
|
163
166
|
rescue Interrupt
|
data/lib/oddb2xml/downloader.rb
CHANGED
@@ -23,7 +23,7 @@ module Oddb2xml
|
|
23
23
|
else
|
24
24
|
begin
|
25
25
|
io = File.open(file, option)
|
26
|
-
data =
|
26
|
+
data = Oddb2xml.uri_open(@url).read
|
27
27
|
io.write(data)
|
28
28
|
rescue => error
|
29
29
|
puts "error #{error} while fetching #{@url}"
|
@@ -283,7 +283,7 @@ module Oddb2xml
|
|
283
283
|
include DownloadMethod
|
284
284
|
def initialize(type=:orphan, options = {})
|
285
285
|
url = BASE_URL + '/swissmedic/de/home/services/listen_neu.html'
|
286
|
-
doc = Nokogiri::HTML(
|
286
|
+
doc = Nokogiri::HTML(Oddb2xml.uri_open(url))
|
287
287
|
@type = type
|
288
288
|
@options = options
|
289
289
|
case @type
|
@@ -88,7 +88,11 @@ module ParseUtil
|
|
88
88
|
composition.substances.each do
|
89
89
|
|substance_item|
|
90
90
|
active_substance_name = substance_item.name.downcase.sub(/^cum\s/, '')
|
91
|
-
substance_item.is_active_agent = (active_agents.find {|x| /#{x.downcase.
|
91
|
+
substance_item.is_active_agent = (active_agents.find {|x| /#{x.downcase.
|
92
|
+
gsub('(', '\(').
|
93
|
+
gsub(')', '\)').
|
94
|
+
gsub('[', '\[').
|
95
|
+
gsub(']', '\]')}($|\s)/.match(active_substance_name) } != nil)
|
92
96
|
substance_item.is_active_agent = true if substance_item.chemical_substance and active_agents.find {|x| x.downcase.eql?(substance_item.chemical_substance.name.downcase) }
|
93
97
|
end
|
94
98
|
comps << composition
|
@@ -64,7 +64,7 @@ module Oddb2xml
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
def everyPharmaArticleHasAProductItem
|
69
69
|
result = true
|
70
70
|
puts "#{Time.now.strftime("%H:%M:%S")}: everyPharmaArticleHasAProductItem"
|
@@ -74,7 +74,7 @@ module Oddb2xml
|
|
74
74
|
unless allProductNumbers.index(item[:PRODNO])
|
75
75
|
puts "Item #{item[:GTIN]} has no Product #{item[:PRODNO]} #{item[:DSCR]}"
|
76
76
|
result = false
|
77
|
-
end
|
77
|
+
end unless item[:Chapter70_HACK]
|
78
78
|
end
|
79
79
|
result
|
80
80
|
end
|
@@ -91,17 +91,19 @@ module Oddb2xml
|
|
91
91
|
end
|
92
92
|
result
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
def everyReferencedLimitationIsIncluded
|
96
|
+
result = true
|
96
97
|
puts "#{Time.now.strftime("%H:%M:%S")}: everyReferencedLimitationIsIncluded"
|
97
98
|
allLimitations = limitations.collect{ |lim| lim[:LIMNAMEBAG] }
|
98
99
|
products.each do |product|
|
99
100
|
next unless product[:LIMNAMEBAG]
|
100
101
|
unless allLimitations.index(product[:LIMNAMEBAG])
|
101
102
|
puts "product #{product[:PRODNO]} has no limitation #{product[:LIMNAMEBAG]} #{product[:DSCR]}"
|
102
|
-
|
103
|
+
result = false
|
103
104
|
end
|
104
105
|
end
|
106
|
+
result
|
105
107
|
end
|
106
108
|
|
107
109
|
def checkPackageSize
|
data/lib/oddb2xml/util.rb
CHANGED
@@ -7,6 +7,14 @@ module Oddb2xml
|
|
7
7
|
def Oddb2xml.gen_prodno(iksnr, seqnr)
|
8
8
|
sprintf('%05d',iksnr) + sprintf('%02d', seqnr)
|
9
9
|
end
|
10
|
+
def Oddb2xml.uri_open(url)
|
11
|
+
version = RUBY_VERSION.split('.').map { |x| x.to_i }
|
12
|
+
if (version <=> [2,5,0]) >= 0
|
13
|
+
URI.open(url)
|
14
|
+
else
|
15
|
+
open(url)
|
16
|
+
end
|
17
|
+
end
|
10
18
|
def Oddb2xml.calc_checksum(str)
|
11
19
|
str = str.strip
|
12
20
|
sum = 0
|
@@ -34,7 +42,7 @@ module Oddb2xml
|
|
34
42
|
end
|
35
43
|
Oddb2xml.patch_some_utf8(german).gsub('<br>',"\n")
|
36
44
|
end
|
37
|
-
|
45
|
+
|
38
46
|
def Oddb2xml.patch_some_utf8(line)
|
39
47
|
begin
|
40
48
|
line = line.encode('utf-8')
|
@@ -61,7 +69,7 @@ module Oddb2xml
|
|
61
69
|
def Oddb2xml.add_epha_changes_for_ATC(iksnr, atc_code, force_run: false)
|
62
70
|
@atc_csv_content = {} if force_run
|
63
71
|
if @atc_csv_content.size == 0
|
64
|
-
|
72
|
+
Oddb2xml.uri_open(@atc_csv_origin).readlines.each{
|
65
73
|
|line|
|
66
74
|
items = line.split(',')
|
67
75
|
@atc_csv_content[[items[0], items[1]]] = items[2]
|
@@ -86,7 +94,7 @@ module Oddb2xml
|
|
86
94
|
def Oddb2xml.skip_download?
|
87
95
|
@options[:skip_download]
|
88
96
|
end
|
89
|
-
|
97
|
+
|
90
98
|
def Oddb2xml.skip_download(file)
|
91
99
|
return false if defined?(VCR)
|
92
100
|
dest = "#{Downloads}/#{File.basename(file)}"
|
@@ -96,7 +104,7 @@ module Oddb2xml
|
|
96
104
|
end
|
97
105
|
false
|
98
106
|
end
|
99
|
-
|
107
|
+
|
100
108
|
def Oddb2xml.download_finished(file, remove_file = true)
|
101
109
|
src = "#{WorkDir}/#{File.basename(file)}"
|
102
110
|
dest = "#{Downloads}/#{File.basename(file)}"
|
@@ -232,7 +240,7 @@ COLUMNS_FEBRUARY_2019= {
|
|
232
240
|
@@ean13_to_no8 = {}
|
233
241
|
def Oddb2xml.setEan13forProdno(prodno, ean13)
|
234
242
|
if ean13.to_i == 7680006660045 || ean13.to_i == 7680006660014
|
235
|
-
|
243
|
+
Oddb2xml.log "setEan13forProdno #{prodno} ean13 #{ean13}"
|
236
244
|
end
|
237
245
|
@@prodno_to_ean13[prodno] ||= []
|
238
246
|
@@prodno_to_ean13[prodno] << ean13
|
@@ -240,13 +248,13 @@ COLUMNS_FEBRUARY_2019= {
|
|
240
248
|
end
|
241
249
|
def Oddb2xml.setEan13forNo8(no8, ean13)
|
242
250
|
if ean13.to_i == 7680006660045 || ean13.to_i == 7680006660014
|
243
|
-
|
251
|
+
Oddb2xml.log "setEan13forNo8 #{no8} ean13 #{ean13}"
|
244
252
|
end
|
245
253
|
if @@no8_to_ean13[no8].nil?
|
246
254
|
@@no8_to_ean13[no8] = ean13
|
247
255
|
@@ean13_to_no8[ean13] = no8
|
248
256
|
elsif !@@no8_to_ean13[no8].eql?(ean13)
|
249
|
-
|
257
|
+
Oddb2xml.log "@@no8_to_ean13[no8] #{@@no8_to_ean13[no8]} not overridden by #{ean13}"
|
250
258
|
end
|
251
259
|
end
|
252
260
|
def Oddb2xml.getEan13forProdno(prodno)
|
data/lib/oddb2xml/version.rb
CHANGED
data/oddb2xml.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
|
+
spec.required_ruby_version = ">= 2.2.0"
|
19
20
|
|
20
21
|
# We fix the version of the spec to newer versions only in the third position
|
21
22
|
# hoping that these version fix only security/severe bugs
|
data/spec/artikelstamm_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe Oddb2xml::Builder do
|
|
24
24
|
unless @inhalt.index(expected_value)
|
25
25
|
puts expected_value
|
26
26
|
end
|
27
|
-
|
27
|
+
binding.pry unless @inhalt.index(expected_value)
|
28
28
|
expect(@inhalt.index(expected_value)).not_to be nil
|
29
29
|
end
|
30
30
|
def common_run_init(options = {})
|
@@ -184,7 +184,7 @@ describe Oddb2xml::Builder do
|
|
184
184
|
@inhalt = IO.read(@artikelstamm_name)
|
185
185
|
expect(@inhalt.index('BIOMARIS Voll Meersalz 500 g')).not_to be nil
|
186
186
|
end
|
187
|
-
|
187
|
+
|
188
188
|
it 'Should not contain PHAR 8809544 Sildenavil with pexf and ppub 0.0' do
|
189
189
|
#1128809544Sildenafil Suspension 7mg/ml 100ml 0030850045801000000000000000000000002
|
190
190
|
@inhalt = IO.read(@artikelstamm_name)
|
@@ -211,7 +211,7 @@ describe Oddb2xml::Builder do
|
|
211
211
|
it 'shoud contain GENERIC_TYPE' do
|
212
212
|
expect(@inhalt.index('<GENERIC_TYPE')).not_to be nil
|
213
213
|
end
|
214
|
-
|
214
|
+
|
215
215
|
it 'should contain DIBASE with phar' do
|
216
216
|
expected = %(<ITEM PHARMATYPE="P">
|
217
217
|
<GTIN>7680658560014</GTIN>
|
@@ -237,7 +237,7 @@ describe Oddb2xml::Builder do
|
|
237
237
|
</ITEM)
|
238
238
|
expect(@inhalt.index(expected)).not_to be nil
|
239
239
|
end
|
240
|
-
|
240
|
+
|
241
241
|
it 'should contain PEVISONE Creme 30 g' do
|
242
242
|
expect(@inhalt.index('Pevisone Creme 15 g')).not_to be nil # 7680406620144
|
243
243
|
expect(@inhalt.index('Pevisone Creme 30 g')).not_to be nil # 7680406620229
|
@@ -349,7 +349,7 @@ describe Oddb2xml::Builder do
|
|
349
349
|
<SL_ENTRY>true</SL_ENTRY>
|
350
350
|
<IKSCAT>D</IKSCAT>
|
351
351
|
<DEDUCTIBLE>10</DEDUCTIBLE>
|
352
|
-
</ITEM>),
|
352
|
+
</ITEM>),
|
353
353
|
'item 7680284860144 ANCOPIR' =>'<ITEM PHARMATYPE="P">
|
354
354
|
<GTIN>7680284860144</GTIN>
|
355
355
|
<PHAR>0177804</PHAR>
|
@@ -391,7 +391,7 @@ describe Oddb2xml::Builder do
|
|
391
391
|
<DOSAGE_FORMF>Compresse</DOSAGE_FORMF>
|
392
392
|
<IKSCAT>C</IKSCAT>
|
393
393
|
<PRODNO>3164402</PRODNO>
|
394
|
-
</ITEM>),
|
394
|
+
</ITEM>),
|
395
395
|
'product 3TC Filmtabl' => %(<PRODUCT>
|
396
396
|
<PRODNO>5366201</PRODNO>
|
397
397
|
<SALECD>A</SALECD>
|
@@ -439,20 +439,38 @@ describe Oddb2xml::Builder do
|
|
439
439
|
<DEDUCTIBLE>20</DEDUCTIBLE>
|
440
440
|
<PRODNO>5329001</PRODNO>
|
441
441
|
</ITEM>),
|
442
|
-
'
|
443
|
-
|
444
|
-
<
|
445
|
-
<DSCR>
|
446
|
-
<DSCRF
|
447
|
-
<
|
448
|
-
|
442
|
+
'Varilrix product' => %(<PRODUCT>
|
443
|
+
<PRODNO>0058501</PRODNO>
|
444
|
+
<SALECD>A</SALECD>
|
445
|
+
<DSCR>Varilrix Trockensub c solv</DSCR>
|
446
|
+
<DSCRF>Varilrix subst sèche c solv</DSCRF>
|
447
|
+
<ATC>J07BK01</ATC>
|
448
|
+
<LIMNAMEBAG>0808</LIMNAMEBAG>
|
449
|
+
<SUBSTANCE>Vaccinum virus varicellae vivus attenuat. (Stamm OKA)</SUBSTANCE>
|
450
|
+
</PRODUCT>),
|
451
|
+
'Varilrix item' => %(<ITEM PHARMATYPE="P">
|
452
|
+
<GTIN>7680005850010</GTIN>
|
453
|
+
<PHAR>1770177</PHAR>
|
454
|
+
<SALECD>A</SALECD>
|
455
|
+
<DSCR>Varilrix Trockensub c solv Fertspr 0.500 ml</DSCR>
|
456
|
+
<DSCRF>Varilrix subst sèche c solv ser prê 0.500 ml</DSCRF>
|
457
|
+
<COMP>
|
458
|
+
<NAME>GlaxoSmithKline AG</NAME>
|
459
|
+
<GLN>7601001000674</GLN>
|
460
|
+
</COMP>
|
461
|
+
<PEXF>43.64</PEXF>
|
462
|
+
<PPUB>66.5</PPUB>
|
463
|
+
<SL_ENTRY>true</SL_ENTRY>
|
464
|
+
<IKSCAT>B</IKSCAT>
|
465
|
+
<DEDUCTIBLE>10</DEDUCTIBLE>
|
466
|
+
<PRODNO>0058501</PRODNO>
|
467
|
+
</ITEM),
|
449
468
|
'Chapter 70 product' => %(<PRODUCT>
|
450
469
|
<PRODNO>2069639</PRODNO>
|
451
|
-
<!--Chapter70 hack-->
|
470
|
+
<!--Chapter70 hack prodno 2069639 Ceres Urtinkturen gemäss L2 mit - im Kommentar-->
|
452
471
|
<SALECD>A</SALECD>
|
453
|
-
<DSCR>Ceres Urtinkturen gemäss L2</DSCR>
|
472
|
+
<DSCR>Ceres Urtinkturen gemäss L2 mit -- im Kommentar</DSCR>
|
454
473
|
<DSCRF/>
|
455
|
-
<LIMNAMEBAG>L1, L2</LIMNAMEBAG>
|
456
474
|
</PRODUCT>),
|
457
475
|
'Chapter 70 item' => %(<ITEM PHARMATYPE="P">
|
458
476
|
<GTIN>2500000588532</GTIN>
|
@@ -462,7 +480,7 @@ describe Oddb2xml::Builder do
|
|
462
480
|
<DSCRF>--missing--</DSCRF>
|
463
481
|
<PEXF>23.44</PEXF>
|
464
482
|
<PPUB>31.30</PPUB>
|
465
|
-
<!--Chapter70 hack-->
|
483
|
+
<!--Chapter70 hack 2500000588532 EINF ARZNEI Ceres Urtinktur spez 20ml-->
|
466
484
|
<SL_ENTRY>true</SL_ENTRY>
|
467
485
|
<PRODNO>2069639</PRODNO>
|
468
486
|
</ITEM>),
|
data/spec/builder_spec.rb
CHANGED
@@ -59,7 +59,7 @@ ARTICLE_NAROPIN = %(<REF_DATA>1</REF_DATA>
|
|
59
59
|
<BCSTAT>A</BCSTAT>
|
60
60
|
</ARTBAR>
|
61
61
|
</ART>)
|
62
|
-
|
62
|
+
|
63
63
|
ARTICLE_COMMON_ELEMENTS = [
|
64
64
|
['ARTICLE/ART/REF_DATA', '1'],
|
65
65
|
['ARTICLE/ART/SMCAT', 'A'],
|
@@ -256,7 +256,7 @@ def check_result(inhalt, nbr_record)
|
|
256
256
|
expect(inhalt.index('<ERROR_CODE/>')).to be > 0
|
257
257
|
m = /<NBR_RECORD>(\d+)<\/NBR_RECORD>/.match(inhalt)
|
258
258
|
expect(m).not_to be nil
|
259
|
-
expect(m[1].to_i).to eq nbr_record
|
259
|
+
expect(m[1].to_i).to eq nbr_record
|
260
260
|
end
|
261
261
|
|
262
262
|
def checkItemForRefdata(doc, pharmacode, isRefdata)
|
@@ -473,15 +473,15 @@ def checkProductXml(nbr_record = -1)
|
|
473
473
|
end
|
474
474
|
|
475
475
|
describe Oddb2xml::Builder do
|
476
|
-
NrExtendedArticles =
|
477
|
-
NrSubstances =
|
478
|
-
NrLimitations =
|
479
|
-
|
476
|
+
NrExtendedArticles = 78
|
477
|
+
NrSubstances = 28
|
478
|
+
NrLimitations = 15
|
479
|
+
|
480
480
|
NrInteractions = 2
|
481
481
|
NrCodes = 5
|
482
482
|
NrProdno = 31
|
483
|
-
NrPackages =
|
484
|
-
NrProducts =
|
483
|
+
NrPackages = 46
|
484
|
+
NrProducts = 40
|
485
485
|
RegExpDesitin = /1125819012LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk/
|
486
486
|
include ServerMockHelper
|
487
487
|
def common_run_init(options = {})
|
@@ -532,7 +532,7 @@ describe Oddb2xml::Builder do
|
|
532
532
|
|
533
533
|
check_attributes(oddb_article_xml, ARTICLE_ATTRIBUTE_TESTS)
|
534
534
|
check_elements(oddb_article_xml, ARTICLE_COMMON_ELEMENTS)
|
535
|
-
|
535
|
+
|
536
536
|
it 'should validate XSD article' do
|
537
537
|
@inhalt = File.read(oddb_article_xml)
|
538
538
|
# This fails on Ruby < 2.4 as NAROPIN INJ LÖS 0.2 % 10 is wrongly encoded
|
@@ -552,7 +552,7 @@ describe Oddb2xml::Builder do
|
|
552
552
|
end
|
553
553
|
|
554
554
|
it 'should have a correct insulin (gentechnik) for 7680532900196' do
|
555
|
-
expect(
|
555
|
+
expect(@inhalt.match(/.*<BC>7680532900196<\/BC>.*/).class).to be MatchData
|
556
556
|
expect(XPath.match( @rexml, "//ART//GEN_PRODUCTION").size).to be >= 1
|
557
557
|
expect(XPath.match( @rexml, "//ART//GEN_PRODUCTION").first.text).to eq 'X'
|
558
558
|
expect(XPath.match( @rexml, "//ART//INSULIN_CATEGORY").size).to eq 1
|
@@ -568,7 +568,7 @@ describe Oddb2xml::Builder do
|
|
568
568
|
ean_with_drug_index = 7680555610041
|
569
569
|
it "should have a correct drug information for #{ean_with_drug_index}" do
|
570
570
|
doc = REXML::Document.new IO.read(checkAndGetArticleXmlName)
|
571
|
-
expect(
|
571
|
+
expect(@inhalt.match(/.*<BC>#{ean_with_drug_index}<\/BC>.*/).class).to be MatchData
|
572
572
|
expect(XPath.match( @rexml, "//ART//DRUG_INDEX").size).to eq 1
|
573
573
|
expect(XPath.match( @rexml, "//ART//DRUG_INDEX").first.text).to eq 'd'
|
574
574
|
found = false
|
@@ -605,11 +605,11 @@ describe Oddb2xml::Builder do
|
|
605
605
|
<CPT/>)
|
606
606
|
expect(oddb_product_xml.index(text2)).to be >= 1
|
607
607
|
end
|
608
|
-
|
608
|
+
|
609
609
|
it 'should generate SALECD A for swissmedic packages' do
|
610
610
|
expect(IO.read(oddb_article_xml).index('<SALECD>A<!--Overriding status I nincd 10 for 7680658560014 as in refdata_pharma--></SALECD>')).to be >= 1
|
611
611
|
end
|
612
|
-
|
612
|
+
|
613
613
|
end
|
614
614
|
|
615
615
|
context 'when -o for fachinfo is given' do
|
data/spec/cli_spec.rb
CHANGED
@@ -184,6 +184,32 @@ describe Oddb2xml::Cli do
|
|
184
184
|
}
|
185
185
|
end
|
186
186
|
end
|
187
|
+
context 'when -e and -f dat option is given' do
|
188
|
+
before(:all) do
|
189
|
+
cleanup_directories_before_run
|
190
|
+
options = Oddb2xml::Options.parse('-e -f dat')
|
191
|
+
@cli = Oddb2xml::Cli.new(options)
|
192
|
+
@cli_output = buildr_capture(:stdout) { @cli.run }
|
193
|
+
end
|
194
|
+
it_behaves_like 'any interface for product'
|
195
|
+
it 'should have calc option' do
|
196
|
+
expect(@cli).to have_option(:format => :dat)
|
197
|
+
expect(@cli).to have_option(:calc => true)
|
198
|
+
expect(@cli).to have_option(:extended => true)
|
199
|
+
end
|
200
|
+
it 'should create xml files' do
|
201
|
+
expect(@cli_output).to match(/NonPharma/)
|
202
|
+
file_today = "oddb_calc_#{Time.now.strftime("%d.%m.%Y_%H.%M")}.xml"
|
203
|
+
expect(Dir.glob(File.join(Oddb2xml::WorkDir, 'oddb_calc.xml')).size).to eq 1
|
204
|
+
expect(Dir.glob(File.join(Oddb2xml::WorkDir, file_today)).size).to eq 1
|
205
|
+
end
|
206
|
+
it 'should create migel files' do
|
207
|
+
expect(@cli_output).to match(/NonPharma/)
|
208
|
+
file_today = "oddb_with_migel_#{Time.now.strftime("%d.%m.%Y_%H.%M")}.dat"
|
209
|
+
expect(Dir.glob(File.join(Oddb2xml::WorkDir, 'oddb_with_migel.dat')).size).to eq 1
|
210
|
+
expect(Dir.glob(File.join(Oddb2xml::WorkDir, file_today)).size).to eq 1
|
211
|
+
end
|
212
|
+
end
|
187
213
|
|
188
214
|
context 'when -a nonpharma option is given' do
|
189
215
|
before(:all) do
|
data/spec/data/Preparations.xml
CHANGED
@@ -1,5 +1,141 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
2
2
|
<Preparations ReleaseDate="01.12.2013">
|
3
|
+
<Preparation ProductCommercial="9801">
|
4
|
+
<NameDe>Varilrix</NameDe>
|
5
|
+
<NameFr>Varilrix</NameFr>
|
6
|
+
<NameIt>Varilrix</NameIt>
|
7
|
+
<DescriptionDe>Trockensub c solv</DescriptionDe>
|
8
|
+
<DescriptionFr>subst sèche c solv </DescriptionFr>
|
9
|
+
<DescriptionIt>sost secca c solv </DescriptionIt>
|
10
|
+
<AtcCode>J07BK01</AtcCode>
|
11
|
+
<SwissmedicNo5>585</SwissmedicNo5>
|
12
|
+
<FlagItLimitation>Y</FlagItLimitation>
|
13
|
+
<OrgGenCode />
|
14
|
+
<FlagSB20>N</FlagSB20>
|
15
|
+
<CommentDe />
|
16
|
+
<CommentFr />
|
17
|
+
<CommentIt />
|
18
|
+
<VatInEXF>N</VatInEXF>
|
19
|
+
<Packs>
|
20
|
+
<Pack ProductKey="9801" PackId="14418">
|
21
|
+
<DescriptionDe>Fertspr 0.500 ml</DescriptionDe>
|
22
|
+
<DescriptionFr>ser prê 0.500 ml</DescriptionFr>
|
23
|
+
<DescriptionIt>sir preriempita 0.500 ml</DescriptionIt>
|
24
|
+
<SwissmedicCategory>B</SwissmedicCategory>
|
25
|
+
<SwissmedicNo8>585001</SwissmedicNo8>
|
26
|
+
<FlagNarcosis>N</FlagNarcosis>
|
27
|
+
<FlagModal />
|
28
|
+
<BagDossierNo>18076</BagDossierNo>
|
29
|
+
<GTIN>7680005850010</GTIN>
|
30
|
+
<SizePack />
|
31
|
+
<PrevPharmacode />
|
32
|
+
<Limitations />
|
33
|
+
<PointLimitations />
|
34
|
+
<Prices>
|
35
|
+
<ExFactoryPrice>
|
36
|
+
<Price>43.64</Price>
|
37
|
+
<ValidFromDate>01.12.2019</ValidFromDate>
|
38
|
+
<DivisionDescription />
|
39
|
+
<PriceTypeCode>PEXF</PriceTypeCode>
|
40
|
+
<PriceTypeDescriptionDe>Ex-Factory Preis</PriceTypeDescriptionDe>
|
41
|
+
<PriceTypeDescriptionFr>Prix ex-factory</PriceTypeDescriptionFr>
|
42
|
+
<PriceTypeDescriptionIt>Prix ex-factory</PriceTypeDescriptionIt>
|
43
|
+
<PriceChangeTypeCode>3JUEBERPRUEF</PriceChangeTypeCode>
|
44
|
+
<PriceChangeTypeDescriptionDe>Preisänderung nach 3-jährlicher Überprüfung der Aufnahmebedingungen</PriceChangeTypeDescriptionDe>
|
45
|
+
<PriceChangeTypeDescriptionFr>Réduction de prix à cause du réexamen des conditions d’admission tous les trois ans</PriceChangeTypeDescriptionFr>
|
46
|
+
<PriceChangeTypeDescriptionIt>Preisänderung nach 3-jährlicher Überprüfung der Aufnahmebedingungen</PriceChangeTypeDescriptionIt>
|
47
|
+
</ExFactoryPrice>
|
48
|
+
<PublicPrice>
|
49
|
+
<Price>66.5</Price>
|
50
|
+
<ValidFromDate>01.12.2019</ValidFromDate>
|
51
|
+
<DivisionDescription />
|
52
|
+
<PriceTypeCode>PPUB</PriceTypeCode>
|
53
|
+
<PriceTypeDescriptionDe>Publikumspreis</PriceTypeDescriptionDe>
|
54
|
+
<PriceTypeDescriptionFr>Prix public</PriceTypeDescriptionFr>
|
55
|
+
<PriceTypeDescriptionIt>Prix public</PriceTypeDescriptionIt>
|
56
|
+
<PriceChangeTypeCode>3JUEBERPRUEF</PriceChangeTypeCode>
|
57
|
+
<PriceChangeTypeDescriptionDe>Preisänderung nach 3-jährlicher Überprüfung der Aufnahmebedingungen</PriceChangeTypeDescriptionDe>
|
58
|
+
<PriceChangeTypeDescriptionFr>Réduction de prix à cause du réexamen des conditions d’admission tous les trois ans</PriceChangeTypeDescriptionFr>
|
59
|
+
<PriceChangeTypeDescriptionIt>Preisänderung nach 3-jährlicher Überprüfung der Aufnahmebedingungen</PriceChangeTypeDescriptionIt>
|
60
|
+
</PublicPrice>
|
61
|
+
</Prices>
|
62
|
+
<Partners>
|
63
|
+
<Partner>
|
64
|
+
<PartnerType>V</PartnerType>
|
65
|
+
<Description>GlaxoSmithKline AG</Description>
|
66
|
+
<Street>Talstrasse 3-5</Street>
|
67
|
+
<ZipCode>3053</ZipCode>
|
68
|
+
<Place>Münchenbuchsee</Place>
|
69
|
+
<Phone>+41318622111</Phone>
|
70
|
+
</Partner>
|
71
|
+
</Partners>
|
72
|
+
<Status>
|
73
|
+
<IntegrationDate>01.01.2005</IntegrationDate>
|
74
|
+
<ValidFromDate>01.01.2005</ValidFromDate>
|
75
|
+
<ValidThruDate>31.12.9999</ValidThruDate>
|
76
|
+
<StatusTypeCodeSl>0</StatusTypeCodeSl>
|
77
|
+
<StatusTypeDescriptionSl>Initialzustand</StatusTypeDescriptionSl>
|
78
|
+
<FlagApd>N</FlagApd>
|
79
|
+
</Status>
|
80
|
+
</Pack>
|
81
|
+
</Packs>
|
82
|
+
<Substances>
|
83
|
+
<Substance>
|
84
|
+
<DescriptionLa>Vaccinum virus varicellae vivus attenuat. (Stamm OKA)</DescriptionLa>
|
85
|
+
<Quantity>10^3.3</Quantity>
|
86
|
+
<QuantityUnit>U</QuantityUnit>
|
87
|
+
</Substance>
|
88
|
+
</Substances>
|
89
|
+
<Limitations />
|
90
|
+
<ItCodes>
|
91
|
+
<ItCode Code="08.">
|
92
|
+
<DescriptionDe>INFEKTIONSKRANKHEITEN</DescriptionDe>
|
93
|
+
<DescriptionFr>MALADIES INFECTIEUSES</DescriptionFr>
|
94
|
+
<DescriptionIt>MALATTIE INFETTIVE </DescriptionIt>
|
95
|
+
<Limitations />
|
96
|
+
</ItCode>
|
97
|
+
<ItCode Code="08.08.">
|
98
|
+
<DescriptionDe>Impfstoffe</DescriptionDe>
|
99
|
+
<DescriptionFr>Vaccins</DescriptionFr>
|
100
|
+
<DescriptionIt>Vaccini </DescriptionIt>
|
101
|
+
<Limitations>
|
102
|
+
<Limitation>
|
103
|
+
<LimitationCode>0808</LimitationCode>
|
104
|
+
<LimitationType>KOM</LimitationType>
|
105
|
+
<LimitationNiveau>I</LimitationNiveau>
|
106
|
+
<DescriptionDe>Die Kostenübernahme der Impfstoffe als Teil einer präventiven Massnahme im Rahmen der obligatorischen Krankenpflegeversicherung richtet sich nach den in Artikel 12a KLV für die jeweiligen Impfungen abschliessend festgelegten Voraussetzungen. Bei beruflicher und reisemedizinischer Indikation erfolgt keine Kostenübernahme durch die obligatorische Krankenpflegeversicherung.<br>
|
107
|
+
Die Preise der Impfstoffe sind Höchstpreise (Art. 52 Abs. 3 KVG) und kommen bei Reihenimpfungen (z.B. im schulärztlichen Dienst) nicht zur Anwendung. In diesen Fällen gelten die von den Krankenversicherern mit den zuständigen Behörden ausgehandelten bzw. die allenfalls von den Behörden festgesetzten Tarife. Wenn der Impfstoff zu einem günstigeren Preis bezogen wird (z.B. im Rahmen von Reihenimpfungen), darf der Arzt oder die Ärztin nicht den Publikumspreis der SL verrechnen. Die Vergünstigung muss gemäss Artikel 56 Absatz 3 KVG weitergegeben werden.<br>
|
108
|
+
<br>
|
109
|
+
Die Vergünstigung muss gemäss Artikel 56 Absatz 3 KVG weitergegeben werden, ausser es bestehen Vereinbarungen nach Artikel 56 Absatz 3bis KVG.<br>
|
110
|
+
<br>
|
111
|
+
</DescriptionDe>
|
112
|
+
<DescriptionFr>La prise en charge des coûts des vaccins au titre de mesure préventive dans le cadre de l'assurance maladie obligatoire des soins est régie par les conditions contraignantes fixées à l'article 12a OPAS pour les vaccinations correspondantes. En cas d'indication professionnelle et de recommandation médicale aux voyageurs, la vaccination n'est pas prise en charge par l'assurance maladie obligatoire des soins. Les prix des vaccins sont des prix maximaux (art. 52, al. 3, LAMal) et ne s'appliquent pas aux vaccinations en série (par ex. dans le service médical scolaire). Dans ce cas, les tarifs négociés par les assureurs maladie avec les autorités compétentes ou, le cas échéant, ceux fixés par les autorités, sont applicables. Si le vaccin est acheté à un prix inférieur (par exemple dans le cadre d'une série de vaccinations), le médecin ne peut pas le facturer au prix public de la LS. L'avantage doit être répercuté conformément à l'article 56, al. 3, LAMal.<br>
|
113
|
+
<br>
|
114
|
+
L'avantage doit être répercuté conformément à l'article 56, al. 3, LAMal, hormis si des conventions au sens de l'art. 56, al. 3bis, LAMal, ont été conclues.<br>
|
115
|
+
<br>
|
116
|
+
|
117
|
+
</DescriptionFr>
|
118
|
+
<DescriptionIt>L’assunzione dei costi dei vaccini, in quanto misura di prevenzione parziale nel quadro dell’assicurazione obbligatoria delle cure medico-sanitarie, è disciplinata in modo esauriente dalle condizioni fissate per i vaccini interessati nell’articolo 12a OPre. In caso di indicazione professionale e di medicina di viaggio, l’assicurazione obbligatoria delle cure medico-sanitarie non ne assume i costi.<br>
|
119
|
+
I prezzi dei vaccini sono prezzi massimi (art. 52 cpv. 3 LAMal) e non si applicano alle vaccinazioni in serie (ad. es. quelle effettuate nell’ambito del servizio medico scolastico). In questi casi sono applicabili le tariffe negoziate dagli assicuratori malattie con le autorità competenti o quelle eventualmente stabilite dalle autorità. Se il vaccino è acquistato a un prezzo più conveniente (p. es. nel quadro di vaccinazioni in serie), il medico non può fatturare il prezzo per il pubblico che figura nell’ES. Lo sconto deve essere fatto usufruire al debitore secondo l’articolo 56 capoverso 3 LAMal.<br>
|
120
|
+
<br>
|
121
|
+
Lo sconto deve essere fatto usufruire al debitore secondo l’articolo 56 capoverso 3 LAMal, tranne in caso di accordi di cui all’articolo 56 capoverso 3bis LAMal.<br>
|
122
|
+
<br>
|
123
|
+
</DescriptionIt>
|
124
|
+
<ValidFromDate>01.01.2000</ValidFromDate>
|
125
|
+
<ValidThruDate>31.12.9999</ValidThruDate>
|
126
|
+
</Limitation>
|
127
|
+
</Limitations>
|
128
|
+
</ItCode>
|
129
|
+
</ItCodes>
|
130
|
+
<Status>
|
131
|
+
<IntegrationDate>01.01.2005</IntegrationDate>
|
132
|
+
<ValidFromDate>01.01.2005</ValidFromDate>
|
133
|
+
<ValidThruDate>31.12.9999</ValidThruDate>
|
134
|
+
<StatusTypeCodeSl>0</StatusTypeCodeSl>
|
135
|
+
<StatusTypeDescriptionSl>Initialzustand</StatusTypeDescriptionSl>
|
136
|
+
<FlagApd>N</FlagApd>
|
137
|
+
</Status>
|
138
|
+
</Preparation>
|
3
139
|
<Preparation ProductCommercial="394">
|
4
140
|
<NameDe>Ancopir</NameDe>
|
5
141
|
<NameFr>Ancopir</NameFr>
|
@@ -1239,7 +1375,7 @@
|
|
1239
1375
|
<StatusTypeDescriptionSl>Initialzustand</StatusTypeDescriptionSl>
|
1240
1376
|
<FlagApd>N</FlagApd>
|
1241
1377
|
</Status>
|
1242
|
-
</Preparation>
|
1378
|
+
</Preparation>
|
1243
1379
|
<Preparation ProductCommercial="25550">
|
1244
1380
|
<NameDe>Adcetris</NameDe>
|
1245
1381
|
<NameFr>Adcetris</NameFr>
|
@@ -2913,8 +3049,8 @@ Le médecin traitant est tenu de saisir en continu les données requises dans l'
|
|
2913
3049
|
2) Date du début de traitement, posologie, ajustements posologiques, date de fin de traitement.
|
2914
3050
|
|
2915
3051
|
</DescriptionFr>
|
2916
|
-
<DescriptionIt>Per la terapia di mantenimento (monoterapia) in pazienti adulte con carcinoma ovarico avanzato e recidivo, con mutazione BRCA, successivamente a una chemioterapia a base di platino e in presenza di una remissione parziale o completa.<br>
|
2917
|
-
Il medico curante è tenuto a raccogliere costantemente i dati necessari nell’apposito strumento internet del registro, disponibile su http://www.olaparib-registry.ch. È necessario il consenso scritto della paziente. Devono essere raccolti i seguenti dati:<br>
|
3052
|
+
<DescriptionIt>Per la terapia di mantenimento (monoterapia) in pazienti adulte con carcinoma ovarico avanzato e recidivo, con mutazione BRCA, successivamente a una chemioterapia a base di platino e in presenza di una remissione parziale o completa.<br>
|
3053
|
+
Il medico curante è tenuto a raccogliere costantemente i dati necessari nell’apposito strumento internet del registro, disponibile su http://www.olaparib-registry.ch. È necessario il consenso scritto della paziente. Devono essere raccolti i seguenti dati:<br>
|
2918
3054
|
1) Anno di nascita e terapie precedenti per il carcinoma ovarico<br>
|
2919
3055
|
2) Data di inizio della terapia, dosaggio, aggiustamenti del dosaggio, data di conclusione della terapia.
|
2920
3056
|
</DescriptionIt>
|
@@ -2,6 +2,17 @@
|
|
2
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
3
|
<soap:Body>
|
4
4
|
<ARTICLE xmlns="http://refdatabase.refdata.ch/Article_out" CREATION_DATETIME="2017-12-01T09:41:49.5856186+01:00">
|
5
|
+
<ITEM DT="2018-12-05T00:00:00">
|
6
|
+
<ATYPE>PHARMA</ATYPE>
|
7
|
+
<GTIN>7680005850010</GTIN>
|
8
|
+
<PHAR>1770177</PHAR>
|
9
|
+
<SWMC_AUTHNR>00585001</SWMC_AUTHNR>
|
10
|
+
<NAME_DE>VARILRIX Trockensub c Solv Fertspr 0.5 ml</NAME_DE>
|
11
|
+
<NAME_FR>VARILRIX subst sèche c solv ser pré 0.5 ml</NAME_FR>
|
12
|
+
<ATC>J07BK01</ATC>
|
13
|
+
<AUTH_HOLDER_NAME>GlaxoSmithKline AG</AUTH_HOLDER_NAME>
|
14
|
+
<AUTH_HOLDER_GLN>7601001000674</AUTH_HOLDER_GLN>
|
15
|
+
</ITEM>
|
5
16
|
<ITEM DT="2017-12-14T00:00:00">
|
6
17
|
<ATYPE>PHARMA</ATYPE>
|
7
18
|
<GTIN>7680545340019</GTIN>
|
Binary file
|
data/spec/data/transfer.dat
CHANGED
@@ -69,4 +69,5 @@
|
|
69
69
|
1122069562EINF ARZNEI Urtinktur 1-10g/ml 0010040013401000000000025000005884712
|
70
70
|
1122069639EINF ARZNEI Ceres Urtinktur spez 20ml 0023440031301000000000025000005885322
|
71
71
|
1122069622EINF ARZNEI Ceres Urtinktur 20ml 0018870025201000000000025000005885252
|
72
|
-
|
72
|
+
1131770177VARILRIX Trockensub c Solv (alt) Fertspr 0.5 ml 004768006650101B080800076800058500102
|
73
|
+
1127766692VARILRIX Trockensub c Solv Fertspr 0.5 ml 004767006650101B080800076800058500342
|
data/spec/data/varia_De.htm
CHANGED
@@ -197,7 +197,7 @@
|
|
197
197
|
<p>70.01.10</p>
|
198
198
|
</td>
|
199
199
|
<td width="52%">
|
200
|
-
<p>Ceres Urtinkturen gemäss L2</p>
|
200
|
+
<p>Ceres Urtinkturen gemäss L2 mit -- im Kommentar</p>
|
201
201
|
</td>
|
202
202
|
<td align="right" width="10%">
|
203
203
|
<p>20ml</p>
|
@@ -2438,4 +2438,4 @@ die Abrechnung zu erleichtern.<br>
|
|
2438
2438
|
|
2439
2439
|
</body>
|
2440
2440
|
|
2441
|
-
</html>
|
2441
|
+
</html>
|
data/spec/extractor_spec.rb
CHANGED
@@ -182,7 +182,7 @@ describe Oddb2xml::SwissmedicExtractor do
|
|
182
182
|
@packs.find{|pack| pack[1][:ean13] == ean13.to_s }[1]
|
183
183
|
end
|
184
184
|
it 'should have correct nr of packages' do
|
185
|
-
expect(@packs.size).to eq(
|
185
|
+
expect(@packs.size).to eq(41)
|
186
186
|
end
|
187
187
|
|
188
188
|
it 'should have serocytol' do
|
data/spec/spec_helper.rb
CHANGED
@@ -257,7 +257,7 @@ def mock_downloads
|
|
257
257
|
'https://github.com/zdavatz/cpp2sqlite/blob/master/input/atc_codes_multi_lingual.txt' => 'atc.csv',
|
258
258
|
'https://raw.githubusercontent.com/zdavatz/oddb2xml_files/master/LPPV.txt' => 'oddb2xml_files_lppv.txt',
|
259
259
|
'http://www.xn--spezialittenliste-yqb.ch/File.axd?file=XMLPublications.zip' => 'XMLPublications.zip',
|
260
|
-
'http://
|
260
|
+
'http://www.spezialitaetenliste.ch/varia_De.htm' => 'varia_De.htm',
|
261
261
|
# 'http://refdatabase.refdata.ch/Service/Article.asmx?WSDL' => 'refdata_Pharma.xml',
|
262
262
|
}.each do |url, file|
|
263
263
|
inhalt = File.read(File.join(Oddb2xml::SpecData, 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.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -479,15 +479,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
479
479
|
requirements:
|
480
480
|
- - ">="
|
481
481
|
- !ruby/object:Gem::Version
|
482
|
-
version:
|
482
|
+
version: 2.2.0
|
483
483
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
484
484
|
requirements:
|
485
485
|
- - ">="
|
486
486
|
- !ruby/object:Gem::Version
|
487
487
|
version: '0'
|
488
488
|
requirements: []
|
489
|
-
|
490
|
-
rubygems_version: 2.7.6.2
|
489
|
+
rubygems_version: 3.1.2
|
491
490
|
signing_key:
|
492
491
|
specification_version: 4
|
493
492
|
summary: oddb2xml creates xml files.
|