示例#1
0
    def logout(self, ):
        """Logout.

        """
        request_data = {}

        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 sid was not found')
        query_data = {
            'api': self._api,
            'url': '/session/logout',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#2
0
    def user_add(
        self,
        role_name,
        uuid,
        email=None,
        user_id=None,
    ):
        """User add.

        :param role_name: The role name that should be used for the user in groups
        :param uuid: The group id
        :param email: email
        :param user_id: user_id
        """
        request_data = {
            'email': email,
            'role_name': role_name,
            'user_id': user_id,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[(
            'ALREADY_EXISTS',
            None)] = AlreadyExists('The user is in the contact list already')
        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 add users to the site')
        errors_mapping[('USER_NOT_FOUND',
                        None)] = UserNotFound('The user was not found')
        query_data = {
            'api': self._api,
            'url': '/site/user/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
示例#3
0
    def anonymize(
        self,
        uuid,
        prompt_for_anonymize=None,
        rules=None,
    ):
        """Anonymize.
        :param uuid: The uuid of the namespace
        :param prompt_for_anonymize: Flag to prompt if the anonymization rules should be applied. Only applicable to ingress anonymization. (optional)
        :param rules: Anonymization rules in JSON format. The format is a hash with the keys the names of the fields to anonymize and the values the regular expressions to apply. (optional)
        """
        request_data = {
            'prompt_for_anonymize': prompt_for_anonymize,
            'uuid': uuid,
            'rules': rules,
        }

        errors_mapping = {}
        errors_mapping['INVALID_FIELD_NAME'] = InvalidFieldName(
            'The field name is n the rules hash is invalid. The error_subtype holds the invalid field name'
        )
        errors_mapping['INVALID_JSON'] = InvalidJson(
            'The field is not in valid JSON format. The error_subtype holds the name of the field'
        )
        errors_mapping['INVALID_REGEXP'] = InvalidRegexp(
            'Invalid regular expression. The error_subtype holds the invalid regexp.'
        )
        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 was not found')
        errors_mapping['NOT_HASH'] = NotHash('The rules field is not a hash')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to anonymize this namespace')
        query_data = {
            'api': self._api,
            'url': '/namespace/anonymize',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#4
0
    def user_list(
        self,
        user_id,
    ):
        """User list.

        :param user_id: The user id
        """
        request_data = {
            'user_id': user_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 user was not found.')
        query_data = {
            'api': self._api,
            'url': '/radreport/user/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        query_data['paginated_field'] = 'radreports'
        return AsyncQueryOPSF(**query_data)
示例#5
0
    def engine_fqdn(
        self,
        namespace_id=None,
        phi_namespace=None,
        source=None,
        storage_namespace=None,
        study_id=None,
        study_uid=None,
    ):
        """Engine fqdn.
        :param namespace_id: namespace_id
        :param phi_namespace: phi_namespace
        :param source: The source of the query (optional)
        :param storage_namespace: storage_namespace
        :param study_id: study_id
        :param study_uid: study_uid

        Notes:
        (namespace_id OR study_id OR study_uid AND storage_namespace AND phi_namespace) - The uuid of the namespace or study or the study_uid/storage_namespace/phi_namespace triplet
        """
        request_data = {
            'study_id': study_id,
            'source': source,
            'storage_namespace': storage_namespace,
            'study_uid': study_uid,
            'phi_namespace': phi_namespace,
            '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 namespace was not found')
        query_data = {
            'api': self._api,
            'url': '/namespace/engine/fqdn',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return QueryO(**query_data)
示例#6
0
    def attach_set(
        self,
        uuid,
        add_if_no_match=None,
        approve_if_match=None,
        sequence=None,
        skip_if_lookup_unchanged=None,
        skip_if_replace_has_value=None,
    ):
        """Attach set.
        :param uuid: The dictionary attach 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 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 any of the replace fields already has a value (optional)
        """
        request_data = {
            'skip_if_replace_has_value': skip_if_replace_has_value,
            'skip_if_lookup_unchanged': skip_if_lookup_unchanged,
            'uuid': uuid,
            'add_if_no_match': add_if_no_match,
            'sequence': sequence,
            'approve_if_match': approve_if_match,
        }

        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 attachment can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to do this')
        query_data = {
            'api': self._api,
            'url': '/dictionary/attach/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#7
0
    def list(
        self,
        account_id,
    ):
        """List.
        :param account_id: uuid of the account
        """
        request_data = {
            'account_id': account_id,
        }

        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'
        )
        errors_mapping['NOT_FOUND'] = NotFound('The account can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to view appointments in this account')
        query_data = {
            'api': self._api,
            'url': '/appointment/list',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        query_data['paginated_field'] = 'appointments'
        return QueryOPSF(**query_data)
示例#8
0
    def add(
        self,
        name,
        state,
        phi_namespace=None,
        storage_namespace=None,
        study_id=None,
        study_uid=None,
    ):
        """Add.
        :param name: Title of the meeting
        :param state: State of the meeting
        :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,
            'name': name,
            'study_uid': study_uid,
            'phi_namespace': phi_namespace,
            'state': state,
        }

        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('The study can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to create a meeting for the study')
        query_data = {
            'api': self._api,
            'url': '/meeting/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#9
0
    def email(
        self,
        email,
        uuid,
    ):
        """Email.

        :param email: The email address(es) to send the radreport to
        :param uuid: The radreport uuid
        """
        request_data = {
            'email': email,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[(
            'INVALID_EMAIL',
            None)] = InvalidEmail('An invalid email address was passed')
        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_ENABLED', None)] = NotEnabled(
            'The radreport mailing out is not enabled for the account')
        errors_mapping[('NOT_FOUND',
                        None)] = NotFound('The radreport can not be found')
        errors_mapping[(
            'NOT_PERMITTED',
            None)] = NotPermitted('You are not permitted to do this')
        errors_mapping[('NO_ATTACHMENT', None)] = NoAttachment(
            'The radreport does not have an attached report')
        errors_mapping[('PDF_FAILED',
                        None)] = PdfFailed('The PDF report failed to generate')
        query_data = {
            'api': self._api,
            'url': '/radreport/email',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#10
0
    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,
            'alt_mobile_phone': alt_mobile_phone,
            'email': email,
            'mobile_phone': mobile_phone,
            'patient_id': patient_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 patient can not be found')
        errors_mapping[(
            'NOT_PERMITTED',
            None)] = 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 AsyncQueryO(**query_data)
示例#11
0
    def share_code(
        self,
        namespace_id=None,
        serial_no=None,
        share_code=None,
        uuid=None,
    ):
        """Share_code.
        :param namespace_id: namespace_id
        :param serial_no: serial_no
        :param share_code: share_code
        :param uuid: uuid

        Notes:
        (share_code OR namespace_id) - The share code or namespace id
        (sid OR uuid AND serial_no) - Either the sid or the node id and serial number (optional)
        """
        request_data = {
            'serial_no': serial_no,
            'uuid': uuid,
            'share_code': share_code,
            'namespace_id': namespace_id,
        }

        errors_mapping = {}
        errors_mapping['INVALID_LINK'] = InvalidLink(
            'The anonymous upload link is no longer valid')
        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 share code was not found or if gateway credentials are passed is not valid for gateway uploads'
        )
        query_data = {
            'api': self._api,
            'url': '/namespace/share_code',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#12
0
    def share_stop(
        self,
        uuid,
        account_id=None,
        group_id=None,
        location_id=None,
        role_id=None,
        user_id=None,
    ):
        """Share stop.

        :param uuid: The filter uuid
        :param account_id: account_id
        :param group_id: group_id
        :param location_id: location_id
        :param role_id: role_id
        :param user_id: user_id
        """
        request_data = {
            'account_id': account_id,
            'group_id': group_id,
            'location_id': location_id,
            'role_id': role_id,
            'user_id': user_id,
            '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/share/stop',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
示例#13
0
    def zip(
        self,
        report_id,
    ):
        """Zip.
        :param report_id: The report id
        """
        request_data = {
           'report_id': report_id,
        }
	
        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('Not found')
        query_data = {
            'api': self._api,
            'url': '/report/zip',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#14
0
    def ping(
        self,
        uuid,
    ):
        """Ping.
        :param uuid: UUID of the meeting
        """
        request_data = {
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('The meeting can not be found')
        query_data = {
            'api': self._api,
            'url': '/meeting/ping',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#15
0
    def pdf(
        self,
        uuid,
    ):
        """Pdf.
        :param uuid: The radreport uuid
        """
        request_data = {
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('Not found')
        query_data = {
            'api': self._api,
            'url': '/radreport/pdf',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#16
0
    def zip(
        self,
        uuid,
    ):
        """Zip.
        :param uuid: The code uuid
        """
        request_data = {
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('Not found')
        query_data = {
            'api': self._api,
            'url': '/customcode/zip',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#17
0
    def get(
        self,
        uuid,
    ):
        """Get.
        :param uuid: The filter uuid
        """
        request_data = {
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('The filter can not be found')
        query_data = {
            'api': self._api,
            'url': '/filter/get',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#18
0
    def set(
        self,
        uuid,
        name=None,
        rules=None,
    ):
        """Set.

        :param uuid: The anonymization profile uuid
        :param name: Name of the anonymization profile (optional)
        :param rules: A JSON hash of anonymization rules to apply to retrieved studies (optional)
        """
        request_data = {
            'name': name,
            'rules': rules,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('IN_USE', None)] = InUse(
            'The anonymization profile is connected to an account, its rule set cannot be changed'
        )
        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 anonymization profile can not be found')
        errors_mapping[('NOT_HASH',
                        None)] = NotHash('The rules field is not a hash')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to edit the anonymization profile')
        query_data = {
            'api': self._api,
            'url': '/anonymization/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
示例#19
0
    def sps_status(
        self,
        mpps_uid,
        serial_no,
        uuid,
        mpps_status=None,
    ):
        """Sps status.
        :param mpps_uid: The mpps UUID of the SPS
        :param serial_no: The serial number of the node
        :param uuid: The node id
        :param mpps_status: mpps_status

        Notes:
        mpps_status - The mpps status to set (PENDING OR IN_PROGRESS OR DISCONTINUED OR COMPLETED)
        """
        request_data = {
            'mpps_status': mpps_status,
            'serial_no': serial_no,
            'uuid': uuid,
            'mpps_uid': mpps_uid,
        }

        errors_mapping = {}
        errors_mapping['INVALID_STATUS'] = InvalidStatus(
            'An invalid status 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 SPS can not be found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'You are not permitted to set the status')
        query_data = {
            'api': self._api,
            'url': '/order/sps/status',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return QueryO(**query_data)
示例#20
0
    def set(
        self,
        uuid,
        attachment=None,
        fields=None,
    ):
        """Set.

        :param uuid: Id of the radreport
        :param attachment: A JSON hash of the storage attachment information (optional)
        :param fields: A JSON hash of the fields in the report (optional)
        """
        request_data = {
            'attachment': attachment,
            'fields': fields,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_JSON', None)] = InvalidJson(
            'The field is not in valid JSON format. The error_subtype holds the name of the field'
        )
        errors_mapping[('LOCKED', None)] = Locked(
            'Only if account.settings.enable_radreport_lock_reading is set. This radreport is locked by another sid. error_subtype=RADREPORT_LOCKED. error_data={"locked_radreport_id":radreport_uuid,"locked_user_id":user_uuid}.'
        )
        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 study was not found.')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to add a radreport to the study')
        query_data = {
            'api': self._api,
            'url': '/radreport/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
示例#21
0
    def fax(
        self,
        number,
        uuid,
    ):
        """Fax.

        :param number: The fax number to send the PDF report to
        :param uuid: The radreport uuid
        """
        request_data = {
            'number': number,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_PHONE',
                        None)] = InvalidPhone('The fax number 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_ENABLED', None)] = NotEnabled(
            'The radreport mailing out is not enabled for the account')
        errors_mapping[('NOT_FOUND',
                        None)] = NotFound('The radreport can not be found')
        errors_mapping[(
            'NOT_PERMITTED',
            None)] = NotPermitted('You are not permitted to do this')
        errors_mapping[('NO_ATTACHMENT', None)] = NoAttachment(
            'The radreport does not have an attached report')
        errors_mapping[('PDF_FAILED',
                        None)] = PdfFailed('The PDF report failed to generate')
        query_data = {
            'api': self._api,
            'url': '/radreport/fax',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#22
0
    def add(
        self,
        study_id,
        type,
        fields=None,
    ):
        """Add.

        :param study_id: Id of the study to add the radreport to
        :param type: The type of the radreport
        :param fields: A JSON hash of the fields in the report (optional)
        """
        request_data = {
            'fields': fields,
            'study_id': study_id,
            'type': type,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_JSON', None)] = InvalidJson(
            'The field is not in valid JSON format. The error_subtype holds the name of the field'
        )
        errors_mapping[('LOCKED', None)] = Locked(
            'Only if account.settings.enable_radreport_lock_reading is set. There is another locked radreport for the study. error_subtype=RADREPORT_LOCKED. error_data={"locked_radreport_id":radreport_uuid,"locked_user_id":user_uuid}.'
        )
        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 study was not found.')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to add a radreport to the study')
        query_data = {
            'api': self._api,
            'url': '/radreport/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#23
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

        Notes:
        (account_id OR vanity OR study_uid AND storage_namespace AND phi_namespace) - The uuid or vanity name of the account or study triplet to apply any account overrides for (optional)
        """
        request_data = {
            'storage_namespace': storage_namespace,
            'vanity': vanity,
            'study_uid': study_uid,
            'phi_namespace': phi_namespace,
            '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 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 QueryO(**query_data)
示例#24
0
    def found_mwl(
        self,
        orders,
        search_id,
        serial_no,
        uuid,
    ):
        """Found mwl.
        :param orders: A JSON array of the orders found. Each object has the following fields:
            patient_name - Patient name
            patientid - Patient id
            accession_number - Accession number
            patient_sex - Gender
            patient_birth_date - Birth date
            order_number - Order number
            order_date - Order date
        :param search_id: The id of the search request
        :param serial_no: The serial number of the node
        :param uuid: The node id
        """
        request_data = {
           'serial_no': serial_no,
           'uuid': uuid,
           'orders': orders,
           'search_id': search_id,
        }
	
        errors_mapping = {}
        errors_mapping['ALREADY_DONE'] = AlreadyDone('The search has already had results returned against it')
        errors_mapping['INVALID_JSON'] = InvalidJson('The field is not in valid JSON format. The error_subtype holds the name of the field')
        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 node or search can not be found')
        query_data = {
            'api': self._api,
            'url': '/node/found/mwl',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': False,
        }
        return QueryO(**query_data)
示例#25
0
    def set(
        self,
        uuid,
        account_id=None,
        configuration=None,
        name=None,
        type=None,
    ):
        """Set.

        :param uuid: The filter uuid
        :param account_id: The account id to link this filter with (optional)
        :param configuration: The configuration as a JSON data structure (optional)
        :param name: The name of the filter (optional)
        :param type: The type of the filter (optional)
        """
        request_data = {
            'account_id': account_id,
            'configuration': configuration,
            'name': name,
            'type': type,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_CONFIG',
                        None)] = InvalidConfig('The configuration is invalid')
        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/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)
示例#26
0
    def transform_set(
        self,
        conditions,
        name,
        order_by,
        replacements,
        uuid,
    ):
        """Transform set.

        :param conditions: A JSON array of the transform conditions
        :param name: Name of the transform
        :param order_by: A numeric ordering value. Transformations are run in this order from lowest to highest
        :param replacements: A JSON array of the transform replacements
        :param uuid: The transform id
        """
        request_data = {
           'conditions': conditions,
           'name': name,
           'order_by': order_by,
           'replacements': replacements,
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping[('DUPLICATE_ORDER_BY', None)] = DuplicateOrderBy('The order_by value is used by another transform')
        errors_mapping[('INVALID_CONDITION', None)] = InvalidCondition('An invalid condition was passed. The error_subtype holds the details on why it is invalid')
        errors_mapping[('INVALID_REPLACEMENT', None)] = InvalidReplacement('An invalid replacement was passed. The error_subtype holds the details on why it 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 account can not be found')
        errors_mapping[('NOT_LIST', None)] = NotList('The field is not a JSON array. The error_subtype holds the name of the field')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted('You are not permitted to do this')
        query_data = {
            'api': self._api,
            'url': '/hl7/transform/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#27
0
    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 = {
            'birth_date': birth_date,
            'first': first,
            'last': last,
            'mrn': mrn,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_DATE',
                        None)] = InvalidDate('An invalid date was passed')
        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 patient can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = 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 AsyncQueryO(**query_data)
示例#28
0
    def delete(
        self,
        uuid,
    ):
        """Delete.
        :param uuid: The filter uuid
        """
        request_data = {
           'uuid': uuid,
        }
	
        errors_mapping = {}
        errors_mapping['NOT_FOUND'] = NotFound('The filter can not be found')
        errors_mapping['NOT_PERMITTED'] = 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)
示例#29
0
    def set(
        self,
        language,
        tag,
        value,
        account_id=None,
        vanity=None,
    ):
        """Set.

        :param language: The ISO 639-1 language code
        :param tag: The tag to set
        :param value: The value of the tag. If this is empty the tag is deleted
        :param account_id: The uuid of the account to apply the tag for (optional)
        :param vanity: Vanity to apply the tag for (optional)
        """
        request_data = {
           'account_id': account_id,
           'language': language,
           'tag': tag,
           'value': value,
           '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 was not found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted('The user is not an account administrator  and is trying to set account tags')
        errors_mapping[('NOT_SYSADMIN_OR_SUPPORT', None)] = NotSysadminOrSupport('The user is not a sysadmin or support user and is trying to set global tags')
        errors_mapping[('NO_VALUE', None)] = NoValue('The value parameter was not passed')
        query_data = {
            'api': self._api,
            'url': '/terminology/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
示例#30
0
    def status_set(
        self,
        new,
        old,
        uuid,
    ):
        """Status set.

        :param new: The new QC task status value (Open|InProgress|Closed)
        :param old: The old QC task status value
        :param uuid: QC task uuid
        """
        request_data = {
            'new': new,
            'old': old,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('INVALID_TAG', None)] = InvalidTag(
            'The QC task status new value is not a valid value')
        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 QC task can not be found')
        errors_mapping[('NOT_PERMITTED', None)] = NotPermitted(
            'You are not permitted to set the status for this QC task')
        errors_mapping[('STALE',
                        None)] = Stale('The QC task status you have is stale')
        query_data = {
            'api': self._api,
            'url': '/qctask/status/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return AsyncQueryO(**query_data)