{"id":19903397,"url":"https://github.com/zdavatz/oddb2xml","last_synced_at":"2026-05-06T18:01:15.348Z","repository":{"id":4472569,"uuid":"5611454","full_name":"zdavatz/oddb2xml","owner":"zdavatz","description":"oddb2xml, create xml files using refdata, swissmedic and bag xml files","archived":false,"fork":false,"pushed_at":"2026-04-25T10:40:02.000Z","size":39152,"stargazers_count":9,"open_issues_count":8,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-01T07:05:46.887Z","etag":null,"topics":["bag","data","drug","open","refdata","ruby","source","swissmedic","switzerland","xml"],"latest_commit_sha":null,"homepage":"http://www.ywesee.com/Oddb2xml/Index","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdavatz.png","metadata":{"files":{"readme":"README.md","changelog":"History.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-08-30T06:43:48.000Z","updated_at":"2026-04-25T10:40:06.000Z","dependencies_parsed_at":"2023-10-26T15:37:49.079Z","dependency_job_id":"e0b65013-3f75-4340-b752-52cfb51c71b1","html_url":"https://github.com/zdavatz/oddb2xml","commit_stats":{"total_commits":883,"total_committers":5,"mean_commits":176.6,"dds":0.680634201585504,"last_synced_commit":"ef21f6acd05ec1887a4deaac04d4642f2f30533b"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/zdavatz/oddb2xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdavatz%2Foddb2xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdavatz%2Foddb2xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdavatz%2Foddb2xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdavatz%2Foddb2xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdavatz","download_url":"https://codeload.github.com/zdavatz/oddb2xml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdavatz%2Foddb2xml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32705620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bag","data","drug","open","refdata","ruby","source","swissmedic","switzerland","xml"],"created_at":"2024-11-12T20:23:35.285Z","updated_at":"2026-05-06T18:01:15.335Z","avatar_url":"https://github.com/zdavatz.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oddb2xml\n\n[![Build Status](https://github.com/zdavatz/oddb2xml/workflows/Ruby/badge.svg)](https://github.com/zdavatz/oddb2xml/actions)\n\n* oddb2xml -a nonpharma -o fi\n\ncreates the following xml files:\n\n* oddb_substance.xml\n* oddb_limitation.xml\n* oddb_interaction.xml\n* oddb_code.xml\n* oddb_product.xml\n* oddb_article.xml\n* oddb_fi.xml\n* oddb_fi_product.xml\n\nand\n\n* oddb2xml -f dat\n* oddb2xml -f dat -a nonpharma\n\ncreates .dat files according to ([IGM-11](http://dev.ywesee.com/uploads/att/IGM.pdf)). IGM-11 describes the structure of the zurrose_transfer.dat.\n\n* oddb.dat\n* oddb_with_migel.dat\n\nthe files are using [Refdata](https://files.refdata.ch/simis-public-prod/Articles/1.0/Refdata.Articles.zip), [BAG-XML](http://bag.e-mediat.net/SL2007.Web.External/Default.aspx?webgrab=ignore) and [Swissmedic](http://www.swissmedic.ch/daten/00080/00251/index.html?lang=de) as sources.\n\nThe following additional data is in the files:\n\n* [Wirkstoffe](http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip) (BAG XML)\n* [Kühlkette](http://www.swissmedic.ch/daten/00080/00254/index.html?lang=de\u0026download=NHzLpZeg7t,lnp6I0NTU042l2Z6ln1acy4Zn4Z2qZpnO2Yuq2Z6gpJCDdH57e2ym162epYbg2c_JjKbNoKOn6A--) (Swissmedic)\n* [Orphan Drugs](http://www.swissmedic.ch/daten/00081/index.html?lang=de\u0026download=NHzLpZeg7t,lnp6I0NTU042l2Z6ln1acy4Zn4Z2qZpnO2Yuq2Z6gpJCDdH55f2ym162epYbg2c_JjKbNoKSn6A--\u0026.xls) (Swissmedic)\n* [FI: de, fr](http://download.swissmedicinfo.ch) (Swissmedic)\n* Limitation-Texte (BAG XML)\n* Interaktionen [EPha.ch](http://epha.ch)\n* [Betäubungsmittel](http://www.swissmedic.ch/produktbereiche/00447/00536/index.html?lang=de\u0026download=NHzLpZeg7t,lnp6I0NTU042l2Z6ln1acy4Zn4Z2qZpnO2Yuq2Z6gpJCDdH1,fWym162epYbg2c_JjKbNoKSn6A--\u0026.pdf) und psychotrope Stoffe (Swissmedic)\n* Non-Pharma from Refdata and Suppliers (swissINDEX)\n\nThe 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.\nConsumers of the data file may use it to check whether they have to replace the corresponding nodes.\n\nGenerating files for Elexis Artikelstamm is discussed in the [Readme for the Artikelstamm](artikelstamm.md)\n\n\n## usage\n\nHIN (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`\n\nsee `--help`.\n\n```\n    /opt/src/oddb2xml/bin/oddb2xml version 3.0.7\n    Usage:\n    oddb2xml [option]\n      produced files are found under data\n    -a, --append              Additional target nonpharma\n    -r, --artikelstamm        Create Artikelstamm Version 3 and 5 for Elexis \u003e= 3.1\n    -c, --compress-ext=\u003cs\u003e    format F. {tar.gz|zip}\n    -e, --extended            pharma, non-pharma plus prices and non-pharma from zurrose.\n                                                          Products without EAN-Code will also be listed.\n                                                          File oddb_calc.xml will also be generated\n    --fhir                    Use FHIR NDJSON format from FOPH/BAG instead of XML\n                                                          from Spezialitätenliste. Downloads per-language\n                                                          NDJSON files (de, fr, it) from epl.bag.admin.ch.\n    --fhir-url=\u003cs\u003e            Specific FHIR NDJSON URL to download (implies --fhir)\n    -f, --format=\u003cs\u003e          File format F, default is xml. {xml|dat}\n                                                          If F is given, -o option is ignored. (Default: xml)\n    -i, --include             Include target option for ean14  for 'dat' format.\n                                                          'xml' format includes always ean14 records.\n    -I, --increment=\u003ci\u003e       Increment price by x percent. Forces -f dat -p zurrose.\n                                                          create additional field price_resellerpub as\n                                                          price_extfactory incremented by x percent (rounded to the next 0.05 francs)\n                                                          in oddb_article.xml. In generated zurrose_transfer.dat PRPU is set to this price\n                                                          Forces -f dat -p zurrose.\n    -o, --fi                  Optional fachinfo output.\n    -p, --price               Price source (transfer.dat) from ZurRose\n    -t, --tag-suffix=\u003cs\u003e      XML tag suffix S. Default is none. [A-z0-9]\n                                                          If S is given, it is also used as prefix of filename.\n    -x, --context=\u003cs\u003e         {product|address}. product is default. (Default: product)\n    -l, --calc                create only oddb_calc.xml with GTIN, name and galenic information\n    -s, --skip-download       skips downloading files it the file is already under downloads.\n                                                          Downloaded files are saved under downloads\n    --log                     log important actions\n    -u, --use-ra11zip=\u003cs\u003e     Use the ra11.zip (a zipped transfer.dat from Galexis)\n    -b, --firstbase           Build all NONPHARMA articles on firstbase\n                                                          (GS1 Switzerland CSV from id.gs1.ch)\n    -v, --version             Print version and exit\n    -h, --help                Show this message\n```\n\n## Option examples\n\n```\n$ oddb2xml -t md                        # =\u003e md_article.xml, md_product.xml, md_substance.xml\n$ oddb2xml -a nonpharma -t md -c tar.gz # =\u003e md_xml_dd.mm.yyyy_hh.mm.tar.gz\n$ oddb2xml -f dat                       # =\u003e oddb.dat\n$ oddb2xml -f dat -a nonpharma          # =\u003e oddb_with_migel.dat\n$ oddb2xml -e                           # =\u003e oddb_article.xml\n```\n\noutput.\n\n```\n$ oddb2xml\nDE\n        Pharma products: 14801\nFR\n        Pharma products: 14801\n```\n\n## Supported ruby version\n\nYou will need ruby \u003e= 2.5 to work correctly. Current development happens on Ruby 3.3 (`.ruby-version`).\nCI runs on Ruby 3.0, 3.1 and 3.2 via GitHub Actions — see the badge above for the latest spec results.\n\n\n## XSD files\n\nThe file oddb2xml.xsd was manually created by merging the output of the xmlbeans tools inst2xsd and trang\n\n* http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html#inst2xsd\n* http://www.thaiopensource.com/relaxng/trang.html\n\nRunning rake spec will validated the XML-files generated during the tests using the Nokogiri validator.\nWe have two XSD files. One for oddb_calc.xml and one for the rest.\n\nManually you can also validate (assuming that you have installed the xmlbeans tools) all generated XML-files using\n\n* xsdvalidate oddb_calc.xsd oddb_article.xml oddb_calc.xml\n* xsdvalidate oddb2xml.xsd oddb_article.xml oddb_code.xml oddb_interaction.xml oddb_product.xml oddb_substance.xml\n\n## XML files\n\nxml files generated are:\n\n* oddb_substance.xml\n* oddb_limitation.xml\n* oddb_interaction.xml\n* oddb_code.xml\n* oddb_product.xml\n* oddb_article.xml\n* oddb_fi.xml\n* oddb_fi_product.xml\n\n### article.xml\n\noddb2xml creates article.xml as oddb_article.xml by default.\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cARTICLE 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\"\u003e\n  \u003cART DT=\"2015-09-09 00:00:00 +0000\" SHA256=\"896dd24bfb4cfd56dcfd3709150da9b652626a430adefbe57cb405a9d46684c6\"\u003e\n    \u003cREF_DATA\u003e1\u003c/REF_DATA\u003e\n    \u003cPHAR\u003e2731179\u003c/PHAR\u003e\n    \u003cSMCAT\u003eD\u003c/SMCAT\u003e\n    \u003cSMNO\u003e16105058\u003c/SMNO\u003e\n    \u003cPRODNO\u003e161051\u003c/PRODNO\u003e\n    \u003cVAT\u003e2\u003c/VAT\u003e\n    \u003cSALECD\u003eA\u003c/SALECD\u003e\n    \u003cCDBG\u003eN\u003c/CDBG\u003e\n    \u003cBG\u003eN\u003c/BG\u003e\n    \u003cDSCRD\u003eHIRUDOID Creme 3 mg/g 40 g\u003c/DSCRD\u003e\n    \u003cDSCRF\u003eHIRUDOID crème 3 mg/g 40 g\u003c/DSCRF\u003e\n    \u003cSORTD\u003eHIRUDOID CREME 3 MG/G 40 G\u003c/SORTD\u003e\n    \u003cSORTF\u003eHIRUDOID CRèME 3 MG/G 40 G\u003c/SORTF\u003e\n    \u003cSYN1D\u003eHirudoid\u003c/SYN1D\u003e\n    \u003cSYN1F\u003eHirudoid\u003c/SYN1F\u003e\n    \u003cSLOPLUS\u003e2\u003c/SLOPLUS\u003e\n    \u003cARTCOMP\u003e\n      \u003cCOMPNO\u003e7601001002258\u003c/COMPNO\u003e\n    \u003c/ARTCOMP\u003e\n    \u003cARTBAR\u003e\n      \u003cCDTYP\u003eE13\u003c/CDTYP\u003e\n      \u003cBC\u003e7680161050583\u003c/BC\u003e\n      \u003cBCSTAT\u003eA\u003c/BCSTAT\u003e\n    \u003c/ARTBAR\u003e\n    \u003cARTPRI\u003e\n      \u003cPTYP\u003ePEXF\u003c/PTYP\u003e\n      \u003cPRICE\u003e4.768575\u003c/PRICE\u003e\n    \u003c/ARTPRI\u003e\n    \u003cARTPRI\u003e\n      \u003cPTYP\u003ePPUB\u003c/PTYP\u003e\n      \u003cPRICE\u003e8.8\u003c/PRICE\u003e\n    \u003c/ARTPRI\u003e\n    \u003cARTPRI\u003e\n      \u003cPTYP\u003eZURROSE\u003c/PTYP\u003e\n      \u003cPRICE\u003e4.77\u003c/PRICE\u003e\n    \u003c/ARTPRI\u003e\n    \u003cARTPRI\u003e\n      \u003cPTYP\u003eZURROSEPUB\u003c/PTYP\u003e\n      \u003cPRICE\u003e8.80\u003c/PRICE\u003e\n    \u003c/ARTPRI\u003e\n    \u003cARTINS\u003e\n      \u003cNINCD\u003e10\u003c/NINCD\u003e\n    \u003c/ARTINS\u003e\n  \u003c/ART\u003e\n  ...\n  \u003cRESULT\u003e\n    \u003cOK_ERROR\u003eOK\u003c/OK_ERROR\u003e\n    \u003cNBR_RECORD\u003e14801\u003c/NBR_RECORD\u003e\n    \u003cERROR_CODE/\u003e\n    \u003cMESSAGE/\u003e\n  \u003c/RESULT\u003e\n\u003c/ARTICLE\u003e\n```\n\n### product.xml\n\nFor example, if `-t _swiss` is given then oddb2xml creates product.xml as swiss_product.xml.\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cPRODUCT_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\"\u003e\n  \u003cPRD_SWISS DT=\"\" SHA256=\"aa82eee2d542787cf2cb8b7f17d748223ec723b935ce20cd29d89e284d16fea1\"\u003e\n    \u003cGTIN\u003e7680353660163\u003c/GTIN\u003e\n    \u003cPRODNO\u003e353661\u003c/PRODNO\u003e\n    \u003cDSCRD\u003eKENDURAL Depottabl 30 Stk\u003c/DSCRD\u003e\n    \u003cDSCRF\u003eKENDURAL cpr dépot 30 pce\u003c/DSCRF\u003e\n    \u003cATC\u003eB03AE10\u003c/ATC\u003e\n    \u003cIT\u003e06.07.1.\u003c/IT\u003e\n    \u003cCPT\u003e\n      \u003cCPTCMP\u003e\n        \u003cLINE\u003e0\u003c/LINE\u003e\n        \u003cSUBNO\u003e5\u003c/SUBNO\u003e\n        \u003cQTY\u003e105\u003c/QTY\u003e\n        \u003cQTYU\u003emg\u003c/QTYU\u003e\n      \u003c/CPTCMP\u003e\n      \u003cCPTCMP\u003e\n        \u003cLINE\u003e1\u003c/LINE\u003e\n        \u003cSUBNO\u003e1\u003c/SUBNO\u003e\n        \u003cQTY\u003e500\u003c/QTY\u003e\n        \u003cQTYU\u003emg\u003c/QTYU\u003e\n      \u003c/CPTCMP\u003e\n    \u003c/CPT\u003e\n    \u003cPackGrSwissmedic\u003e30\u003c/PackGrSwissmedic\u003e\n    \u003cEinheitSwissmedic\u003eTablette(n)\u003c/EinheitSwissmedic\u003e\n    \u003cSubstanceSwissmedic\u003eferrum(II), acidum ascorbicum\u003c/SubstanceSwissmedic\u003e\n    \u003cCompositionSwissmedic\u003eferrum(II) 105 mg ut ferrosi sulfas dessiccatus, acidum ascorbicum 500 mg ut natrii ascorbas, color.: E 124, excipiens pro compresso obducto.\u003c/CompositionSwissmedic\u003e\n  \u003c/PRD\u003e\n  ...\n  \u003cRESULT_SWISS\u003e\n    \u003cOK_ERROR_SWISS\u003eOK\u003c/OK_ERROR_SWISS\u003e\n    \u003cNBR_RECORD_SWISS\u003e14336\u003c/NBR_RECORD_SWISS\u003e\n    \u003cERROR_CODE_SWISS/\u003e\n    \u003cMESSAGE_SWISS/\u003e\n  \u003c/RESULT_SWISS\u003e\n\u003c/PRODUCT_SWISS\u003e\n```\n\n### substance.xml\n\nproduct.xml has relation to substance as `\u003cSUBNO\u003e`.\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cSUBSTANCE 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\"\u003e\n  \u003cSB DT=\"\" SHA256=\"a510f9b1e7216cda2d5e0c3b82bacef96da963e14f36c97e0e1a8baf55d00287\"\u003e\n    \u003cSUBNO\u003e1\u003c/SUBNO\u003e\n    \u003cNAML\u003eAcidum ascorbicum (Vitamin C, E300)\u003c/NAML\u003e\n  \u003c/SB\u003e\n  \u003cSB DT=\"\" SHA256=\"de64fcc718b7f30bfe4283fb40c8b558cf2f30a8acc4a7bf6a643e82dfe82931\"\u003e\n    \u003cSUBNO\u003e2\u003c/SUBNO\u003e\n    \u003cNAML\u003eAlprostadilum\u003c/NAML\u003e\n  \u003c/SB\u003e\n  ...\n  \u003cRESULT\u003e\n    \u003cOK_ERROR\u003eOK\u003c/OK_ERROR\u003e\n    \u003cNBR_RECORD\u003e1441\u003c/NBR_RECORD\u003e\n    \u003cERROR_CODE/\u003e\n    \u003cMESSAGE/\u003e\n  \u003c/RESULT\u003e\n\u003c/SUBSTANCE\u003e\n```\n\n## Data sources\n\nWe use the following files:\n\n* https://www.swissmedic.ch/arzneimittel/00156/00221/00222/00230/index.html?lang=de (Präparateliste und zugelassene Packungen)\n* https://raw.githubusercontent.com/zdavatz/oddb2xml_files/master/interactions_de_utf8.csv\n* https://files.refdata.ch/simis-public-prod/Articles/1.0/Refdata.Articles.zip\n* http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip\n* https://www.medregbm.admin.ch/Publikation/CreateExcelListBetriebs\n* https://www.medregbm.admin.ch/Publikation/CreateExcelListMedizinalPersons\n* http://zurrose.com/fileadmin/main/lib/download.php?file=/fileadmin/user_upload/downloads/ProduktUpdate/IGM11_mit_MwSt/Vollstamm/transfer.dat\n* https://raw.githubusercontent.com/zdavatz/oddb2xml_files/master/NON-Pharma.xls\n* http://download.swissmedicinfo.ch/ (AipsDownload)\n* https://raw.githubusercontent.com/zdavatz/oddb2xml_files/master/LPPV.txt\n* https://raw.githubusercontent.com/zdavatz/cpp2sqlite/master/input/atc_codes_multi_lingual.txt\n* https://epl.bag.admin.ch/static/fhir/foph-sl-export-latest-{de,fr,it}.ndjson (FHIR NDJSON, used with `--fhir`)\n* https://id.gs1.ch/01/07612345000961 (GS1 Switzerland firstbase CSV — full barcode registry, used with `-b`/`--firstbase`)\n\n## Indikationscode (BAG XXXXX.NN)\n\nIn `--fhir` mode, oddb2xml extracts the BAG **Indikationscode** for SL\nprice-model drugs and emits one repeated `\u003cINDICATION_CODE\u003e` child per\nindication on each `\u003cPRD\u003e` in `oddb_product.xml`:\n\n```xml\n\u003cPRD DT=\"...\"\u003e\n  \u003cGTIN\u003e7680123456789\u003c/GTIN\u003e\n  ...\n  \u003cINDICATION_CODE code=\"20403.01\" cud_id=\"CYRAMZA.01\"\u003eIn Kombination mit Paclitaxel für die Behandlung ...\u003c/INDICATION_CODE\u003e\n  \u003cINDICATION_CODE code=\"20403.02\" cud_id=\"CYRAMZA.02\"\u003eIn Kombination mit FOLFIRI ...\u003c/INDICATION_CODE\u003e\n  \u003cPackGrSwissmedic\u003e...\u003c/PackGrSwissmedic\u003e\n\u003c/PRD\u003e\n```\n\nThe code is built per FHIR bundle by combining the\n`FOPHDossierNumber` from the reimbursement `RegulatedAuthorization`\n(`XXXXX`) with the `.NN` suffix of each sibling\n`ClinicalUseDefinition` whose `type == \"indication\"` (e.g.\n`CYRAMZA.01` / `CYRAMZA.02` → `20403.01` / `20403.02`).  The element\nbody carries the human-readable indication text from\n`indication.diseaseSymptomProcedure.concept.text`.\n\nThe same data is also exposed in-memory on each item and package as\n`item[:indication_codes]` (an array of `{code:, cud_id:, text:}`\nhashes) for downstream consumers that build their own emitters.\n\nCounted on the live FOPH feed (`foph-sl-export-latest-de.ndjson`,\n6'775 bundles): **539** products carry a total of **1'293** codes.\n\nPer BAG Rundschreiben vom 19. Februar 2026, the Indikationscode must\nbe transmitted with every prescription and invoice for SL price-model\ndrugs from **2026-07-01**; from **2027-01-01** insurers may reject\ninvoices without it. See issue\n[#113](https://github.com/zdavatz/oddb2xml/issues/113).\n\n## Refdata data-quality compensation\n\nRefdata.Articles.xml from `files.refdata.ch` ships with a number of recurring\ndata-quality issues that propagate into downstream systems unchanged. oddb2xml\napplies a small set of conservative cleanups before emitting any output. See\nGitHub issue [#112](https://github.com/zdavatz/oddb2xml/issues/112) for the\nfull catalogue and the parallel report sent to Refdata.\n\nCurrently active fixes (`lib/oddb2xml/refdata_cleanup.rb`):\n\n* **Doubled dose token** — Refdata sometimes emits the strength twice in\n  `\u003cFullName\u003e`, e.g. `MIRTAZAPIN Sandoz eco 30 mg / 30 mg / 100 Tablette`.\n  When the matching Swissmedic entry shows a single active substance, the\n  duplicate token is collapsed to a single occurrence. Real combination\n  products (e.g. PHESGO 600 mg / 600 mg / 10 ml — pertuzumab + trastuzumab)\n  are detected via the comma in `substance_swissmedic` and left untouched.\n\nThe cleanup runs at the start of `prepare_articles` in `Builder` and is\nidempotent. Each rule is guarded by a Swissmedic-side heuristic so genuine\ndata is never altered.\n\n## Rules for matching GTIN (aka EAN13), product number and IKSNR\n\nFor drugs which appear in Packungen.xlsx file published by Swissmedic the following rule is used to create the GTIN\n* First 4 digits identify SwissMedic and are fixed to 7680\n* next 5 digits corresponding to IKSNR (authorization) number\n* next 3 digits corresponding to Packungscode\n* last digit is checksum\n\nThe product number is calculated as\n* 5 digits corresponding to IKSNR (authorization) number\n* 2 digits corresponding to Dosisstärke (aka sequence number)\n\nIn oddb_article.xml you find\n* GTIN is found as \"BC\" inside \"ARTBAR\"\n* The product number as field PRODNO\n\nExample given. For the IKSNR 48305 sequence number 1 named \"Felden, Gel\" with Packungscode \"024\" we get GTIN 7680483050247 and a product number 483051.\n\n\n## SSLv3 cert for Windows Users\n\nSome websites need SSLv3 connection.\nIf you don't have these root CA files (x509), Please install these Certificates before running.  \nsee [cURL Website](http://curl.haxx.se/ca/)\n\nYou can confirm wit `ruby -ropenssl -e 'p OpenSSL::X509::DEFAULT_CERT_FILE'`.\n\n### Windows User: Making your SSL Certificate permanent via your PATH\n\n1. Download this [cacert.pem](http://curl.haxx.se/ca/cacert.pem) (cURL) into your HOME directory.\n * or directly select cacert.pem from your oddb2xml-x.x.x gems directory.\n * tools/cacert.pem is bundled with the oddb2xml gem.\n2. Then Choose Menu \"Control Panel\" \u003e \"System\" \u003e \"Advanced system settings\"\n * This opens the \"System Properties\" Window.\n3. Click \"Advanced\" Tab.\n4. Click \"Environment Variables\" button.\n5. Add set variable entry \"SSL\\_CERT\\_FILE=%HOMEPATH%\\cacert.pem\"\n  * Variable name: SSL\\_CERT\\_FILE\n  * Variable value: %HOMEPATH%\\cacert.pem\n  * with \"New...\" button into upper are \"User variables for xxx\"\n6. Do not remove this cacert.pem. All SSLv3 connections use this file.\n\n### win_fetch_cacerts.rb\nYou can also run\n\n* tools/win_fetch_cacerts.rb\n\nfor your currently open Terminal to download and set the Certificate.\n\n\n## Testing\n\n* Calling rake spec runs spec tests.\n* Calling rake test installs the gems and runs oddb2xml with the most commonly used combinations. All output is placed under under ausgabe/\u003ctimestamp\u003e. These files should be manually compared to the ones generated by the last release to check for possible problems.\n* we use the gem VCR to record real HTTP responses.\n** Removing the directory fixtures and running @bundle exec rspec spec/downloader_spec.rb@ gets the actual content from the different servers\n** To minimize the downloaded size we use several @before_record@ hooks to select the desired content, eg. only the 5 items from EPha.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdavatz%2Foddb2xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdavatz%2Foddb2xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdavatz%2Foddb2xml/lists"}