OMOP CDM utils in Python
Project description
pyomop
OMOP CDM utils
Description
The OHSDI OMOP Common Data Model allows for the systematic analysis of healthcare observational databases. This is a python library to use the CDM v6 compliant databases.
Support
- Postgres
- MySQL
- SqLite
- More to follow..
Installation
pip install pyomop
Usage
from pyomop import CdmEngineFactory
from pyomop import metadata
from sqlalchemy.sql import select
import datetime
cdm = CdmEngineFactory() # Creates SQLite database by default
engine = cdm.engine
# Create Tables
metadata.create_all(engine)
# Create vocabulary
vocab = CdmVocabulary(cdm)
vocab.create_vocab('/path/to/csv/files')
# SQLAlchemy as ORM
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)
command-line usage
pyomop -help
What to expect
- Integration with machine learning libraries
Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pyomop-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91473420b8d42019c101ff3ec930afcd20e746265ca03a3f57e557d3bf65a24e |
|
MD5 | 3360d6bddccf006edd3439ef4bddb321 |
|
BLAKE2b-256 | 74e1b13579cc54bd49706ffdf5e53fed7b415791b04d1a80bdae0f16360c2289 |