예제 #1
0
        public async Task GivenMatchingStudiesInDifferentPartitions_WhenSearchForStudySeriesLevel_OnePartitionMatchesResult()
        {
            var newPartition1 = TestUidGenerator.Generate();
            var newPartition2 = TestUidGenerator.Generate();

            var studyUid = TestUidGenerator.Generate();

            DicomFile file1 = Samples.CreateRandomDicomFile(studyUid);

            file1.Dataset.AddOrUpdate(new DicomDataset()
            {
                { DicomTag.Modality, "MRI" },
            });

            DicomFile file2 = Samples.CreateRandomDicomFile(studyUid);

            file2.Dataset.AddOrUpdate(new DicomDataset()
            {
                { DicomTag.Modality, "MRI" },
            });

            using DicomWebResponse <DicomDataset> response1 = await _instancesManager.StoreAsync(new[] { file1 }, partitionName : newPartition1);

            using DicomWebResponse <DicomDataset> response2 = await _instancesManager.StoreAsync(new[] { file2 }, partitionName : newPartition2);

            using DicomWebAsyncEnumerableResponse <DicomDataset> response = await _client.QueryStudySeriesAsync(studyUid, "Modality=MRI", newPartition1);

            DicomDataset[] datasets = await response.ToArrayAsync();

            Assert.Single(datasets);
            ValidationHelpers.ValidateResponseDataset(QueryResource.StudySeries, file1.Dataset, datasets[0]);
        }
        public async Task GivenSearchRequest_StudySeriesLevel_MatchResult()
        {
            DicomDataset matchInstance = await PostDicomFileAsync(new DicomDataset()
            {
                { DicomTag.Modality, "MRI" },
            });

            var studyId = matchInstance.GetSingleValue <string>(DicomTag.StudyInstanceUID);

            await PostDicomFileAsync(new DicomDataset()
            {
                { DicomTag.StudyInstanceUID, studyId },
                { DicomTag.Modality, "CT" },
            });

            using DicomWebAsyncEnumerableResponse <DicomDataset> response = await _client.QueryStudySeriesAsync(studyId, "Modality=MRI");

            DicomDataset[] datasets = await response.ToArrayAsync();

            Assert.Single(datasets);
            ValidationHelpers.ValidateResponseDataset(QueryResource.StudySeries, matchInstance, datasets[0]);
        }