コード例 #1
0
        public static async Task <TResource> ReadOneFromBundleWithContinuationAsync <TResource>(
            this Bundle bundle,
            IFhirService fhirService,
            bool throwOnMultipleFound = true)
            where TResource : Resource, new()
        {
            if (bundle == null)
            {
                return(null);
            }

            var resources = await bundle?.ReadFromBundleWithContinuationAsync <TResource>(fhirService, 2);

            var resourceCount = resources.Count();

            if (resourceCount == 0)
            {
                return(null);
            }

            if (throwOnMultipleFound && resourceCount > 1)
            {
                throw new MultipleResourceFoundException <TResource>(resourceCount);
            }

            return(resources.FirstOrDefault());
        }
コード例 #2
0
 public MaintenanceService(IFhirService _fhirServiceFull, ILocalhost localhost, IGenerator keyGenerator, IFhirStoreAdministration fhirStoreAdministration, IFhirIndex fhirIndex)
 {
     this._fhirServiceFull        = _fhirServiceFull;
     this.localhost               = localhost;
     this.keyGenerator            = keyGenerator;
     this.fhirStoreAdministration = fhirStoreAdministration;
     this.fhirIndex               = fhirIndex;
 }
コード例 #3
0
 public ScopedFhirServiceBuilder(Uri baseUri, IStorageBuilder <TScope> storageBuilder,
                                 IServiceListener[] listeners = null)
 {
     this.baseUri        = baseUri;
     this.storageBuilder = storageBuilder;
     this.listeners      = listeners;
     this.fhirService    = FhirServiceFactory.GetFhirService(baseUri, storageBuilder, listeners);
 }
コード例 #4
0
ファイル: MaintenanceHub.cs プロジェクト: sikim51/spark
 public MaintenanceHub(IFhirService fhirService, ILocalhost localhost, IFhirStoreAdministration fhirStoreAdministration, IFhirIndex fhirIndex, ExamplesSettings examplesSettings)
 {
     _localhost               = localhost;
     _fhirService             = fhirService;
     _fhirStoreAdministration = fhirStoreAdministration;
     _fhirIndex               = fhirIndex;
     _examplesSettings        = examplesSettings;
 }
コード例 #5
0
 public InitializerHub(IFhirService fhirService, ILocalhost localhost, IFhirStoreAdministration fhirStoreAdministration, IFhirIndex fhirIndex)
 {
     this.localhost               = localhost;
     this.fhirService             = fhirService;
     this.fhirStoreAdministration = fhirStoreAdministration;
     this.fhirIndex               = fhirIndex;
     this.resources               = null;
 }
コード例 #6
0
ファイル: ServiceHandler.cs プロジェクト: verzada/FhirStarter
        public HttpResponseMessage ResourceDelete(string type, Key key, IFhirService service)
        {
            if (service != null)
            {
                return(service.Delete(key));
            }

            throw new ArgumentException("Service is null, cannot update resource of type " + type);
        }
コード例 #7
0
 public ObservationController(IFhirService fhirService, IObservationService observationService,
                              IConverter <Observation, ObservationDto> observationToDtoConverter,
                              IConverter <IList <Observation>, IList <ObservationDto> > observationsToDtoConverter)
 {
     _observationService         = observationService;
     _observationToDtoConverter  = observationToDtoConverter;
     _observationsToDtoConverter = observationsToDtoConverter;
     fhirService.Initialize();
 }
コード例 #8
0
        public EndpointPipelineStep(
            IOptions <DicomWebConfiguration> dicomWebConfiguration,
            IFhirService fhirService)
        {
            EnsureArg.IsNotNull(dicomWebConfiguration?.Value, nameof(dicomWebConfiguration));
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));

            _fhirService      = fhirService;
            _dicomWebEndpoint = dicomWebConfiguration.Value.Endpoint.ToString();
        }
コード例 #9
0
        public ImagingStudyUpsertHandler(
            IFhirService fhirService,
            IImagingStudySynchronizer imagingStudySynchronizer)
        {
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));
            EnsureArg.IsNotNull(imagingStudySynchronizer, nameof(_imagingStudySynchronizer));

            _fhirService = fhirService;
            _imagingStudySynchronizer = imagingStudySynchronizer;
        }
コード例 #10
0
        public ImagingStudyDeleteHandler(
            IFhirService fhirService,
            IOptions <DicomWebConfiguration> dicomWebConfiguration)
        {
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));
            EnsureArg.IsNotNull(dicomWebConfiguration?.Value, nameof(dicomWebConfiguration));

            _fhirService      = fhirService;
            _dicomWebEndpoint = dicomWebConfiguration.Value.Endpoint.ToString();
        }
コード例 #11
0
        public PatientPipelineStep(
            IFhirService fhirService,
            IPatientSynchronizer patientSynchronizer)
        {
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));
            EnsureArg.IsNotNull(patientSynchronizer, nameof(patientSynchronizer));

            _fhirService         = fhirService;
            _patientSynchronizer = patientSynchronizer;
        }
コード例 #12
0
 public PatientService(IFhirService fhirService,
                       ICitizenshipService citizenshipService,
                       IConverter <PatientCsv, Patient> patientCsvToPatientConverter,
                       IConverter <PatientDto, Patient> patientDtoToPatientConverter)
 {
     _citizenshipService           = citizenshipService;
     _patientCsvToPatientConverter = patientCsvToPatientConverter;
     _patientDtoToPatientConverter = patientDtoToPatientConverter;
     fhirService.Initialize();
     _fhirClient = fhirService.Client;
 }
コード例 #13
0
        public ImagingStudyDeleteHandlerTests()
        {
            _configuration = new DicomWebConfiguration()
            {
                Endpoint = new System.Uri(DefaultDicomWebEndpoint),
            };
            IOptions <DicomWebConfiguration> optionsConfiguration = Options.Create(_configuration);

            _fhirService = Substitute.For <IFhirService>();
            _imagingStudyDeleteHandler = new ImagingStudyDeleteHandler(_fhirService, optionsConfiguration);
        }
コード例 #14
0
 public PatientController(IFhirService fhirService, IPatientService patientService,
                          IConverter <Patient, PatientDetailDto> patientToDtoConverter,
                          IConverter <IList <Patient>, IList <PatientDetailDto> > patientsToDtoConverter,
                          IValidator <IList <PatientCsv> > patientsCsvValidator)
 {
     _patientService         = patientService;
     _patientToDtoConverter  = patientToDtoConverter;
     _patientsToDtoConverter = patientsToDtoConverter;
     _patientsCsvValidator   = patientsCsvValidator;
     fhirService.Initialize();
 }
コード例 #15
0
        public ImagingStudyUpsertHandlerTests()
        {
            _configuration = new DicomWebConfiguration()
            {
                Endpoint = new System.Uri(DefaultDicomWebEndpoint),
            };
            IOptions <DicomWebConfiguration> optionsConfiguration = Options.Create(_configuration);

            _fhirService = Substitute.For <IFhirService>();
            _imagingStudySynchronizer  = new ImagingStudySynchronizer(new ImagingStudyPropertySynchronizer(), new ImagingStudySeriesPropertySynchronizer(), new ImagingStudyInstancePropertySynchronizer());
            _imagingStudyUpsertHandler = new ImagingStudyUpsertHandler(_fhirService, _imagingStudySynchronizer, optionsConfiguration);
        }
コード例 #16
0
        public ImagingStudyUpsertHandler(
            IFhirService fhirService,
            IImagingStudySynchronizer imagingStudySynchronizer,
            IOptions <DicomWebConfiguration> dicomWebConfiguration)
        {
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));
            EnsureArg.IsNotNull(imagingStudySynchronizer, nameof(_imagingStudySynchronizer));
            EnsureArg.IsNotNull(dicomWebConfiguration?.Value, nameof(dicomWebConfiguration));

            _fhirService = fhirService;
            _imagingStudySynchronizer = imagingStudySynchronizer;
            _dicomWebEndpoint         = dicomWebConfiguration.Value.Endpoint.ToString();
        }
コード例 #17
0
        public EndpointPipelineStepTests()
        {
            _configuration = new DicomWebConfiguration()
            {
                Endpoint = new System.Uri(DefaultDicomWebEndpoint),
            };

            IOptions <DicomWebConfiguration> optionsConfiguration = Options.Create(_configuration);

            _fhirService = Substitute.For <IFhirService>();

            _endpointPipeline = new EndpointPipelineStep(optionsConfiguration, _fhirService);
        }
コード例 #18
0
        public R4FhirImportService(
            IResourceIdentityService resourceIdentityService,
            IFhirService fhirService,
            IFhirTemplateProcessor <ILookupTemplate <IFhirTemplate>, Model.Observation> fhirTemplateProcessor,
            IMemoryCache observationCache,
            ITelemetryLogger logger)
        {
            _fhirTemplateProcessor = EnsureArg.IsNotNull(fhirTemplateProcessor, nameof(fhirTemplateProcessor));
            _fhirService           = EnsureArg.IsNotNull(fhirService, nameof(fhirService));
            _observationCache      = EnsureArg.IsNotNull(observationCache, nameof(observationCache));
            _logger = EnsureArg.IsNotNull(logger, nameof(logger));

            ResourceIdentityService = EnsureArg.IsNotNull(resourceIdentityService, nameof(resourceIdentityService));
        }
コード例 #19
0
ファイル: ServiceHandler.cs プロジェクト: verzada/FhirStarter
        public HttpResponseMessage ResourceCreate(string type, Resource resource, IFhirService service)
        {
            if (service != null && !string.IsNullOrEmpty(type) && resource != null)
            {
                var key    = Key.Create(type);
                var result = service.Create(key, resource);
                if (result != null)
                {
                    return(result);
                }
            }

            return(new HttpResponseMessage(HttpStatusCode.Ambiguous));
        }
コード例 #20
0
        public DicomCastWorkerTests()
        {
            _cancellationToken = _cancellationTokenSource.Token;

            _dicomCastWorkerConfiguration.PollInterval = TimeSpan.Zero;

            _fhirService = Substitute.For <IFhirService>();

            _dicomCastWorker = new DicomCastWorker(
                Options.Create(_dicomCastWorkerConfiguration),
                _changeFeedProcessor,
                NullLogger <DicomCastWorker> .Instance,
                _hostApplication,
                _fhirService);
        }
コード例 #21
0
        public DicomCastWorker(
            IOptions <DicomCastWorkerConfiguration> dicomCastWorkerConfiguration,
            IChangeFeedProcessor changeFeedProcessor,
            ILogger <DicomCastWorker> logger,
            IHostApplicationLifetime hostApplicationLifetime,
            IFhirService fhirService)
        {
            EnsureArg.IsNotNull(dicomCastWorkerConfiguration?.Value, nameof(dicomCastWorkerConfiguration));
            EnsureArg.IsNotNull(changeFeedProcessor, nameof(changeFeedProcessor));
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(hostApplicationLifetime, nameof(hostApplicationLifetime));
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));

            _dicomCastWorkerConfiguration = dicomCastWorkerConfiguration.Value;
            _changeFeedProcessor          = changeFeedProcessor;
            _logger = logger;
            _hostApplicationLifetime = hostApplicationLifetime;
            _fhirService             = fhirService;
        }
コード例 #22
0
ファイル: MaintenanceHub.cs プロジェクト: tomhydra/spark
 public MaintenanceHub(
     IFhirService fhirService,
     ILocalhost localhost,
     IFhirStoreAdministration fhirStoreAdministration,
     IFhirIndex fhirIndex,
     ExamplesSettings examplesSettings,
     IIndexRebuildService indexRebuildService,
     ILogger <MaintenanceHub> logger,
     IHubContext <MaintenanceHub> hubContext)
 {
     _localhost               = localhost;
     _fhirService             = fhirService;
     _fhirStoreAdministration = fhirStoreAdministration;
     _fhirIndex               = fhirIndex;
     _examplesSettings        = examplesSettings;
     _indexRebuildService     = indexRebuildService;
     _logger     = logger;
     _hubContext = hubContext;
 }
コード例 #23
0
        private static async Task <IEnumerable <TResource> > ReadFromBundleWithContinuationAsync <TResource>(
            this Bundle bundle,
            IFhirService fhirService,
            int?count = null)
            where TResource : Resource
        {
            EnsureArg.IsNotNull(fhirService, nameof(fhirService));

            var resources = new List <TResource>();

            Action <Bundle> storeResources = (bundle) =>
            {
                foreach (var r in bundle.ReadFromBundle <TResource>(count))
                {
                    if (count == 0)
                    {
                        break;
                    }

                    resources.Add(r);
                    if (count != null)
                    {
                        count--;
                    }
                }
            };

            storeResources.Invoke(bundle);

            await foreach (var currentBundle in fhirService.IterateOverAdditionalBundlesAsync(bundle))
            {
                storeResources.Invoke(currentBundle);
            }

            return(resources);
        }
 public R4DeviceAndPatientWithEncounterLookupIdentityService(IFhirService fhirService)
     : base(fhirService)
 {
 }
コード例 #25
0
 public FhirController(IFhirService fhirService, SparkSettings settings)
 {
     _fhirService = fhirService ?? throw new ArgumentNullException(nameof(fhirService));
     _settings    = settings ?? throw new ArgumentNullException(nameof(settings));
 }
コード例 #26
0
 public OrganizationService(IFhirService fhirService)
 {
     fhirService.Initialize();
     _fhirClient = fhirService.Client;
 }
コード例 #27
0
 public OrganizationController(IFhirService fhirService, IOrganizationService organizationService)
 {
     _organizationService = organizationService;
     fhirService.Initialize();
 }
コード例 #28
0
ファイル: FhirController.cs プロジェクト: HowardEdidin/spark
 public FhirController()
 {
     service = DependencyCoupler.Inject <IFhirService>();
 }
コード例 #29
0
ファイル: FhirController.cs プロジェクト: sivaram-tg/spark
 public FhirController(IFhirService fhirService)
 {
     // This will be a (injected) constructor parameter in ASP.vNext.
     _fhirService = fhirService;
 }
 public R4DeviceAndPatientWithEncounterLookupIdentityService(IFhirService fhirService, ResourceManagementService resourceIdService)
     : base(fhirService, resourceIdService)
 {
 }
コード例 #31
0
ファイル: FhirController.cs プロジェクト: TonyAbell/spark
 public FhirController()
 {
     service = DependencyCoupler.Inject<IFhirService>();
 }