public IHttpActionResult GetEpisodes(int key)
        {
            SeriesTable series = new SeriesTable();

            series = seriesServices.GetByID(key);
            var episodes = seriesServices.GetAllEpisodes(key);

            return(Ok(episodes.Select(x => new EpisodeDto {
                SeriesName = series.SeriesName, EpisodeID = x.EpisodesID, Season = x.Season, SeriesID = x.SeriesID
            })));
        }
        public IHttpActionResult Delete(int key)
        {
            SeriesTable series = new SeriesTable();

            series = seriesServices.GetByID(key);
            if (series != null)
            {
                series.isDeleted = true;
                return(Ok());
            }
            else
            {
                return(null);
            }
        }
        public IHttpActionResult GetByID(int ID)
        {
            SeriesTable series = new SeriesTable();

            if (series != null)
            {
                return(Ok(new SeriesDto {
                    SeriesName = series.SeriesName, SeriesID = series.SeriesID, SeriesPicture = series.SeriesPicture
                }));
            }
            else
            {
                return(null);
            }
        }
 public IHttpActionResult Update([FromBody] SeriesTable series, int key)
 {
     seriesServices.Update(series, key);
     return(Ok());
 }
 public IHttpActionResult Create(SeriesTable series)
 {
     seriesServices.Create(series);
     return(Ok());
 }
示例#6
0
        public void SetupSuite(DiscoveredDatabase databaseToCreateInto, IRDMPPlatformRepositoryServiceLocator repositoryLocator, GlobalOptions globalOptions, Type pipelineDicomSourceType, string root = null, ImageTableTemplateCollection template = null, bool persistentRaw = false, string modalityPrefix = null)
        {
            ImageTable  = databaseToCreateInto.ExpectTable(modalityPrefix + "ImageTable");
            SeriesTable = databaseToCreateInto.ExpectTable(modalityPrefix + "SeriesTable");
            StudyTable  = databaseToCreateInto.ExpectTable(modalityPrefix + "StudyTable");

            try
            {
                File.Copy(typeof(InvalidDataHandling).Assembly.Location, Path.Combine(TestContext.CurrentContext.TestDirectory, "Rdmp.Dicom.dll"), true);
            }
            catch (System.IO.IOException)
            {
                //nevermind, it's probably locked
            }


            //The Rdmp.Dicom assembly should be loaded as a plugin, this simulates it.
            foreach (var type in typeof(InvalidDataHandling).Assembly.GetTypes())
            {
                repositoryLocator.CatalogueRepository.MEF.AddTypeToCatalogForTesting(type);
            }


            ICatalogueRepository  catalogueRepository  = repositoryLocator.CatalogueRepository;
            IDataExportRepository dataExportRepository = repositoryLocator.DataExportRepository;

            foreach (var t in new[] { ImageTable, SeriesTable, StudyTable })
            {
                if (t.Exists())
                {
                    t.Drop();
                }
            }

            var suite = new ExecuteCommandCreateNewImagingDatasetSuite(repositoryLocator, databaseToCreateInto, new DirectoryInfo(TestContext.CurrentContext.TestDirectory));

            suite.Template = template ?? GetDefaultTemplate(databaseToCreateInto.Server.DatabaseType);

            suite.PersistentRaw = persistentRaw;
            suite.TablePrefix   = modalityPrefix;

            suite.DicomSourceType = pipelineDicomSourceType;
            suite.CreateCoalescer = true;

            suite.Execute();
            DicomSourcePipelineComponent = suite.DicomSourcePipelineComponent; //store the component created so we can inject/adjust the arguments e.g. adding ElevationRequests to it

            LoadMetadata = suite.NewLoadMetadata;


            var tableInfos = LoadMetadata.GetAllCatalogues().SelectMany(c => c.GetTableInfoList(false)).Distinct().ToArray();

            ImageTableInfo  = (TableInfo)tableInfos.Single(t => t.GetRuntimeName().Equals(ImageTable.GetRuntimeName()));
            SeriesTableInfo = (TableInfo)tableInfos.Single(t => t.GetRuntimeName().Equals(SeriesTable.GetRuntimeName()));
            StudyTableInfo  = (TableInfo)tableInfos.Single(t => t.GetRuntimeName().Equals(StudyTable.GetRuntimeName()));

            // Override the options with stuff coming from Core RDMP DatabaseTests (TestDatabases.txt)
            globalOptions.FileSystemOptions.FileSystemRoot = root ?? TestContext.CurrentContext.TestDirectory;

            globalOptions.RDMPOptions.CatalogueConnectionString  = ((TableRepository)catalogueRepository).DiscoveredServer.Builder.ConnectionString;
            globalOptions.RDMPOptions.DataExportConnectionString = ((TableRepository)dataExportRepository).DiscoveredServer.Builder.ConnectionString;

            globalOptions.DicomRelationalMapperOptions.LoadMetadataId               = LoadMetadata.ID;
            globalOptions.DicomRelationalMapperOptions.MinimumBatchSize             = 1;
            globalOptions.DicomRelationalMapperOptions.UseInsertIntoForRAWMigration = true;

            //Image table now needs all the UIDs in order to be extractable
            var adder = new TagColumnAdder("StudyInstanceUID", "varchar(100)", ImageTableInfo, new AcceptAllCheckNotifier());

            adder.Execute();
        }