示例#1
0
        protected virtual IFhirServiceExtension GetSearch()
        {
            IFhirIndex fhirStore = fhirStoreBuilder.GetStore <IFhirIndex>();

            if (fhirStore != null)
            {
                return(new SearchService(new Localhost(baseUri), new FhirModel(), fhirStore));
            }
            return(null);
        }
示例#2
0
        public static IFhirService GetFhirService(Uri baseUri, IFhirExtensionsBuilder extensionsBuilder,
                                                  IStorageBuilder storageBuilder, //we won't need this anymore if we can remove the Transfer dependency for IFhirService
                                                  IServiceListener[] listeners = null)
        {
            IGenerator generator = storageBuilder.GetStore <IGenerator>();

            IFhirServiceExtension[] extensions        = extensionsBuilder.GetExtensions().ToArray();
            IServiceListener[]      computedListeners = (listeners ?? Enumerable.Empty <IServiceListener>())
                                                        .Union(extensions.OfType <IServiceListener>())
                                                        .ToArray();
            ICompositeServiceListener serviceListener = new ServiceListener(new Localhost(baseUri), computedListeners);
            Transfer transfer = new Transfer(generator, new Localhost(baseUri));

            return(new FhirService(extensions,
                                   GetFhirResponseFactory(baseUri),
                                   transfer,
                                   serviceListener));
        }