swissmedic-diff 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/History.txt +4 -0
- data/Packungen-2015.07.02.xlsx +0 -0
- data/lib/swissmedic-diff.rb +8 -1
- data/lib/version.rb +1 -1
- data/test/test_swissmedic-diff.rb +11 -11
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 925c71a322a4c7cd09d8c9424abd81a789e6e1f4a7873d1a57bfc00b5c8d94eb
|
4
|
+
data.tar.gz: 1e7dc182db7f46ceadfc140ee5e4d1ea10297ea9670533ba65ed6fefbf937182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c780ba3d8556a397b65e32bea5ceff473f7f0ced14872a02231e30d15ec4f508d495e943878346a1354e739a6292d37b07c03d8efe2e4fe480e293e33e83b6c
|
7
|
+
data.tar.gz: 3fa78fda4e35364769e91cc9c1ae41b78cd46d3b37cbf8aad5223fdc03920ef136c9470d0c201b587b40c1ffe870a5b1daec0abd9e4cfe0cddcac60ad883cacb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
swissmedic-diff (0.2.
|
4
|
+
swissmedic-diff (0.2.7)
|
5
5
|
nokogiri
|
6
6
|
rubyXL (>= 3.3.1)
|
7
7
|
rubyzip
|
@@ -36,11 +36,11 @@ GEM
|
|
36
36
|
rake (12.3.0)
|
37
37
|
ruby-ole (1.2.12.1)
|
38
38
|
ruby-progressbar (1.8.3)
|
39
|
-
rubyXL (3.
|
39
|
+
rubyXL (3.4.2)
|
40
40
|
nokogiri (>= 1.4.4)
|
41
41
|
rubyzip (>= 1.1.6)
|
42
42
|
rubyzip (1.2.2)
|
43
|
-
spreadsheet (1.
|
43
|
+
spreadsheet (1.2.2)
|
44
44
|
ruby-ole (>= 1.0)
|
45
45
|
yard (0.9.9)
|
46
46
|
|
data/History.txt
CHANGED
Binary file
|
data/lib/swissmedic-diff.rb
CHANGED
@@ -23,6 +23,9 @@ require File.join(File.dirname(__FILE__), 'compatibility.rb')
|
|
23
23
|
#License:: GPLv2.0 Compliance
|
24
24
|
#Source:: http://scm.ywesee.com/?p=swissmedic-diff/.git;a=summary
|
25
25
|
class SwissmedicDiff
|
26
|
+
VALUE_UNLIMITED = nil
|
27
|
+
REGEXP_UNLIMITED = /unbegrenzt/i
|
28
|
+
|
26
29
|
module Diff
|
27
30
|
COLUMNS_2014 = {
|
28
31
|
:iksnr => /Zulassungs-Nummer/i, # column-nr: 0
|
@@ -350,7 +353,11 @@ class SwissmedicDiff
|
|
350
353
|
if cell = row[idx]
|
351
354
|
case key
|
352
355
|
when :registration_date, :expiry_date
|
353
|
-
row[idx] && row[idx].value
|
356
|
+
if row[idx] && row[idx].value && REGEXP_UNLIMITED.match(row[idx].value.to_s)
|
357
|
+
VALUE_UNLIMITED # Date.new(2099,12,31)
|
358
|
+
else
|
359
|
+
row[idx] && row[idx].value ? row[idx].value.to_date : nil
|
360
|
+
end
|
354
361
|
when :seqnr
|
355
362
|
sprintf "%02i", cell(row, idx).to_i
|
356
363
|
else
|
data/lib/version.rb
CHANGED
@@ -22,11 +22,11 @@ module ODDB
|
|
22
22
|
this_month = File.expand_path 'data/Packungen-2015.07.02.xlsx', File.dirname(__FILE__)
|
23
23
|
result = @diff.diff this_month, last_month, [:atc_class, :sequence_date]
|
24
24
|
assert(result.changes.flatten.index('Zulassungs-Nummer') == nil, "Should not find Zulassungs-Nummer in changes")
|
25
|
-
assert_equal(
|
26
|
-
assert_equal(
|
25
|
+
assert_equal(2, result.news.size)
|
26
|
+
assert_equal(4, result.changes.size)
|
27
27
|
assert_equal(4, result.updates.size)
|
28
|
-
assert_equal(['65838'], result.news.collect{|x| x[0] if x[0] == '65838'})
|
29
|
-
assert_equal({"00277"=>[:name_base, :expiry_date], "00279"=>[:expiry_date], "65838"=>[:new]}, result.changes)
|
28
|
+
assert_equal(['65838', nil], result.news.collect{|x| x[0] if x[0] == '65838'})
|
29
|
+
assert_equal({"00277"=>[:name_base, :expiry_date], "00279"=>[:expiry_date], "65838"=>[:new], "15219"=>[:new]}, result.changes)
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_diff_changes
|
@@ -34,9 +34,10 @@ module ODDB
|
|
34
34
|
last_month = File.expand_path 'data/Packungen-2015.06.04.xlsx', File.dirname(__FILE__)
|
35
35
|
this_month = File.expand_path 'data/Packungen-2015.07.02.xlsx', File.dirname(__FILE__)
|
36
36
|
expected = {
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
"00277"=>[:name_base, :expiry_date],
|
38
|
+
"00279"=>[:expiry_date],
|
39
|
+
"65838"=>[:new],
|
40
|
+
"15219"=>[:new]
|
40
41
|
}
|
41
42
|
result = @diff.diff this_month, last_month
|
42
43
|
assert_equal(expected, result.changes)
|
@@ -46,9 +47,9 @@ module ODDB
|
|
46
47
|
def test_diff_changes_february_2019
|
47
48
|
@diff = SwissmedicDiff.new
|
48
49
|
last_month = File.expand_path 'data/Packungen-2015.07.02.xlsx', File.dirname(__FILE__)
|
49
|
-
this_month = File.expand_path 'data/Packungen-2019.
|
50
|
+
this_month = File.expand_path 'data/Packungen-2019.03.06.xlsx', File.dirname(__FILE__)
|
50
51
|
expected = {"00277"=>[:name_base, :expiry_date, :production_science],
|
51
|
-
"15219"=>[:
|
52
|
+
"15219"=>[:expiry_date, :indication_registration, :indication_sequence, :sequence],
|
52
53
|
"16105"=>[:new],
|
53
54
|
"16598"=>[:new],
|
54
55
|
"28486"=>[:new],
|
@@ -85,8 +86,7 @@ module ODDB
|
|
85
86
|
"00279"=>[:delete],
|
86
87
|
"65837"=>[:delete],
|
87
88
|
"65838"=>[:delete]
|
88
|
-
|
89
|
-
|
89
|
+
}
|
90
90
|
result = @diff.diff this_month, last_month
|
91
91
|
assert_equal(expected, result.changes)
|
92
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swissmedic-diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannes Wyss, Masaomi Hatakeyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyXL
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- History.txt
|
122
122
|
- LICENSE
|
123
123
|
- Manifest.txt
|
124
|
+
- Packungen-2015.07.02.xlsx
|
124
125
|
- Packungen-2016.01.09.xlsx
|
125
126
|
- Packungen-2017.09.07.xlsx
|
126
127
|
- README.txt
|
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
152
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.7.
|
153
|
+
rubygems_version: 2.7.3
|
153
154
|
signing_key:
|
154
155
|
specification_version: 4
|
155
156
|
summary: Find out what Products have changed on the swiss healthcare market
|