Exemple #1
0
 public Pager(IFhirStore store, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer)
 {
     this.store = store;
     this.snapshotstore = snapshotstore;
     this.localhost = localhost;
     this.transfer = transfer;
 }
Exemple #2
0
 public SnapshotPaginationProvider(IFhirStore fhirStore, ITransfer transfer, ILocalhost localhost, ISnapshotPaginationCalculator snapshotPaginationCalculator)
 {
     this.fhirStore = fhirStore;
     this.transfer  = transfer;
     this.localhost = localhost;
     _snapshotPaginationCalculator = snapshotPaginationCalculator;
 }
Exemple #3
0
 public Pager(IFhirStore store, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer)
 {
     this.store         = store;
     this.snapshotstore = snapshotstore;
     this.localhost     = localhost;
     this.transfer      = transfer;
 }
 public MongoFhirStoreOther(string mongoUrl, IFhirStore mongoFhirStoreOther)
 {
     _mongoFhirStoreOther = mongoFhirStoreOther;
     this.database        = MongoDatabaseFactory.GetMongoDatabase(mongoUrl);
     this.collection      = database.GetCollection <BsonDocument>(Collection.RESOURCE);
     //this.transaction = new MongoSimpleTransaction(collection);
 }
Exemple #5
0
 public Pager(IFhirStore fhirStore, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer, List<ModelInfo.SearchParamDefinition> searchParameters)
 {
     this.fhirStore = fhirStore;
     this.snapshotstore = snapshotstore;
     this.localhost = localhost;
     this.transfer = transfer;
     this.searchParameters = searchParameters;
 }
Exemple #6
0
 public InitializeHub(FhirService fhirService, ILocalhost localhost, IFhirStore fhirStore, IFhirIndex fhirIndex)
 {
     this.localhost   = localhost;
     this.fhirService = fhirService;
     this.fhirStore   = fhirStore;
     this.fhirIndex   = fhirIndex;
     this.resources   = null;
 }
Exemple #7
0
 public InitializeHub()
 {
     this.localhost = InfrastructureProvider.Mongo.Localhost;
     this.service   = InfrastructureProvider.Mongo.CreateService();
     this.store     = InfrastructureProvider.Mongo.Store;
     this.index     = InfrastructureProvider.Mongo.Index;
     this.resources = null;
 }
 public InitializeHub()
 {
     this.localhost = InfrastructureProvider.Mongo.Localhost;
     this.service = InfrastructureProvider.Mongo.CreateService();
     this.store = InfrastructureProvider.Mongo.Store;
     this.index = InfrastructureProvider.Mongo.Index;
     this.resources = null;
 }
 public MaintenanceService(Infrastructure infrastructure, FhirService service)
 {
     this.service   = service;
     this.localhost = infrastructure.Localhost;
     this.generator = infrastructure.Generator;
     this.store     = infrastructure.Store;
     this.index     = infrastructure.Index;
 }
Exemple #10
0
 public Pager(IFhirStore fhirStore, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer, List <ModelInfo.SearchParamDefinition> searchParameters)
 {
     this.fhirStore        = fhirStore;
     this.snapshotstore    = snapshotstore;
     this.localhost        = localhost;
     this.transfer         = transfer;
     this.searchParameters = searchParameters;
 }
 public MaintenanceService(FhirService fhirService, ILocalhost localhost, IGenerator keyGenerator, IFhirStore fhirStore, IFhirIndex fhirIndex)
 {
     this.fhirService  = fhirService;
     this.localhost    = localhost;
     this.keyGenerator = keyGenerator;
     this.fhirStore    = fhirStore;
     this.fhirIndex    = fhirIndex;
 }
Exemple #12
0
 public MaintenanceService(FhirService fhirService, ILocalhost localhost, IGenerator keyGenerator, IFhirStore fhirStore, IFhirIndex fhirIndex)
 {
     this.fhirService = fhirService;
     this.localhost = localhost;
     this.keyGenerator = keyGenerator;
     this.fhirStore = fhirStore;
     this.fhirIndex = fhirIndex;
 }
Exemple #13
0
 public InitializeHub(FhirService fhirService, ILocalhost localhost, IFhirStore fhirStore, IFhirIndex fhirIndex)
 {
     this.localhost = localhost;
     this.fhirService = fhirService;
     this.fhirStore = fhirStore;
     this.fhirIndex = fhirIndex;
     this.resources = null;
 }
 public MaintenanceService(Infrastructure infrastructure, FhirService service)
 {
     this.service = service;
     this.localhost = infrastructure.Localhost;
     this.generator = infrastructure.Generator;
     this.store = infrastructure.Store;
     this.index = infrastructure.Index;
 }
Exemple #15
0
 public FhirService(Uri serviceBase)
 {
     store = DependencyCoupler.Inject<IFhirStore>(); // new MongoFhirStore();
     _index = DependencyCoupler.Inject<IFhirIndex>(); // Factory.Index;
     _importer = DependencyCoupler.Inject<ResourceImporter>();
     exporter = DependencyCoupler.Inject<ResourceExporter>();
     pager = new Pager(store);
     Endpoint = serviceBase;
 }
Exemple #16
0
 public FhirService(Uri serviceBase)
 {
     _store    = DependencyCoupler.Inject <IFhirStore>(); // new MongoFhirStore();
     _index    = DependencyCoupler.Inject <IFhirIndex>(); // Factory.Index;
     _importer = DependencyCoupler.Inject <ResourceImporter>();
     _exporter = DependencyCoupler.Inject <ResourceExporter>();
     _pager    = new Pager(_store);
     Endpoint  = serviceBase;
 }
Exemple #17
0
        protected virtual IFhirServiceExtension GetStorage()
        {
            IFhirStore fhirStore     = fhirStoreBuilder.GetStore <IFhirStore>();
            IGenerator fhirGenerator = fhirStoreBuilder.GetStore <IGenerator>();

            if (fhirStore != null)
            {
                return(new ResourceStorageService(new Transfer(fhirGenerator, new Localhost(baseUri)), fhirStore));
            }
            return(null);
        }
Exemple #18
0
        public FhirService(Infrastructure infrastructure)
        {
            this.localhost     = infrastructure.Localhost;
            this.store         = infrastructure.Store;
            this.snapshotstore = infrastructure.SnapshotStore;
            this.generator     = infrastructure.Generator;
            this.index         = infrastructure.Index;
            this.listener      = infrastructure.ServiceListener;

            transfer = new Transfer(generator, localhost);
            pager    = new Pager(store, snapshotstore, localhost, transfer);
        }
Exemple #19
0
        public FhirService(Infrastructure infrastructure)
        {
            this.localhost = infrastructure.Localhost;
            this.store = infrastructure.Store;
            this.snapshotstore = infrastructure.SnapshotStore;
            this.generator = infrastructure.Generator;
            this.index = infrastructure.Index;
            this.listener = infrastructure.ServiceListener;

            transfer = new Transfer(generator, localhost);
            pager = new Pager(store, snapshotstore, localhost, transfer);
        }
Exemple #20
0
        public static ResourceImporter GetResourceImporter()
        {
            IFhirStore       store    = GetMongoFhirStore();
            ResourceImporter importer = new ResourceImporter(store, Settings.Endpoint);

            importer.SharedEndpoints.Add("http://hl7.org/fhir/");

            importer.SharedEndpoints.Add("localhost");
            importer.SharedEndpoints.Add("localhost.");

            return(importer);
        }
Exemple #21
0
        protected virtual IFhirServiceExtension GetPaging()
        {
            IFhirStore     fhirStore      = fhirStoreBuilder.GetStore <IFhirStore>();
            ISnapshotStore snapshotStore  = fhirStoreBuilder.GetStore <ISnapshotStore>();
            IGenerator     storeGenerator = fhirStoreBuilder.GetStore <IGenerator>();

            if (fhirStore != null)
            {
                return(new PagingService(snapshotStore, new SnapshotPaginationProvider(fhirStore, new Transfer(storeGenerator, new Localhost(baseUri)), new Localhost(baseUri), new SnapshotPaginationCalculator())));
            }
            return(null);
        }
Exemple #22
0
 public SnapshotPaginationService(
     IFhirStore fhirStore,
     ITransfer transfer,
     ILocalhost localhost,
     ISnapshotPaginationCalculator snapshotPaginationCalculator,
     Snapshot snapshot)
 {
     _fhirStore = fhirStore;
     _transfer  = transfer;
     _localhost = localhost;
     _snapshotPaginationCalculator = snapshotPaginationCalculator;
     _snapshot = snapshot;
 }
Exemple #23
0
        public FhirService(Uri endpoint)
        {
            //refac: store = DependencyCoupler.Inject<IFhirStore>(); // new MongoFhirStore();

            store     = DependencyCoupler.Inject <IFhirStore>();
            tagstore  = DependencyCoupler.Inject <ITagStore>();
            generator = DependencyCoupler.Inject <IGenerator>();
            index     = DependencyCoupler.Inject <IFhirIndex>(); // Factory.Index;
            importer  = DependencyCoupler.Inject <ResourceImporter>();
            exporter  = DependencyCoupler.Inject <ResourceExporter>();
            pager     = new Pager(store, exporter);
            Endpoint  = endpoint;
        }
Exemple #24
0
        public FhirService(Uri endpoint)
        {
            //refac: store = DependencyCoupler.Inject<IFhirStore>(); // new MongoFhirStore();

            store = DependencyCoupler.Inject<IFhirStore>();
            tagstore = DependencyCoupler.Inject<ITagStore>();
            generator = DependencyCoupler.Inject<IGenerator>();
            index = DependencyCoupler.Inject<IFhirIndex>(); // Factory.Index;
            importer = DependencyCoupler.Inject<ResourceImporter>();
            exporter = DependencyCoupler.Inject<ResourceExporter>();
            pager = new Pager(store, exporter);
            Endpoint = endpoint;
        }
        public string GenerateQuery(IFhirStore store, string resourceType, NameValueCollection parms)
        {
            var where = new StringBuilder();
            //Select statement for Resource
            var select = new StringBuilder();

            select.Append(store.SelectAllQuery);
            foreach (string key in parms)
            {
                var value = parms[key];
                pmap.TryGetValue(resourceType + "." + key, out var parmdef);
                if (parmdef == null)
                {
                    continue;
                }
                //TODO Handle Setting up Parm Type and process value for prefix and modifiers
                //Add JOINS to select
                pmap.TryGetValue(resourceType + "." + key + ".join", out var join);
                if (join != null)
                {
                    if (!select.ToString().Contains(join))
                    {
                        select.Append(" " + join);
                    }
                }
                //Add Where clauses/bind values
                pmap.TryGetValue(resourceType + "." + key + ".default", out var querypiece);
                if (querypiece == null)
                {
                    continue;
                }
                where.Append(where.Length == 0 ? " WHERE (" : " and (");
                //Handle bind values single or multiple
                var vals = value.Split(',');
                foreach (var s in vals)
                {
                    var currentpiece = querypiece;
                    var t            = s.Split('|');
                    var x            = 0;
                    currentpiece = t.Aggregate(currentpiece, (current, u) => current.Replace("~v" + x++ + "~", u));
                    where.Append("(" + currentpiece + ") OR ");
                }

                where.Remove(where.Length - 3, 3);
                where.Append(")");
            }

            return(select + where.ToString());
        }
Exemple #26
0
        //TODO: Inject Storage Implementation
        public ResourceController(IFhirStore store)
        {
            var s      = CloudConfigurationManager.GetSetting("FHIRParserMode");
            var strict = s == null || s.Equals("strict", StringComparison.CurrentCultureIgnoreCase);

            storage = store;
            var parsersettings = new ParserSettings
            {
                AcceptUnknownMembers   = !strict,
                AllowUnrecognizedEnums = !strict
            };

            jsonparser = new FhirJsonParser(parsersettings);
            xmlparser  = new FhirXmlParser(parsersettings);
        }
Exemple #27
0
        public FhirService(ILocalhost localhost, IFhirStore fhirStore, ISnapshotStore snapshotStore, IGenerator keyGenerator,
                           IFhirIndex fhirIndex, IServiceListener serviceListener, IFhirResponseFactory responseFactory, IndexService indexService)
        {
            this.localhost       = localhost;
            this.fhirStore       = fhirStore;
            this.snapshotstore   = snapshotStore;
            this.keyGenerator    = keyGenerator;
            this.fhirIndex       = fhirIndex;
            this.serviceListener = serviceListener;
            this.responseFactory = responseFactory;
            _indexService        = indexService;

            transfer = new Transfer(this.keyGenerator, localhost);
            pager    = new Pager(this.fhirStore, snapshotstore, localhost, transfer, ModelInfo.SearchParameters);
            //TODO: Use FhirModel instead of ModelInfo for the searchparameters.
        }
Exemple #28
0
        public FhirService(ILocalhost localhost, IFhirStore fhirStore, ISnapshotStore snapshotStore, IGenerator keyGenerator,
            IFhirIndex fhirIndex, IServiceListener serviceListener, IFhirResponseFactory responseFactory, IndexService indexService)
        {
            this.localhost = localhost;
            this.fhirStore = fhirStore;
            this.snapshotstore = snapshotStore;
            this.keyGenerator = keyGenerator;
            this.fhirIndex = fhirIndex;
            this.serviceListener = serviceListener;
            this.responseFactory = responseFactory;
            _indexService = indexService;

            transfer = new Transfer(this.keyGenerator, localhost);
            pager = new Pager(this.fhirStore, snapshotstore, localhost, transfer, ModelInfo.SearchParameters);
            //TODO: Use FhirModel instead of ModelInfo for the searchparameters.
        }
Exemple #29
0
        private static void AddTaggedPatient()
        {
            IFhirStore store   = Spark.Store.MongoStoreFactory.GetMongoFhirStore();
            var        patient = new Patient();

            patient.Id   = "Patient/tagged";
            patient.Name = new List <HumanName>();
            patient.Name.Add(new HumanName()
            {
                Given = new string[] { "Truus" }, Family = new string[] { "Tagged" }
            });
            ResourceEntry patientRE = ResourceEntry.Create(patient);

            patientRE.Id       = new Uri("Patient/tagged", UriKind.Relative);
            patientRE.SelfLink = new Uri("Patient/tagged", UriKind.Relative);
            patientRE.Tags.Add(new Tag(_otherTag, Tag.FHIRTAGSCHEME_GENERAL, "dummy"));
            store.Add(patientRE);
            index.Process(patientRE);
        }
Exemple #30
0
 public ResourceImporter(IFhirStore store, Uri endpoint)
 {
     _endpoint = endpoint;
     _store = store;
     SharedEndpoints.Add(_endpoint);
 }
Exemple #31
0
 public Pager(IFhirStore store)
 {
     this._store = store;
 }
 public ResourceStorageService(ITransfer transfer, IFhirStore fhirStore)
 {
     this.transfer  = transfer;
     this.fhirStore = fhirStore;
 }
Exemple #33
0
 public FhirResponseFactory(IFhirStore fhirStore, Transfer transfer, IFhirResponseInterceptorRunner interceptorRunner)
 {
     this.fhirStore = fhirStore;
     this.transfer = transfer;
     this.interceptorRunner = interceptorRunner;
 }
Exemple #34
0
 public ResourceStorageService(ITransfer transfer, IFhirStore fhirStore)
 {
     _transfer  = transfer;
     _fhirStore = fhirStore;
 }
Exemple #35
0
 public Pager(IFhirStore store, ResourceExporter exporter)
 {
     this.store = store;
     this.exporter = exporter;
 }
Exemple #36
0
 public FhirResponseFactory(IFhirStore fhirStore, Transfer transfer, IFhirResponseInterceptorRunner interceptorRunner)
 {
     this.fhirStore         = fhirStore;
     this.transfer          = transfer;
     this.interceptorRunner = interceptorRunner;
 }
Exemple #37
0
 public Pager(IFhirStore store)
 {
     this._store = store;
 }
Exemple #38
0
        public static async Task <List <Resource> > ProcessIncludesAsync(Resource source, NameValueCollection parms, IFhirStore store)
        {
            var retVal      = new List <Resource>();
            var includeparm = parms["_include"];

            if (!string.IsNullOrEmpty(includeparm))
            {
                var serialize = new FhirJsonSerializer();


                var j    = serialize.SerializeToString(source);
                var incs = includeparm.Split(',');
                foreach (var t in incs)
                {
                    var isinstance = false;
                    var s          = t.Split(':');
                    if (s.Length <= 1)
                    {
                        continue;
                    }
                    var    prop = s[1];
                    JToken x    = null;
                    try
                    {
                        if (prop.Equals("substance"))
                        {
                            x          = j[Convert.ToInt32("suspectEntity")];
                            isinstance = true;
                        }
                        else
                        {
                            x = j[Convert.ToInt32(prop)];
                        }
                    }
                    catch
                    {
                        // ignored
                    }

                    if (x == null)
                    {
                        continue;
                    }
                    for (var i = 0; i < x.Count(); i++)
                    {
                        var x1    = x.Type == JTokenType.Array ? x[i] : x;
                        var z     = isinstance ? x1["instance"]["reference"].ToString() : x1["reference"].ToString();
                        var split = z.Split('/');
                        if (split.Length <= 1)
                        {
                            continue;
                        }
                        var a1 = await store.LoadFhirResourceAsync(split[1], split[0]).ConfigureAwait(false);

                        if (a1 != null)
                        {
                            retVal.Add(a1);
                        }
                    }
                }
            }

            return(retVal);
        }
 public ResourceImporter(IFhirStore store, Uri endpoint)
 {
     _endpoint = endpoint;
     _store    = store;
     SharedEndpoints.Add(_endpoint);
 }
Exemple #40
0
 public Pager(IFhirStore store, ResourceExporter exporter)
 {
     this.store    = store;
     this.exporter = exporter;
 }