Giter VIP home page Giter VIP logo

python-carepoint's Introduction

Build Status | Coveralls Status | Codecov Status | Code Climate

Python CarePoint Library

This library will allow you to interact with CarePoint using Python.

For the most part, it just provides some convenience wrappers to encapsulate
all of the tables within one object/session for easy use.

Most of the methods return SQLAlchemy ResultProxies.

Installation

To install this module, you need to:

  • Utilize a system able to access all CarePoint network resources (database, SMB)
  • This includes things like DNS entries for the NETBIOS names
  • Setup UnixODBC - http://help.interfaceware.com/kb/904
  • Install UnixODBC development headers - apt-get install unixodbc-dev or yum install unixODBC-devel
  • Install dependencies - pip install -r requirements.txt
  • Install library - pip install .

Setup

  • Create an Active Directory user
  • Give AD user permissions to CarePoint images and data net shares
  • Give AD user read & write permissions on the following databases:
  • cph
  • grx_master

Usage

Connect to Database server

from carepoint import Carepoint

cp = Carepoint(
    server='127.0.0.1',
    user='test_db_user',
    passwd='db_pass',
)

Perform a search for a patient with the last name Smith

res = cp.search(
    cp['Patient'],
    {'lname': 'Smith'},
)
for row in res:
    print row.fname

Perform a search for a patient with the last name Smith or Jones

res = cp.search(
    cp['Patient'],
    {'lname': ['Smith', 'Jones']},
)
for row in res:
    print row.fname

Perform a patient search, but only return the mname column

res = cp.search(
    cp['Patient'],
    {'lname': 'Smith'},
    ['mname'],
)
for row in res:
    print row.mname

Get patients modified in 2015

res = cp.search(
    cp['Patient'],
    {
        'chg_date': {
            '<=': '2015-12-31',
            '>=': '2015-01-01',
        }
    },
)
for row in res:
    print row.fname

Get image using SMB path from database

cp = Carepoint(**opts)
img_rec = cp.search(cp['FdbImg']).first()
image_file = cp.get_file(img_rec.IMAGE_PATH)
image_data = image_file.read()

Known Issues / Road Map

  • More usage samples
  • A decent amount of models are missing
  • Create documentation of models
  • Add some basic validations
  • Create a column type that will retrieve file from SMB path in DB
  • Better SMB support (allow ftimes, dir list, caching)
  • FDB images only serve from store ID 1’s net share
  • Having to pass the model to the Carepoint object is annoying, object

python-carepoint's People

Contributors

lasley avatar vcorcoran avatar

Stargazers

Glenn Nagel avatar Fitz avatar

Watchers

James Cloos avatar  avatar

Forkers

libertang0

python-carepoint's Issues

Bad docblock in policy_sign

In policy_sign (line 17). The comment says 'usage_policies (tuple of PolicyUser): Usage’ I believe this should be PolicyUse, but it's just a comment.

Assumed existing hosts in cfssl.to_api

In cfssl.py (line 347): host.to_api() for host in hosts
This fails if hosts are not specified. The default value for hosts is None, it should be []
Also easy enough to work around by specifying the value in the call

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.