oddb2xml 2.7.4 → 2.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) 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/History.txt +14 -0
  8. data/LICENSE +0 -0
  9. data/Manifest.txt +0 -0
  10. data/QA.md +0 -0
  11. data/README.md +0 -0
  12. data/Rakefile +0 -0
  13. data/artikelstamm.md +0 -0
  14. data/data/article_overrides.yaml +0 -0
  15. data/data/gal_forms.yaml +0 -0
  16. data/data/gal_groups.yaml +0 -0
  17. data/data/gtin2ignore.yaml +0 -0
  18. data/data/product_overrides.yaml +0 -0
  19. data/dokumentation_calc.textile +0 -0
  20. data/lib/oddb2xml/builder.rb +2 -2
  21. data/lib/oddb2xml/chapter_70_hack.rb +0 -0
  22. data/lib/oddb2xml/cli.rb +0 -0
  23. data/lib/oddb2xml/compare.rb +0 -0
  24. data/lib/oddb2xml/compositions_syntax.rb +4 -1
  25. data/lib/oddb2xml/compressor.rb +0 -0
  26. data/lib/oddb2xml/downloader.rb +1 -1
  27. data/lib/oddb2xml/options.rb +0 -0
  28. data/lib/oddb2xml/parslet_compositions.rb +4 -2
  29. data/lib/oddb2xml/util.rb +0 -0
  30. data/lib/oddb2xml/version.rb +1 -1
  31. data/lib/oddb2xml/xml_definitions.rb +0 -0
  32. data/lib/oddb2xml.rb +0 -0
  33. data/oddb2xml.gemspec +3 -2
  34. data/oddb_calc.xsd +0 -0
  35. data/shell.nix +17 -0
  36. data/spec/artikelstamm_spec.rb +10 -3
  37. data/spec/builder_spec.rb +4 -3
  38. data/spec/calc_spec.rb +0 -0
  39. data/spec/check_artikelstamm_spec.rb +0 -0
  40. data/spec/cli_spec.rb +0 -0
  41. data/spec/compare_spec.rb +0 -0
  42. data/spec/composition_syntax_spec.rb +0 -0
  43. data/spec/compressor_spec.rb +0 -0
  44. data/spec/data/AipsDownload.zip +0 -0
  45. data/spec/data/Elexis_Artikelstamm_v5.xsd +0 -0
  46. data/spec/data/GL_Diff_SB.xml +0 -0
  47. data/spec/data/ItCodes.xml +0 -0
  48. data/spec/data/PR121001.txt +0 -0
  49. data/spec/data/PR121002.txt +0 -0
  50. data/spec/data/Preparations.xml +0 -0
  51. data/spec/data/Publications.xls +0 -0
  52. data/spec/data/artikelstamm_N_010917.xml +0 -0
  53. data/spec/data/artikelstamm_N_011217.xml +0 -0
  54. data/spec/data/artikelstamm_P_010917.xml +0 -0
  55. data/spec/data/artikelstamm_P_011217.xml +0 -0
  56. data/spec/data/atc.csv +0 -0
  57. data/spec/data/check_artikelstamm/artikelstamm_v5_gtin_non_numeric.xml +0 -0
  58. data/spec/data/check_artikelstamm/artikelstamm_v5_gtin_not_uniq.xml +0 -0
  59. data/spec/data/check_artikelstamm/artikelstamm_v5_limitation_exists.xml +0 -0
  60. data/spec/data/check_artikelstamm/artikelstamm_v5_okay.xml +0 -0
  61. data/spec/data/check_artikelstamm/artikelstamm_v5_pharma_has_product.xml +0 -0
  62. data/spec/data/check_artikelstamm/artikelstamm_v5_prodno_not_uniq.xml +0 -0
  63. data/spec/data/check_artikelstamm/artikelstamm_v5_product_needs_article.xml +0 -0
  64. data/spec/data/column_c.txt +0 -0
  65. data/spec/data/compositions.txt +0 -0
  66. data/spec/data/compressor/oddb2xml_files_bm_update.txt +0 -0
  67. data/spec/data/compressor/oddb2xml_files_lppv.txt +0 -0
  68. data/spec/data/compressor/oddb2xml_files_nonpharma.xls +0 -0
  69. data/spec/data/epha_interactions.csv +0 -0
  70. data/spec/data/listen_neu.html +0 -0
  71. data/spec/data/medregbm_betrieb.txt +0 -0
  72. data/spec/data/medregbm_person.txt +0 -0
  73. data/spec/data/oddb2xml_files_bm_update.txt +0 -0
  74. data/spec/data/oddb2xml_files_lppv.txt +0 -0
  75. data/spec/data/oddb2xml_files_nonpharma.xls +0 -0
  76. data/spec/data/problems.txt +0 -0
  77. data/spec/data/refdata_NonPharma.xml +0 -0
  78. data/spec/data/refdata_Pharma.xml +0 -0
  79. data/spec/data/swissmedic_fridges.html +0 -0
  80. data/spec/data/swissmedic_info.html +0 -0
  81. data/spec/data/swissmedic_info_2.html +0 -0
  82. data/spec/data/swissmedic_orphan.xlsx +0 -0
  83. data/spec/data/swissmedic_orphans.html +0 -0
  84. data/spec/data/swissmedic_package.xlsx +0 -0
  85. data/spec/data/swissmedic_packages.html +0 -0
  86. data/spec/data/transfer.dat +0 -0
  87. data/spec/data/v5_first.xml +0 -0
  88. data/spec/data/v5_second.xml +0 -0
  89. data/spec/data/varia_De.htm +0 -0
  90. data/spec/data/vcr/transfer.dat +0 -0
  91. data/spec/data/vcr/transfer.zip +0 -0
  92. data/spec/data/wsdl_nonpharma.xml +0 -0
  93. data/spec/data/wsdl_pharma.xml +0 -0
  94. data/spec/extractor_spec.rb +1 -1
  95. data/spec/fixtures/vcr_cassettes/artikelstamm.json +0 -0
  96. data/spec/fixtures/vcr_cassettes/oddb2xml.json +1 -1
  97. data/spec/galenic_spec.rb +0 -0
  98. data/spec/parslet_spec.rb +65 -4
  99. data/tools/cacert.pem +0 -0
  100. data/tools/set.bat +0 -0
  101. data/tools/win_fetch_cacerts.rb +0 -0
  102. metadata +29 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af1cbeb37bf057e98955776c87dd5092fc5706af18d00ba818efccd2c52a076e
4
- data.tar.gz: 1f4faf8f73b2cffa14bd3dda23dad4e401b524587c0f95d80e0cc9cbd4ba5d2b
3
+ metadata.gz: 8d94c5e970a0c4917bfd547d1c71b6c889cd9ec4420e2d986eb53023bbdd2d94
4
+ data.tar.gz: 2a242506a97171bbb882f5daa9e634ff1485e32bed2116d4e2dd3ffb1d948850
5
5
  SHA512:
6
- metadata.gz: ace048c855b3711fd6b75692373318fe992a5c6529d322c13b516a7bd09390e36efec3f14edaa91ddeb223438d74c97c15ba4691077e9c77ce5063a10bdcc423
7
- data.tar.gz: 9dcf787039edc02a56b7301f6849e76259628ac55da598a2878e4a08c63fd3c3aaef35bfea6bda8184c6e3552314fba7bb028962d81151ca98bf76f830c3303f
6
+ metadata.gz: d3816794c1f84e301d091ddf35bbea6246da42bbb8fdce8bb9b9444b9cc8280e51f712ff3bc5b6b3166d2e78f942441e7600c9e86030034e93fe89bf5b5b0b91
7
+ data.tar.gz: 5518a263cd2e9813b7625f2aab9e32ce455ec4ece55dc84bf8bb862f62f8a61b027ae9eb5396c92ef2a35de3acfa9e4024f6ead2a581c6c009a4cc559da75d16
@@ -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
data/History.txt CHANGED
@@ -1,3 +1,17 @@
1
+ === 2.7.7/ 12.08.2022
2
+ * Workaround for artikelstamm V3. Strip IKSCAT from A+ to A to be compatible with XSD
3
+
4
+ === 2.7.6/ 9.03.2022
5
+ * Workaround for artikelstamm V5. Strip IKSCAT from A+ to A to be compatible with XSD
6
+ * Fix spec tests
7
+
8
+ === 2.7.5 / 1.02.2022
9
+ * Specify old versions of savon and rdoc to avoid importing psych
10
+ * Added ruby 3.1 to tested ruby versions
11
+ * Removed ruby 2.5 from supported versions
12
+ * Force psych to < 4.0 to avoid the error Psych::DisallowedClass: Tried to load unspecified class: Struct::GalenicGroup
13
+ * Therefor rdoc < 6.4
14
+
1
15
  === 2.7.4 / 30.03.2021
2
16
  * Update needed Ruby-Version to 2.5.0 in gemspec
3
17
  * Ensure downloads directory is created at first run
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
@@ -910,7 +910,7 @@ module Oddb2xml
910
910
  # xml.CDS01
911
911
  # xml.CDS02
912
912
  if ppac
913
- xml.SMCAT ppac[:swissmedic_category] unless ppac[:swissmedic_category].empty?
913
+ xml.SMCAT ppac[:swissmedic_category][0] unless ppac[:swissmedic_category].empty?
914
914
  xml.GEN_PRODUCTION ppac[:gen_production] unless ppac[:gen_production].empty?
915
915
  xml.INSULIN_CATEGORY ppac[:insulin_category] unless ppac[:insulin_category].empty?
916
916
  xml.DRUG_INDEX ppac[:drug_index] unless ppac[:drug_index].empty?
@@ -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
@@ -243,7 +243,7 @@ module Oddb2xml
243
243
  class RefdataDownloader < Downloader
244
244
  def initialize(options = {}, type = :pharma)
245
245
  @type = (type == :pharma ? "Pharma" : "NonPharma")
246
- url = "http://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
246
+ url = "https://refdatabase.refdata.ch/Service/Article.asmx?WSDL"
247
247
  super(options, url)
248
248
  end
249
249
 
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.4"
2
+ VERSION = "2.7.7"
3
3
  end
File without changes
data/lib/oddb2xml.rb CHANGED
File without changes
data/oddb2xml.gemspec CHANGED
@@ -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/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
@@ -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/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.4
4
+ version: 2.7.7
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-30 00:00:00.000000000 Z
11
+ date: 1980-01-01 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
@@ -529,9 +544,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
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.26
548
+ signing_key:
535
549
  specification_version: 4
536
550
  summary: oddb2xml creates xml files.
537
551
  test_files: