Module Import alias ImportFrom alias alias alias Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Lambda arguments args NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareIsNot NameLoad NameLoad body If UnaryOpNot CompareIn Str NameLoad body Raise Call NameLoad Str If UnaryOpNot CompareIn Str NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword SubscriptLoad NameLoad Index Str orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad Str attr ListLoad NameLoad NameLoad orelse If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr ListLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body If AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return CompareIsNot AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad CompareIsNot AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Import alias TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Return Str Assign NameStore ListLoad For NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return IfExp CompareGt Call NameLoad NameLoad Num Call AttributeLoad Str attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Dict Str Str Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assert NameLoad Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A logging server FHIRServer FHIRUnauthorizedException FHIRNotFoundException N/A __version__ 1.0.4 N/A __author__ SMART Platforms Team N/A __license__ APACHE2 N/A __copyright__ Copyright 2016 Boston Children's Hospital N/A scope_default user/*.* patient/*.read openid profile N/A scope_haslaunch launch N/A scope_patientlaunch launch/patient FHIRClient N/A object N/A N/A  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'
        - `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
     __init__ N/A N/A self settings state save_func N/A None None N/A N/A N/A x N/A x N/A N/A N/A self app_id None N/A  The app-id for the app this client is used in.  N/A N/A self server None N/A N/A self scope scope_default N/A N/A self redirect None N/A  The redirect-uri that will be used to redirect after authorization.  N/A N/A self launch_token None N/A  The token/id provided at launch, if any.  N/A N/A self launch_context None N/A  Context parameters supplied by the server during launch.  N/A N/A self wants_patient True N/A  If true and launched without patient, will add the correct scope
        to indicate that the server should prompt for a patient after login.  N/A N/A self patient_id None N/A N/A self _patient None N/A N/A save_func None N/A N/A N/A Exception Must supply a save_func when initializing the SMART client N/A N/A self _save_func save_func N/A N/A state None N/A N/A N/A N/A self from_state state N/A N/A N/A settings None N/A N/A N/A N/A app_id settings N/A N/A N/A Exception Must provide 'app_id' in settings dictionary N/A N/A N/A api_base settings N/A N/A N/A Exception Must provide 'api_base' in settings dictionary N/A N/A self app_id N/A settings N/A app_id N/A N/A self redirect N/A N/A settings get redirect_uri N/A N/A self patient_id N/A N/A settings get patient_id N/A N/A self scope N/A N/A settings get scope N/A self scope N/A N/A self launch_token N/A N/A settings get launch_token N/A N/A self server N/A FHIRServer self base_uri N/A settings N/A api_base N/A N/A N/A Exception Must either supply settings or a state upon client initialization N/A desired_scope N/A N/A self N/A N/A N/A  Ensures `self.scope` is completed with launch scopes, according to
        current client settings.
         N/A scope N/A self scope N/A N/A N/A self launch_token None N/A N/A scope N/A N/A join N/A scope_haslaunch scope N/A N/A N/A N/A N/A self patient_id None N/A self wants_patient N/A N/A scope N/A N/A join N/A scope_patientlaunch scope N/A scope N/A property ready N/A N/A self N/A N/A N/A  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
         N/A N/A N/A N/A self server None N/A N/A self server ready False N/A property prepare N/A N/A self N/A N/A N/A  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 Conformance
        statement if it hasn't yet been fetched.
        
        :returns: True if the server can make authenticated calls
         N/A N/A self server N/A N/A N/A N/A self server ready N/A N/A True N/A N/A N/A N/A self server prepare N/A False N/A authorize_url N/A N/A self N/A N/A N/A  The URL to use to receive an authorization token.
         N/A N/A N/A N/A self server None N/A N/A self server authorize_uri None N/A property handle_callback N/A N/A self url N/A N/A N/A  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
         N/A ctx N/A N/A N/A self server None N/A N/A N/A self server handle_callback url None N/A N/A N/A self _handle_launch_context ctx N/A reauthorize N/A N/A self N/A N/A N/A  Try to reauthorize with the server.
        
        :returns: A bool indicating reauthorization success
         N/A ctx N/A N/A N/A self server None N/A N/A N/A self server reauthorize N/A self server None N/A N/A N/A self _handle_launch_context ctx N/A N/A N/A self launch_context None N/A _handle_launch_context N/A N/A self ctx N/A N/A N/A N/A N/A logging debug N/A N/A SMART: Handling launch context: {0} format ctx N/A N/A patient ctx N/A N/A N/A self patient_id N/A ctx N/A patient N/A N/A id_token ctx N/A N/A N/A N/A logging warning SMART: Received an id_token, ignoring N/A N/A self launch_context ctx N/A N/A N/A self save_state N/A patient N/A N/A self N/A N/A N/A N/A N/A N/A self _patient None N/A N/A self patient_id None N/A self ready N/A N/A models.patient N/A N/A N/A N/A N/A logging debug N/A N/A SMART: Attempting to read Patient {0} format N/A self patient_id N/A N/A self _patient N/A N/A N/A N/A models patient Patient read N/A self patient_id N/A self server N/A N/A N/A FHIRUnauthorizedException N/A e N/A N/A N/A N/A self reauthorize N/A N/A N/A N/A logging debug N/A N/A SMART: Attempting to read Patient {0} after reauthorizing format N/A self patient_id N/A N/A self _patient N/A N/A N/A N/A models patient Patient read N/A self patient_id N/A self server N/A N/A FHIRNotFoundException N/A e N/A N/A N/A N/A logging warning N/A N/A SMART: Patient with id {0} not found format N/A self patient_id N/A N/A self patient_id None N/A N/A N/A self save_state N/A N/A self _patient N/A property human_name N/A N/A self human_name_instance N/A N/A N/A  Formats a `HumanName` instance into a string.
         N/A N/A human_name_instance None N/A N/A Unknown N/A parts N/A N/A n N/A N/A human_name_instance prefix N/A human_name_instance given N/A human_name_instance family N/A human_name_instance suffix N/A N/A N/A n None N/A N/A N/A N/A parts extend n N/A N/A N/A N/A len parts 0 N/A N/A join parts Unnamed N/A reset_patient N/A N/A self N/A N/A N/A N/A self launch_token None N/A N/A self launch_context None N/A N/A self patient_id None N/A N/A self _patient None N/A N/A N/A self save_state N/A state N/A N/A self N/A N/A N/A N/A app_id scope redirect patient_id server launch_token launch_context N/A self app_id N/A self scope N/A self redirect N/A self patient_id N/A N/A self server state N/A self launch_token N/A self launch_context N/A property from_state N/A N/A self state N/A N/A N/A state N/A N/A self app_id N/A N/A N/A state get app_id N/A self app_id N/A N/A self scope N/A N/A N/A state get scope N/A self scope N/A N/A self redirect N/A N/A N/A state get redirect N/A self redirect N/A N/A self patient_id N/A N/A N/A state get patient_id N/A self patient_id N/A N/A self launch_token N/A N/A N/A state get launch_token N/A self launch_token N/A N/A self launch_context N/A N/A N/A state get launch_context N/A self launch_context N/A N/A self server N/A FHIRServer self state N/A N/A state get server N/A save_state N/A N/A self N/A N/A N/A N/A N/A self _save_func N/A self state N/A N/A