jmandel / smart_client_python

SMArt application API: client library for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMArt Python Client Library

To generate this README:

  $ python generate_readme.py > README

---


class SmartClient(oauth.OAuthClient)
 |  Establishes OAuth communication with a SMArt Container, and
 |  provides access to the SMArt REST API
 |  
 |  Method resolution order:
 |      SmartClient
 |      oauth.OAuthClient
 |      __builtin__.object
 |  
 |  Methods defined here:
 |  
 |  __init__(self, app_id, server_params, consumer_token, resource_token=None)
 |      Constructor for SmartClient. 
 |      
 |      app_id:  ID by which the app is known to the SMArt Container
 |      
 |      server_params: Hash containing an "api_base" key pointing
 |      to the SMArt Container's base URL.
 |      
 |          e.g. {"api_base" : "http://sandbox-api.smartplatforms.org"}
 |      
 |      consumer_token: Hash containing a "consumer_key" and
 |      "consumer_secret" to be used for two- and three-legged
 |      OAuth requests.
 |      
 |      resource_token (optional): Hash containing session
 |      "oauth_token" and "oauth_token_secret" to be used for
 |      three-legged OAuth requests.
 |  
 |  capabilities_GET = c(self, *args, **kwargs)
 |      GET /capabilities/
 |      
 |      Get a list of all auxiliiary container capabilities
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Container
 |  
 |  data_mapper(self, data)
 |      Hook to parse the results of OAuth requests into a
 |      query-able RDF graph
 |  
 |  delete(self, url, data=None, content_type=None)
 |      Issue an HTTP DELETE request to the specified URL and
 |      return the response body.
 |  
 |  exchange(self, request_token, verifier=None)
 |  
 |  get(self, url, data=None, content_type=None)
 |      Issue an HTTP GET request to the specified URL and
 |      return the response body.
 |      
 |            data: a dictionary of data to be url-encoded, or a
 |            string containing the HTTP request message body.
 |      
 |            content_type:  defaults to "application/x-www-form-urlencoded"
 |  
 |  get_request_token(self, params={})
 |  
 |  loop_over_records(self)
 |      Iterator allowing background apps to loop through each
 |      patient record in the SMArt container, e.g. to perform
 |      reporting or analytics.  For each patient record in the
 |      container, sets access tokens on the SmartClient object and
 |      yields the new record_id.
 |  
 |  ontology_GET = c(self, *args, **kwargs)
 |      GET /ontology
 |      
 |      Retrieve ontology used by a SMArt container
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Ontology
 |  
 |  post(self, url, data='', content_type='application/rdf+xml')
 |      Issue an HTTP POST request to the specified URL and
 |      return the response body.
 |      
 |            data: string containing HTTP request message body.
 |      
 |            content_type:  defaults to "application/x-www-form-urlencoded"
 |  
 |  put(self, url, data='', content_type='application/rdf+xml')
 |      Issue an HTTP PUT request to the specified URL and
 |      return the response body.
 |      
 |            data: string containing HTTP request message body.
 |      
 |            content_type:  defaults to "application/x-www-form-urlencoded"
 |  
 |  records_POST = c(self, *args, **kwargs)
 |      POST /records/
 |      
 |      Create a new medical record from the supplied graph
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#MedicalRecord
 |  
 |  records_X_alerts_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/alerts/
 |      
 |      Post new Alert for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Alert
 |  
 |  records_X_allergies_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/allergies/
 |      
 |      Get all allergies for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Allergy
 |  
 |  records_X_allergies_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/allergies/
 |      
 |      Post allergies for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Allergy
 |  
 |  records_X_allergies_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/allergies/{allergy_id}
 |      
 |      Get allergies for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Allergy
 |  
 |  records_X_demographics_DELETE = c(self, *args, **kwargs)
 |      DELETE /records/{record_id}/demographics
 |      
 |      Delete demographics for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Demographics
 |  
 |  records_X_demographics_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/demographics
 |      
 |      Get all demographics for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Demographics
 |  
 |  records_X_demographics_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/demographics
 |      
 |      Add to demographics for a patient with a newly-supplied graph
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Demographics
 |  
 |  records_X_encounters_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/encounters/
 |      
 |      Get all encounters for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Encounter
 |  
 |  records_X_encounters_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/encounters/
 |      
 |      Post encounters for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Encounter
 |  
 |  records_X_encounters_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/encounters/{encounter_id}
 |      
 |      Get encounters for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Encounter
 |  
 |  records_X_fulfillments_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/fulfillments/
 |      
 |      Get all fulfillments for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Fulfillment
 |  
 |  records_X_fulfillments_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/fulfillments/
 |      
 |      Post fulfillments for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Fulfillment
 |  
 |  records_X_fulfillments_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/fulfillments/{fulfillment_id}
 |      
 |      Get fulfillments for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Fulfillment
 |  
 |  records_X_lab_results_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/lab_results/
 |      
 |      Get all lab results for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#LabResult
 |  
 |  records_X_lab_results_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/lab_results/
 |      
 |      Post lab results for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#LabResult
 |  
 |  records_X_lab_results_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/lab_results/{lab_result_id}
 |      
 |      Get lab results for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#LabResult
 |  
 |  records_X_medications_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/medications/
 |      
 |      Get all medications for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Medication
 |  
 |  records_X_medications_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/medications/
 |      
 |      Post new medication for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Medication
 |  
 |  records_X_medications_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/medications/{medication_id}
 |      
 |      Get medication for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Medication
 |  
 |  records_X_problems_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/problems/
 |      
 |      Get all problems for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Problem
 |  
 |  records_X_problems_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/problems/
 |      
 |      Post problems for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Problem
 |  
 |  records_X_problems_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/problems/{problem_id}
 |      
 |      Get problems for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#Problem
 |  
 |  records_X_vital_signs_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/vital_signs/
 |      
 |      Get all vital signs for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#VitalSigns
 |  
 |  records_X_vital_signs_POST = c(self, *args, **kwargs)
 |      POST /records/{record_id}/vital_signs/
 |      
 |      Post vital signs for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#VitalSigns
 |  
 |  records_X_vital_signs_X_GET = c(self, *args, **kwargs)
 |      GET /records/{record_id}/vital_signs/{vital_signs_id}
 |      
 |      Get vital signs for a patient
 |      
 |      Returns RDF Graph containing:  http://smartplatforms.org/terms#VitalSigns
 |  
 |  redirect_url(self, request_token)
 |  
 |  update_token(self, resource_token)
 |      Sets the session token for subsequent three-legged OAuth requests.
 |      
 |      resource_token: Hash containing session "oauth_token" and
 |      "oauth_token_secret" to be used for three-legged OAuth
 |      requests.
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  ontology_file = '<?xml version="1.0"?>\n\n\n<!DOCTYPE rdf:RDF [\n    ....
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from oauth.OAuthClient:
 |  
 |  access_resource(self, http_request, with_content_type=False)
 |      host is a dictionary containing protocol, hostname, and port
 |      if port is not specified, it is assumed to be 80 for http, and 443 for https
 |  
 |  fetch_access_token(self, request_token, verifier=None)
 |  
 |  fetch_request_token(self)
 |  
 |  get_authorize_url(self, request_token)
 |  
 |  get_consumer(self)
 |  
 |  get_token(self)
 |  
 |  set_token(self, token)
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from oauth.OAuthClient:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from oauth.OAuthClient:
 |  
 |  consumer = None
 |  
 |  token = None

About

SMArt application API: client library for python


Languages

Language:Python 100.0%