/eurekaclinical-python-client

Client library for accessing Eureka! Clinical's web services APIs

Primary LanguagePythonApache License 2.0Apache-2.0

Eureka! Clinical Python Client

Georgia Clinical and Translational Science Alliance (Georgia CTSA), Emory University, Atlanta, GA

A client library for accessing Eureka! Clinical's web services APIs.

Requirements

  • Python 2.7.10 or higher. Installation instructions for CentOS 6 are available at http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/. We use virtualenv as described on that page.
  • The requests module (can be installed using sudo pip install requests) version >= 2.11.0.
  • Tested on CentOS 6 and 7; and OS X 10.11. We expect the library will work on any OS that can run the Python version above.

On older operating systems, you may get the following warning printed to your screen on initial connection to Eureka:

SNIMissingWarning: An HTTPS request has been made, but the SNI
(Subject Name Indication) extension to TLS is not available on this
platform. This may cause the server to present an incorrect TLS
certificate, which can cause validation failures. You can upgrade to a
newer version of Python to solve this. For more information, see
https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.

This warning is generated by Python when an important component of SSL is missing from your operating system. While this software will likely work anyway, we strongly recommend that you upgrade your operating system to a newer version.

Installation

On the command line, execute python setup.py install.

Example

If you run eureka on your local machine using mvn tomcat7:run, you can access the REST APIs from python as follows:

import eurekaclinical

with eurekaclinical.connect('username', 'password', verify_cas_cert=False) as cn:
  with cn.analytics(verify_api_cert=False) as ec:
    print ec.users.me()
    print ec.concepts.get('ICD9:250.00')
    print ec.phenotypes.get('30-day readmission')

Limitations

Only local user accounts can login using this client.