oddb2xml
- 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:
- Wirkstoffe (BAG XML)
- Kühlkette (Swissmedic)
- Orphan Drugs (Swissmedic)
- FI: de, fr (Swissmedic)
- Limitation-Texte (BAG XML)
- Interaktionen EPha.ch
- Betäubungsmittel und psychotrope Stoffe (Swissmedic)
- Non-Pharma from Refdata and Suppliers (swissINDEX)
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.4 to work correctly. Ruby 2.2/2.3 have problems with i18n encoding and fail a spec test for Naropin
XSD files
The file oddb2xml.xsd was manually created by merging the output of the xmlbeans tools inst2xsd and trang
- http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html#inst2xsd
- http://www.thaiopensource.com/relaxng/trang.html
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”?>
```
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”?>