Skip to main content

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

Project description

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

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carepoint-0.1.8b651.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carepoint-0.1.8b651-py2-none-any.whl (95.1 kB view details)

Uploaded Python 2

File details

Details for the file carepoint-0.1.8b651.tar.gz.

File metadata

  • Download URL: carepoint-0.1.8b651.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for carepoint-0.1.8b651.tar.gz
Algorithm Hash digest
SHA256 06fc903e23de440442c93e7b0dca604cfdc8214705c202be88a6d7a69168f509
MD5 07ae75a8b798c1e47e58e53c84433511
BLAKE2b-256 d9d1f03aaa95022db3a2c805453a94e6dd3f9dd52ff31439b0c1202a7b3fbbe5

See more details on using hashes here.

File details

Details for the file carepoint-0.1.8b651-py2-none-any.whl.

File metadata

File hashes

Hashes for carepoint-0.1.8b651-py2-none-any.whl
Algorithm Hash digest
SHA256 523f28dcdd074a1f2441239ae68c21cada99564bc64ba5181c74c2baaf0648f6
MD5 45e6ea11ada02a8f554068780fa47dd3
BLAKE2b-256 93d559f63e8a9b8568427ddaca8d69f7cc7cca6c3f90bbdfb8bae61250a4b2e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page