-
Loading fimea drug database to postgres.
-
Convert and export the input files required for OHDSI BuildRxE.
https://www.fimea.fi/laakehaut_ja_luettelot/perusrekisteri
https://www.fimea.fi/web/en/databases_and_registers/basic-register
SQL-files are named using flyway conventions, typically
-
Vx__filename.sql for creating and altering tables
-
R__filename.sql for defining views and functions
If run manually, the order is V1__, V2__, .... R__a***, R__b***, ...
Additionally, flyway hook beforeEachMigrate is used to reset the role to the desired object owner. This is not necessary if the role is set manually.
etl/ dir contains etl scripts
-
Copy config-template.sh -> config.sh and edit (do not edit placeholders in copy-files-template.sh, these are replaced automatically in the scripts).
-
Run numbered shell-scripts
The documentation from fimea implies an underlying data model (quasi ER-diagram and list of tables and fields). The following changes have to be made to the data model for the data to fit.
Laakeaine references both pakkaus_nolla and pakkaus_m (määräaikaiset) from the same id column (pakkausnro). This is not possible to implement as a foreign key.
Solution:
pakkaus_m is inserted into pakkaus, with an additional boolean field maaraaikainen in the pakkaus table (maaraaikainen BOOLEAN DEFAULT FALSE).
maaraamisehto table is used for both maaraamisehto and maaraamisehto_m
-
pakkaus, pakkaus_m:
-
Remove null constraint: kerroin, koko, vahvuus, yksikkö, pakkauskoko, atckoodi, atc
-
varchar(19) --> varchar(100): eumyyntilupanro (eg, "EU/1/96/007/002,020-021", "EU/1/96/022/002,019,023,029,035")
-
-
laakeaine
- Remove null constraint: ainenimi
- there are some empty lines in laakeaine.txt (66648, 67281) These are removed in etl script.
Views named export_ohdsi_*
are intended for exporting mapping tables to submit drug mappings to OHDSI maintained RxNorm Extension Vocabulary.
The process and the tables are documented here: FinOMOP drug mappings using RxE boiler