Sign inSign up

edence/sqlalchemy-omopcdm-modelgen

By edence

•Updated about 2 years ago

code generator that powers sqlalchemy_omopcdm

Image
0

2.6K

edence/sqlalchemy-omopcdm-modelgen repository overview

⁠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⁠

Tag summary

Content type

Image

Digest

sha256:438b9a474…

Size

126.7 MB

Last updated

about 2 years ago

docker pull edence/sqlalchemy-omopcdm-modelgen