Instances of this class handle authorizing and talking to SMART on FHIR servers. More...
Public Member Functions | |
def | __init__ (self, settings=None, state=None, save_func=lambda x:x) |
def | desired_scope (self) |
Ensures self.scope is completed with launch scopes, according to current client settings. More... | |
def | ready (self) |
Returns True if the client is ready to make API calls (e.g. More... | |
def | prepare (self) |
Returns True if the client is ready to make API calls (e.g. More... | |
def | authorize_url (self) |
The URL to use to receive an authorization token. More... | |
def | handle_callback (self, url) |
You can call this to have the client automatically handle the auth callback after the user has logged in. More... | |
def | reauthorize (self) |
Try to reauthorize with the server. More... | |
def | patient (self) |
def | human_name (self, human_name_instance) |
Formats a HumanName instance into a string. More... | |
def | reset_patient (self) |
def | state (self) |
def | from_state (self, state) |
def | save_state (self) |
Public Attributes | |
app_id | |
app_secret | |
server | |
scope | |
redirect | |
launch_token | |
launch_context | |
wants_patient | |
patient_id | |
Instances of this class handle authorizing and talking to SMART on FHIR servers.
The settings dictionary supports:
- `app_id`*: Your app/client-id, e.g. 'my_web_app' - `app_secret`*: Your app/client-secret - `api_base`*: The FHIR service to connect to, e.g. 'https://fhir-api-dstu2.smarthealthit.org' - `redirect_uri`: The callback/redirect URL for your app, e.g. 'http://localhost:8000/fhir-app/' when testing locally - `patient_id`: The patient id against which to operate, if already known - `scope`: Space-separated list of scopes to request, if other than default - `launch_token`: The launch token
def fhirclient.client.FHIRClient.__init__ | ( | self, | |
settings = None , |
|||
state = None , |
|||
save_func = lambda x:x |
|||
) |
def fhirclient.client.FHIRClient.authorize_url | ( | self | ) |
The URL to use to receive an authorization token.
def fhirclient.client.FHIRClient.desired_scope | ( | self | ) |
Ensures self.scope
is completed with launch scopes, according to current client settings.
def fhirclient.client.FHIRClient.from_state | ( | self, | |
state | |||
) |
def fhirclient.client.FHIRClient.handle_callback | ( | self, | |
url | |||
) |
You can call this to have the client automatically handle the auth callback after the user has logged in.
:param str url: The complete callback URL
def fhirclient.client.FHIRClient.human_name | ( | self, | |
human_name_instance | |||
) |
Formats a HumanName
instance into a string.
def fhirclient.client.FHIRClient.patient | ( | self | ) |
def fhirclient.client.FHIRClient.prepare | ( | self | ) |
Returns True if the client is ready to make API calls (e.g.
there is an access token or this is an open server). In contrast to the ready
property, this method will fetch the server's capability statement if it hasn't yet been fetched.
:returns: True if the server can make authenticated calls
def fhirclient.client.FHIRClient.ready | ( | self | ) |
Returns True if the client is ready to make API calls (e.g.
there is an access token or this is an open server).
:returns: True if the server can make authenticated calls
def fhirclient.client.FHIRClient.reauthorize | ( | self | ) |
Try to reauthorize with the server.
:returns: A bool indicating reauthorization success
def fhirclient.client.FHIRClient.reset_patient | ( | self | ) |
def fhirclient.client.FHIRClient.save_state | ( | self | ) |
def fhirclient.client.FHIRClient.state | ( | self | ) |
fhirclient.client.FHIRClient.app_id |
fhirclient.client.FHIRClient.app_secret |
fhirclient.client.FHIRClient.launch_context |
fhirclient.client.FHIRClient.launch_token |
fhirclient.client.FHIRClient.patient_id |
fhirclient.client.FHIRClient.redirect |
fhirclient.client.FHIRClient.scope |
fhirclient.client.FHIRClient.server |
fhirclient.client.FHIRClient.wants_patient |