oddb2xml 2.5.7 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cca220296af283c4de0922213c3be785a7cc8f2c
4
- data.tar.gz: 9c8be6ecf7b70e07387c1a6252cebf3bea4e243f
3
+ metadata.gz: 366f44dde83e17df28bf8f833ab7a41abea0c018
4
+ data.tar.gz: 9e97aaefb44149756996f4ce4c8220d0679f876f
5
5
  SHA512:
6
- metadata.gz: ce8ed5a537cb1f0ededcddfac17ceac36276d165ad0524854756f7fafed1c64bb3f3b09f048849319ed573617f42ff6569c522aa93dbdee4ca969b0e5cf14d74
7
- data.tar.gz: c86602624445ed966d3c166e0e520c95d338eed4ac0c9cf91df1498181093d5ff96de8768d25f9bcbd99cdad1b8386c217e5778720fc186d031664b1db24c860
6
+ metadata.gz: 381616e0bc2e029a1013b6763dfb8bf9ee9d4900d09e5fa0015d519ac36306895b69f16e9e67152e23d5cc4140b8510148fa85706a63e2d2c8e52bc16df39c18
7
+ data.tar.gz: bb9bc23c545dbdd00f3c8e9e71cfa8c98d4002c44ed9db81cc42b7a2f59559c4049c68085ca029af9c786c3bf9d39fc55dc47beb0e761ab4497efd0d5fb50ce7
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 2.5.8 / 20.09.2018
2
+
3
+ * Set SALECD to 'A' if article is from refdata_pharma/swissmedic
4
+ Marking these cases in oddb_article.xml, eg.
5
+ <SALECD>A<!--Overriding status I nincd 10 for 7680669940041 as in refdata_pharma--></SALECD>
6
+
1
7
  === 2.5.7 / 11.09.2018
2
8
 
3
9
  * Emit ATC code if product is not in refdata
@@ -828,6 +828,7 @@ module Oddb2xml
828
828
  end
829
829
 
830
830
  def build_article
831
+ @overriden_salecd = []
831
832
  prepare_limitations
832
833
  prepare_articles
833
834
  idx = 0
@@ -1035,7 +1036,7 @@ module Oddb2xml
1035
1036
  }
1036
1037
  }
1037
1038
  end
1038
- Oddb2xml.log "build_article. Done #{idx} of #{@articles.size} articles"
1039
+ Oddb2xml.log "build_article. Done #{idx} of #{@articles.size} articles. Overrode #{@overriden_salecd.size} SALECD"
1039
1040
  Oddb2xml.add_hash(_builder.to_xml)
1040
1041
  end
1041
1042
  def build_fi
@@ -1381,8 +1382,16 @@ module Oddb2xml
1381
1382
  zur_rose = @infos_zur_rose[ean13] # zurrose
1382
1383
  end
1383
1384
  nincd = detect_nincd(obj)
1385
+ in_refdata = !!( obj[:seq] && obj[:seq][:packages] && obj[:seq][:packages][ean13] && obj[:seq][:packages][ean13][:swissmedic_number8])
1384
1386
  status = (nincd && nincd == 13) ? 'A' : (zur_rose && zur_rose[:cmut] != '3') ? 'A' : 'I'
1385
- xml.SALECD(status) { xml.comment( "expiry_date #{obj[:expiry_date]}") if obj[:expiry_date] }
1387
+ if in_refdata && !'A'.eql?(status)
1388
+ msg = "Overriding status #{status} nincd #{nincd} for #{ean13} as in refdata_pharma"
1389
+ # Oddb2xml.log msg
1390
+ @overriden_salecd << ean13
1391
+ xml.SALECD('A') { xml.comment(msg)}
1392
+ else
1393
+ xml.SALECD(status) { xml.comment( "expiry_date #{obj[:expiry_date]}") if obj[:expiry_date] }
1394
+ end
1386
1395
  end
1387
1396
 
1388
1397
  def build_artikelstamm
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.5.7"
2
+ VERSION = "2.5.8"
3
3
  end
@@ -121,7 +121,7 @@ describe Oddb2xml::Builder do
121
121
  it 'should find price from Preparations.xml by setting' do
122
122
  expect(File.exists?(@elexis_v5_csv)).to eq true
123
123
  inhalt = File.open(@elexis_v5_csv, 'r+').read
124
- expected = %(7680658560014,"Dibase 10'000, Tropfen 10000 IE/ml",Flasche(n),Flasche(n),5,9.25,6585601,A11CC05,cholecalciferolum,,07.02.3.,SL)
124
+ expected = %(7680658560014,Dibase 10'000 Tropfen 10000 IE/ml Fl 10 ml,,Flasche(n),5,9.25,,,,"",,SL)
125
125
  expect(inhalt.index(expected)).to be > 0
126
126
  end
127
127
 
@@ -214,25 +214,22 @@ describe Oddb2xml::Builder do
214
214
 
215
215
  it 'should contain DIBASE with phar' do
216
216
  expected = %(<ITEM PHARMATYPE="P">
217
- <GTIN>7680658560014</GTIN>
217
+ <GTIN>7680658570013</GTIN>
218
218
  <!--override with-->
219
219
  <SALECD>A</SALECD>
220
- <DSCR>Dibase 10'000, Tropfen 10000 IE/ml</DSCR>
221
- <DSCRF>Dibase 10'000, gouttes 10000 UI/ml</DSCRF>
220
+ <DSCR>DIBASE 25'000, Lösung zum Einnehmen</DSCR>
221
+ <DSCRF>--missing--</DSCRF>
222
222
  <COMP>
223
223
  <NAME>Gebro Pharma AG</NAME>
224
224
  <GLN/>
225
225
  </COMP>
226
- <PEXF>5</PEXF>
227
- <PPUB>9.25</PPUB>
228
226
  <PKG_SIZE>1</PKG_SIZE>
229
227
  <MEASURE>Flasche(n)</MEASURE>
230
228
  <MEASUREF>Flasche(n)</MEASUREF>
231
- <DOSAGE_FORM>orale Tropflösung</DOSAGE_FORM>
232
- <SL_ENTRY>true</SL_ENTRY>
229
+ <DOSAGE_FORM>Lösung</DOSAGE_FORM>
230
+ <DOSAGE_FORMF>Solution</DOSAGE_FORMF>
233
231
  <IKSCAT>D</IKSCAT>
234
- <DEDUCTIBLE>10</DEDUCTIBLE>
235
- <PRODNO>6585601</PRODNO>
232
+ <PRODNO>6585701</PRODNO>
236
233
  </ITEM>)
237
234
  expect(@inhalt.index(expected)).not_to be nil
238
235
  end
data/spec/builder_spec.rb CHANGED
@@ -473,7 +473,7 @@ def checkProductXml(nbr_record = -1)
473
473
  end
474
474
 
475
475
  describe Oddb2xml::Builder do
476
- NrExtendedArticles = 77
476
+ NrExtendedArticles = 76
477
477
  NrSubstances = 27
478
478
  NrLimitations = 14
479
479
 
@@ -605,6 +605,11 @@ describe Oddb2xml::Builder do
605
605
  <CPT/>)
606
606
  expect(oddb_product_xml.index(text2)).to be >= 1
607
607
  end
608
+
609
+ it 'should generate SALECD A for swissmedic packages' do
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
+ end
612
+
608
613
  end
609
614
 
610
615
  context 'when -o for fachinfo is given' do
@@ -35,6 +35,17 @@
35
35
  <AUTH_HOLDER_NAME>Shire Switzerland GmbH</AUTH_HOLDER_NAME>
36
36
  <AUTH_HOLDER_GLN>7601001395756</AUTH_HOLDER_GLN>
37
37
  </ITEM>
38
+ <ITEM DT="2018-09-20T00:00:00">
39
+ <ATYPE>PHARMA</ATYPE>
40
+ <GTIN>7680658560014</GTIN>
41
+ <PHAR>7199565</PHAR>
42
+ <SWMC_AUTHNR>65856001</SWMC_AUTHNR>
43
+ <NAME_DE>DIBASE Tropfen 10000 IE/ml Fl 10 ml</NAME_DE>
44
+ <NAME_FR>DIBASE gouttes 10000 UI/ml fl 10 ml</NAME_FR>
45
+ <ATC>A11CC05</ATC>
46
+ <AUTH_HOLDER_NAME>Gebro Pharma AG</AUTH_HOLDER_NAME>
47
+ <AUTH_HOLDER_GLN>7612053000000</AUTH_HOLDER_GLN>
48
+ </ITEM>
38
49
  <ITEM DT="2017-12-08T00:00:00">
39
50
  <ATYPE>PHARMA</ATYPE>
40
51
  <GTIN>7680555580054</GTIN>
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.7
4
+ version: 2.5.8
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-11 00:00:00.000000000 Z
11
+ date: 2018-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip