swissmedic-diff 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -31
- data/History.txt +10 -0
- data/Packungen-2023.08.08.xlsx +0 -0
- data/Packungen-2023.09.08.xlsx +0 -0
- data/lib/swissmedic-diff.rb +13 -2
- data/lib/version.rb +1 -1
- data/test/test_swissmedic-diff.rb +11 -11
- metadata +8 -9
- data/Packungen-2016.01.09.xlsx +0 -0
- data/Packungen-2017.09.07.xlsx +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c9f7f364660ce0313e6261e73e127c73e6f737b236e95a19934a817ba7e2eed
|
4
|
+
data.tar.gz: aa425b73fdfd27acc1f5a59c7b091c4655355f647e232fd91e781eef925a04e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 002e643de90c8536d6e891420cf66960f1447636eca5bdd775a14f7469f337ad8cc98422427dc4ea8e9e9a76e046afa489667bebb705bacb983d27d7d2b6cb33
|
7
|
+
data.tar.gz: 9eda362cca9621f6f6ad60d5fe476bde48d691f5dcd058b618f1cbe69176d4e26e098a5a78e7ceca8dc39d4a5444b992a03a9b3d077b325f334f6bcff7f6cddd
|
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.8)
|
5
5
|
nokogiri
|
6
6
|
rubyXL (>= 3.3.1)
|
7
7
|
rubyzip
|
@@ -11,41 +11,41 @@ GEM
|
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
13
|
ansi (1.5.0)
|
14
|
-
builder (3.2.
|
15
|
-
byebug (
|
16
|
-
coderay (1.1.
|
17
|
-
method_source (0.
|
18
|
-
|
19
|
-
minitest (
|
20
|
-
minitest-reporters (1.1.18)
|
14
|
+
builder (3.2.4)
|
15
|
+
byebug (11.1.3)
|
16
|
+
coderay (1.1.3)
|
17
|
+
method_source (1.0.0)
|
18
|
+
minitest (5.20.0)
|
19
|
+
minitest-reporters (1.6.1)
|
21
20
|
ansi
|
22
21
|
builder
|
23
22
|
minitest (>= 5.0)
|
24
23
|
ruby-progressbar
|
25
|
-
nokogiri (1.
|
26
|
-
|
27
|
-
pry (0.
|
28
|
-
coderay (~> 1.1
|
29
|
-
method_source (~> 0
|
30
|
-
pry-byebug (3.
|
31
|
-
byebug (~>
|
32
|
-
pry (
|
33
|
-
pry-doc (
|
34
|
-
pry (~> 0.
|
35
|
-
yard (~> 0.9)
|
36
|
-
|
37
|
-
|
38
|
-
ruby-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
24
|
+
nokogiri (1.15.4-x86_64-linux)
|
25
|
+
racc (~> 1.4)
|
26
|
+
pry (0.14.2)
|
27
|
+
coderay (~> 1.1)
|
28
|
+
method_source (~> 1.0)
|
29
|
+
pry-byebug (3.10.1)
|
30
|
+
byebug (~> 11.0)
|
31
|
+
pry (>= 0.13, < 0.15)
|
32
|
+
pry-doc (1.4.0)
|
33
|
+
pry (~> 0.11)
|
34
|
+
yard (~> 0.9.11)
|
35
|
+
racc (1.7.1)
|
36
|
+
rake (13.0.6)
|
37
|
+
ruby-ole (1.2.12.2)
|
38
|
+
ruby-progressbar (1.13.0)
|
39
|
+
rubyXL (3.4.25)
|
40
|
+
nokogiri (>= 1.10.8)
|
41
|
+
rubyzip (>= 1.3.0)
|
42
|
+
rubyzip (2.3.2)
|
43
|
+
spreadsheet (1.3.0)
|
44
|
+
ruby-ole
|
45
|
+
yard (0.9.34)
|
46
46
|
|
47
47
|
PLATFORMS
|
48
|
-
|
48
|
+
x86_64-linux
|
49
49
|
|
50
50
|
DEPENDENCIES
|
51
51
|
minitest
|
@@ -56,4 +56,4 @@ DEPENDENCIES
|
|
56
56
|
swissmedic-diff!
|
57
57
|
|
58
58
|
BUNDLED WITH
|
59
|
-
|
59
|
+
2.4.10
|
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
=== 0.2.8 / 04.10.2023
|
2
|
+
|
3
|
+
* Fix problem when expiration_date is a string 'Unbegrenzt'
|
4
|
+
* Updated tests
|
5
|
+
* Added Ruby 3.2 for running github/workflow tests
|
6
|
+
|
7
|
+
=== 0.2.7 / 13.03.2019
|
8
|
+
|
9
|
+
* Set date to nil when expiration_date is a string 'Unbegrenzt'
|
10
|
+
|
1
11
|
=== 0.2.6 / 13.02.2019
|
2
12
|
|
3
13
|
* Adapt to swissmedic new XLSX files
|
Binary file
|
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
|
@@ -152,7 +155,11 @@ class SwissmedicDiff
|
|
152
155
|
sprintf "%s (%s)", txt, pairs.join(',')
|
153
156
|
when :registration_date, :expiry_date
|
154
157
|
row = diff.newest_rows[iksnr].sort.first.last
|
155
|
-
|
158
|
+
if row[COLUMNS_2014.keys.index(flag)].value.to_s.match(REGEXP_UNLIMITED)
|
159
|
+
sprintf "%s (%s)", txt, 'unbegrenzt'
|
160
|
+
else
|
161
|
+
sprintf "%s (%s)", txt, row[COLUMNS_2014.keys.index(flag)].value.strftime('%d.%m.%Y')
|
162
|
+
end
|
156
163
|
else
|
157
164
|
row = diff.newest_rows[iksnr].sort.first.last
|
158
165
|
sprintf "%s (%s)", txt, cell(row, COLUMNS_2014.keys.index(flag))
|
@@ -350,7 +357,11 @@ class SwissmedicDiff
|
|
350
357
|
if cell = row[idx]
|
351
358
|
case key
|
352
359
|
when :registration_date, :expiry_date
|
353
|
-
row[idx] && row[idx].value
|
360
|
+
if row[idx] && row[idx].value && REGEXP_UNLIMITED.match(row[idx].value.to_s)
|
361
|
+
VALUE_UNLIMITED # Date.new(2099,12,31)
|
362
|
+
else
|
363
|
+
row[idx] && row[idx].value ? row[idx].value.to_date : nil
|
364
|
+
end
|
354
365
|
when :seqnr
|
355
366
|
sprintf "%02i", cell(row, idx).to_i
|
356
367
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannes Wyss, Masaomi Hatakeyama
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyXL
|
@@ -121,8 +121,8 @@ files:
|
|
121
121
|
- History.txt
|
122
122
|
- LICENSE
|
123
123
|
- Manifest.txt
|
124
|
-
- Packungen-
|
125
|
-
- Packungen-
|
124
|
+
- Packungen-2023.08.08.xlsx
|
125
|
+
- Packungen-2023.09.08.xlsx
|
126
126
|
- README.txt
|
127
127
|
- Rakefile
|
128
128
|
- bin/swissmedic-diff
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
homepage: https://github.com/zdavatz/swissmedic-diff
|
134
134
|
licenses: []
|
135
135
|
metadata: {}
|
136
|
-
post_install_message:
|
136
|
+
post_install_message:
|
137
137
|
rdoc_options: []
|
138
138
|
require_paths:
|
139
139
|
- lib
|
@@ -148,9 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
|
152
|
-
|
153
|
-
signing_key:
|
151
|
+
rubygems_version: 3.4.13
|
152
|
+
signing_key:
|
154
153
|
specification_version: 4
|
155
154
|
summary: Find out what Products have changed on the swiss healthcare market
|
156
155
|
test_files:
|
data/Packungen-2016.01.09.xlsx
DELETED
Binary file
|
data/Packungen-2017.09.07.xlsx
DELETED
Binary file
|