public async Task GivenSupportedTransferSyntax_WhenNoTsSpecified_DefaultTsReturned()
        {
            var seriesInstanceUid = TestUidGenerator.Generate();
            var studyInstanceUid  = TestUidGenerator.Generate();

            DicomFile dicomFile = Samples.CreateRandomDicomFileWith8BitPixelData(
                studyInstanceUid,
                seriesInstanceUid,
                transferSyntax: DicomTransferSyntax.DeflatedExplicitVRLittleEndian.UID.UID);

            try
            {
                await _client.StoreAsync(new[] { dicomFile });

                DicomWebResponse <IReadOnlyList <DicomFile> > retrieveResponse = await _client.RetrieveSeriesAsync(
                    studyInstanceUid,
                    seriesInstanceUid);

                Assert.Equal(HttpStatusCode.OK, retrieveResponse.StatusCode);
                Assert.Equal(DicomTransferSyntax.DeflatedExplicitVRLittleEndian, retrieveResponse.Value.Single().Dataset.InternalTransferSyntax);
            }
            finally
            {
                await _client.DeleteSeriesAsync(studyInstanceUid, seriesInstanceUid);
            }
        }
Example #2
0
        public async Task GivenAnExistingSeries_WhenDeletingSeries_TheServerShouldReturnNoContentAndAllLevelsShouldBeRemoved()
        {
            var studyInstanceUid  = TestUidGenerator.Generate();
            var seriesInstanceUid = TestUidGenerator.Generate();
            var sopInstanceUid    = TestUidGenerator.Generate();

            await CreateFile(studyInstanceUid, seriesInstanceUid, sopInstanceUid);

            using (DicomWebResponse response = await _client.DeleteSeriesAsync(studyInstanceUid, seriesInstanceUid))
            {
                Assert.Equal(HttpStatusCode.NoContent, response?.StatusCode);
            }

            await VerifyAllRemoval(studyInstanceUid, seriesInstanceUid, sopInstanceUid);
        }
Example #3
0
        public async Task GivenDeleteRequestForSeries_WhenResourceExists_ThenAuditLogEntriesShouldBeCreated()
        {
            InstanceIdentifier dicomInstance = await CreateDicomFileAndGetInstanceIdentifierAsync();

            await ExecuteAndValidate(
                () => _client.DeleteSeriesAsync(dicomInstance.StudyInstanceUid, dicomInstance.SeriesInstanceUid),
                AuditEventSubType.Delete,
                $"studies/{dicomInstance.StudyInstanceUid}/series/{dicomInstance.SeriesInstanceUid}",
                HttpStatusCode.NoContent);
        }