def status( self, uuid, link_charge_id=None, ): """Status. :param uuid: Id of the link :param link_charge_id: The uuid of the prior charge against this link (optional) """ request_data = { 'link_charge_id': link_charge_id, 'uuid': uuid, } errors_mapping = {} errors_mapping['INVALID_SOURCE'] = InvalidSource( 'The referer is invalid') errors_mapping['IP_BLOCKED'] = IpBlocked( 'An IP whitelist blocked access') errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The link was not found') query_data = { 'api': self._api, 'url': '/link/status', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def list( self, language, tags, account_id=None, vanity=None, ): """List. :param language: The ISO 639-1 language code :param tags: A comma separated list of the terminology tags to look up :param account_id: account_id :param vanity: vanity Notes: (account_id OR vanity) - The uuid or vanity name of the account to apply any account overrides for (optional) """ request_data = { 'vanity': vanity, 'tags': tags, 'language': language, 'account_id': account_id, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) query_data = { 'api': self._api, 'url': '/terminology/list', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def delete( self, uuid, ): """Delete. :param uuid: The dictionary id """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The dictionary can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/dictionary/delete', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def delete( self, uuid, ): """Delete. :param uuid: The filter uuid """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping[('NOT_FOUND', None)] = NotFound('The filter can not be found') errors_mapping[( 'NOT_PERMITTED', None)] = NotPermitted('You are not the owner of the filter') query_data = { 'api': self._api, 'url': '/filter/delete', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def find( self, last, state, first=None, zip=None, ): """Find. :param last: Last name :param state: 2 letter state code :param first: First name (optional) :param zip: Zip code (optional) """ request_data = { 'state': state, 'zip': zip, 'last': last, 'first': first, } errors_mapping = {} errors_mapping['LOOKUP_FAILED'] = LookupFailed( 'The lookup against the NPI registry failed') errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) query_data = { 'api': self._api, 'url': '/npi/find', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def study_list( self, uuid, viewable_only, ): """Study list. :param uuid: The patient id :param viewable_only: Flag if they only want the studies the user can view """ request_data = { 'uuid': uuid, 'viewable_only': viewable_only, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields') errors_mapping['NOT_FOUND'] = NotFound('The patient can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to view this patient') query_data = { 'api': self._api, 'url': '/patient/study/list', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def portal_pin( self, alt_email, alt_mobile_phone, email, mobile_phone, patient_id, ): """Portal pin. :param alt_email: Flag if they want the PIN sent via the alt_email :param alt_mobile_phone: Flag if they want the PIN sent via SMS to the alt_mobile_phone :param email: Flag if they want the PIN sent via email :param mobile_phone: Flag if they want the PIN sent via SMS :param patient_id: The patient id """ request_data = { 'alt_email': alt_email, 'patient_id': patient_id, 'alt_mobile_phone': alt_mobile_phone, 'mobile_phone': mobile_phone, 'email': email, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields') errors_mapping['NOT_FOUND'] = NotFound('The patient can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to do this') query_data = { 'api': self._api, 'url': '/patient/portal/pin', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def report_detail( self, account_id, ): """Report detail. :param account_id: The account id """ request_data = { 'account_id': account_id, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The account was not found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to run this report') errors_mapping['REPORT_ERROR'] = ReportError( 'Unable to start the report') query_data = { 'api': self._api, 'url': '/role/report/detail', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def set( self, key, value, user_id=None, ): """Set. :param key: The key to store the value under. If the key name begins with temp it is only available for the session. :param value: The value to store :param user_id: A sysadmin user can set the value for a specific user (optional) """ request_data = { 'user_id': user_id, 'value': value, 'key': key, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields') query_data = { 'api': self._api, 'url': '/setting/set', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def attach( self, uuid, account_id=None, add_if_no_match=None, approve_if_match=None, delay=None, global_counter=None, namespace_id=None, run_once=None, sequence=None, skip_if_lookup_unchanged=None, skip_if_replace_has_value=None, ): """Attach. :param uuid: The dictionary id :param account_id: account_id :param add_if_no_match: Flag to add the lookup and replace values to the dictionary if no match occurs (optional) :param approve_if_match: Approve the object if there was a match (optional) :param delay: An integer number of seconds to delay the dictionary application (optional) :param global_counter: A flag if you want the counter to run against the account namespace instead of the object namespace (optional) :param namespace_id: namespace_id :param run_once: Flag to make dictionary apply only once per object (optional) :param sequence: An integer value. Attachments are processed from low number to high number (optional) :param skip_if_lookup_unchanged: Flag to skip the lookup if the lookup field(s) are un-changed (optional) :param skip_if_replace_has_value: Flag to skip the lookup if the replace field already has a value (optional) """ request_data = { 'account_id': account_id, 'add_if_no_match': add_if_no_match, 'approve_if_match': approve_if_match, 'delay': delay, 'global_counter': global_counter, 'namespace_id': namespace_id, 'run_once': run_once, 'sequence': sequence, 'skip_if_lookup_unchanged': skip_if_lookup_unchanged, 'skip_if_replace_has_value': skip_if_replace_has_value, 'uuid': uuid, } errors_mapping = {} errors_mapping[('MISSING_FIELDS', None)] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping[( 'NOT_FOUND', None)] = NotFound('The dictionary or entry can not be found') errors_mapping[( 'NOT_PERMITTED', None)] = NotPermitted('You are not permitted to do this') query_data = { 'api': self._api, 'url': '/dictionary/attach', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def delete( self, uuid, ): """Delete. :param uuid: The role uuid """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping['IN_USE'] = InUse( 'The role is in use. The error_subtype holds a array of the objects that are using it' ) errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The role can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to delete this role') query_data = { 'api': self._api, 'url': '/role/delete', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def done( self, account_id, additional_parameters, form_number, ): """Done. :param account_id: Id of the account the training is for :param additional_parameters: All additional parameters will be logged as part of the TRAINING_DONE user audit event :param form_number: The formstack id of the form """ request_data = { 'form_number': form_number, 'account_id': account_id, } if additional_parameters is not None: additional_parameters_dict = { '{prefix}{k}'.format(prefix='', k=k): v for k, v in additional_parameters.items() } request_data.update(additional_parameters_dict) errors_mapping = {} errors_mapping['NOT_FOUND'] = NotFound( 'The form was not found for this user') query_data = { 'api': self._api, 'url': '/training/done', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def charge( self, charge_token, uuid, ): """Charge. :param charge_token: The stripe charge token :param uuid: The uuid of the link """ request_data = { 'charge_token': charge_token, 'uuid': uuid, } errors_mapping = {} errors_mapping['CHARGE_FAILED'] = ChargeFailed( 'The charge failed. The error_subtype holds the details on the error' ) errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The link was not found') query_data = { 'api': self._api, 'url': '/link/charge', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def mail( self, email, uuid, ): """Mail. :param email: Email address :param uuid: The uuid of the link """ request_data = { 'uuid': uuid, 'email': email, } errors_mapping = {} errors_mapping['INVALID_EMAIL'] = InvalidEmail( 'Enter a valid email address') errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The link was not found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/link/mail', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def get( self, uuid, ): """Get. :param uuid: Id of the message """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping[('MISSING_FIELDS', None)] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping[('NOT_FOUND', None)] = NotFound('The message can not be found') errors_mapping[( 'NOT_PERMITTED', None)] = NotPermitted('You are not permitted to view this message') query_data = { 'api': self._api, 'url': '/message/get', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def lookup( self, account_id, name, ): """Lookup. :param account_id: uuid of the account :param name: Name of the customfield """ request_data = { 'name': name, 'account_id': account_id, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The customfield can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/customfield/lookup', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def get( self, uuid, ): """Get. :param uuid: The activity uuid """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound('The activity was not found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to access this activity') query_data = { 'api': self._api, 'url': '/activity/get', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def search( self, uuid, search=None, ): """Search. :param uuid: uuid of the customfield :param search: The value to search for (optional) """ request_data = { 'uuid': uuid, 'search': search, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_A_SEARCH'] = NotASearch( 'This is not a search type of customfield') errors_mapping['NOT_FOUND'] = NotFound( 'The customfield can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/customfield/search', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def portal_find( self, birth_date, first, last, mrn, ): """Portal find. :param birth_date: Date of birth :param first: The first name :param last: The last name :param mrn: MRN (required if the require_mrn_for_patient_portal account setting is on) """ request_data = { 'mrn': mrn, 'last': last, 'first': first, 'birth_date': birth_date, } errors_mapping = {} errors_mapping['INVALID_DATE'] = InvalidDate('An invalid date was passed') errors_mapping['MISSING_FIELDS'] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields') errors_mapping['NOT_FOUND'] = NotFound('The patient can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to perform this search') query_data = { 'api': self._api, 'url': '/patient/portal/find', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def user_delete( self, user_id, uuid, ): """User delete. :param user_id: Id of the user :param uuid: The site id """ request_data = { 'user_id': user_id, 'uuid': uuid, } errors_mapping = {} errors_mapping[('MISSING_FIELDS', None)] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping[('NOT_FOUND', None)] = NotFound('The site can not be found') errors_mapping[('NOT_PERMITTED', None)] = NotPermitted( 'You are not permitted to delete users from the contact list') errors_mapping[('USER_NOT_FOUND', None)] = UserNotFound( 'The user can not be found in the contact list') query_data = { 'api': self._api, 'url': '/site/user/delete', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def portal_login( self, patient_id, pin, ): """Portal login. :param patient_id: The patient id :param pin: The PIN """ request_data = { 'pin': pin, 'patient_id': patient_id, } errors_mapping = {} errors_mapping['INVALID_PIN'] = InvalidPin('The PIN is invalid or expired') errors_mapping['LOCKOUT'] = Lockout('Too many failed attempts') errors_mapping['MISSING_FIELDS'] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields') errors_mapping['NOT_FOUND'] = NotFound('The patient can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to do this') query_data = { 'api': self._api, 'url': '/patient/portal/login', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def delete( self, uuid, ): """Delete. :param uuid: The code uuid """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping['IS_DEPLOYED'] = IsDeployed( 'The code is deployed and can not be deleted') errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to delete the code') query_data = { 'api': self._api, 'url': '/customcode/delete', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def add( self, configuration, name, type, account_id=None, tier_parent_id=None, ): """Add. :param configuration: The configuration as a JSON data structure :param name: The name of the filter :param type: The type of the filter :param account_id: The account id to link this filter with (optional) :param tier_parent_id: The uuid of the filter that this filter should be a child of (optional, for tiered filters) """ request_data = { 'account_id': account_id, 'configuration': configuration, 'name': name, 'tier_parent_id': tier_parent_id, 'type': type, } errors_mapping = {} errors_mapping[('INVALID_CONFIG', None)] = InvalidConfig('The configuration is invalid') query_data = { 'api': self._api, 'url': '/filter/add', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def deploy( self, namespace_id, uuid, ): """Deploy. :param namespace_id: uuid of the namespace :param uuid: uuid of the customcode """ request_data = { 'uuid': uuid, 'namespace_id': namespace_id, } errors_mapping = {} errors_mapping['ALREADY'] = Already( 'The code is already deployed for this namespace') errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The namespace or customcode can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to deploy code in this namespace') query_data = { 'api': self._api, 'url': '/customcode/deploy', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def set( self, key, text, ): """Set. :param key: The help key :param text: The help text """ request_data = { 'text': text, 'key': key, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_SYSADMIN_OR_SUPPORT'] = NotSysadminOrSupport( 'The user is not a sysadmin or support user') query_data = { 'api': self._api, 'url': '/help/set', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def undeploy( self, deployment_id, ): """Undeploy. :param deployment_id: Deployment uuid """ request_data = { 'deployment_id': deployment_id, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The deployment can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to undeploy code in this namespace') query_data = { 'api': self._api, 'url': '/customcode/undeploy', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def i18next( self, lng, account_id=None, vanity=None, ): """I18next. :param lng: The language code :param account_id: account_id :param vanity: vanity Notes: (account_id OR vanity) - The uuid or vanity name of the account to apply any account overrides for (optional) """ request_data = { 'vanity': vanity, 'lng': lng, 'account_id': account_id, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) query_data = { 'api': self._api, 'url': '/terminology/i18next', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': False, } return QueryO(**query_data)
def deploy_get( self, uuid, ): """Deploy get. :param uuid: uuid of customcode deployment """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The customcode deployment can not be found') errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/customcode/deploy/get', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def entries( self, uuid, lookup=None, ): """Entries. :param uuid: The dictionary id :param lookup: Only return the entry for the optional lookup entry (optional) """ request_data = { 'lookup': lookup, 'uuid': uuid, } errors_mapping = {} errors_mapping['MISSING_FIELDS'] = MissingFields( 'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields' ) errors_mapping['NOT_FOUND'] = NotFound( 'The dictionary can not be found') errors_mapping['NOT_LIST'] = NotList( 'The field is not a JSON array. The error_subtype holds the name of the field' ) errors_mapping['NOT_PERMITTED'] = NotPermitted( 'You are not permitted to do this') query_data = { 'api': self._api, 'url': '/dictionary/entries', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)
def get( self, uuid, ): """Get. :param uuid: UUID of the meeting """ request_data = { 'uuid': uuid, } errors_mapping = {} errors_mapping[('NOT_FOUND', None)] = NotFound('The meeting can not be found') errors_mapping[( 'NOT_PERMITTED', None)] = NotPermitted('You are not permitted to get the meeting') query_data = { 'api': self._api, 'url': '/meeting/get', 'request_data': request_data, 'errors_mapping': errors_mapping, 'required_sid': True, } return QueryO(**query_data)