Skip to content

zdavatz/cpp2sqlite

Repository files navigation

cpp2sqlite

C++ tool to generate sqlite database containing Swiss Healthcare Public Domain Drug Information

History

This tool is a port of aips2sqlite

Requirements

  • Boost (BOOST_BIND_GLOBAL_PLACEHOLDERS is defined to suppress deprecated bind placeholder warnings)
  • C++17
  • sqlite
  • cmake
  • gcc-9
  • g++-9 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
  • xlnt with cmake -DSTATIC=on, also apply swissmedic.patch
  • jq (Command-line JSON processor)
  • json
  • xmllint

Installation

$ git clone
$ git submodule init
$ git submodule update

See build.sh

Usage

cpp2sqlite

./cpp2sqlite --inDir ~/.software/cpp2sqlite/input

deepl translation

_ run build/sappinfo to generate the unique language file.
_ comment in the line 20 of build.sh to do the translations.
_ if there are no errors, then commit intput/deepl.sappinfo.out.fr.txt.

Input Sources

_ AIPS
_ BAG XML
_ BAG FHIR (ndjson, use --fhir flag, prices from BAGFHIR are used by Refdata and Swissmedic lookups)
_ Refdata Artikel
_ Refdata Partner
_ Refdata SAI
_ Swissmedic
_ Swissmedic HPC
_ Swissmedic Chargenrückrufe
_ EPha
_ Swisspeddose
_ Sappinfo
_ Drugshortage

Output Sqlite Database

_ amiko_db_de
_ amiko_db_fr

Indikationscode (BAG XXXXX.NN)

When --fhir is set, two extra columns are appended at the tail of the amikodb schema:

  • indikationscode — comma-joined XXXXX.NN codes (BAG FOPHDossierNumber + ClinicalUseDefinition .NN suffix), deduped, in bundle order.
  • indikationscode_text — newline-joined XXXXX.NN: <limitations text> lines for the same set of codes.

Both columns are bundle-scoped at the BAG preparation level and joined onto each row by Swissmedic 5-digit registration number. Non-FHIR builds keep the legacy schema (columns 0..18 only), so existing apps that read by column index are unaffected. Mandatory transmission of IndC on prescriptions and invoices for SL drugs starts 2026-07-01 (BAG Rundschreiben 2026-02-19).

Glossary

_ GTIN

About

C++ tool to generate sqlite database containing Swiss Healthcare Public Domain Drug Information

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors