Skip to content

Commit

Permalink
Merge branch 'feature/changes-v6' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatologist committed Oct 23, 2020
2 parents 743bedb + 53995ed commit 28f0fd1
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Python Test

on:
on:
push:
branches:
- master
- develop
pull_request:
branches:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Python Test

on:
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install tox
- name: Test with tox
run: |
tox
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyomop

OMOP CDM utils. This repo may be similar to [@jbadger3's](https://github.com/jbadger3) [inspectomop](https://github.com/jbadger3/inspectomop), but this is not a fork.
OMOP CDM utils. This repo may be similar to [@jbadger3's](https://github.com/jbadger3) [inspectomop](https://github.com/jbadger3/inspectomop), but this is not a fork.

## Description

Expand Down Expand Up @@ -29,6 +29,12 @@ import datetime
cdm = CdmEngineFactory() # Creates SQLite database by default
# Postgres example (db='mysql' also supported)
# cdm = CdmEngineFactory(db='pgsql', host='', port=5432,
# user='', pw='',
# name='', schema='cdm6')
engine = cdm.engine
# Create Tables if required
metadata.create_all(engine)
Expand All @@ -38,8 +44,8 @@ vocab = CdmVocabulary(cdm)
# SQLAlchemy as ORM
session = cdm.session
session.add(Cohort(cohort_definition_id=2, subject_id=100,
cohort_end_date=datetime.datetime.now(),
session.add(Cohort(cohort_definition_id=2, subject_id=100,
cohort_end_date=datetime.datetime.now(),
cohort_start_date=datetime.datetime.now()))
session.commit()
Expand Down
12 changes: 7 additions & 5 deletions src/pyomop/cdm6_tables.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""
Copyright (C) 2020 Bell Eapen
This file is part of PyOMOP.
PyOMOP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PyOMOP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PyOMOP. If not, see <http://www.gnu.org/licenses/>.
"""
Expand Down Expand Up @@ -454,7 +454,9 @@ class Person(Base):
year_of_birth = Column(Integer, nullable=False)
month_of_birth = Column(Integer)
day_of_birth = Column(Integer)
time_of_birth = Column(String(10))
#time_of_birth = Column(String(10))
birth_datetime = Column(String(10))
death_datetime = Column(String(10))
race_concept_id = Column(Integer, nullable=False)
ethnicity_concept_id = Column(Integer, nullable=False)
location_id = Column(Integer)
Expand Down
11 changes: 8 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

[tox]
minversion = 2.4
envlist = default
envlist = py37, integration

[testenv]
setenv = TOXINIDIR = {toxinidir}
passenv =
HOME
deps =
pytest
commands =
py.test {posargs}
extras =
all
testing

[testenv:integration]
setenv = TOXINIDIR = {toxinidir}
commands =
python t_install.py

0 comments on commit 28f0fd1

Please sign in to comment.