Skip to content

Commit b0c2c9b

Browse files
author
Ted S
authored
Merge pull request #25 from laslabs/feature/0.1/readme-to-rst
[IMP] Change ReadMe to RST
2 parents fcbc49d + 9c60b69 commit b0c2c9b

2 files changed

Lines changed: 124 additions & 126 deletions

File tree

README.md

Lines changed: 0 additions & 126 deletions
This file was deleted.

README.rst

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
| |Build Status|
2+
| |Coveralls Status|
3+
| |Codecov Status|
4+
5+
Python CarePoint Library
6+
========================
7+
8+
This library will allow you to interact with CarePoint using Python.
9+
10+
| For the most part, it just provides some convenience wrappers to
11+
encapsulate
12+
| all of the tables within one object/session for easy use.
13+
14+
Most of the methods return SQLAlchemy ResultProxies.
15+
16+
Installation
17+
------------
18+
19+
To install this module, you need to:
20+
21+
- Utilize a system able to access all CarePoint network resources
22+
(database, SMB)
23+
- This includes things like DNS entries for the NETBIOS names
24+
- Setup UnixODBC - http://help.interfaceware.com/kb/904
25+
- Install UnixODBC development headers -
26+
``apt-get install unixodbc-dev``
27+
- Install dependencies - ``pip install -r requirements.txt``
28+
- Install library - ``pip install .``
29+
30+
Setup
31+
-----
32+
33+
- Create an Active Directory user
34+
- Give AD user permissions to CarePoint images and data net shares
35+
- Give AD user read & write permissions on the following databases:
36+
- cph
37+
- grx\_master
38+
39+
Usage
40+
-----
41+
42+
Connect to Database server
43+
~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
45+
::
46+
47+
from carepoint import Carepoint
48+
49+
cp = Carepoint(
50+
server='127.0.0.1',
51+
user='test_db_user',
52+
passwd='db_pass',
53+
)
54+
55+
Perform a search for a patient with the last name Smith
56+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+
::
59+
60+
res = cp.search(
61+
cp['Patient'],
62+
{'lname': 'Smith'},
63+
)
64+
for row in res:
65+
print row.fname
66+
67+
Perform a patient search, but only return the ``mname`` column
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
70+
::
71+
72+
res = cp.search(
73+
cp['Patient'],
74+
{'lname': 'Smith'},
75+
['mname'],
76+
)
77+
for row in res:
78+
print row.mname
79+
80+
Get patients modified in 2015
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82+
83+
::
84+
85+
res = cp.search(
86+
cp['Patient'],
87+
{
88+
'chg_date': {
89+
'<=': '2015-12-31',
90+
'>=': '2015-01-01',
91+
}
92+
},
93+
)
94+
for row in res:
95+
print row.fname
96+
97+
Get image using SMB path from database
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
100+
::
101+
102+
cp = Carepoint(**opts)
103+
img_rec = cp.search(cp['FdbImg']).first()
104+
image_file = cp.get_file(img_rec.IMAGE_PATH)
105+
image_data = image_file.read()
106+
107+
Known Issues / Road Map
108+
-----------------------
109+
110+
- More usage samples
111+
- A decent amount of models are missing
112+
- Create documentation of models
113+
- Add some basic validations
114+
- Create a column type that will retrieve file from SMB path in DB
115+
- Better SMB support (allow ftimes, dir list, caching)
116+
- FDB images only serve from store ID 1’s net share
117+
- Having to pass the model to the Carepoint object is annoying, object
118+
119+
.. |Build Status| image:: https://api.travis-ci.org/laslabs/Python-Carepoint.svg?branch=release%2F0.1
120+
:target: https://travis-ci.org/laslabs/Python-Carepoint
121+
.. |Coveralls Status| image:: https://coveralls.io/repos/laslabs/Python-Carepoint/badge.svg?branch=release%2F0.1
122+
:target: https://coveralls.io/r/laslabs/Python-Carepoint?branch=release%2F0.1
123+
.. |Codecov Status| image:: https://codecov.io/gh/laslabs/Python-Carepoint/branch/release%2F0.1/graph/badge.svg
124+
:target: https://codecov.io/gh/laslabs/Python-Carepoint

0 commit comments

Comments
 (0)