Skip to content

Python package for managing OHDSI clinical data models. Includes support for LLM based plain text queries!

License

Notifications You must be signed in to change notification settings

dermatologist/pyomop

Repository files navigation

pyomop

OMOP CDM utils

Description

A python library for using the OMOP Common Data Model.

Installation

pip install https://github.com/dermatologist/pyomop/releases/download/1.1.0/pyomop-1.1.0-py2.py3-none-any.whl

Usage

from pyomop import CdmEngineFactory
from pyomop import metadata
from sqlalchemy.sql import select
import datetime

cdm = CdmEngineFactory()

engine = cdm.engine
# Create Tables 
metadata.create_all(engine)

Cohort = cdm.base.cohort
session =  cdm.session
session.add(Cohort(cohort_definition_id=2, subject_id=100, 
            cohort_end_date=datetime.datetime.now(), 
            cohort_start_date=datetime.datetime.now()))
session.commit()

s = select([Cohort])
result = session.execute(s)
for row in result:
    print(row)