예제 #1
0
        public async Task GetStatusTest_Pending_SingleUpload()
        {
            var testNumber = 5;

            // Create a test workspace
            var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber);

            // In one upload, upload test data that has the same Patient ID, but different Patient's Name
            var uploadPath    = Path.Combine(TestSettings.TestDataRootDirectory, "PatientNameConflict");
            var uploadResults = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath);

            var uploadProcessingResults = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults);

            var uploadBatch = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults.Results);

            // Verify that one of the two files shows a status of "pending" (conflict)
            var uploadPath1 = Path.Combine(TestSettings.TestDataRootDirectory, "PatientNameConflict", "CT.1.dcm");
            var uploadPath2 = Path.Combine(TestSettings.TestDataRootDirectory, "PatientNameConflict", "CT.2.dcm");

            Assert.IsTrue(uploadBatch.GetStatus(uploadPath1) == "pending" || uploadBatch.GetStatus(uploadPath2) == "pending");
        }
예제 #2
0
        public async Task GetStatusTest_Failed()
        {
            var testNumber = 7;

            // Create a test workspace
            var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber);

            // Upload test data
            var uploadPath    = Path.Combine(TestSettings.TestDataRootDirectory, "RtImage", "RTIMAGE.dcm");
            var uploadResults = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath);

            var uploadProcessingResults = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults);

            var uploadBatch = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults.Results);

            // Verify the status
            Assert.AreEqual("failed", uploadBatch.GetStatus(uploadPath));
        }
예제 #3
0
        public async Task GetStatusTest_Duplicate()
        {
            var testNumber = 8;

            // Create a test workspace
            var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber);

            // Upload test data
            var uploadPath     = Path.Combine(TestSettings.TestDataRootDirectory, "Sro", "reg.dcm");
            var uploadResults1 = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath);

            await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults1);

            // Upload the same data again
            var uploadResults2 = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath);

            var uploadProcessingResults2 = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults2);

            var uploadBatch2 = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults2.Results);

            // Verify the status is still "completed"
            Assert.AreEqual("completed", uploadBatch2.GetStatus(uploadPath));
        }
예제 #4
0
        public async Task GetStatusTest_Pending_MultipleUploads()
        {
            var testNumber = 6;

            // Create a test workspace
            var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber);

            // In two uploads, upload test data that has the same Patient ID, but different Patient's Name
            var uploadPath1    = Path.Combine(TestSettings.TestDataRootDirectory, "PatientNameConflict", "CT.1.dcm");
            var uploadResults1 = await _proKnow.Uploads.UploadAsync(workspaceItem.Id, uploadPath1);

            await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults1);

            var uploadPath2    = Path.Combine(TestSettings.TestDataRootDirectory, "PatientNameConflict", "CT.2.dcm");
            var uploadResults2 = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath2);

            var uploadProcessingResults2 = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults2);

            var uploadBatch2 = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults2.Results);

            // Verify that the second file shows a status of "pending" (conflict)
            Assert.IsTrue(uploadBatch2.GetStatus(uploadPath2) == "pending");
        }