oddb2xml 2.5.8 → 2.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 366f44dde83e17df28bf8f833ab7a41abea0c018
4
- data.tar.gz: 9e97aaefb44149756996f4ce4c8220d0679f876f
3
+ metadata.gz: fc9711600834d1ef9b14c3dd2c1f7c82e725bd22
4
+ data.tar.gz: 258203f1ea2cd3dd7b8ec6e33c0a1568f5c7f249
5
5
  SHA512:
6
- metadata.gz: 381616e0bc2e029a1013b6763dfb8bf9ee9d4900d09e5fa0015d519ac36306895b69f16e9e67152e23d5cc4140b8510148fa85706a63e2d2c8e52bc16df39c18
7
- data.tar.gz: bb9bc23c545dbdd00f3c8e9e71cfa8c98d4002c44ed9db81cc42b7a2f59559c4049c68085ca029af9c786c3bf9d39fc55dc47beb0e761ab4497efd0d5fb50ce7
6
+ metadata.gz: 8827e73d456965da4c44c1e9e06b89ee1a091c0be1d77204f54443f31b7494cce4d6afb4af956907fdfa272854abd7d33a23c4834a41ef49c080fad3a4c11b82
7
+ data.tar.gz: d0db714f066294ad1e1f0b389f366bd96f7c23a2955a8dd609303293b7c29291a16ce720c6e1363b18224c410f7383d07b42a4e65e737681a56d0620bde448cb
@@ -1,3 +1,9 @@
1
+ === 2.5.9 / 06.12.2018
2
+
3
+ * Only changes when generating artikelstamm
4
+ ** Use sequence name from packages when there is no german name in the article (from refdata)
5
+ ** Correct header of artikelstamm-*.csv
6
+
1
7
  === 2.5.8 / 20.09.2018
2
8
 
3
9
  * Set SALECD to 'A' if article is from refdata_pharma/swissmedic
@@ -1397,7 +1397,7 @@ module Oddb2xml
1397
1397
  def build_artikelstamm
1398
1398
  @@emitted_v5_gtins = []
1399
1399
  @csv_file = CSV.open(File.join(WorkDir, "artikelstamm_#{Date.today.strftime('%d%m%Y')}_v5.csv"), "w+")
1400
- @csv_file << ['gtin', 'price', 'galenic_form', 'pkg_size', 'pexf', 'ppub', 'iksnr', 'atc_code', 'active_substance', 'original', 'it-code', 'sl-liste']
1400
+ @csv_file << ['gtin', 'name', 'pkg_size', 'galenic_form', 'price_ex_factory', 'price_public', 'prodno', 'atc_code', 'active_substance', 'original', 'it-code', 'sl-liste']
1401
1401
  @csv_file.sync = true
1402
1402
  variant = "build_artikelstamm"
1403
1403
  # @infos_zur_rose.delete_if { |key, val| val[:cmut].eql?('3') } # collect only active zur rose item
@@ -1581,7 +1581,7 @@ module Oddb2xml
1581
1581
  # in refdata/packungen
1582
1582
  chap70 = nil
1583
1583
  if @chapter70items.values.find {|x| x[:pharmacode] && x[:pharmacode].eql?(obj[:pharmacode])}
1584
- Oddb2xml.log "found chapter #{obj[:pharmacode]}"
1584
+ Oddb2xml.log "found chapter #{obj[:pharmacode]}" if $VERBOSE
1585
1585
  chap70 = true
1586
1586
  end
1587
1587
  patched_pharma_type = (/^7680/.match(ean13.to_s.rjust(13, '0')) || chap70 ? 'P': 'N' )
@@ -1680,8 +1680,17 @@ module Oddb2xml
1680
1680
  xml.PRODNO prodno
1681
1681
  if sequence
1682
1682
  xml.SALECD('A') # these products are always active!
1683
- override(xml, prodno, :DSCR, ((sequence[:name_de] ? sequence[:name_de] : '') + ' ' + sequence[:desc_de]).strip)
1684
- override(xml, prodno, :DSCRF, ((sequence[:name_fr] ? sequence[:name_fr] : '') + ' ' + sequence[:desc_fr]).strip)
1683
+ name_de = sequence[:name_de]
1684
+ unless name_de
1685
+ if ppac && /stk/i.match( sequence[:desc_de])
1686
+ name_de = ppac[:sequence_name]
1687
+ else
1688
+ name_de = sequence[:desc_de]
1689
+ end
1690
+ end
1691
+ name_fr = sequence[:name_fr] || (ppac && ppac[:sequence_name]) || sequence[:desc_fr]
1692
+ override(xml, prodno, :DSCR, name_de.strip)
1693
+ override(xml, prodno, :DSCRF, name_fr.strip)
1685
1694
  end
1686
1695
  xml.ATC sequence[:atc_code] if sequence && sequence[:atc_code] && !sequence[:atc_code].empty?
1687
1696
  if sequence && sequence[:packages] && (first_package = sequence[:packages].values.first) &&
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.5.8"
2
+ VERSION = "2.5.9"
3
3
  end
@@ -315,6 +315,20 @@ Corresp. 5300 kJ.",
315
315
  specify { expect(res.first.class).to eq String }
316
316
  end
317
317
 
318
+ context 'should return correct value for 5 Ampullen a 10 mk' do
319
+ pkg_size_L = '5 Ampullen a 10 ml'
320
+ einheit_M = 'Ampulle'
321
+ name_C = 'Suspension zur Injektion'
322
+
323
+ result = Calc.new(name_C, pkg_size_L, einheit_M, nil)
324
+ specify { expect(result.selling_units).to eq 5 }
325
+ specify { expect(result.measure).to eq einheit_M }
326
+
327
+ res = Calc.report_conversion
328
+ specify { expect(res.class).to eq Array }
329
+ specify { expect(res.first.class).to eq String }
330
+ end
331
+
318
332
  context 'find correct result for Nutriflex' do
319
333
  info = Calc.new(Tst_nutriflex.name_C, Tst_nutriflex.package_size_L, Tst_nutriflex.einheit_M, Tst_nutriflex.active_substance_0, Tst_nutriflex.composition_P)
320
334
  specify { expect(info.selling_units).to eq 5 }
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.5.8
4
+ version: 2.5.9
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: 2018-09-20 00:00:00.000000000 Z
11
+ date: 2018-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip