public async Task GivenRetrieveMetadataRequestForStudy_WhenResourceIsFound_ThenAuditEntriesShouldBeCreated() { InstanceIdentifier dicomInstance = await CreateDicomFileAndGetInstanceIdentifierAsync(); await ExecuteAndValidate( () => _client.RetrieveStudyMetadataAsync(dicomInstance.StudyInstanceUid), AuditEventSubType.RetrieveMetadata, $"studies/{dicomInstance.StudyInstanceUid}/metadata", HttpStatusCode.OK); }
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); } }
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; }
public async Task GivenRetrieveStudyMetadataRequest_WhenStudyInstanceUidDoesnotExists_ThenNotFoundIsReturned() { DicomWebException exception = await Assert.ThrowsAsync <DicomWebException>(() => _client.RetrieveStudyMetadataAsync(TestUidGenerator.Generate())); Assert.Equal(HttpStatusCode.NotFound, exception.StatusCode); }
private static void RetrieveStudyMetadata(string studyUid) { s_client.RetrieveStudyMetadataAsync(studyUid).Wait(); }