Allscripts Touchworks API Client for Python
Project description
Allscripts Touchworks Platform API Client for Python
Installation
$ pip install touchworks
Resources
Report issues on GitHub
Quick start
import touchworks
tw = TouchWorks('<url'>, '<your svc_username>' , '<your svc_password',
'<your app_name>')
#optional parameter : cache_token=True
#optional parameter: username : ehr_username
# search for patients whose name matches F*
patients = tw.search_patients(search_criteria='J*')
patient_id = patients[0]['ID']
#find patient activities
activities = tw.get_patient_activities(patient_id)
#find all encounters
cilinical_summary = tw.get_clinical_summary(patient_id)
# get schedules
schedules = tw.get_schedule(start_date='10/4/2015)
schedules = tw.get_schedule(start_date='10/4/2015, end_date='10/12/2015')
APIs Available
save_note
search_patients
get_document_type
get_patient
get_encounter
get_dictionary
find_document_type_by_name
get_encounter_list_for_patient
save_unstructured_document
set_patient_location_and_status
get_clinical_summary
get_patient_activity
set_patient_medhx_flag
get_changes_patients
get_patients_locations
get_patient_pharmacies
get_user_id
get_provider
get_provider_info
get_providers
get_task_list
save_message_from_pat_portal
save_task_comment
get_task
save_task_status
search_task_views
save_task
get_task_comments
get_delegates
get_task_list_by_view
get_schedule
get_documents
Error Handing
All supported APIs right now raise an exception of type TouchWorksException where the string will contain the error received from the TouchWorks WebService APIs.
example 1: service username or password is invalid:
touchworks.api.http.TouchWorksException: unable to acquire the token from web service
example 2: SaveNot action failed .. code-block:: python
touchworks.api.http.TouchWorksException: magic json api failed : Error converting data type varchar to numeric.
Logging
in order to enable debugging user can set the logging level to DEBUG.when DEBUG is enabled the library will print out each request and response in the logs.
Developers
build instructions:
make
flake8 is used to ensure that there are no syntax issues with the code. if you are contributing to the code base please make sure make is passing before you push the changes to the repository.
test
create a config.json file which contains these keys
{
"server": "http://somesandbox.com/Unity/UnityService.svc",
"appname": "Test App Name assigned to you",
"serviceusername": "Test Service User assigned to you",
"servicepassword": "Test Service Password assigned to you",
"ehr_username": "username that works on the sandbox",
"ehr_password": "password which would work on the sandbox"
}
and then
make tests
Supported Python Versions
This library aims to support and is tested against these Python versions:
2.7.6
3.4.0
PyPy
License
See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for touchworks-0.3.macosx-10.6-intel.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24a8f9abbeb9fca8c63a04fc06e389f04610c5502b4f360ceccb2b6cfff9fc1f |
|
MD5 | 8800dbbf296b7f11c54ad826be60010c |
|
BLAKE2b-256 | 816e6be0b884b9da5c79979a628d4d13340fa04d898fa4576ea6d1d5b8f815fb |
Hashes for touchworks-0.3.macosx-10.6-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 165e5e8cc5088e3ad84811b7e7951b7951600e4f9436b372d938c28d290de582 |
|
MD5 | da5f23cc2f84ac5ef6e0fc45b1c2b550 |
|
BLAKE2b-256 | 6fab02060c10db803cc5e040c8cdeddec6256b25233099ebc9b04307931cc351 |