示例#1
0
        public async Task GivenRetrieveMetadataRequestForStudy_WhenResourceIsFound_ThenAuditEntriesShouldBeCreated()
        {
            InstanceIdentifier dicomInstance = await CreateDicomFileAndGetInstanceIdentifierAsync();

            await ExecuteAndValidate(
                () => _client.RetrieveStudyMetadataAsync(dicomInstance.StudyInstanceUid),
                AuditEventSubType.RetrieveMetadata,
                $"studies/{dicomInstance.StudyInstanceUid}/metadata",
                HttpStatusCode.OK);
        }
示例#2
0
        public async Task GivenRetrieveStudyMetadataRequest_WhenIfNoneMatchMatchesETag_ThenNotModifiedResponseIsReturned()
        {
            string studyInstanceUid = TestUidGenerator.Generate();

            DicomDataset storedInstance = await PostDicomFileAsync(ResourceType.Study, studyInstanceUid, dataSet : GenerateNewDataSet());

            string eTag;

            using (DicomWebAsyncEnumerableResponse <DicomDataset> response = await _client.RetrieveStudyMetadataAsync(studyInstanceUid))
            {
                eTag = GetEtagFromResponse(response);
            }

            using (DicomWebAsyncEnumerableResponse <DicomDataset> response = await _client.RetrieveStudyMetadataAsync(studyInstanceUid, eTag))
            {
                Assert.Equal(HttpStatusCode.NotModified, response.StatusCode);
                ValidateNoContent(response);
            }
        }
示例#3
0
        private static async Task WadoMetadata(Message message, CancellationToken token)
        {
            (string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid) = ParseMessageForUids(message);

            if (sopInstanceUid != null)
            {
                await client.RetrieveInstanceMetadataAsync(studyInstanceUid, seriesInstanceUid, sopInstanceUid, cancellationToken : token);
            }
            else if (seriesInstanceUid != null)
            {
                await client.RetrieveSeriesMetadataAsync(studyInstanceUid, seriesInstanceUid, cancellationToken : token);
            }
            else
            {
                await client.RetrieveStudyMetadataAsync(studyInstanceUid, cancellationToken : token);
            }

            return;
        }
示例#4
0
        public async Task GivenRetrieveStudyMetadataRequest_WhenStudyInstanceUidDoesnotExists_ThenNotFoundIsReturned()
        {
            DicomWebException exception = await Assert.ThrowsAsync <DicomWebException>(() => _client.RetrieveStudyMetadataAsync(TestUidGenerator.Generate()));

            Assert.Equal(HttpStatusCode.NotFound, exception.StatusCode);
        }
示例#5
0
 private static void RetrieveStudyMetadata(string studyUid)
 {
     s_client.RetrieveStudyMetadataAsync(studyUid).Wait();
 }