Skip to main content

Latest version released on PyPi wheel python3 Build status of the master branch

Allscripts Touchworks Platform API Client for Python

Installation

Install from PyPI using pip

$ 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')

Authentication and Authorization

Please see http://developer.allscripts.com/ for more information

import touchworks

tw = TouchWorks('<url'>, '<your svc_username>' , '<your svc_password',
                '<your app_name>', '<ehr username>)

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.

Metadata

Release files for touchworks 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for touchworks 0.3
File Size Uploaded
touchworks-0.3.tar.gz 3.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for touchworks 0.3
File Interpreter ABI Platform
touchworks-0.3.macosx-10.6-intel.tar.gz Details
touchworks-0.3.macosx-10.6-intel.exe Details

Total release size: 69.7 kB

Release files / touchworks-0.3.tar.gz

Download URL touchworks-0.3.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9dc295966b7d235b5cdd876b74c13fea7ba899a83e31ccfca42d18a844734a0f
BLAKE2b-256 checksum
How to use checksums
5cd13898bbbc070eee309fedf3f49ae1de98453a8f85ea4f87325ce155c5908e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / touchworks-0.3.macosx-10.6-intel.tar.gz

Download URL touchworks-0.3.macosx-10.6-intel.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
24a8f9abbeb9fca8c63a04fc06e389f04610c5502b4f360ceccb2b6cfff9fc1f
BLAKE2b-256 checksum
How to use checksums
816e6be0b884b9da5c79979a628d4d13340fa04d898fa4576ea6d1d5b8f815fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / touchworks-0.3.macosx-10.6-intel.exe

Download URL touchworks-0.3.macosx-10.6-intel.exe
Size 64.2 kB
Tags Source
SHA-256 checksum
How to use checksums
165e5e8cc5088e3ad84811b7e7951b7951600e4f9436b372d938c28d290de582
BLAKE2b-256 checksum
How to use checksums
6fab02060c10db803cc5e040c8cdeddec6256b25233099ebc9b04307931cc351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3 This release

3 release files

0.2

3 release files

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page