OHDSI Home | Forums | Wiki | Github

Importing the csv files downloaded from Athena to the OMOPCDM_sql_server_5.4_ddl


We have setup the OMOP CDM schema for a MSSQL database using the following ddl script https://github.com/OHDSI/CommonDataModel/blob/main/inst/ddl/5.4/sql_server/OMOPCDM_sql_server_5.4_ddl.sql

Using a Python script, I have successfully been able import the following csv files into the equivalent placeholder table:


However, trying to import the data from CONCEPT_SYNONYM.csv into the CONCEPT_SYNONYM table is resulting in the following error:

IntegrityError: (‘23000’, “[23000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert the value NULL into column ‘concept_synonym_name’, table ‘sqldb-gosh-CDM-dev.cdm.CONCEPT_SYNONYM’; column does not allow nulls. INSERT fails. (515) (SQLExecute)”)

I wanted to check if there was a standard approach or an OHDSI tool which is used for importing the vocabulary csv files into the predefined ddl?

Many thanks,

The process for downloading the vocab files and loading them into your CDM is documented here: General Structure, Download and Use · OHDSI/Vocabulary-v5.0 Wiki · GitHub. Make sure you follow all the steps there. The end of that section also links out to some scripts you can use to load the vocab data into your database.

If you followed all the steps in that process without issue, then maybe there’s an issue with your concept_synonym file (the concept_synonym_name should not be NULL).

PS - Broadsea also provides a module for reconstituting and loading the vocabulary data into a database.

Hi @katy-sadowski - Thanks so much for the steps above.

Had a look at the instructions and the link to the scripts to load the csv files is giving a 404 error. I raised this Github issue https://github.com/OHDSI/Vocabulary-v5.0/issues/901.

There a few files from the csv downloads that we have had to use workarounds to load the data into the tables. Hopefully one of the scripts in the Github repository will work and we can avoid the workarounds :slight_smile: