Example #1
0
        public async Task GivenATransactionContextAndImagingStudyWithExistingEndpointReference_WhenProcessedForStudy_ThenEndpointResourceIsNotAddedAsync()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            Endpoint endpoint           = FhirResourceBuilder.CreateEndpointResource();
            var      endpointResourceId = new ServerResourceId(ResourceType.Endpoint, endpoint.Id);
            var      endpointReference  = endpointResourceId.ToResourceReference();

            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            context.Request.Endpoint = FhirTransactionRequestEntryGenerator.GenerateDefaultNoChangeRequestEntry <Endpoint>(endpointResourceId);

            imagingStudy.Endpoint.Add(endpointReference);

            await _imagingStudyPropertySynchronizer.SynchronizeAsync(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Endpoint,
                endPoint => Assert.Equal(endpointReference, endPoint));
        }
Example #2
0
        public async Task GivenATransactionContexAndImagingStudyWithNewAccessionNumber_WhenProcessedForStudy_ThenNewAccessionNumberIsAddedAsync()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            await _imagingStudyPropertySynchronizer.SynchronizeAsync(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Identifier,
                identifier => ValidationUtility.ValidateIdentifier("urn:dicom:uid", $"urn:oid:{DefaultStudyInstanceUid}", identifier),            // studyinstanceUid
                identifier => ValidationUtility.ValidateAccessionNumber(null, FhirTransactionContextBuilder.DefaultAccessionNumber, identifier)); // accession number

            FhirTransactionContext newConText = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(accessionNumber: NewAccessionNumber));

            await _imagingStudyPropertySynchronizer.SynchronizeAsync(newConText, imagingStudy);

            Assert.Collection(
                imagingStudy.Identifier,
                identifier => ValidationUtility.ValidateIdentifier("urn:dicom:uid", $"urn:oid:{DefaultStudyInstanceUid}", identifier),           // studyinstanceUid
                identifier => ValidationUtility.ValidateAccessionNumber(null, FhirTransactionContextBuilder.DefaultAccessionNumber, identifier), // accession number
                identifier => ValidationUtility.ValidateAccessionNumber(null, NewAccessionNumber, identifier));                                  // new accession number
        }
Example #3
0
        public void GivenATransactionContexAndImagingStudy_WhenProcessedForStudy_ThenDicomPropertiesAreCorrectlyMappedtoImagingStudy()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Endpoint,
                reference => string.Equals(reference.Reference, context.Request.Endpoint.Resource.ToString(), StringComparison.Ordinal));

            Assert.Collection(
                imagingStudy.Modality,
                modality => string.Equals(modality.Code, "MODALITY", StringComparison.Ordinal));

            Assert.Collection(
                imagingStudy.Note,
                note => string.Equals(note.Text.ToString(), "Study Description", StringComparison.Ordinal));

            Assert.Equal(new FhirDateTime(1974, 7, 10, 7, 10, 24, TimeSpan.Zero), imagingStudy.StartedElement);
        }
        public async Task GivenATransactionContexAndImagingStudy_WhenprocessedForInstance_ThenDicomPropertiesAreCorrectlyMappedtoInstanceWithinImagingStudyAsync()
        {
            DicomDataset dataset = FhirTransactionContextBuilder.CreateDicomDataset();

            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(StudyInstanceUid, new List <string>()
            {
                SeriesInstanceUid
            }, new List <string>()
            {
                SopInstanceUid
            }, PatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(dataset);

            if (imagingStudy.Series.Count() > 0)
            {
                System.Console.WriteLine("");
            }
            ImagingStudy.SeriesComponent   series   = imagingStudy.Series.First();
            ImagingStudy.InstanceComponent instance = series.Instance.First();

            await _imagingStudyInstancePropertySynchronizer.SynchronizeAsync(context, instance, DefaultCancellationToken);

            Assert.Equal(SopClassUid, instance.SopClass.Code);
            Assert.Equal(1, instance.Number);
        }
Example #5
0
        public void GivenATransactionContexAndImagingStudyWithNewModality_WhenProcessedForStudy_ThenNewModalityIsAdded()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Modality,
                modality => string.Equals(modality.Code, "MODALITY", StringComparison.Ordinal));

            FhirTransactionContext newConText = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(modalityInStudy: "NEWMODALITY", modalityInSeries: "NEWMODALITY"));

            _imagingStudyPropertySynchronizer.Synchronize(newConText, imagingStudy);

            Assert.Collection(
                imagingStudy.Modality,
                modality => string.Equals(modality.Code, "MODALITY", StringComparison.Ordinal),
                modality => string.Equals(modality.Code, "NEWMODALITY", StringComparison.Ordinal));
        }
        public void GivenATransactionContextWithUpdatedInstanceNumber_WhenprocessedForInstance_ThenDicomPropertyValuesAreUpdatedCorrectly()
        {
            DicomDataset dataset = FhirTransactionContextBuilder.CreateDicomDataset();

            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(studyInstanceUid, new List <string>()
            {
                seriesInstanceUid
            }, new List <string>()
            {
                sopInstanceUid
            }, patientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(dataset);

            ImagingStudy.SeriesComponent   series   = imagingStudy.Series.First();
            ImagingStudy.InstanceComponent instance = series.Instance.First();

            _imagingStudyInstancePropertySynchronizer.Synchronize(context, instance);

            Assert.Equal(1, instance.Number);

            FhirTransactionContext newContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(instanceNumber: "2"));

            _imagingStudyInstancePropertySynchronizer.Synchronize(newContext, instance);
            Assert.Equal(2, instance.Number);
        }
        public async Task GivenATransactionContextWithNoDicomPropertyValueChange_WhenprocessedForInstancee_ThenDicomPropertyValuesUpdateIsSkippedAsync()
        {
            DicomDataset dataset = FhirTransactionContextBuilder.CreateDicomDataset();

            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(StudyInstanceUid, new List <string>()
            {
                SeriesInstanceUid
            }, new List <string>()
            {
                SopInstanceUid
            }, PatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(dataset);

            ImagingStudy.SeriesComponent   series   = imagingStudy.Series.First();
            ImagingStudy.InstanceComponent instance = series.Instance.First();

            await _imagingStudyInstancePropertySynchronizer.SynchronizeAsync(context, instance, DefaultCancellationToken);

            Assert.Equal(1, instance.Number);

            FhirTransactionContext newContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext(dataset);

            await _imagingStudyInstancePropertySynchronizer.SynchronizeAsync(newContext, instance, DefaultCancellationToken);

            Assert.Equal(1, instance.Number);
        }
Example #8
0
        public void GivenATransactionContexAndImagingStudyWithNewStudyDescription_WhenProcessedForStudy_ThenNewNoteIsAdded()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Note,
                note => string.Equals(note.Text.ToString(), "Study Description", StringComparison.Ordinal));

            // When studyDescription is same, note is not added twice

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Note,
                note => string.Equals(note.Text.ToString(), "Study Description", StringComparison.Ordinal));

            // When study description is new, new note is added
            FhirTransactionContext newConText = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(studyDescription: "New Study Description"));

            _imagingStudyPropertySynchronizer.Synchronize(newConText, imagingStudy);

            Assert.Collection(
                imagingStudy.Note,
                note => string.Equals(note.Text.ToString(), "Study Description", StringComparison.Ordinal),
                note => string.Equals(note.Text.ToString(), "New Study Description", StringComparison.Ordinal));
        }
Example #9
0
        public void GivenATransactionContextAndImagingStudyWithNewEndpointReference_WhenProcessedForStudyWithEndpoint_ThenEndpointIsAdded()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);

            // Simulate the imaging study with an existing endpoint.
            Endpoint existingEndpoint           = FhirResourceBuilder.CreateEndpointResource(id: "2345", name: "new wado-rs");
            var      existingEndpointResourceId = new ServerResourceId(ResourceType.Endpoint, existingEndpoint.Id);
            var      existingEndpointReference  = existingEndpointResourceId.ToResourceReference();

            imagingStudy.Endpoint.Add(existingEndpointReference);

            Endpoint endpoint           = FhirResourceBuilder.CreateEndpointResource();
            var      endpointResourceId = new ServerResourceId(ResourceType.Endpoint, endpoint.Id);
            var      endpointReference  = endpointResourceId.ToResourceReference();

            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            context.Request.Endpoint = FhirTransactionRequestEntryGenerator.GenerateDefaultNoChangeRequestEntry <Endpoint>(endpointResourceId);

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Endpoint,
                endPoint => Assert.Equal(existingEndpointReference, endPoint),
                endPoint => Assert.Equal(endpointReference, endPoint));
        }
        public void GivenATransactionContextAndImagingStudyWithExitsingAccessionNumber_WhenProcessedForStudy_ThenAccessionNumberIsNotAdded()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Identifier,
                identifier => ValidationUtility.ValidateIdentifier("urn:dicom:uid", $"urn:oid:{DefaultStudyInstanceUid}", identifier),
                identifier => ValidationUtility.ValidateAccessionNumber(null, FhirTransactionContextBuilder.DefaultAccessionNumber, identifier));

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Identifier,
                identifier => ValidationUtility.ValidateIdentifier("urn:dicom:uid", $"urn:oid:{DefaultStudyInstanceUid}", identifier),
                identifier => ValidationUtility.ValidateAccessionNumber(null, FhirTransactionContextBuilder.DefaultAccessionNumber, identifier));
        }
Example #11
0
        public void GivenAChangeFeedEntryWithInvalidUtcTimeOffset_WhenDateTimeOffsetIsCalculated_ThenInvalidDicomTagValueExceptionIsThrown()
        {
            FhirTransactionContext fhirTransactionContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext();

            fhirTransactionContext.ChangeFeedEntry.Metadata.Add(DicomTag.TimezoneOffsetFromUTC, "0");

            Assert.Throws <InvalidDicomTagValueException>(
                () => ImagingStudyPipelineHelper.SetDateTimeOffSet(fhirTransactionContext));
        }
Example #12
0
        public void GivenAChangeFeedEntry_WhenDateTimeOffsetIsCalculated_ThenDateTimeOffsetIsSet(int hour, int minute, string dicomValue)
        {
            FhirTransactionContext fhirTransactionContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext();

            DateTimeOffset utcTimeZoneOffset = new DateTimeOffset(2020, 1, 1, 0, 0, 0, new TimeSpan(hour, minute, 0));

            fhirTransactionContext.ChangeFeedEntry.Metadata.Add(DicomTag.TimezoneOffsetFromUTC, dicomValue);

            ImagingStudyPipelineHelper.SetDateTimeOffSet(fhirTransactionContext);

            Assert.Equal(utcTimeZoneOffset.Offset, fhirTransactionContext.UtcDateTimeOffset);
        }
Example #13
0
        public void GivenAChangeFeedEntry_WhenDateTimeOffsetIsCalculated_ThenDateTimeOffsetIsSet()
        {
            FhirTransactionContext fhirTransactionContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext();

            DateTimeOffset utcTimeZoneOffset = DateTimeOffset.Now;

            fhirTransactionContext.ChangeFeedEntry.Metadata.Add(DicomTag.TimezoneOffsetFromUTC, utcTimeZoneOffset.ToString(FhirTransactionConstants.UtcTimezoneOffsetFormat));

            ImagingStudyPipelineHelper.SetDateTimeOffSet(fhirTransactionContext);

            Assert.Equal(utcTimeZoneOffset.Offset, fhirTransactionContext.UtcDateTimeOffset);
        }
Example #14
0
        public async Task SyncPropertiesAsync_PartialValidationEnabledAndPropertyRequired_ThrowsError()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            Action <ImagingStudy, FhirTransactionContext> actionSubstitute = Substitute.For <Action <ImagingStudy, FhirTransactionContext> >();

            actionSubstitute.When(x => x.Invoke(imagingStudy, context)).Do(x => throw new InvalidDicomTagValueException("invalid tag", "invalid tag"));

            await Assert.ThrowsAsync <InvalidDicomTagValueException>(() => ImagingStudyPipelineHelper.SynchronizePropertiesAsync(imagingStudy, context, actionSubstitute, true, true, _exceptionStore));
        }
Example #15
0
        public void GivenATransactionContextAndImagingStudyWithNoEndpoint_WhenProcessedForStudy_ThenNewEndpointIsAdded()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            _imagingStudyPropertySynchronizer.Synchronize(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Endpoint,
                endPoint => Assert.Equal(context.Request.Endpoint.ResourceId.ToResourceReference(), endPoint));
        }
        public async Task GivenATransactionContexAndImagingStudy_WhenprocessedForSeries_ThenDicomPropertiesAreCorrectlyMappedtoSeriesWithinImagingStudyAsync()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(StudyInstanceUid, new List <string>()
            {
                SeriesInstanceUid
            }, new List <string>()
            {
                SopInstanceUid
            }, PatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            ImagingStudy.SeriesComponent series = imagingStudy.Series.First();

            await _imagingStudySeriesPropertySynchronizer.SynchronizeAsync(context, series, DefaultCancellationToken);

            Assert.Equal("Series Description", series.Description);
            Assert.Equal("MODALITY", series.Modality.Code);
            Assert.Equal(1, series.Number);
            Assert.Equal(new FhirDateTime(1974, 8, 10, 8, 10, 24, TimeSpan.Zero), series.StartedElement);
        }
        public void GivenATransactionContexAndImagingStudy_WhenprocessedForInstance_ThenDicomPropertiesAreCorrectlyMappedtoInstanceWithinImagingStudy()
        {
            DicomDataset dataset = FhirTransactionContextBuilder.CreateDicomDataset();

            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(studyInstanceUid, new List <string>()
            {
                seriesInstanceUid
            }, new List <string>()
            {
                sopInstanceUid
            }, patientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(dataset);

            ImagingStudy.SeriesComponent   series   = imagingStudy.Series.First();
            ImagingStudy.InstanceComponent instance = series.Instance.First();

            _imagingStudyInstancePropertySynchronizer.Synchronize(context, instance);

            Assert.Equal(sopClassUid, instance.SopClass.Code);
            Assert.Equal(1, instance.Number);
        }
Example #18
0
        public void GivenATransactionContextWithUpdatedSeriesModality_WhenprocessedForSeries_ThenDicomPropertyValuesAreUpdatedAreCorrectly()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(studyInstanceUid, new List <string>()
            {
                seriesInstanceUid
            }, new List <string>()
            {
                sopInstanceUid
            }, patientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            ImagingStudy.SeriesComponent series = imagingStudy.Series.First();

            _imagingStudySeriesPropertySynchronizer.Synchronize(context, series);

            Assert.Equal("MODALITY", series.Modality.Code);

            FhirTransactionContext newContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(modalityInSeries: "NEWMODALITY"));

            _imagingStudySeriesPropertySynchronizer.Synchronize(newContext, series);
            Assert.Equal("NEWMODALITY", series.Modality.Code);
        }
Example #19
0
        public void GivenATransactionContextWithNoPropertyValueChange_WhenprocessedForSeries_ThenDicomPropertyValuesUpdateIsSkipped()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(studyInstanceUid, new List <string>()
            {
                seriesInstanceUid
            }, new List <string>()
            {
                sopInstanceUid
            }, patientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext();

            ImagingStudy.SeriesComponent series = imagingStudy.Series.First();

            _imagingStudySeriesPropertySynchronizer.Synchronize(context, series);

            Assert.Equal(1, series.Number);

            FhirTransactionContext newContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext();

            _imagingStudySeriesPropertySynchronizer.Synchronize(newContext, series);
            Assert.Equal(1, series.Number);
        }
        public async Task GivenATransactionContextWithUpdatedSeriesDescription_WhenprocessedForSeries_ThenDicomPropertyValuesAreUpdatedAreCorrectlyAsync()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(StudyInstanceUid, new List <string>()
            {
                SeriesInstanceUid
            }, new List <string>()
            {
                SopInstanceUid
            }, PatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            ImagingStudy.SeriesComponent series = imagingStudy.Series.First();

            await _imagingStudySeriesPropertySynchronizer.SynchronizeAsync(context, series, DefaultCancellationToken);

            Assert.Equal("Series Description", series.Description);

            FhirTransactionContext newContext = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset(seriesDescrition: "New Series Description"));

            await _imagingStudySeriesPropertySynchronizer.SynchronizeAsync(newContext, series, DefaultCancellationToken);

            Assert.Equal("New Series Description", series.Description);
        }
Example #21
0
        public async Task GivenATransactionContextAndImagingStudyWithExitsingModality_WhenProcessedForStudy_ThenModalityIsNotAddedAsync()
        {
            ImagingStudy imagingStudy = FhirResourceBuilder.CreateNewImagingStudy(DefaultStudyInstanceUid, new List <string>()
            {
                DefaultSeriesInstanceUid
            }, new List <string>()
            {
                DefaultSopInstanceUid
            }, DefaultPatientResourceId);
            FhirTransactionContext context = FhirTransactionContextBuilder.DefaultFhirTransactionContext(FhirTransactionContextBuilder.CreateDicomDataset());

            await _imagingStudyPropertySynchronizer.SynchronizeAsync(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Modality,
                modality => string.Equals(modality.Code, "MODALITY", StringComparison.Ordinal));

            await _imagingStudyPropertySynchronizer.SynchronizeAsync(context, imagingStudy);

            Assert.Collection(
                imagingStudy.Modality,
                modality => string.Equals(modality.Code, "MODALITY", StringComparison.Ordinal));
        }