Skip to content

edencehealth/sqlalchemy_omopcdm_modelgen

Repository files navigation

sqlalchemy_omopcdm_modelgen

Repo URL
GitHub https://github.com/edencehealth/sqlalchemy_omopcdm_modelgen
Docker Hub https://hub.docker.com/r/edence/sqlalchemy-omopcdm-modelgen

This repo contains the source code for the tool we use to generate the model files in our edencehealth/sqlalchemy_omopcdm repo.

The source code in this repo is a containerized Python program which:

  • downloads the official OHDSI OMOP CDM DDL files
  • applies the DDL files to a PostgreSQL database server
  • applies edenceHealth custom DDL which adds composite primary keys to the tables that don't have a natural primary key
  • uses the tool sqlacodegen to scan that database to generate a Declarative Mapping-based SQLAlchemy 2 model for each table in the OMOP CDM, including primary keys, indexes, and constraints
  • rewrites the generated model using libcst to:
  • formats the resulting python module with the PSF tools black and isort

About

code generator that powers sqlalchemy_omopcdm

Resources

License

Stars

Watchers

Forks

Packages

No packages published