Instances of this class handle authorizing and talking to SMART on FHIR servers. More...
Public Member Functions | |
__init__ (self, settings=None, state=None, save_func=lambda x:x) | |
prepare (self) | |
Returns True if the client is ready to make API calls (e.g. | |
handle_callback (self, url) | |
You can call this to have the client automatically handle the auth callback after the user has logged in. | |
authorize (self) | |
Try to authorize with the server. | |
reauthorize (self) | |
Try to reauthorize with the server. | |
human_name (self, human_name_instance) | |
Formats a HumanName instance into a string. | |
reset_patient (self) | |
from_state (self, state) | |
save_state (self) | |
Public Attributes | |
app_id | |
app_secret | |
server | |
scope | |
redirect | |
launch_token | |
launch_context | |
wants_patient | |
patient_id | |
jwt_token | |
Protected Member Functions | |
_handle_launch_context (self, ctx) | |
Protected Attributes | |
_patient | |
_save_func | |
Properties | |
desired_scope = property | |
Ensures self.scope is completed with launch scopes, according to current client settings. | |
ready = property | |
Returns True if the client is ready to make API calls (e.g. | |
authorize_url = property | |
The URL to use to receive an authorization token. | |
patient = property | |
state = property | |
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
fhirclient.client.FHIRClient.__init__ | ( | self, | |
settings = None , |
|||
state = None , |
|||
save_func = lambda x:x |
|||
) |
|
protected |
fhirclient.client.FHIRClient.authorize | ( | self | ) |
Try to authorize with the server.
fhirclient.client.FHIRClient.from_state | ( | self, | |
state | |||
) |
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.
url | str The complete callback URL |
fhirclient.client.FHIRClient.human_name | ( | self, | |
human_name_instance | |||
) |
Formats a HumanName
instance into a string.
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.
fhirclient.client.FHIRClient.reauthorize | ( | self | ) |
Try to reauthorize with the server.
fhirclient.client.FHIRClient.reset_patient | ( | self | ) |
fhirclient.client.FHIRClient.save_state | ( | self | ) |
|
protected |
|
protected |
fhirclient.client.FHIRClient.app_id |
fhirclient.client.FHIRClient.app_secret |
fhirclient.client.FHIRClient.jwt_token |
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 |
|
static |
The URL to use to receive an authorization token.
|
static |
Ensures self.scope
is completed with launch scopes, according to current client settings.
|
static |
|
static |
Returns True if the client is ready to make API calls (e.g.
there is an access token or this is an open server).
|
static |