oddb2xml 2.7.3 → 2.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -2
  3. data/.gitignore +0 -0
  4. data/.rspec +0 -0
  5. data/.standard.yml +0 -0
  6. data/Elexis_Artikelstamm_v003.xsd +0 -0
  7. data/Elexis_Artikelstamm_v5.xsd +0 -0
  8. data/History.txt +15 -0
  9. data/LICENSE +0 -0
  10. data/Manifest.txt +0 -0
  11. data/QA.md +0 -0
  12. data/README.md +0 -0
  13. data/Rakefile +0 -0
  14. data/artikelstamm.md +0 -0
  15. data/data/article_overrides.yaml +0 -0
  16. data/data/gal_forms.yaml +0 -0
  17. data/data/gal_groups.yaml +0 -0
  18. data/data/gtin2ignore.yaml +0 -0
  19. data/data/product_overrides.yaml +0 -0
  20. data/dokumentation_calc.textile +0 -0
  21. data/lib/oddb2xml/builder.rb +1 -1
  22. data/lib/oddb2xml/chapter_70_hack.rb +0 -0
  23. data/lib/oddb2xml/cli.rb +0 -0
  24. data/lib/oddb2xml/compare.rb +0 -0
  25. data/lib/oddb2xml/compositions_syntax.rb +4 -1
  26. data/lib/oddb2xml/compressor.rb +0 -0
  27. data/lib/oddb2xml/downloader.rb +3 -1
  28. data/lib/oddb2xml/extractor.rb +0 -0
  29. data/lib/oddb2xml/options.rb +0 -0
  30. data/lib/oddb2xml/parslet_compositions.rb +4 -2
  31. data/lib/oddb2xml/util.rb +0 -0
  32. data/lib/oddb2xml/version.rb +1 -1
  33. data/lib/oddb2xml/xml_definitions.rb +0 -0
  34. data/lib/oddb2xml.rb +0 -0
  35. data/oddb2xml.gemspec +4 -3
  36. data/oddb2xml.xsd +0 -0
  37. data/oddb_calc.xsd +0 -0
  38. data/shell.nix +17 -0
  39. data/spec/artikelstamm_spec.rb +10 -3
  40. data/spec/builder_spec.rb +4 -3
  41. data/spec/calc_spec.rb +0 -0
  42. data/spec/check_artikelstamm_spec.rb +0 -0
  43. data/spec/cli_spec.rb +0 -0
  44. data/spec/compare_spec.rb +0 -0
  45. data/spec/composition_syntax_spec.rb +0 -0
  46. data/spec/compressor_spec.rb +0 -0
  47. data/spec/data/AipsDownload.zip +0 -0
  48. data/spec/data/Elexis_Artikelstamm_v5.xsd +0 -0
  49. data/spec/data/GL_Diff_SB.xml +0 -0
  50. data/spec/data/ItCodes.xml +0 -0
  51. data/spec/data/PR121001.txt +0 -0
  52. data/spec/data/PR121002.txt +0 -0
  53. data/spec/data/Preparations.xml +0 -0
  54. data/spec/data/Publications.xls +0 -0
  55. data/spec/data/artikelstamm_N_010917.xml +0 -0
  56. data/spec/data/artikelstamm_N_011217.xml +0 -0
  57. data/spec/data/artikelstamm_P_010917.xml +0 -0
  58. data/spec/data/artikelstamm_P_011217.xml +0 -0
  59. data/spec/data/atc.csv +0 -0
  60. data/spec/data/check_artikelstamm/artikelstamm_v5_gtin_non_numeric.xml +0 -0
  61. data/spec/data/check_artikelstamm/artikelstamm_v5_gtin_not_uniq.xml +0 -0
  62. data/spec/data/check_artikelstamm/artikelstamm_v5_limitation_exists.xml +0 -0
  63. data/spec/data/check_artikelstamm/artikelstamm_v5_okay.xml +0 -0
  64. data/spec/data/check_artikelstamm/artikelstamm_v5_pharma_has_product.xml +0 -0
  65. data/spec/data/check_artikelstamm/artikelstamm_v5_prodno_not_uniq.xml +0 -0
  66. data/spec/data/check_artikelstamm/artikelstamm_v5_product_needs_article.xml +0 -0
  67. data/spec/data/column_c.txt +0 -0
  68. data/spec/data/compositions.txt +0 -0
  69. data/spec/data/compressor/oddb2xml_files_bm_update.txt +0 -0
  70. data/spec/data/compressor/oddb2xml_files_lppv.txt +0 -0
  71. data/spec/data/compressor/oddb2xml_files_nonpharma.xls +0 -0
  72. data/spec/data/epha_interactions.csv +0 -0
  73. data/spec/data/listen_neu.html +0 -0
  74. data/spec/data/medregbm_betrieb.txt +0 -0
  75. data/spec/data/medregbm_person.txt +0 -0
  76. data/spec/data/oddb2xml_files_bm_update.txt +0 -0
  77. data/spec/data/oddb2xml_files_lppv.txt +0 -0
  78. data/spec/data/oddb2xml_files_nonpharma.xls +0 -0
  79. data/spec/data/problems.txt +0 -0
  80. data/spec/data/refdata_NonPharma.xml +0 -0
  81. data/spec/data/refdata_Pharma.xml +0 -0
  82. data/spec/data/swissmedic_fridges.html +0 -0
  83. data/spec/data/swissmedic_info.html +0 -0
  84. data/spec/data/swissmedic_info_2.html +0 -0
  85. data/spec/data/swissmedic_orphan.xlsx +0 -0
  86. data/spec/data/swissmedic_orphans.html +0 -0
  87. data/spec/data/swissmedic_package.xlsx +0 -0
  88. data/spec/data/swissmedic_packages.html +0 -0
  89. data/spec/data/transfer.dat +0 -0
  90. data/spec/data/v5_first.xml +0 -0
  91. data/spec/data/v5_second.xml +0 -0
  92. data/spec/data/varia_De.htm +0 -0
  93. data/spec/data/vcr/transfer.dat +0 -0
  94. data/spec/data/vcr/transfer.zip +0 -0
  95. data/spec/data/wsdl_nonpharma.xml +0 -0
  96. data/spec/data/wsdl_pharma.xml +0 -0
  97. data/spec/downloader_spec.rb +6 -2
  98. data/spec/extractor_spec.rb +1 -1
  99. data/spec/fixtures/vcr_cassettes/artikelstamm.json +0 -0
  100. data/spec/fixtures/vcr_cassettes/oddb2xml.json +1 -1
  101. data/spec/galenic_spec.rb +0 -0
  102. data/spec/parslet_spec.rb +65 -4
  103. data/spec/spec_helper.rb +0 -1
  104. data/tools/cacert.pem +0 -0
  105. data/tools/set.bat +0 -0
  106. data/tools/win_fetch_cacerts.rb +0 -0
  107. metadata +30 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dc59cd0f8ed09f2416f4ba77030ab3549618c3cbe90b3e0496e91808e51fa95
4
- data.tar.gz: 3fdbf0803a5b92b4b3af6950c0021db33ade825de3bb768ca34c54c90e0e659a
3
+ metadata.gz: a39a53e8f34da09e020d5d2d339e2290cba71591bc01c9e7de932dd953d2b9dd
4
+ data.tar.gz: a77e06a2c8a3aa41e416a9b365a3420c46844c01e11c36013a4382a12ac54bde
5
5
  SHA512:
6
- metadata.gz: b742461c737d8409d8a6f79eba36d4a3d87458e6f211086ff8c828264d76b5c6b3216cdb9b8ce216c3bbb3caa3a38dae2a430e9dd97faa624e8c3b15ceb0a749
7
- data.tar.gz: 1b825d705594c244f34a9ff4df06e158f8fd63ebabd1bdf7c760ea52a50b816d8781eacd5b0627df394a39de62dc3572afd07261358df66e6d6f0b7cfa0846bf
6
+ metadata.gz: 229bd808da81f0a83dd18b3355882690b908610f8253bad0f95e39cc654589e7a380d78fd54ca70a2d42c7e6664a9b934c032e6cfab9e8db5361c9f8ec7fa446
7
+ data.tar.gz: ae4cdf349f8a15f88c31ce09e4d88d84fb91f49f79c9d5b0afdad251249de4e69d3be9f32a442c04e40902d27097edae39da96cb0cb43111e493f70b61f30523
@@ -22,8 +22,7 @@ jobs:
22
22
  fail-fast: false
23
23
  matrix:
24
24
  os: [ ubuntu]
25
- ruby: [2.5, 2.6, 2.7, 3.0, head]
26
- continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
25
+ ruby: [2.6, 2.7, "3.0", 3.1]
27
26
  steps:
28
27
  - uses: actions/checkout@v2
29
28
  - uses: ruby/setup-ruby@v1
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.standard.yml CHANGED
File without changes
File without changes
File without changes
data/History.txt CHANGED
@@ -1,3 +1,18 @@
1
+ === 2.7.6/ 9.03.2022
2
+ * Workaround for artikelstamm V5. Strip IKSCAT from A+ to A to be compatible with XSD
3
+ * Fix spec tests
4
+
5
+ === 2.7.5 / 1.02.2022
6
+ * Specify old versions of savon and rdoc to avoid importing psych
7
+ * Added ruby 3.1 to tested ruby versions
8
+ * Removed ruby 2.5 from supported versions
9
+ * Force psych to < 4.0 to avoid the error Psych::DisallowedClass: Tried to load unspecified class: Struct::GalenicGroup
10
+ * Therefor rdoc < 6.4
11
+
12
+ === 2.7.4 / 30.03.2021
13
+ * Update needed Ruby-Version to 2.5.0 in gemspec
14
+ * Ensure downloads directory is created at first run
15
+
1
16
  === 2.7.3 / 29.03.2021
2
17
  * Do not delete swissmedic_package.xlsx and swissmedic_orphan.xlsx
3
18
  * Save swissmedic_package.xlsx and swissmedic_orphan.xlsx under downloads
data/LICENSE CHANGED
File without changes
data/Manifest.txt CHANGED
File without changes
data/QA.md CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/artikelstamm.md CHANGED
File without changes
File without changes
data/data/gal_forms.yaml CHANGED
File without changes
data/data/gal_groups.yaml CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1568,7 +1568,7 @@ module Oddb2xml
1568
1568
  xml.DOSAGE_FORMF info.galenic_form.descriptions["fr"] if info.galenic_form.descriptions["fr"]
1569
1569
  end
1570
1570
  xml.SL_ENTRY "true" if sl_gtins.index(pkg_gtin)
1571
- xml.IKSCAT package[:swissmedic_category] if package[:swissmedic_category] && package[:swissmedic_category].length > 0
1571
+ xml.IKSCAT package[:swissmedic_category][0] if package[:swissmedic_category] && package[:swissmedic_category].length > 0
1572
1572
  xml.GENERIC_TYPE sequence[:org_gen_code] if sequence[:org_gen_code] && !sequence[:org_gen_code].empty?
1573
1573
  xml.LPPV "true" if @lppvs[pkg_gtin.to_s] # detect_nincd
1574
1574
  if item && item[:deductible]
File without changes
data/lib/oddb2xml/cli.rb CHANGED
File without changes
File without changes
@@ -213,7 +213,6 @@ class CompositionParser < Parslet::Parser
213
213
  str("et ") |
214
214
  str("excipiens") |
215
215
  str("partes") |
216
- str("pro capsula") |
217
216
  str("pro dosi") |
218
217
  str("pro vitroe") |
219
218
  str("q.s. ad ") |
@@ -259,6 +258,9 @@ class CompositionParser < Parslet::Parser
259
258
 
260
259
  rule(:pro_identifiers) {
261
260
  str("ut aqua ad iniectabilia q.s. ad emulsionem pro ") |
261
+ str("aqua ").maybe >> str("ad iniectabile q.s. ad suspensionem pro ") |
262
+ str("aqua ").maybe >> str("ad iniectabile q.s. ad solutionem pro ") |
263
+ str("aqua ").maybe >> str("ad iniectabile ad solutionem pro ") |
262
264
  str("aqua ").maybe >> str("ad iniectabilia q.s. ad solutionem pro ") |
263
265
  str("aqua ").maybe >> str("ad solutionem pro ") |
264
266
  str("aqua ").maybe >> str("q.s. ad emulsionem pro ") |
@@ -270,6 +272,7 @@ class CompositionParser < Parslet::Parser
270
272
  str("excipiens ad pulverem pro ") |
271
273
  str("excipiens ad solutionem pro ") |
272
274
  str("pro vase ") |
275
+ str("pro capsula ") |
273
276
  str("q.s. ad pulverem pro ")
274
277
  }
275
278
  rule(:excipiens_dose) {
File without changes
@@ -16,6 +16,7 @@ module Oddb2xml
16
16
  @file2save = File.join(DOWNLOADS, File.basename(file))
17
17
  report_download(@url, @file2save)
18
18
  data = nil
19
+ FileUtils.makedirs(File.dirname(file), verbose: true)
19
20
  if Oddb2xml.skip_download(file)
20
21
  io = File.open(file, option)
21
22
  data = io.read
@@ -23,6 +24,7 @@ module Oddb2xml
23
24
  begin
24
25
  io = File.open(file, option)
25
26
  data = Oddb2xml.uri_open(@url).read
27
+ io.sync = true
26
28
  io.write(data)
27
29
  rescue => error
28
30
  puts "error #{error} while fetching #{@url}"
@@ -241,7 +243,7 @@ module Oddb2xml
241
243
  class RefdataDownloader < Downloader
242
244
  def initialize(options = {}, type = :pharma)
243
245
  @type = (type == :pharma ? "Pharma" : "NonPharma")
244
- url = "http://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
246
+ url = "https://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
245
247
  super(options, url)
246
248
  end
247
249
 
File without changes
File without changes
@@ -6,7 +6,7 @@
6
6
 
7
7
  require "parslet"
8
8
  require "parslet/convenience"
9
- require "oddb2xml/compositions_syntax"
9
+ require_relative "compositions_syntax"
10
10
  VERBOSE_MESSAGES ||= false
11
11
 
12
12
  module ParseUtil
@@ -101,6 +101,7 @@ module ParseUtil
101
101
  rescue => error
102
102
  puts "error #{error}"
103
103
  # binding.pry
104
+ raise error
104
105
  end
105
106
  end
106
107
 
@@ -373,6 +374,7 @@ class ParseComposition
373
374
  ERRORS_TO_FIX = {
374
375
  /(\d+)\s+-\s*(\d+)/ => '\1-\2',
375
376
  "o.1" => "0.1",
377
+ /polymerisat(i|um) \d:\d/ => "polymerisatum",
376
378
  /\s+(mg|g) DER:/ => ' \1, DER:',
377
379
  " mind. " => " min. ",
378
380
  " streptococci pyogen. " => " streptococci pyogen ",
@@ -384,7 +386,7 @@ class ParseComposition
384
386
  / U\.: (excipiens) / => ' U. \1 ',
385
387
  / U\.: (alnus|betula|betula|betulae) / => ' U., \1 ',
386
388
  /^(acari allergeni extractum (\(acarus siro\)|).+\s+U\.:)/ => 'A): \1',
387
- "Solvens: alprostadilum" => "alprostadilum"
389
+ "Solvens: alprostadilum" => "alprostadilum",
388
390
  }
389
391
  @@error_handler = ParseUtil::HandleSwissmedicErrors.new(ERRORS_TO_FIX)
390
392
 
data/lib/oddb2xml/util.rb CHANGED
File without changes
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.7.3"
2
+ VERSION = "2.7.6"
3
3
  end
File without changes
data/lib/oddb2xml.rb CHANGED
File without changes
data/oddb2xml.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
- spec.required_ruby_version = ">= 2.2.0"
18
+ spec.required_ruby_version = ">= 2.5.0"
19
19
 
20
20
  # We fix the version of the spec to newer versions only in the third position
21
21
  # hoping that these version fix only security/severe bugs
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "minitar" # , '~> 0.5.2'
25
25
  spec.add_dependency "mechanize" # , '~> 2.5.1'
26
26
  spec.add_dependency "nokogiri", ">= 1.8.2"
27
- spec.add_dependency "savon" # , '~> 2.11.0'
27
+ spec.add_dependency "savon" , '~> 2.12.0'
28
28
  spec.add_dependency "spreadsheet" # , '~> 1.0.0'
29
29
  spec.add_dependency "rubyXL", "~> 3.4.0"
30
30
  spec.add_dependency "sax-machine" # , '~> 0.1.0'
@@ -44,8 +44,9 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency "rake"
45
45
  spec.add_development_dependency "rspec"
46
46
  spec.add_development_dependency "webmock"
47
- spec.add_development_dependency "rdoc"
47
+ spec.add_development_dependency "rdoc", "~> 6.3.3" # rdoc 6.4 depends on psych 4.0 which breaks savon!
48
48
  spec.add_development_dependency "vcr"
49
49
  spec.add_development_dependency "timecop"
50
50
  spec.add_development_dependency "flexmock"
51
+ spec.add_development_dependency "psych", "< 4.0.0"
51
52
  end
data/oddb2xml.xsd CHANGED
File without changes
data/oddb_calc.xsd CHANGED
File without changes
data/shell.nix ADDED
@@ -0,0 +1,17 @@
1
+ # See https://nixos.wiki/wiki/Packaging/Ruby
2
+ # A small helper script to get a development version for oddb2xml under NixOS
3
+ with import <nixpkgs> {};
4
+ stdenv.mkDerivation {
5
+ name = "env";
6
+ buildInputs = [
7
+ ruby_3_0.devEnv
8
+ git
9
+ python
10
+ libpcap
11
+ libxml2
12
+ libxslt
13
+ pkg-config
14
+ bundix
15
+ gnumake
16
+ ];
17
+ }
@@ -12,7 +12,7 @@ describe Oddb2xml::Builder do
12
12
  unless @inhalt.index(expected_value)
13
13
  puts expected_value
14
14
  end
15
- # binding.pry if defined?(Pry) && !@inhalt.index(expected_value)
15
+ # binding.irb unless @inhalt.index(expected_value)
16
16
  expect(@inhalt.index(expected_value)).not_to be nil
17
17
  end
18
18
 
@@ -475,7 +475,14 @@ Der behandelnde Arzt ist verpflichtet, die erforderlichen Daten laufend im vorge
475
475
  1\) Geburtsjahr, sowie Vortherapien für das OC
476
476
 
477
477
  2\) Datum Therapiestart, Dosierung, Dosisanpassungen, Datum Therapieende.
478
- </DSCR>)}
478
+ </DSCR>),
479
+ "No A+" => %(<PRODUCT>
480
+ <PRODNO>1336901</PRODNO>
481
+ <SALECD>A</SALECD>
482
+ <DSCR>Pethidin HCl Amino 100 mg/2 ml, Injektionslösung</DSCR>
483
+ <DSCRF/>
484
+ <ATC>N02AB02</ATC>
485
+ </PRODUCT>)}
479
486
 
480
487
  tests.each do |key, expected|
481
488
  it "should a valid entry for #{key}" do
@@ -492,7 +499,7 @@ Der behandelnde Arzt ist verpflichtet, die erforderlichen Daten laufend im vorge
492
499
  result = Oddb2xml::Chapter70xtractor.parse
493
500
  expect(result.class).to eq Array
494
501
  expect(result.first).to eq ["2069562", "70.01.10", "Urtinktur", "1--10 g/ml", "13.40", ""]
495
- expect(result.last).to eq ["6516727", "70.02", "Allergenorum extractum varium / Inj. Susp. \tFortsetzungsbehandlung", "1 Durchstfl 1.5 ml", "311.85", "L"]
502
+ expect(result.last).to eq ["6516727", "70.02", "Allergenorum extractum varium / Inj. Susp. \n\tFortsetzungsbehandlung", "1 Durchstfl 1.5 ml", "311.85", "L"]
496
503
  end
497
504
  end
498
505
  end
data/spec/builder_spec.rb CHANGED
@@ -458,7 +458,7 @@ NR_LIMITATIONS = 15
458
458
  NR_INTERACTIONS = 2
459
459
  NR_CODES = 5
460
460
  NR_PRODNO = 31
461
- NR_PACKAGES = 46
461
+ NR_PACKAGES = 47
462
462
  NR_PRODUCTS = 40
463
463
  REG_EXP_DESITIN = /1120000000LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk/
464
464
  describe Oddb2xml::Builder do
@@ -497,7 +497,7 @@ describe Oddb2xml::Builder do
497
497
 
498
498
  it "should have a correct NBR_RECORD in oddb_products.xml" do
499
499
  oddb_product_xml = oddb_article_xml.sub("oddb_article.xml", "oddb_product.xml")
500
- check_result(File.read(oddb_product_xml), 46)
500
+ check_result(File.read(oddb_product_xml), NR_PACKAGES)
501
501
  end
502
502
 
503
503
  it "oddb_article.xml should contain a SHA256" do
@@ -546,7 +546,8 @@ describe Oddb2xml::Builder do
546
546
  it "should flag fridge drugs correctly" do
547
547
  doc = REXML::Document.new IO.read(checkAndGetArticleXmlName)
548
548
  checkAndGetArticleWithGTIN(doc, Oddb2xml::FRIDGE_GTIN)
549
- expect(REXML::XPath.match(doc, "//COOL='1']").size).to eq 1
549
+ expect(REXML::XPath.match(doc, "//COOL=").size).to eq 1
550
+ expect(REXML::XPath.match(doc, "//COOL").first.text).to eq "1"
550
551
  end
551
552
 
552
553
  ean_with_drug_index = 7680555610041
data/spec/calc_spec.rb CHANGED
File without changes
File without changes
data/spec/cli_spec.rb CHANGED
File without changes
data/spec/compare_spec.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/data/atc.csv CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -256,6 +256,7 @@ describe Oddb2xml::SwissmedicDownloader do
256
256
  end
257
257
  VCR.eject_cassette
258
258
  VCR.insert_cassette("oddb2xml", tag: :swissmedic, exclusive: false)
259
+ FileUtils.rm_rf(Oddb2xml::DOWNLOADS, verbose: true)
259
260
  common_before
260
261
  @downloader = Oddb2xml::SwissmedicDownloader.new(:orphan)
261
262
  end
@@ -276,9 +277,12 @@ describe Oddb2xml::SwissmedicDownloader do
276
277
  expect { bin }.not_to raise_error
277
278
  expect(File.exist?("oddb_orphan.xls")).to eq(false)
278
279
  end
280
+ expect(File.dirname(bin)).to be == (Oddb2xml::DOWNLOADS)
281
+ expect(File.exist?(bin)).to eq(true)
279
282
  end
280
- it "should not save into the download directory" do
281
- expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "oddb_orphan.xls"))).to eq(false)
283
+ it "should save into the download directory" do
284
+ expect(File.exist?(bin)).to eq(true)
285
+ expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "swissmedic_orphan.xlsx"))).to eq(true)
282
286
  end
283
287
  end
284
288
  end
@@ -181,7 +181,7 @@ describe Oddb2xml::SwissmedicExtractor do
181
181
  @packs.find { |pack| pack[1][:ean13] == ean13.to_s }[1]
182
182
  end
183
183
  it "should have correct nr of packages" do
184
- expect(@packs.size).to eq(41)
184
+ expect(@packs.size).to eq(42)
185
185
  end
186
186
 
187
187
  it "should have serocytol" do
File without changes
@@ -19,7 +19,7 @@
19
19
  ]
20
20
  },
21
21
  "method": "get",
22
- "uri": "http://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
22
+ "uri": "https://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
23
23
  },
24
24
  "response": {
25
25
  "body": {
data/spec/galenic_spec.rb CHANGED
File without changes
data/spec/parslet_spec.rb CHANGED
@@ -1,8 +1,13 @@
1
- require "pp"
2
1
  VERBOSE_MESSAGES = false
3
- require "spec_helper"
4
- require "#{Dir.pwd}/lib/oddb2xml/parslet_compositions"
2
+ if File.exists?("#{Dir.pwd}/lib/oddb2xml/parslet_compositions.rb")
3
+ require_relative "../lib/oddb2xml/parslet_compositions"
4
+ else
5
+ puts :ParseFailed
6
+ require_relative "../src/plugin/parslet_compositions"
7
+ end
8
+
5
9
  require "parslet/rig/rspec"
10
+ require "socket"
6
11
 
7
12
  hostname = Socket.gethostbyname(Socket.gethostname).first
8
13
  RUN_ALL_COMPOSITION_TESTS = false # /travis|localhost/i.match(hostname) != nil # takes about five minutes to run!
@@ -15,7 +20,6 @@ describe ParseComposition do
15
20
  string = "conserv.: E 216, E 218, excipiens pro suppositorio."
16
21
  composition = ParseComposition.from_string(string)
17
22
  # active_agent = ["hynic-[d-phe(1)", "tyr(3)-octeotridum]trifluoroacetum", "acidum ethylendiamini-n,n'-diaceticum"]
18
-
19
23
  active_substance = "HYNIC-[D-Phe(1)"
20
24
  composition_text = "II) Durchstechflasche 2: acidum ethylendiamini-N,N'-diaceticum 10 mg, dinatrii phosphas dodecahydricus, natrii hydroxidum, pro vitro."
21
25
  composition = ParseUtil.parse_compositions(composition_text, active_substance).first
@@ -1290,6 +1294,63 @@ describe ParseComposition do
1290
1294
  specify { expect(substance.unit).to eq nil }
1291
1295
  end
1292
1296
 
1297
+ context "should handle 41174" do
1298
+ string = "triamcinoloni acetonidum 10 mg, carmellosum natricum, natrii chloridum, polysorbatum 80, conserv.: alcohol benzylicus 9.9 mg, aqua ad iniectabile q.s. ad suspensionem pro 1 ml."
1299
+ composition = ParseComposition.from_string(string)
1300
+ specify { expect(composition.source).to eq string }
1301
+ specify { expect(composition.label).to eq nil }
1302
+ specify { expect(composition.substances.size).to be > 1 }
1303
+ specify { expect(composition.substances.first.name).to eq "Triamcinoloni Acetonidum" }
1304
+ specify { expect(composition.substances.last.name).to eq "Alcohol Benzylicus" }
1305
+ end
1306
+
1307
+ context "should handle 67023" do
1308
+ string = "noradrenalinum 0.06 mg ut noradrenalini tartras, natrii chloridum, acidum hydrochloridum, aqua ad iniectabile q.s. ad solutionem pro 1 ml corresp. natrium 3.308 mg."
1309
+ composition = ParseComposition.from_string(string)
1310
+ specify { expect(composition.source).to eq string }
1311
+ specify { expect(composition.label).to eq nil }
1312
+ specify { expect(composition.substances.size).to be > 1 }
1313
+ specify { expect(composition.substances.first.name).to eq "Noradrenalinum" }
1314
+ specify { expect(composition.substances.last.name).to eq "Acidum Hydrochloridum" }
1315
+ end
1316
+
1317
+ context "should handle 67023" do
1318
+ string = "noradrenalinum 0.06 mg ut noradrenalini tartras, natrii chloridum, acidum hydrochloridum, aqua ad iniectabile q.s. ad solutionem pro 1 ml corresp. natrium 3.308 mg."
1319
+ composition = ParseComposition.from_string(string)
1320
+ specify { expect(composition.source).to eq string }
1321
+ specify { expect(composition.label).to eq nil }
1322
+ specify { expect(composition.substances.size).to be > 0 }
1323
+ specify { expect(composition.substances.first.name).to eq "Noradrenalinum" }
1324
+ specify { expect(composition.substances.last.name).to eq "Acidum Hydrochloridum" }
1325
+ end
1326
+
1327
+ context "should handle 67689" do
1328
+ string = "daratumumabum 1800 mg, hyaluronidasum humanum ADNr, histidinum, histidini hydrochloridum monohydricum, sorbitolum 735.1 mg, methioninum, polysorbatum 20, aqua ad iniectabile ad solutionem pro 15 ml"
1329
+ composition = ParseComposition.from_string(string)
1330
+ specify { expect(composition.source).to eq string }
1331
+ specify { expect(composition.label).to eq nil }
1332
+ specify { expect(composition.substances.size).to be > 0 }
1333
+ specify { expect(composition.substances.first.name).to eq "Daratumumabum" }
1334
+ specify { expect(composition.substances.last.name).to eq "Polysorbatum 20" }
1335
+ end
1336
+
1337
+ context "should handle 66097" do
1338
+ string = "acidum acetylsalicylicum 100 mg, cellulosum microcristallinum, maydis amylum, silica colloidalis anhydrica, acidum stearicum, Überzug: acidi methacrylici et ethylis acrylatis polymerisatum 1:1, polysorbatum 80, natrii laurilsulfas corresp. natrium 2 µg, triethylis citras, talcum pro compresso obducto" # fails
1339
+ composition = ParseComposition.from_string(string)
1340
+ specify { expect(composition.source).to eq string }
1341
+ specify { expect(composition.label).to eq nil }
1342
+ specify { expect(composition.substances.first.name).to eq "Acidum Acetylsalicylicum" }
1343
+ specify { expect(composition.substances.last.name).to eq "Talcum pro compresso Obducto" }
1344
+ end
1345
+ context "should handle 65828" do
1346
+ string = " esomeprazolum 20 mg ut esomeprazolum magnesicum dihydricum, acidi methacrylici et ethylis acrylatis polymerisati 1:1 dispersio 30 per centum, natrii laurilsulfas, talcum, triethylis citras, hypromellosum, sacchari sphaerae corresp. saccharum 4.73 mg et maydis amylum, magnesii stearas, hydroxypropylcellulosum, glyceroli monostearas 40-55, polysorbatum 80, cellulosum microcristallinum, povidonum K 29-32, macrogolum 6000, crospovidonum, natrii stearylis fumaras, Überzug: hypromellosum, E 171, macrogolum 400, E 172 (rubrum), E 172 (flavum), pro compresso obducto corresp. natrium 0.01 mg."
1347
+ composition = ParseComposition.from_string(string)
1348
+ specify { expect(composition.source).to eq string }
1349
+ specify { expect(composition.label).to eq nil }
1350
+ specify { expect(composition.substances.first.name).to eq "Esomeprazolum" }
1351
+ specify { expect(composition.substances.last.name).to eq "pro compresso Obducto" }
1352
+ end
1353
+
1293
1354
  context "should return correct composition for 'minoxidilum excipiens'" do
1294
1355
  string = "minoxidilum 2.5 mg, excipiens pro compresso."
1295
1356
  composition = ParseComposition.from_string(string)
data/spec/spec_helper.rb CHANGED
@@ -164,7 +164,6 @@ module ServerMockHelper
164
164
  def cleanup_directories_before_run
165
165
  dirs = [Oddb2xml::DOWNLOADS, Oddb2xml::WORK_DIR]
166
166
  dirs.each { |dir| FileUtils.rm_rf(Dir.glob(File.join(dir, "*")), verbose: false) }
167
- dirs.each { |dir| FileUtils.makedirs(dir, verbose: false) }
168
167
  cleanup_compressor
169
168
  mock_downloads
170
169
  end
data/tools/cacert.pem CHANGED
File without changes
data/tools/set.bat CHANGED
File without changes
File without changes
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.7.3
4
+ version: 2.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: savon
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 2.12.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 2.12.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: spreadsheet
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -336,16 +336,16 @@ dependencies:
336
336
  name: rdoc
337
337
  requirement: !ruby/object:Gem::Requirement
338
338
  requirements:
339
- - - ">="
339
+ - - "~>"
340
340
  - !ruby/object:Gem::Version
341
- version: '0'
341
+ version: 6.3.3
342
342
  type: :development
343
343
  prerelease: false
344
344
  version_requirements: !ruby/object:Gem::Requirement
345
345
  requirements:
346
- - - ">="
346
+ - - "~>"
347
347
  - !ruby/object:Gem::Version
348
- version: '0'
348
+ version: 6.3.3
349
349
  - !ruby/object:Gem::Dependency
350
350
  name: vcr
351
351
  requirement: !ruby/object:Gem::Requirement
@@ -388,6 +388,20 @@ dependencies:
388
388
  - - ">="
389
389
  - !ruby/object:Gem::Version
390
390
  version: '0'
391
+ - !ruby/object:Gem::Dependency
392
+ name: psych
393
+ requirement: !ruby/object:Gem::Requirement
394
+ requirements:
395
+ - - "<"
396
+ - !ruby/object:Gem::Version
397
+ version: 4.0.0
398
+ type: :development
399
+ prerelease: false
400
+ version_requirements: !ruby/object:Gem::Requirement
401
+ requirements:
402
+ - - "<"
403
+ - !ruby/object:Gem::Version
404
+ version: 4.0.0
391
405
  description: oddb2xml creates xml files using swissINDEX, BAG-XML and Swissmedic.
392
406
  email: yasaka@ywesee.com, zdavatz@ywesee.com, ngiger@ywesee.com
393
407
  executables:
@@ -439,6 +453,7 @@ files:
439
453
  - oddb2xml.gemspec
440
454
  - oddb2xml.xsd
441
455
  - oddb_calc.xsd
456
+ - shell.nix
442
457
  - spec/artikelstamm_spec.rb
443
458
  - spec/builder_spec.rb
444
459
  - spec/calc_spec.rb
@@ -514,7 +529,7 @@ homepage: https://github.com/zdavatz/oddb2xml
514
529
  licenses:
515
530
  - GPL-3.0
516
531
  metadata: {}
517
- post_install_message:
532
+ post_install_message:
518
533
  rdoc_options: []
519
534
  require_paths:
520
535
  - lib
@@ -522,16 +537,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
522
537
  requirements:
523
538
  - - ">="
524
539
  - !ruby/object:Gem::Version
525
- version: 2.2.0
540
+ version: 2.5.0
526
541
  required_rubygems_version: !ruby/object:Gem::Requirement
527
542
  requirements:
528
543
  - - ">="
529
544
  - !ruby/object:Gem::Version
530
545
  version: '0'
531
546
  requirements: []
532
- rubyforge_project:
533
- rubygems_version: 2.7.6.2
534
- signing_key:
547
+ rubygems_version: 3.2.16
548
+ signing_key:
535
549
  specification_version: 4
536
550
  summary: oddb2xml creates xml files.
537
551
  test_files: