oddb2xml 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3049b7997045bc7986340211b3611456ac10e68f
4
- data.tar.gz: 11ade3b7d58f6b6de89f06ef51feaae35e69d2bb
3
+ metadata.gz: a4a25bdc724120b7570f7d671bcb4b5f7bfbc90d
4
+ data.tar.gz: 41ba2d28a669bc73e41d4767339d10eddc2d480a
5
5
  SHA512:
6
- metadata.gz: e788309b1dc86015dabdf1a0f1ed6b3afd4322d38171c4ac9074657af65f73c2695ee0cd8e95b1aaaf3725e0095bc84df1d68d9eecad1842225c8bad79da679b
7
- data.tar.gz: 901264169a14365065320c630886d631edad15adb8334708ad69073c01b599b470f85a1f849cef44dd6dbad23ceb710a03215f3809976d74e8c9558141e0ade6
6
+ metadata.gz: 129ce0e4983949fe59d1281643330a0c5d11d367adc2cb130aa85ca2f60c33b542b7311e92fbe821d42aa8a9c4a155520a919f77fb4d11fbe84bb6b220814c78
7
+ data.tar.gz: 8cf9e4fe4d4610df2794b4004abedeba5dd9ddce8c59aa99efc3ca0a8a40d63d2819a32fdaaa703ec473debdd6a0576125e7dd27ec9ac017d3937639e0ec676c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (2.3.1)
4
+ oddb2xml (2.3.2)
5
5
  archive-tar-minitar
6
6
  httpi (>= 2.4.1)
7
7
  mechanize
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.3.2 /11.01.2016
2
+
3
+ * File from swissmedic for blood products and vaccines has no longer a field Kühlkette. Therefore no longer downloading it.
4
+ * Set oddb_article COOL for all blod products and vaccines
5
+
1
6
  === 2.3.1 /15.12.2015
2
7
 
3
8
  * Deactivate (Pseudo-)Migel. Updated corresponding tests
@@ -35,7 +35,7 @@ module Oddb2xml
35
35
  }
36
36
  class Builder
37
37
  attr_accessor :subject, :refdata, :items, :flags, :lppvs,
38
- :actions, :migel, :orphan, :fridge,
38
+ :actions, :migel, :orphan,
39
39
  :infos, :packs, :infos_zur_rose,
40
40
  :ean14, :tag_suffix,
41
41
  :companies, :people,
@@ -53,7 +53,6 @@ module Oddb2xml
53
53
  @infos_zur_rose = {} # zurrose
54
54
  @actions = []
55
55
  @orphan = []
56
- @fridge = []
57
56
  @ean14 = false
58
57
  @companies = []
59
58
  @people = []
@@ -831,10 +830,7 @@ module Oddb2xml
831
830
  xml.LIMPTS pac[:limitation_points] unless pac[:limitation_points].empty?
832
831
  end
833
832
  #xml.GRDFR
834
- if no8 and !no8.empty? and
835
- no8.to_s =~ /(\d{5})(\d{3})/
836
- xml.COOL 1 if @fridge.include?($1.to_s)
837
- end
833
+ xml.COOL 1 if ppac && /Blutprodukte|impfstoffe/.match(ppac[:list_code])
838
834
  #xml.TEMP
839
835
  if ean
840
836
  flag = (ppac && !ppac[:drug_index].empty?) ? true : false
@@ -1260,8 +1256,7 @@ module Oddb2xml
1260
1256
  else
1261
1257
  '3'
1262
1258
  end
1263
- row << "%#{DAT_LEN[:CLAG]}s" % if ((no8 && no8.to_s =~ /(\d{5})(\d{3})/) and
1264
- @fridge.include?($1.to_s))
1259
+ row << "%#{DAT_LEN[:CLAG]}s" % if ppac && /Blutproduct|impfstoffe/.match(ppac[:list_code]) # COOL
1265
1260
  '1'
1266
1261
  else
1267
1262
  '0'
data/lib/oddb2xml/cli.rb CHANGED
@@ -31,8 +31,7 @@ module Oddb2xml
31
31
  @migel = {} # [addition] additional Non Pharma products from files repo
32
32
  @actions = [] # [addition] interactions from epha
33
33
  @orphan = [] # [addition] Orphaned drugs from Swissmedic xls
34
- @fridge = [] # [addition] ReFridge drugs from Swissmedic xls
35
- # addres
34
+ # addresses
36
35
  @companies = [] # betrieb
37
36
  @people = [] # medizinalperson
38
37
  @_message = false
@@ -52,9 +51,7 @@ module Oddb2xml
52
51
  if @options[:fi]
53
52
  threads << download(:fachinfo) # swissmedic-info
54
53
  end
55
- [:orphan, :fridge].each do |type|
56
- threads << download(type) # swissmedic
57
- end
54
+ threads << download(:orphan) # swissmedic
58
55
  threads << download(:interaction) # epha
59
56
  end
60
57
  if @options[:nonpharma]
@@ -116,7 +113,7 @@ module Oddb2xml
116
113
  builder.infos = @infos
117
114
  builder.packs = @packs
118
115
  # additional sources
119
- %w[actions orphan fridge migel infos_zur_rose].each do |addition|
116
+ %w[actions orphan migel infos_zur_rose].each do |addition|
120
117
  builder.send("#{addition}=".intern, self.instance_variable_get("@#{addition}"))
121
118
  end
122
119
  end
@@ -179,7 +176,7 @@ module Oddb2xml
179
176
  @infos
180
177
  end
181
178
  end
182
- when :orphan, :fridge
179
+ when :orphan
183
180
  var = what.to_s
184
181
  begin # instead of Thread.new do
185
182
  downloader = SwissmedicDownloader.new(what)
@@ -262,9 +262,6 @@ module Oddb2xml
262
262
  when :orphan
263
263
  action = "arzneimittel/00156/00221/00222/00223/00224/00227/00228/index.html?lang=de"
264
264
  @xpath = "//div[@id='sprungmarke10_3']//a[@title='Humanarzneimittel']"
265
- when :fridge
266
- action = "arzneimittel/00156/00221/00222/00235/index.html?lang=de"
267
- @xpath = "//div[@id='sprungmarke10_2']//a[@title='Excel-Version']"
268
265
  when :package
269
266
  action = "arzneimittel/00156/00221/00222/00230/index.html?lang=de"
270
267
  @xpath = "//div[@id='sprungmarke10_7']//a[@title='Excel-Version Zugelassene Verpackungen*']"
@@ -214,18 +214,6 @@ module Oddb2xml
214
214
  data << sprintf("%05d", number)
215
215
  end
216
216
  end
217
- when :fridge
218
- row_explanation = 9
219
- col_zulassung = 0
220
- col_cool = 12
221
- explanation = @sheet[row_explanation]
222
- raise "Could not find Zulassungsnummer in column #{col_zulassung} of #{@filename}" unless /Zul.*Nr/.match(explanation[col_zulassung].value)
223
- raise "Could not find Kühlkette in column #{col_cool}" unless /Kühlkette/.match(explanation[col_cool].value)
224
- @sheet.each do |row|
225
- if row[col_zulassung] and number = row[col_zulassung].value and row[col_cool] and row[col_cool].value.to_s.downcase == 'x'
226
- data << sprintf("%05d", number)
227
- end
228
- end
229
217
  end
230
218
  cleanup_file
231
219
  # puts "found #{data.uniq.size} entities for type #{@type}"
@@ -492,6 +480,7 @@ module Oddb2xml
492
480
  data[ean13] = {
493
481
  :line => line.chomp,
494
482
  :ean => ean13,
483
+ :clag => line[73],
495
484
  :vat => line[96],
496
485
  :description => line[10..59].sub(/\s+$/, ''),
497
486
  :quantity => '',
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
@@ -264,24 +264,6 @@ end
264
264
  end
265
265
  end
266
266
  end
267
- context 'fridge' do
268
- before(:each) do
269
- VCR.eject_cassette
270
- VCR.insert_cassette('oddb2xml', :tag => :swissmedic, :exclusive => false)
271
- common_before
272
- @downloader = Oddb2xml::SwissmedicDownloader.new(:fridge)
273
- end
274
- after(:each) do common_after end
275
- context 'download_by for fridge xls' do
276
- let(:bin) {
277
- @downloader.download
278
- }
279
- it 'should return valid Binary-String' do
280
- expect(bin).to be_a String
281
- expect(bin.bytes).not_to be nil
282
- end
283
- end
284
- end
285
267
  context 'package' do
286
268
  before(:each) do
287
269
  VCR.eject_cassette
@@ -216,15 +216,6 @@ describe Oddb2xml::SwissmedicExtractor do
216
216
  end
217
217
  end
218
218
 
219
- context 'can parse swissmedic_fridge.xlsx' do
220
- it {
221
- @filename = File.join(Oddb2xml::SpecData, 'swissmedic_fridge.xlsx')
222
- @packs = Oddb2xml::SwissmedicExtractor.new(@filename, :fridge).to_arry
223
- expect(@packs.size).to eq 16
224
- expect(@packs[0]).to eq("58618")
225
- expect(@packs[1]).to eq("00696")
226
- }
227
- end
228
219
  context 'can parse swissmedic_orphans.xls' do
229
220
  it {
230
221
  @filename = File.join(Oddb2xml::SpecData, 'swissmedic_orphan.xlsx')