Example #1
0
    def test_search_uid_list(self):
        """Test search using a UID list."""
        query = Dataset()
        query.QueryRetrieveLevel = 'PATIENT'
        query.SOPInstanceUID = None

        q = db._search_uid_list(query['SOPInstanceUID'], self.session)
        assert 5 == len(q.all())

        query.SOPInstanceUID = [
            '1.3.6.1.4.1.5962.1.1.4.1.1.20040826185059.5457'
        ]
        q = db._search_uid_list(query['SOPInstanceUID'], self.session)
        assert 1 == len(q.all())

        query.SOPInstanceUID = [
            '1.3.6.1.4.1.5962.1.1.4.1.1.20040826185059.5457',
            '1.3.6.1.4.1.5962.1.1.1.1.1.20040119072730.12322'
        ]
        q = db._search_uid_list(query['SOPInstanceUID'], self.session)
        assert 2 == len(q.all())

        query.SOPInstanceUID = [
            '1.3.6.1.4.1.5962.1.1.4.1.1.20040826185059.5457',
            '1.3.6.1.4.1.5962.1.1.1.1.1.20040119072730.12322',
            '1.3.46.423632.132218.1415242681.6'
        ]
        q = db._search_uid_list(query['SOPInstanceUID'], self.session)
        assert 2 == len(q.all())
Example #2
0
    def test_search_uid_list_empty(self):
        """Test searching an empty UID element works correctly."""
        query = Dataset()
        query.QueryRetrieveLevel = 'PATIENT'
        query.SOPInstanceUID = None

        q = db._search_uid_list(query['SOPInstanceUID'], self.session)
        assert 5 == len(q.all())