public WadoStoreResponse(string studyInstanceUID)
 {
     _dataset         = new fo.DicomDataset( );
     UrlProvider      = new RetieveUrlProvider( );
     StudyInstanceUID = studyInstanceUID;
     HttpStatus       = HttpStatusCode.Unused;
 }
Example #2
0
        protected virtual void RegisterComponents( )
        {
            For <IConnectionStringProvider> ( ).Use <ConnectionStringProvider> ( );
            For <DbSchemaProvider> ( ).Use <StorageDbSchemaProvider> ( ); //default constructor
            For <IDatabaseFactory> ( ).Use <SqlDatabaseFactory> ( );
            For <ISortingStrategyFactory> ( ).Use <SortingStrategyFactory> ( );
            For <ObjectArchieveDataAdapter> ( ).Use <ObjectArchieveDataAdapter> ( );
            For <IObjectArchieveDataAccess> ( ).Use <ObjectArchieveDataAccess> ( );

            IRetieveUrlProvider urlProvider = new RetieveUrlProvider(CloudConfigurationManager.GetSetting(RetieveUrlProvider.config_WadoRs_API_URL),
                                                                     CloudConfigurationManager.GetSetting(RetieveUrlProvider.config_WadoUri_API_URL));

            For <IDCloudCommandFactory> ( ).Use <DCloudCommandFactory> ( );

            For <IObjectArchieveQueryService> ( ).Use <ObjectArchieveQueryService> ( );
            For <IObjectStoreService>         ( ).Use <ObjectStoreService>         ( );
            For <IObjectRetrieveService>      ( ).Use <ObjectRetrieveService>      ( );

            For <IWadoRsService>         ( ).Use <WadoRsService>         ( );
            For <IWebObjectStoreService> ( ).Use <WebObjectStoreService> ( );
            For <IQidoRsService>         ( ).Use <QidoRsService>         ( );
            For <IWadoUriService>        ( ).Use <WadoUriService>        ( );
            For <IOhifService>           ( ).Use <OhifService>           ( );

            For <IDicomMediaIdFactory> ( ).Use <DicomMediaIdFactory> ( );

            For <IRetieveUrlProvider> ( ).Use(urlProvider);

            if (StorageConection.StartsWith("|datadirectory|", StringComparison.OrdinalIgnoreCase))
            {
                var appDataPath  = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
                var lastIndex    = StorageConection.IndexOf('|', 1);
                var userPathPart = StorageConection.Substring(lastIndex + 1);


                StorageConection = appDataPath + userPathPart;
            }

            if (System.IO.Path.IsPathRooted(StorageConection))
            {
                For <IKeyProvider> ( ).Use <HashedFileKeyProvider> ( );
                For <IMediaStorageService> ( ).Use <FileStorageService> ( ).Ctor <string> ( ).Is(StorageConection);
            }
            else
            {
                StorageAccount = CloudStorageAccount.Parse(StorageConection);

                AzureStorageSupported = true;

                For <CloudStorageAccount> ( ).Use(@StorageAccount);

                For <IMediaStorageService> ( ).Use <AzureStorageService> ( ).Ctor <CloudStorageAccount> ( ).Is(StorageAccount);
            }
        }