def __init__(self, base_url, username,
                 password, app_name, cache_token=True,
                 token_timeout=TOKEN_DEFAULT_TIMEOUT_IN_SECS,
                 app_username=None):
        """
        creates an instance of TouchWorks, connects to the TouchWorks Web Service
        and caches username, password, app_name
        :param base_url: required
        :param username: required
        :param password: required
        :param app_name: required
        :param cache_token: optional
        :param token_timeout: optional
        :param app_username: optional
        :return:
        """
        if not base_url:
            raise ValueError('base_url can not be null')
        if not username:
            raise ValueError('username can not be null')
        if not password:
            raise ValueError('password can not be null')
        if not app_name:
            raise ValueError('app_name can not be null')
        self._base_url = base_url
        self._app_name = app_name
        self._username = username
        # FIXME: store username, password only if user decided to cache token
        self._password = password
        self._token_timeout = token_timeout
        self._ehr_username = app_username
        self._cache_token = cache_token
        self._token = self.get_token(self._app_name, self._username, self._password)
def __init__ ( self , base_url , username , password , app_name , cache_token = True , token_timeout = TOKEN_DEFAULT_TIMEOUT_IN_SECS , app_username = None ) : if not base_url : raise ValueError ( 'base_url can not be null' ) if not username : raise ValueError ( 'username can not be null' ) if not password : raise ValueError ( 'password can not be null' ) if not app_name : raise ValueError ( 'app_name can not be null' ) self . _base_url = base_url self . _app_name = app_name self . _username = username self . _password = password self . _token_timeout = token_timeout self . _ehr_username = app_username self . _cache_token = cache_token self . _token = self . get_token ( self . _app_name , self . _username , self . _password )
creates an instance of TouchWorks, connects to the TouchWorks Web Service
        and caches username, password, app_name
        :param base_url: required
        :param username: required
        :param password: required
        :param app_name: required
        :param cache_token: optional
        :param token_timeout: optional
        :param app_username: optional
        :return: