Skip to content

Commit

Permalink
Finish 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatologist committed Jun 27, 2020
2 parents be039af + 1fd2055 commit 8bf264f
Show file tree
Hide file tree
Showing 16 changed files with 1,511 additions and 630 deletions.
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# How to contribute

## Please note:

* (Optional) We adopt [Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). Most feature branches are pushed to the repository and deleted when merged to *develop* branch.
* (**Important**): Submit pull requests to the *develop* branch or *feature/* branches
* Use *GitHub Issues* for feature requests and bug reports. Include as much information as possible while reporting bugs.


## Contributing (Step-by-step)

1. [Fork the repo](http://help.github.com/fork-a-repo) and clone it to your local computer, and set up the upstream remote:

git clone https://github.com/YourGithubUsername/pyomop.git
cd pyomop
git remote add upstream https://github.com/dermatologist/pyomop.git

2. Checkout out a new local branch based on your master and update it to the latest (TRUNK-123 is the branch name, You can name it whatever you want. Try to give it a meaningful name. If you are fixing an issue, please include the issue #).

git checkout -b BRANCH-123 develop
git clean -df
git pull --rebase upstream develop

> Please keep your code clean. If you find another bug, you want to fix while being in a new branch, please fix it in a separated branch instead.
3. Push the branch to your fork. Treat it as a backup.

git push origin BRANCH-123

4. Code

* Adhere to common conventions you see in the existing code.
* Include tests as much as possible, and ensure they pass.

5. Commit to your branch

git commit -m "BRANCH-123: Put change summary here (can be a ticket title)"

**NEVER leave the commit message blank!** Provide a detailed, clear, and complete description of your commit!

6. Update your branch to the latest code.

git pull --rebase upstream develop

7. **Important** If you have made many commits, please squash them into atomic units of work. (Most Git GUIs such as sourcetree and smartgit offer a squash option)

git checkout develop
git pull --rebase upstream develop
git merge --squash BRANCH-123
git commit -m "fix: 123"

Push changes to your fork:

git push

8. Issue a Pull Request

In order to make a pull request:
* Click "Pull Request".
* Choose the develop branch
* Click 'Create pull request'
* Fill in some details about your potential patch including a meaningful title.
* Click "Create pull request".

Thanks for that -- we'll get to your pull request ASAP. We love pull requests!

## Feedback

If you need to contact me, see my contact details on my profile page.
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion LICENSE.txt

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pip install pyomop
## Usage

```
from pyomop import CdmEngineFactory
from pyomop import metadata
from pyomop import CdmEngineFactory, CdmVocabulary, Cohort, Vocabulary, metadata
from sqlalchemy.sql import select
import datetime
Expand All @@ -34,10 +33,9 @@ engine = cdm.engine
metadata.create_all(engine)
# Create vocabulary
vocab = CdmVocabulary(cdm)
vocab.create_vocab('/path/to/csv/files')
# vocab.create_vocab('/path/to/csv/files') # Uncomment to load vocabulary 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(),
Expand All @@ -48,6 +46,9 @@ s = select([Cohort])
result = session.execute(s)
for row in result:
print(row)
result.close()
for v in session.query(Vocabulary).order_by(Vocabulary.vocabulary_name):
print(v.vocabulary_name)
```

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions notes/notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Use sqlacodegen
pip install sqlacodegen
sqlacodegen sqlite:///database.db


## Create an _id primary key field in the autogenerated script

Replace metadata, with
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
sqlacodegen
sqlalchemy
click
pandas
pandas
pytest
psycopg2
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package_dir =
# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD!
setup_requires = pyscaffold>=3.2a0,<3.3a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires = sqlalchemy; click
install_requires = sqlalchemy; click; pandas; psycopg2
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
Expand Down
45 changes: 45 additions & 0 deletions src/pyomop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,51 @@
from .cdm6_tables import metadata
from .vocabulary import CdmVocabulary

from .cdm6_tables import AttributeDefinition
from .cdm6_tables import CareSite
from .cdm6_tables import CdmSource
from .cdm6_tables import Cohort
from .cdm6_tables import CohortAttribute
from .cdm6_tables import CohortDefinition
from .cdm6_tables import Concept
from .cdm6_tables import ConceptAncestor
from .cdm6_tables import ConceptClass
from .cdm6_tables import ConceptRelationship
from .cdm6_tables import ConceptSynonym
from .cdm6_tables import ConditionEra
from .cdm6_tables import ConditionOccurrence
from .cdm6_tables import Death
from .cdm6_tables import DeviceCost

from .cdm6_tables import DeviceExposure
from .cdm6_tables import Domain
from .cdm6_tables import DoseEra
from .cdm6_tables import DrugCost
from .cdm6_tables import DrugEra

from .cdm6_tables import DrugExposure
from .cdm6_tables import DrugStrength
from .cdm6_tables import FactRelationship
from .cdm6_tables import Location
from .cdm6_tables import Measurement

from .cdm6_tables import Note
from .cdm6_tables import Observation
from .cdm6_tables import ObservationPeriod
from .cdm6_tables import PayerPlanPeriod
from .cdm6_tables import Person

from .cdm6_tables import ProcedureCost
from .cdm6_tables import ProcedureOccurrence
from .cdm6_tables import Provider
from .cdm6_tables import Relationship
from .cdm6_tables import SourceToConceptMap

from .cdm6_tables import Speciman
from .cdm6_tables import VisitCost
from .cdm6_tables import VisitOccurrence
from .cdm6_tables import Vocabulary

try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
Expand Down

0 comments on commit 8bf264f

Please sign in to comment.