Exemplo n.º 1
0
    def log(
        self,
        bucket,
        rest_params=None,
    ):
        """Log.

        :param bucket: Name of the bucket to log to
        :param rest_params: Parameters are logged to a message in the bucket
        """
        request_data = {
            'bucket': bucket,
        }
        if rest_params is not None:
            rest_params_dict = {
                '{prefix}{k}'.format(prefix='', k=k): v
                for k, v in rest_params.items()
            }
            request_data.update(rest_params_dict)

        errors_mapping = {}
        errors_mapping[('INVALID_BUCKET', None)] = InvalidBucket(
            'The bucket name can only contain A-z characters and must be between 4 and 16 characters long'
        )
        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'
        )
        query_data = {
            'api': self._api,
            'url': '/audit/log',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 2
0
    def transform_list(
        self,
        account_id,
    ):
        """Transform list.

        :param account_id: The account uuid
        """
        request_data = {
           'account_id': account_id,
        }
	
        errors_mapping = {}
        errors_mapping[('FILTER_NOT_FOUND', None)] = FilterNotFound('The filter can not be found. The error_subtype will hold the filter UUID')
        errors_mapping[('INVALID_CONDITION', None)] = InvalidCondition('The condition is not support. The error_subtype will hold the filter expression this applies to')
        errors_mapping[('INVALID_FIELD', None)] = InvalidField('The field is not valid for this object. The error_subtype will hold the filter expression this applies to')
        errors_mapping[('INVALID_SORT_FIELD', None)] = InvalidSortField('The field is not valid for this object. The error_subtype will hold the field name this applies to')
        errors_mapping[('INVALID_SORT_ORDER', None)] = InvalidSortOrder('The sort order for the field is invalid. The error_subtype will hold the field name this applies to')
        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 account can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted('You are not permitted to view this list')
        query_data = {
            'api': self._api,
            'url': '/hl7/transform/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        query_data['paginated_field'] = 'transforms'
        return AsyncQueryOPSF(**query_data)
Exemplo n.º 3
0
    def delete(
        self,
        uuid,
    ):
        """Delete.

        :param uuid: The location uuid
        """
        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_EMPTY',
            None)] = NotEmpty('The location still has studies in it')
        errors_mapping[('NOT_FOUND',
                        None)] = NotFound('The location can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to delete the location')
        query_data = {
            'api': self._api,
            'url': '/location/delete',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 4
0
    def parse_fields(
        self,
        message,
        fields=None,
    ):
        """Parse fields.

        :param message: HL7 message to parse
        :param fields: Comma delimited list of the field to return. Use the notation specified in /hl7/transform/add (optional)
        """
        request_data = {
           'fields': fields,
           'message': message,
        }
	
        errors_mapping = {}
        errors_mapping[('INVALID_MESSAGE', None)] = InvalidMessage('The message could not parsed as a HL7 message')
        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')
        query_data = {
            'api': self._api,
            'url': '/hl7/parse/fields',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return QueryO(**query_data)
Exemplo n.º 5
0
    def extract_report(
        self,
        uuid,
    ):
        """Extract report.

        :param uuid: The HL7 uuid
        """
        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_CONFIGURED', None)] = NotConfigured('The node setting report_from_hl7 is not configured')
        errors_mapping[('NOT_FOUND', None)] = NotFound('The HL7 can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted('You are not permitted to access this HL7 message')
        query_data = {
            'api': self._api,
            'url': '/hl7/extract/report',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 6
0
    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
        """
        request_data = {
           'account_id': account_id,
           'language': language,
           'tags': tags,
           'vanity': vanity,
        }
	
        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')
        query_data = {
            'api': self._api,
            'url': '/terminology/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 7
0
    def set(
        self,
        key,
        text,
    ):
        """Set.

        :param key: The help key
        :param text: The help text
        """
        request_data = {
            'key': key,
            'text': text,
        }

        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_SYSADMIN_OR_SUPPORT',
                        None)] = 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)
Exemplo n.º 8
0
    def delete(
        self,
        object,
        object_id,
        tag,
    ):
        """Delete.

        :param object: Object class to apply it to (Study|User_account|Group|Location|Account|Patient|Case|Order)
        :param object_id: UUID of the object
        :param tag: Value of the tag
        """
        request_data = {
            'object': object,
            'object_id': object_id,
            'tag': tag,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_OBJECT',
                        None)] = InvalidObject('The object type is invalid')
        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 object was not found')
        query_data = {
            'api': self._api,
            'url': '/tag/delete',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 9
0
    def get(
        self,
        uuid,
    ):
        """Get.

        :param uuid: Id of the validate
        """
        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 validate was not found.')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to view the validation rule')
        query_data = {
            'api': self._api,
            'url': '/validate/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 10
0
    def get(
        self,
        key,
        user_id=None,
    ):
        """Get.

        :param key: The key to get
        :param user_id: A sysadmin user can get the value for a specific user (optional)
        """
        request_data = {
            'key': key,
            'user_id': user_id,
        }

        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'
        )
        query_data = {
            'api': self._api,
            'url': '/setting/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 11
0
    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 = {
            'key': key,
            'user_id': user_id,
            'value': value,
        }

        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'
        )
        query_data = {
            'api': self._api,
            'url': '/setting/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 12
0
    def add(
        self,
        body,
        account_id=None,
        email=None,
        group_id=None,
        location_id=None,
        namespace_id=None,
        parent_id=None,
        share_code=None,
        study_id=None,
        subject=None,
        user_id=None,
    ):
        """Add.
        :param body: The body of the message
        :param account_id: account_id
        :param email: email
        :param group_id: group_id
        :param location_id: location_id
        :param namespace_id: namespace_id
        :param parent_id: The uuid of the parent message (optional)
        :param share_code: share_code
        :param study_id: study_id
        :param subject: The subject of the message (optional)
        :param user_id: user_id

        Notes:
        (namespace_id OR user_id OR group_id OR location_id OR account_id OR email OR share_code OR study_id) - The namespace, entity, email, share code or study to send the message to
        """
        request_data = {
            'study_id': study_id,
            'share_code': share_code,
            'body': body,
            'group_id': group_id,
            'parent_id': parent_id,
            'account_id': account_id,
            'location_id': location_id,
            'user_id': user_id,
            'email': email,
            'subject': subject,
            'namespace_id': namespace_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 recipient or the parent message cannot be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to send to the recipient')
        query_data = {
            'api': self._api,
            'url': '/message/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 13
0
    def list(self, ):
        """List.
        """
        request_data = {}

        errors_mapping = {}
        errors_mapping['FILTER_NOT_FOUND'] = FilterNotFound(
            'The filter can not be found. The error_subtype will hold the filter UUID'
        )
        errors_mapping['INVALID_CONDITION'] = InvalidCondition(
            'The condition is not support. The error_subtype will hold the filter expression this applies to'
        )
        errors_mapping['INVALID_FIELD'] = InvalidField(
            'The field is not valid for this object. The error_subtype will hold the filter expression this applies to'
        )
        errors_mapping['INVALID_SORT_FIELD'] = InvalidSortField(
            'The field is not valid for this object. The error_subtype will hold the field name this applies to'
        )
        errors_mapping['INVALID_SORT_ORDER'] = InvalidSortOrder(
            'The sort order for the field is invalid. The error_subtype will hold the field name this applies to'
        )
        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': '/message/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        query_data['paginated_field'] = 'messages'
        return QueryOPSF(**query_data)
Exemplo n.º 14
0
    def delete(
        self,
        uuid,
    ):
        """Delete.
        :param uuid: Id of the message
        """
        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 message can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to delete this message')
        query_data = {
            'api': self._api,
            'url': '/message/delete',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 15
0
    def list(
        self,
        phi_namespace=None,
        storage_namespace=None,
        study_id=None,
        study_uid=None,
    ):
        """List.
        :param phi_namespace: phi_namespace
        :param storage_namespace: storage_namespace
        :param study_id: study_id
        :param study_uid: study_uid

        Notes:
        (study_id OR study_uid AND storage_namespace AND phi_namespace) The uuid of the study or the storage triplet
        """
        request_data = {
           'study_id': study_id,
           'storage_namespace': storage_namespace,
           'study_uid': study_uid,
           'phi_namespace': phi_namespace,
        }
	
        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 study was not found.')
        errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to view the study or key images for the study')
        query_data = {
            'api': self._api,
            'url': '/keyimage/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 16
0
    def delete(
        self,
        uuid,
    ):
        """Delete.

        :param uuid: Id of the validation rule
        """
        request_data = {
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[(
            'IN_USE',
            None)] = InUse('The validation rule is used in a routing rule')
        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 validation rule  was not found.')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to delete the validation rule')
        query_data = {
            'api': self._api,
            'url': '/validate/delete',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 17
0
    def account_overrides(
        self,
        account_id=None,
        phi_namespace=None,
        storage_namespace=None,
        study_uid=None,
        vanity=None,
    ):
        """Account overrides.

        :param account_id: account_id
        :param phi_namespace: phi_namespace
        :param storage_namespace: storage_namespace
        :param study_uid: study_uid
        :param vanity: vanity
        """
        request_data = {
           'account_id': account_id,
           'phi_namespace': phi_namespace,
           'storage_namespace': storage_namespace,
           'study_uid': study_uid,
           'vanity': vanity,
        }
	
        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 account or vanity was not found')
        query_data = {
            'api': self._api,
            'url': '/terminology/account/overrides',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 18
0
    def status(
        self,
        report_id,
    ):
        """Status.

        :param report_id: The report id
        """
        request_data = {
            'report_id': report_id,
        }

        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 report can not be found')
        errors_mapping[('REPORT_FAILED',
                        None)] = ReportFailed('The report failed')
        query_data = {
            'api': self._api,
            'url': '/report/status',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 19
0
    def i18next(
        self,
        lng,
        account_id=None,
        vanity=None,
    ):
        """I18next.

        :param lng: The language code
        :param account_id: account_id
        :param vanity: vanity
        """
        request_data = {
           'account_id': account_id,
           'lng': lng,
           'vanity': vanity,
        }
	
        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')
        query_data = {
            'api': self._api,
            'url': '/terminology/i18next',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 20
0
    def trigger(
        self,
        study_id,
        uuid,
    ):
        """Trigger.
        :param study_id: uuid of the study to fire the webhook for
        :param uuid: uuid of the webhook
        """
        request_data = {
            'study_id': study_id,
            '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 webhook or study can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to trigger the webhook')
        query_data = {
            'api': self._api,
            'url': '/webhook/trigger',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 21
0
    def get(
        self,
        key,
    ):
        """Get.

        :param key: The help key
        """
        request_data = {
            'key': key,
        }

        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 help was not found')
        query_data = {
            'api': self._api,
            'url': '/help/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 22
0
    def list(
        self,
        account_id,
    ):
        """List.
        :param account_id: uuid of the account
        """
        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 can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to view this list')
        query_data = {
            'api': self._api,
            'url': '/webhook/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 23
0
    def add(
        self,
        message,
        serial_no,
        uuid,
        accession_number=None,
    ):
        """Add.

        :param message: The HL7 message
        :param serial_no: The serial number of the node
        :param uuid: The node id
        :param accession_number: Use this accession number instead of the accession number in the HL7 message (optional)
        """
        request_data = {
           'accession_number': accession_number,
           'message': message,
           'serial_no': serial_no,
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping[('INVALID_MESSAGE', None)] = InvalidMessage('The message could not parsed as a HL7 message')
        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 node can not be found')
        query_data = {
            'api': self._api,
            'url': '/hl7/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 24
0
    def get(
        self,
        account_id=None,
        uuid=None,
    ):
        """Get.
        :param account_id: Account id if you are trying to get a user other than yourself (optional)
        :param uuid: The users uuid (optional). Uses the session user if not passed
        """
        request_data = {
           'uuid': uuid,
           '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 user can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted('You are not permitted to access this user record')
        query_data = {
            'api': self._api,
            'url': '/user/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 25
0
    def template_set(
        self,
        body,
        name,
        uuid,
    ):
        """Template set.

        :param body: The HL7 message with replacement expressions
        :param name: Name of the template
        :param uuid: The template id
        """
        request_data = {
           'body': body,
           'name': name,
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping[('INVALID_HL7', None)] = InvalidHl7('The body is not a valid HL7 message')
        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 template can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted('You are not permitted to do this')
        query_data = {
            'api': self._api,
            'url': '/hl7/template/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 26
0
    def password_reset(
        self,
        password,
        token,
    ):
        """Password reset.
        :param password: The new password
        :param token: The reset token
        """
        request_data = {
           'token': token,
           'password': password,
        }
	
        errors_mapping = {}
        errors_mapping['BAD_PASSWORD'] = BadPassword('Password needs to be at least 8 characters long, contain at least two numbers, contain at least two characters and can't be one of your last three passwords')
        errors_mapping['INVALID_TOKEN'] = InvalidToken('The token is invalid')
        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': '/user/password/reset',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return QueryO(**query_data)
Exemplo n.º 27
0
    def get(
        self,
        uuid,
    ):
        """Get.
        :param uuid: The appointment 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 appointment can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to view this appointment')
        query_data = {
            'api': self._api,
            'url': '/appointment/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 28
0
    def welcome(
        self,
        account_id,
        email,
        link,
    ):
        """Welcome.
        :param account_id: Id of the account to welcome them to
        :param email: The email of the user to welcome
        :param link: URL to reset the password at. The reset token will be appended to the link
        """
        request_data = {
           'link': link,
           'account_id': account_id,
           'email': email,
        }
	
        errors_mapping = {}
        errors_mapping['INVALID_LINK'] = InvalidLink('The link needs to be a https link within the site domain')
        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 user can not be found')
        query_data = {
            'api': self._api,
            'url': '/user/welcome',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Exemplo n.º 29
0
    def user_delete(
        self,
        user_id,
        uuid,
    ):
        """User delete.

        :param user_id: The user id
        :param uuid: The location 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 location can not be found')
        errors_mapping[(
            'NOT_PERMITTED',
            None)] = NotPermitted('You are not permitted to edit the location')
        query_data = {
            'api': self._api,
            'url': '/location/user/delete',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
Exemplo n.º 30
0
    def deleted(
        self,
        account_id,
        type,
    ):
        """Deleted.

        :param account_id: The id of the account
        :param type: The type of the object (Study|User etc.)
        """
        request_data = {
            'account_id': account_id,
            'type': type,
        }

        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_PERMITTED', None)] = NotPermitted(
            'You are not permitted to access this record')
        query_data = {
            'api': self._api,
            'url': '/audit/deleted',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        query_data['paginated_field'] = 'objects'
        return AsyncQueryOP(**query_data)