Code Monkey home page Code Monkey logo

oddb2xml's Introduction

oddb2xml

Build Status

  • oddb2xml -a nonpharma -o fi

creates the following xml files:

  • oddb_substance.xml
  • oddb_limitation.xml
  • oddb_interaction.xml
  • oddb_code.xml
  • oddb_product.xml
  • oddb_article.xml
  • oddb_fi.xml
  • oddb_fi_product.xml

and

  • oddb2xml -f dat
  • oddb2xml -f dat -a nonpharma

creates .dat files according to (IGM-11). IGM-11 describes the structure of the zurrose_transfer.dat.

  • oddb.dat
  • oddb_with_migel.dat

the files are using swissINDEX, BAG-XML and Swissmedic as sources.

The following additional data is in the files:

The top elements of all XML files have a SHA256 attribute over their content. The content corresponds to Nokogiris text method of the node which is essentially join by "\n" + some whitespaces of each element. Consumers of the data file may use it to check whether they have to replace the corresponding nodes.

Generating files for Elexis Artikelstamm is discussed in the Readme for the Artikelstamm

usage

HIN (http://hin.ch) creates daily the actual file. They can be downloaded from https://download.hin.ch/download/oddb2xml, e.g. using wget https://download.hin.ch/download/oddb2xml/oddb_article.xml

see --help.

    /opt/src/oddb2xml_v5/bin/oddb2xml version 2.4.3
    Usage:
    oddb2xml [option]
      produced files are found under data
    -a, --append              Additional target nonpharma
    -r, --artikelstamm        Create Artikelstamm Version 3 and 5 for Elexis >= 3.1
    -c, --compress-ext=<s>    format F. {tar.gz|zip}
    -e, --extended            pharma, non-pharma plus prices and non-pharma from zurrose.
                                                          Products without EAN-Code will also be listed.
                                                          File oddb_calc.xml will also be generated
    -f, --format=<s>          File format F, default is xml. {xml|dat}
                                                          If F is given, -o option is ignored. (Default: xml)
    -i, --include             Include target option for ean14  for 'dat' format.
                                                          'xml' format includes always ean14 records.
    -I, --increment=<i>       Increment price by x percent. Forces -f dat -p zurrose.
                                                          create additional field price_resellerpub as
                                                          price_extfactory incremented by x percent (rounded to the next 0.05 francs)
                                                          in oddb_article.xml. In generated zurrose_transfer.dat PRPU is set to this price
                                                          Forces -f dat -p zurrose.
    -o, --fi                  Optional fachinfo output.
    -p, --price               Price source (transfer.dat) from ZurRose
    -t, --tag-suffix=<s>      XML tag suffix S. Default is none. [A-z0-9]
                                                          If S is given, it is also used as prefix of filename.
    -x, --context=<s>         {product|address}. product is default. (Default: product)
    -l, --calc                create only oddb_calc.xml with GTIN, name and galenic information
    -s, --skip-download       skips downloading files it the file is already under downloads.
                                                          Downloaded files are saved under downloads
    --log                     log important actions
    -u, --use-ra11zip=<s>     Use the ra11.zip (a zipped transfer.dat from Galexis)
    -v, --version             Print version and exit
    -h, --help                Show this message

Option examples

$ oddb2xml -t md                        # => md_article.xml, md_product.xml, md_substance.xml
$ oddb2xml -a nonpharma -t md -c tar.gz # => md_xml_dd.mm.yyyy_hh.mm.tar.gz
$ oddb2xml -f dat                       # => oddb.dat
$ oddb2xml -f dat -a nonpharma          # => oddb_with_migel.dat
$ oddb2xml -e                           # => oddb_article.xml

output.

$ oddb2xml
DE
        Pharma products: 14801
FR
        Pharma products: 14801

Supported ruby version

We run tests on travis-ci.org for the Ruby versions mentioned in the .travis.yml file. You will need ruby > 2.5 to work correctly. Look at the github actions to see the spec test results. We ignore errors against ruby head, as it is sometimes unstable.

XSD files

The file oddb2xml.xsd was manually created by merging the output of the xmlbeans tools inst2xsd and trang

Running rake spec will validated the XML-files generated during the tests using the Nokogiri validator. We have two XSD files. One for oddb_calc.xml and one for the rest.

Manually you can also validate (assuming that you have installed the xmlbeans tools) all generated XML-files using

  • xsdvalidate oddb_calc.xsd oddb_article.xml oddb_calc.xml
  • xsdvalidate oddb2xml.xsd oddb_article.xml oddb_code.xml oddb_interaction.xml oddb_product.xml oddb_substance.xml

XML files

xml files generated are:

  • oddb_substance.xml
  • oddb_limitation.xml
  • oddb_interaction.xml
  • oddb_code.xml
  • oddb_product.xml
  • oddb_article.xml
  • oddb_fi.xml
  • oddb_fi_product.xml

article.xml

oddb2xml creates article.xml as oddb_article.xml by default.

<?xml version="1.0" encoding="utf-8"?>
<ARTICLE xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2015-09-09T09:50:28+0000" PROD_DATE="2015-09-09T09:50:28+0000" VALID_DATE="2015-09-09T09:50:28+0000">
  <ART DT="2015-09-09 00:00:00 +0000" SHA256="896dd24bfb4cfd56dcfd3709150da9b652626a430adefbe57cb405a9d46684c6">
    <REF_DATA>1</REF_DATA>
    <PHAR>2731179</PHAR>
    <SMCAT>D</SMCAT>
    <SMNO>16105058</SMNO>
    <PRODNO>161051</PRODNO>
    <VAT>2</VAT>
    <SALECD>A</SALECD>
    <CDBG>N</CDBG>
    <BG>N</BG>
    <DSCRD>HIRUDOID Creme 3 mg/g 40 g</DSCRD>
    <DSCRF>HIRUDOID crème 3 mg/g 40 g</DSCRF>
    <SORTD>HIRUDOID CREME 3 MG/G 40 G</SORTD>
    <SORTF>HIRUDOID CRèME 3 MG/G 40 G</SORTF>
    <SYN1D>Hirudoid</SYN1D>
    <SYN1F>Hirudoid</SYN1F>
    <SLOPLUS>2</SLOPLUS>
    <ARTCOMP>
      <COMPNO>7601001002258</COMPNO>
    </ARTCOMP>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BC>7680161050583</BC>
      <BCSTAT>A</BCSTAT>
    </ARTBAR>
    <ARTPRI>
      <PTYP>PEXF</PTYP>
      <PRICE>4.768575</PRICE>
    </ARTPRI>
    <ARTPRI>
      <PTYP>PPUB</PTYP>
      <PRICE>8.8</PRICE>
    </ARTPRI>
    <ARTPRI>
      <PTYP>ZURROSE</PTYP>
      <PRICE>4.77</PRICE>
    </ARTPRI>
    <ARTPRI>
      <PTYP>ZURROSEPUB</PTYP>
      <PRICE>8.80</PRICE>
    </ARTPRI>
    <ARTINS>
      <NINCD>10</NINCD>
    </ARTINS>
  </ART>
  ...
  <RESULT>
    <OK_ERROR>OK</OK_ERROR>
    <NBR_RECORD>14801</NBR_RECORD>
    <ERROR_CODE/>
    <MESSAGE/>
  </RESULT>
</ARTICLE>

product.xml

For example, if -t _swiss is given then oddb2xml creates product.xml as swiss_product.xml.

<?xml version="1.0" encoding="utf-8"?>
<PRODUCT_SWISS xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2012-11-21T13:01:29.5903756+0900" PROD_DATE="2012-11-21T13:01:29.5903756+0900" VALID_DATE="2012-11-21T13:01:29.5903756+0900">
  <PRD_SWISS DT="" SHA256="aa82eee2d542787cf2cb8b7f17d748223ec723b935ce20cd29d89e284d16fea1">
    <GTIN>7680353660163</GTIN>
    <PRODNO>353661</PRODNO>
    <DSCRD>KENDURAL Depottabl 30 Stk</DSCRD>
    <DSCRF>KENDURAL cpr dépot 30 pce</DSCRF>
    <ATC>B03AE10</ATC>
    <IT>06.07.1.</IT>
    <CPT>
      <CPTCMP>
        <LINE>0</LINE>
        <SUBNO>5</SUBNO>
        <QTY>105</QTY>
        <QTYU>mg</QTYU>
      </CPTCMP>
      <CPTCMP>
        <LINE>1</LINE>
        <SUBNO>1</SUBNO>
        <QTY>500</QTY>
        <QTYU>mg</QTYU>
      </CPTCMP>
    </CPT>
    <PackGrSwissmedic>30</PackGrSwissmedic>
    <EinheitSwissmedic>Tablette(n)</EinheitSwissmedic>
    <SubstanceSwissmedic>ferrum(II), acidum ascorbicum</SubstanceSwissmedic>
    <CompositionSwissmedic>ferrum(II) 105 mg ut ferrosi sulfas dessiccatus, acidum ascorbicum 500 mg ut natrii ascorbas, color.: E 124, excipiens pro compresso obducto.</CompositionSwissmedic>
  </PRD>
  ...
  <RESULT_SWISS>
    <OK_ERROR_SWISS>OK</OK_ERROR_SWISS>
    <NBR_RECORD_SWISS>14336</NBR_RECORD_SWISS>
    <ERROR_CODE_SWISS/>
    <MESSAGE_SWISS/>
  </RESULT_SWISS>
</PRODUCT_SWISS>

substance.xml

product.xml has relation to substance as <SUBNO>.

<?xml version="1.0" encoding="utf-8"?>
<SUBSTANCE xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2012-12-11T14:27:17.4444763+0900" PROD_DATE="2012-12-11T14:27:17.4444763+0900" VALID_DATE="2012-12-11T14:27:17.4444763+0900">
  <SB DT="" SHA256="a510f9b1e7216cda2d5e0c3b82bacef96da963e14f36c97e0e1a8baf55d00287">
    <SUBNO>1</SUBNO>
    <NAML>Acidum ascorbicum (Vitamin C, E300)</NAML>
  </SB>
  <SB DT="" SHA256="de64fcc718b7f30bfe4283fb40c8b558cf2f30a8acc4a7bf6a643e82dfe82931">
    <SUBNO>2</SUBNO>
    <NAML>Alprostadilum</NAML>
  </SB>
  ...
  <RESULT>
    <OK_ERROR>OK</OK_ERROR>
    <NBR_RECORD>1441</NBR_RECORD>
    <ERROR_CODE/>
    <MESSAGE/>
  </RESULT>
</SUBSTANCE>

Data sources

We use the following files:

Rules for matching GTIN (aka EAN13), product number and IKSNR

For drugs which appear in Packungen.xlsx file published by Swissmedic the following rule is used to create the GTIN

  • First 4 digits identify SwissMedic and are fixed to 7680
  • next 5 digits corresponding to IKSNR (authorization) number
  • next 3 digits corresponding to Packungscode
  • last digit is checksum

The product number is calculated as

  • 5 digits corresponding to IKSNR (authorization) number
  • 2 digits corresponding to Dosisstärke (aka sequence number)

In oddb_article.xml you find

  • GTIN is found as "BC" inside "ARTBAR"
  • The product number as field PRODNO

Example given. For the IKSNR 48305 sequence number 1 named "Felden, Gel" with Packungscode "024" we get GTIN 7680483050247 and a product number 483051.

SSLv3 cert for Windows Users

Some websites need SSLv3 connection. If you don't have these root CA files (x509), Please install these Certificates before running.
see cURL Website

You can confirm wit ruby -ropenssl -e 'p OpenSSL::X509::DEFAULT_CERT_FILE'.

Windows User: Making your SSL Certificate permanent via your PATH

  1. Download this cacert.pem (cURL) into your HOME directory.
  • or directly select cacert.pem from your oddb2xml-x.x.x gems directory.
  • tools/cacert.pem is bundled with the oddb2xml gem.
  1. Then Choose Menu "Control Panel" > "System" > "Advanced system settings"
  • This opens the "System Properties" Window.
  1. Click "Advanced" Tab.
  2. Click "Environment Variables" button.
  3. Add set variable entry "SSL_CERT_FILE=%HOMEPATH%\cacert.pem"
  • Variable name: SSL_CERT_FILE
  • Variable value: %HOMEPATH%\cacert.pem
  • with "New..." button into upper are "User variables for xxx"
  1. Do not remove this cacert.pem. All SSLv3 connections use this file.

win_fetch_cacerts.rb

You can also run

  • tools/win_fetch_cacerts.rb

for your currently open Terminal to download and set the Certificate.

Testing

  • Calling rake spec runs spec tests.
  • Calling rake test installs the gems and runs oddb2xml with the most commonly used combinations. All output is placed under under ausgabe/. These files should be manually compared to the ones generated by the last release to check for possible problems.
  • we use the gem VCR to record real HTTP responses. ** Removing the directory fixtures and running @bundle exec rspec spec/downloader_spec.rb@ gets the actual content from the different servers ** To minimize the downloaded size we use several @before_record@ hooks to select the desired content, eg. only the 5 items from EPha.

oddb2xml's People

Contributors

b123400 avatar dependabot[bot] avatar lgtm-migrator avatar ngiger avatar zdavatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

oddb2xml's Issues

Error in fetching

Error using oddb2xml 1.6.6 on Debian 7

/var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:304:in `fetch': 404 => Net::HTTPNotFound for https://www.swissmedic.ch/daten/00081/index.html?lang=de -- unhandled response (Mechanize::ResponseCodeError)
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:949:in `response_redirect'
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:299:in `fetch'
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize.rb:407:in `get'
    from /var/lib/gems/1.9.1/gems/oddb2xml-1.6.6/lib/oddb2xml/downloader.rb:247:in `download'
    from /var/lib/gems/1.9.1/gems/oddb2xml-1.6.6/lib/oddb2xml/cli.rb:179:in `block in download'
/var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:304:in `fetch': 404 => Net::HTTPNotFound for https://www.swissmedic.ch/daten/00080/00251/index.html?lang=de -- unhandled response (Mechanize::ResponseCodeError)
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:949:in `response_redirect'
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:299:in `fetch'
    from /var/lib/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize.rb:407:in `get'
    from /var/lib/gems/1.9.1/gems/oddb2xml-1.6.6/lib/oddb2xml/downloader.rb:247:in `download'
    from /var/lib/gems/1.9.1/gems/oddb2xml-1.6.6/lib/oddb2xml/cli.rb:204:in `block in download'

Präparat NaCl Bichsel mit "(alt)" Vermerk in ODDB, obwohl auf SL

In der SL ist das Präparat mit GTIN 7612929030193 mit dem IT-Code 05.03.20. zu finden. In der oddb_article.xml findet man das Präparat auch, jedoch mit dem Namen NACL Bichsel Inf Lös 0.9 % 500ml PPF m Be (alt).

Warum ist das genau "alt"? Ich sehe in der oddb_article.xml nur vergleichbar das 7612929501655 (NACL Bichsel Inf Lös 0.9 % 500ml PPF), welches jedoch nicht in der SL ist.

Wie kann man genau nachvollziehen, welches Präparat von welchem abgelöst wurde?

Vielen Dank & Gruss
luetm

Warum ist bei "FLUARIX TETRA m sep Nad 2018/2019 0.5 ml" das SaleCD inaktiv?

Das Produkt ist bei Refdata vorhanden.

<ART DT="2018-09-14 00:00:00 +0200" SHA256="dce62560098a571ab10d28085b1ea3dbe3b433ae465c3f98cf5157cc2beef077">
   <REF_DATA>1</REF_DATA>
   <PHAR>7305932</PHAR>
   <SMCAT>B</SMCAT>
   <SMNO>62961019</SMNO>
   <PRODNO>6296105</PRODNO>
   <SALECD>I</SALECD>
   <CDBG>N</CDBG>
   <BG>N</BG>
   <DSCRD>FLUARIX TETRA m sep Nad 2018/2019 0.5 ml</DSCRD>
   <DSCRF>FLUARIX TETRA av aig sép 2018/2019 0.5 ml</DSCRF>
   <SORTD>FLUARIX TETRA M SEP NAD 2018/2019 0.5 ML</SORTD>
   <SORTF>FLUARIX TETRA AV AIG SÉP 2018/2019 0.5 ML</SORTF>
   <SYN1D>Fluarix Tetra</SYN1D>
   <SYN1F>Fluarix Tetra</SYN1F>
   <SLOPLUS>2</SLOPLUS>

Drugshortage Flag einpflegen

Das Drugshortage File von oddb.org täglich in oddb2xml einpflegen. Flag ist "Ja" wenn ein Shortage vorhanden ist. Sonst ist der Flag leer. Auch das Datum wann der Flag erstellt wurde, soll hinterlegt werden.

Requirements to run

Hy there,

could you please point out what the exact requirements are to run this tool? I'm not that firm with ruby and stuff! Maybe you could put a how to install or something? Thanks

7640187360059, WALA Solum uliginosum comp Öl Fl 100 ml

      <ITEM DT="2020-03-10T00:00:00">
        <ATYPE>PHARMA</ATYPE>
        <GTIN>7640187360059</GTIN>
        <PHAR>0833556</PHAR>
        <SWMC_AUTHNR>00405981</SWMC_AUTHNR>
        <NAME_DE>WALA Solum uliginosum comp Öl Fl 100 ml</NAME_DE>
        <NAME_FR>WALA solum uliginosum comp huile fl 100 ml</NAME_FR>
        <ATC>V03ZB</ATC>
        <AUTH_HOLDER_NAME>WALA Schweiz AG</AUTH_HOLDER_NAME>
        <AUTH_HOLDER_GLN>7601001341883</AUTH_HOLDER_GLN>
      </ITEM>
      <ITEM DT="2020-03-10T00:00:00">
        <ATYPE>PHARMA</ATYPE>
        <GTIN>7680405981109</GTIN>
        <PHAR>0833556</PHAR>
        <SWMC_AUTHNR>00405981</SWMC_AUTHNR>
        <NAME_DE>WALA Solum uliginosum comp Öl Fl 100 ml</NAME_DE>
        <NAME_FR>WALA solum uliginosum comp huile fl 100 ml</NAME_FR>
        <ATC>V03ZB</ATC>
        <AUTH_HOLDER_NAME>WALA Schweiz AG</AUTH_HOLDER_NAME>
        <AUTH_HOLDER_GLN>7601001341883</AUTH_HOLDER_GLN>
      </ITEM>

ATC-Code fehlt

For example:
Viagra 50 mg, Filmtabletten has no ATC-Code
VIAGRA Filmtabl 50 mg 4 Stk has the ATC-Code

Cloud you please explain why is this happening? This can be seen again and again. Here you can find another example:

<PRD DT="" SHA256="4c6bfb78cd3549cc85e334c4e87fb9f23ec64cbc7b2ccfbe67e023d44c548a46">
   <GTIN>7680002780020</GTIN>
   <PRODNO>0027801</PRODNO>
   <DSCRD>Colon Sérocytol, suppositoire</DSCRD>
   <DSCRF>Colon Sérocytol, suppositoire</DSCRF>
   <IT>08.07.</IT>
   <CPT/>
   <PackGrSwissmedic>9</PackGrSwissmedic>
   <EinheitSwissmedic>Suppositorien</EinheitSwissmedic>
   <SubstanceSwissmedic>globulina equina (immunisé avec tissu intestinal porcin)</SubstanceSwissmedic>
   <CompositionSwissmedic>globulina equina (immunisé avec tissu intestinal porcin) 8 mg, propylenglycolum, conserv.: E 216, E 218, excipiens pro suppositorio.</CompositionSwissmedic>
 </PRD>

Cleanup swissmedic_* files after creation

oddb2xml leaves a number of files lying around like

-rw-r--r-- 1 jenkins jenkins 303093 May 8 09:00 swissmedic_fridge.xlsx
-rw-r--r-- 1 jenkins jenkins 303093 May 22 12:54 swissmedic_fridge.xlsx.1
-rw-r--r-- 1 jenkins jenkins 303093 May 24 06:37 swissmedic_fridge.xlsx.2
-rw-r--r-- 1 jenkins jenkins 303093 May 31 06:38 swissmedic_fridge.xlsx.3
-rw-r--r-- 1 jenkins jenkins 303093 Jun 3 13:05 swissmedic_fridge.xlsx.4
-rw-r--r-- 1 jenkins jenkins 303017 Jun 7 06:38 swissmedic_fridge.xlsx.5
-rw-r--r-- 1 jenkins jenkins 303017 Jun 14 06:38 swissmedic_fridge.xlsx.6
-rw-r--r-- 1 jenkins jenkins 303017 Jun 18 10:42 swissmedic_fridge.xlsx.7
-rw-r--r-- 1 jenkins jenkins 311738 May 8 09:00 swissmedic_orphan.xlsx
-rw-r--r-- 1 jenkins jenkins 311738 May 22 12:54 swissmedic_orphan.xlsx.1
-rw-r--r-- 1 jenkins jenkins 311738 May 24 06:37 swissmedic_orphan.xlsx.2
-rw-r--r-- 1 jenkins jenkins 311738 May 31 06:38 swissmedic_orphan.xlsx.3
-rw-r--r-- 1 jenkins jenkins 313609 Jun 3 13:05 swissmedic_orphan.xlsx.4
-rw-r--r-- 1 jenkins jenkins 313609 Jun 7 06:38 swissmedic_orphan.xlsx.5
-rw-r--r-- 1 jenkins jenkins 313609 Jun 14 06:38 swissmedic_orphan.xlsx.6
-rw-r--r-- 1 jenkins jenkins 313609 Jun 18 10:42 swissmedic_orphan.xlsx.7
-rw-r--r-- 1 jenkins jenkins 2647558 May 8 09:01 swissmedic_package.xlsx
-rw-r--r-- 1 jenkins jenkins 2674914 May 22 12:54 swissmedic_package.xlsx.1
-rw-r--r-- 1 jenkins jenkins 2674914 May 24 06:37 swissmedic_package.xlsx.2
-rw-r--r-- 1 jenkins jenkins 2674914 May 31 06:38 swissmedic_package.xlsx.3
-rw-r--r-- 1 jenkins jenkins 2674914 Jun 3 13:05 swissmedic_package.xlsx.4
-rw-r--r-- 1 jenkins jenkins 2674914 Jun 7 06:38 swissmedic_package.xlsx.5
-rw-r--r-- 1 jenkins jenkins 2672681 Jun 14 06:38 swissmedic_package.xlsx.6
-rw-r--r-- 1 jenkins jenkins 2672681 Jun 18 10:43 swissmedic_package.xlsx.7

could you provide a clean option for removing them automatically after the result was generated?

thanks

Since 28.2.22 swissmedic_package.xlsx contains IKSCAT A+

In column "N" Abgabekategorie Packung" we had till february 2022 only the values "A", "B","C", "D" "E", in march we have about 200 items with "A+". This distinction is not nedded for the the artikelstamm as used in the Elexis app.Therefore we should simply truncate it to "A".

invalid value for Integer(): "0707387007355" (ArgumentError)

Aufruf mit Executing /usr/local/bin/oddb2xml -f dat -p zurrose -a nonpharma -e ..

merci

12:54:49 Executing /usr/local/bin/oddb2xml -p zurrose -a nonpharma -e
17:14:12 DE
17:14:12 Pharma products: 15443
17:14:12 NonPharma products: 28884
17:14:12 FR
17:14:12 Pharma products: 15443
17:14:12 NonPharma products: 28884
17:14:12 2014-04-04 17:14:11 +0200: 98 done
17:14:12 Added 53075 via pharmacodes of 136723 items when extracting the transfer.dat from "Zur Rose"
17:14:12 found 773 lines with duplicated ean13
17:14:13 Executing /usr/local/bin/oddb2xml -f dat -p zurrose -a nonpharma -e
17:15:49 /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1091:in %': invalid value for Integer(): "0707387007355" (ArgumentError) 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1091:inblock (2 levels) in build_with_migel_dat'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1066:in each' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1066:ineach_with_index'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1066:in block in build_with_migel_dat' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1065:ineach'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:1065:in build_with_migel_dat' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/builder.rb:57:into_dat'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:139:in block (2 levels) in build' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:127:ineach'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:127:in block in build' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:93:ineach_pair'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:93:in build' 17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/lib/oddb2xml/cli.rb:86:inrun'
17:15:49 from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.7.8/bin/oddb2xml:94:in <top (required)>' 17:15:49 from /usr/local/bin/oddb2xml:23:inload'
17:15:49 from /usr/local/bin/oddb2xml:23:in `

'
17:15:49 Added 53075 via pharmacodes of 136723 items when extracting the transfer.dat from "Zur Rose"
17:15:49 found 773 lines with duplicated ean13
17:15:49 Build step 'Execute shell' marked build as failure
17:15:49 Finished: FAILURE

oddb2xml -x address fails with Timeout::Error

jenkins@srv:/home/artikelstamm/add$ oddb2xml -x address
/home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:146:in rescue in rbuf_fill': too many connection resets (due to Timeout::Error - Timeout::Error) after 0 requests on 6950760, last used 1400651839.489951 seconds ago (Net::HTTP::Persistent::Error) from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:140:inrbuf_fill'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:122:in readuntil' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:132:inreadline'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:2563:in read_status_line' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:2552:inread_new'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:1320:in block in transport_request' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:1317:incatch'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:1317:in transport_request' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:1294:inrequest'
from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/net-http-persistent-2.9/lib/net/http/persistent.rb:986:in request' from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:258:infetch'
from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/mechanize-2.5.1/lib/mechanize.rb:407:in get' from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.8.3/lib/oddb2xml/downloader.rb:21:indownload_as'
from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.8.3/lib/oddb2xml/downloader.rb:178:in download' from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/gems/oddb2xml-1.8.3/lib/oddb2xml/cli.rb:163:inblock in download'

buildr -h fails on some rubyies

Output seen with jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-01 26e08ba) (OpenJDK 64-Bit Server VM 1.6.0_24) [linux-amd64-java]
and ruby 1.9.3p0 under [i386-mingw]
oddb2xml -h
SyntaxError: /home/niklaus/.rvm/gems/jruby-1.6.7.2/gems/oddb2xml-1.2.2/lib/oddb2xml/builder.rb:145: syntax error, unexpected tRPAREN

    ) {
    ^

require at org/jruby/RubyKernel.java:1033
require at /home/niklaus/.rvm/rubies/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55
(root) at /home/niklaus/.rvm/gems/jruby-1.6.7.2/gems/oddb2xml-1.2.2/lib/oddb2xml/builder.rb:4
require at org/jruby/RubyKernel.java:1033
require at /home/niklaus/.rvm/rubies/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55
(root) at /home/niklaus/.rvm/gems/jruby-1.6.7.2/gems/oddb2xml-1.2.2/lib/oddb2xml/cli.rb:2
require at org/jruby/RubyKernel.java:1033
require at /home/niklaus/.rvm/rubies/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55
(root) at /home/niklaus/.rvm/gems/jruby-1.6.7.2/gems/oddb2xml-1.2.2/lib/oddb2xml.rb:9
load at org/jruby/RubyKernel.java:1058
at /home/niklaus/.rvm/gems/jruby-1.6.7.2/gems/oddb2xml-1.2.2/bin/oddb2xml:19
eval at org/jruby/RubyKernel.java:1083
(root) at /home/niklaus/.rvm/gems/jruby-1.6.7.2/bin/ruby_noexec_wrapper:14
niklaus@ng-hp:/opt/elexis-2.1.7-rm$ ruby -v

regular expression has ']' without escape

This may just be some insignificant warning for oddb2xml-2.6.8:

/opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.8/lib/oddb2xml/parslet_compositions.rb:91: warning: regular expression has ']' without escape: /tyr\(3\)-octreotidi]trifluoroacetum($|\s)/
/opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.8/lib/oddb2xml/parslet_compositions.rb:91: warning: regular expression has ']' without escape: /tyr\(3\)-octreotidi]trifluoroacetum($|\s)/
/opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.8/lib/oddb2xml/parslet_compositions.rb:91: warning: regular expression has ']' without escape: /tyr\(3\)-octreotidi]trifluoroacetum($|\s)/

BRONCHO-VAXOM with wrong ATC-Code in artikelstamm

In refdata_pharma.xml we have

<SWMC_AUTHNR>00596001</SWMC_AUTHNR>
<NAME_DE>BRONCHO-VAXOM Kaps Erw 10 Stk</NAME_DE>
<NAME_FR>BRONCHO-VAXOM caps adult 10 pce</NAME_FR>
<ATC>J07AX</ATC>```
But after running oddb2xml --artikelstamm we have in the csv

`7680005960016,BRONCHO-VAXOM Kaps Erw 10 Stk,Kapsel(n),Kapsel(n),18.02,27.80,0059601,R07AX,"haemophili influenzae lysatum, diplococci pneumoniae lysatum, klebsiellae pneumoniae et ozaenae lysatum, staphylococci aurei lysatum, streptococci pyogen. et viridantis lysatum, neisseriae catarrhalis lysatum",,03.05.0.,""`

Why did the ATC-Code change fom J07AX to R07AX?

Ruby 2.4.0 Error

Release 2.6.7 breaks usage for Ruby-2.4.0.

/opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.7/lib/oddb2xml/downloader.rb:286:in `initialize': private method `open' called for URI:Module (NoMethodError)
        from /opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.7/lib/oddb2xml/cli.rb:202:in `new'
        from /opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.7/lib/oddb2xml/cli.rb:202:in `download'
        from /opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.7/lib/oddb2xml/cli.rb:56:in `run'
        from /opt/ywesee/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/oddb2xml-2.6.7/bin/oddb2xml:38:in `<top (required)>'
        from /opt/ywesee/.rbenv/versions/2.4.0/bin/oddb2xml:22:in `load'
        from /opt/ywesee/.rbenv/versions/2.4.0/bin/oddb2xml:22:in `<main>'

Bugs found by Lukas Furrer in Version 2.6.8

Hi Zeno

I played around with oddb2xml yesterday. Very useful piece of software, thank you very much!

I noticed that odd2xml (Version 2.6.8) fails when the tool is used with the -e and -f dat options combined.

The first problem occurs in builder.rb, line 1340:

In the source data there is an ean with leading zeros. Ruby interprets this as an octal number and sprintf fails complaining that ean isn’t an integer. I changed ean to ean.to_i and it worked fine after that.

Another error is thrown at the end when the resulting .dat file is copied to one with a date and timestamp at the end of the filename.

Line 160 in cli.rb fails because your code looks to substitute .xml with timestamp.xml. Since the filename has a .dat extension .xml isn’t found and the source file name and the destination file name is the same and FileUtils.cp fails complaining about that.

As a quick workaround I changed the code from

FileUtils.cp(File.join(WorkDir, file), File.join(WorkDir, file.sub('.xml', '_'+Time.now.strftime("%d.%m.%Y_%H.%M")+'.xml')), :verbose => false)

To

FileUtils.cp(File.join(WorkDir, file), File.join(WorkDir, file.sub('.', '_'+Time.now.strftime("%d.%m.%Y_%H.%M")+'.')), :verbose => false)

Now it only searches for the dot . in the filename. Of course this would fail if there is already another dot . in the filename.

After these two modifications to the code oddb2xml completed without any errors even with the -e and -f dat options combined.

Thanks again and have a good day!

Lukas

oddb2xml 1.8.1 does not work, 1.8.0 does due to nokogiri dependency clash

/home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1638:in raise_if_conflicts': Unable to activate sax-machine-0.2.1, because nokogiri-1.5.11 conflicts with nokogiri (~> 1.6.0) (Gem::LoadError) from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:747:inactivate'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:781:in block in activate_dependencies' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:767:ineach'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:767:in activate_dependencies' from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:751:inactivate'
from /home/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in gem' from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/bin/oddb2xml:18:in

'
from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in eval' from /home/jenkins/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in'

Pharmacode nicht mehr vorhanden bei Refdata.

Ich lade alle zwei Monate die oddb_product.xml und oddb_article.xml in meine Datenbank. Nun ist mir aufgefallen, dass seit meinem letzten Import die xml-Struktur leicht geändert wurde bei product.xml.

In der heutigen Ausgabe von product.xml (02.02.2021) fehlt die Entität , wie Sie aus der Abbildung sehen können. Das ist bei früheren xml und auch in der aktuellen article.xml nicht der Fall. Die Entität enthält die Anzahl Records >NBR_RECORD>, die ich als Kontrolle verwende.

feeback_fabio_valeri

Ich kann damit leben, aber ich wollte sie einfach darüber informieren, dass doch eine wichtige Kontrolle nicht mehr vorhanden ist. Ich weiss nicht, seit wann das der Fall ist, aber ich könnte es herausfinden, falls erwünscht. Wenn Sie es so belassen wollen, wie es nun ist, wäre ich Ihnen dankbar, wenn Sie mich informieren. Dann passe ich mein Import-Skript entsprechend an, damit keine Fehlermeldung stattfindet.

Seit 06.01.2021 wird kein NBR_RECORD geliefert.
Bis 05.01.2021 wurde NBR_RECORD geliefert.

Refdata XML files without pharmacode

Refdata no longer published the pharmacode field.
Building the artikelstamm failed, because it failed the validation with errors like artikelstamm_01022021_v5.xml:1693969: element PHAR: Schemas validity error : Element '{http://elexis.ch/Elexis_Artikelstamm_v5}PHAR': '' is not a valid value of the local atomic type.

oddb2xml not yet working with Ruby 3.1.0

~/.software/oddb2xml> ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]

~/.software/oddb2xml> oddb2xml --help
results in

/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Struct::GalenicGroup (Psych::DisallowedClass)
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/class_loader.rb:28:in `load'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:424:in `resolve_class'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:171:in `visit_Psych_Nodes_Mapping'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych.rb:335:in `safe_load'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych.rb:370:in `load'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych.rb:671:in `block in load_file'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych.rb:670:in `open'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych.rb:670:in `load_file'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml/calc.rb:98:in `<class:Calc>'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml/calc.rb:23:in `<module:Oddb2xml>'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml/calc.rb:5:in `<top (required)>'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml/builder.rb:3:in `<top (required)>'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml/cli.rb:1:in `<top (required)>'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/lib/oddb2xml.rb:2:in `<top (required)>'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/zeno/.rbenv/versions/3.1.0/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/zeno/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/oddb2xml-2.7.5/bin/oddb2xml:8:in `<top (required)>'
        from /home/zeno/.rbenv/versions/3.1.0/bin/oddb2xml:25:in `load'
        from /home/zeno/.rbenv/versions/3.1.0/bin/oddb2xml:25:in `<main>'

Artikelstamm: Wrong ATC for 'BRONCHO-VAXOM Kaps Erw 10 Stk' code taken from redata instead of swissmedic packages

A medical practice reported the following errors

Die Medikamente:
BRONCHO-VAXOM Kaps. Erw 10 Stk, BRONCHO-VAXOM Kaps. Erw 30 Stk, BRONCHO-VAXOM Kaps. Kind10 Stk sowie BRONCHO-VAXOM Kaps. Kind 30 Stk rufen im Elexis jeweils die Impfliste auf und machen einen entsprechenden Eintrag, jedoch sind diese Medikamente KEINE Impfstoffe!

Reason is that refdata_pharma contains the wrong ATC-Code J07AX

  <ITEM DT="2019-04-08T00:00:00">
    <ATYPE>PHARMA</ATYPE>
    <GTIN>7680005960016</GTIN>
    <PHAR>0829684</PHAR>
    <SWMC_AUTHNR>00596001</SWMC_AUTHNR>
    <NAME_DE>BRONCHO-VAXOM Kaps Erw 10 Stk</NAME_DE>
    <NAME_FR>BRONCHO-VAXOM caps adult 10 pce</NAME_FR>
    <ATC>J07AX</ATC>
    <AUTH_HOLDER_NAME>OM Pharma SA</AUTH_HOLDER_NAME>
    <AU

Whereas in the swissmedic-packages we find the correct value ATC-Code R07AX

596,1,"Broncho-Vaxom adultes, capsules","OM Pharma SA","Bakterien- und Hefepräparate",03.05.0.,R07AX,1997/07/03,1997/07/03,2022/07/03,1,10,Kapsel(n),D,D,D,"haemophili influenzae lysatum, diplococci pneumoniae lysatum, klebsiellae pneumoniae et ozaenae lysatum, staphylococci aurei lysatum, streptococci pyogen. et viridantis lysatum, neisseriae catarrhalis lysatum","lysatum bacteriorum lyophilisatum 7 mg corresp. haemophili influenzae lysatum et diplococci pneumoniae lysatum et klebsiellae pneumoniae et ozaenae lysatum et staphylococci aurei lysatum et streptococci pyogen. et viridantis lysatum et neisseriae catarrhalis lysatum, natrii hydrogenoglutamas, antiox.: E 310, color.: E 132, excipiens pro capsula.",,"immuno-stimulant lors d' infections du système respiratoire et lors de bronchite chronique",,,,

https://ch.oddb.org/de/gcc/search/zone/drugs/search_query/00596/search_type/st_registration
shows the correct ATC-Code R07AX

Homöopatahische Mittel gemäss Kapitel 70 fehlen im oddb2xml

Bei Elexis wurden Rechnungen zurückgewiesen, Gemäss Julian Kappis aus folgenden Gründen:

Anforderung:

  • oddb2xml --artikelstamm muss diese entsprechend berücksichtigten und auch als SL Medikamente markieren

Refdata is mixing HTTP with HTTPS requests

  1. The following two URLs always worked:
SOAPAction: http://refdatabase.refdata.ch/Pharma/Download
http://refdatabase.refdata.ch/Service/Article.asmx
  1. But now the second URL has to be HTTPS.
SOAPAction: http://refdatabase.refdata.ch/Pharma/Download
https://refdatabase.refdata.ch/Service/Article.asmx

to make the GTIN XML file download work.

oddb_calc Ampullen werden falsch ausgelesen

diese angaben stimmen zu 90%. aber bei ampullen ist dies wirr. 5 Ampullen a 10 ml. dort steht im sellingunit feld 10. dort sollte aber 5 stehen für 5 ampullen. man verkauft dies ja immper per ampulle. was können wir hier machen?

Illegal characters in datasets

It seems that there is some problems with the created datasets when it comes to character encoding.

We face entries like

11:15:52.795 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xC2\x92s gl...' for column 'DSCR' at row 1
11:15:59.071 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xC2\x928 af...' for column 'DSCR' at row 1
11:16:11.601 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xC2\x9636 M...' for column 'DSCR' at row 1
11:16:12.961 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xC2\x96 Jog...' for column 'DSCR' at row 1
11:16:29.075 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xC2\x89 100...' for column 'DSCR' at row 1
11:17:15.998 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA4 30...' for column 'LIMITATION_TXT' at row 1
11:17:16.009 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA4 30...' for column 'LIMITATION_TXT' at row 1
11:17:16.023 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA4 30...' for column 'LIMITATION_TXT' at row 1
11:17:16.033 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA4 30...' for column 'LIMITATION_TXT' at row 1
11:17:25.245 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA5 30...' for column 'LIMITATION_TXT' at row 1
11:17:25.256 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA5 30...' for column 'LIMITATION_TXT' at row 1
11:17:26.249 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA5 16...' for column 'LIMITATION_TXT' at row 1
11:17:26.277 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xE2\x89\xA5 16...' for column 'LIMITATION_TXT' at row 1
11:17:30.666 [main] WARN  java.lang.Throwable - java.sql.SQLException: Incorrect string value: '\xCE\xB1) ni...' for column 'LIMITATION_TXT' at row 1

on certain mysql databases. I could track it to entries like

WARNING SCHAR SEMPER Cookie-O�s glutenfrei 150 g
WARNING SCHAR CER�8 after sting Roll-on 20 ml
WARNING SCHAR DermaSilk Set Body + Strumpfhöschen 24�36 Mon (98)
WARNING SCHAR Inkosport Activ Pro 80 Himbeer � Joghurt Ds 750g
WARNING SCHAR Ethacridin lactat 1� 100ml

vi shows the data e.g. like this

3731928     <DSCRD>Ethacridin lactat 1<89> 100ml                        </DSCRD>
3731929     <DSCRF>Ethacridin lactat 1<89> 100ml                        </DSCRF>
3731930     <SORTD>ETHACRIDIN LACTAT 1<89> 100ML                        </SORTD>
3731931     <SORTF>ETHACRIDIN LACTAT 1<89> 100ML                        </SORTF>

where the <89> is an unwritable sign.

Could you please ensure, that only valid characters are used in the xml files?

Invalid entry in article.xml

Thats an invalid entry, no?

3739614   <ART DT="">
3739615     <REF_DATA>0</REF_DATA>
3739616     <PHAR>8808827</PHAR>
3739617     <SALECD>I</SALECD>
3739618     <DSCRD> 237.44                                           </DSCRD>
3739619     <DSCRF> 237.44                                           </DSCRF>
3739620     <SORTD> 237.44                                           </SORTD>
3739621     <SORTF> 237.44                                           </SORTF>
3739622     <ARTCOMP/>
3739623   </ART>

Add -v option to oddb2xml

I'd like to have an -v option to just print out the versioning line, please.

Like

oddb2xml -v

results in

/home/jenkins/.rvm/gems/ruby-1.9.3-p448/bin/oddb2xml ver.1.8.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.