Beispiel #1
0
        public FhirResponse Conformance()
        {
            var conformance = DependencyCoupler.Inject <Conformance>();

            return(Respond.WithResource(conformance));

            // DSTU2: conformance
            //var conformance = ConformanceBuilder.Build();

            //return Respond.WithResource(conformance);

            //var entry = new ResourceEntry<Conformance>(KeyHelper.NewCID(), DateTimeOffset.Now, conformance);
            //return entry;

            //Uri location =
            //     ResourceIdentity.Build(
            //        ConformanceBuilder.CONFORMANCE_COLLECTION_NAME,
            //        ConformanceBuilder.CONFORMANCE_ID
            //    ).OperationPath;

            //BundleEntry conformance = _store.FindEntryById(location);

            //if (conformance == null || !(conformance is ResourceEntry))
            //{
            //    throw new SparkException(
            //        HttpStatusCode.InternalServerError,
            //        "Cannot find an installed conformance statement for this server. Has it been initialized?");
            //}
            //else
            //    return (ResourceEntry)conformance;
        }
Beispiel #2
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;
 }
        public OperationOutcome BinTest()
        {
            IBlobStorage store = DependencyCoupler.Inject <IBlobStorage>();

            byte[]       byteArray = Encoding.UTF8.GetBytes("Hello world!");
            MemoryStream stream    = new MemoryStream(byteArray);

            store.Open();
            store.Store("maintenanceblob", stream);
            store.Close();
            return(new OperationOutcome().Message("Binary test completed."));
        }
Beispiel #4
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;
        }
Beispiel #5
0
 public FhirController()
 {
     service = DependencyCoupler.Inject <IFhirService>();
 }
Beispiel #6
0
 public MetaStore()
 {
     database   = DependencyCoupler.Inject <MongoDatabase>();
     collection = database.GetCollection(MongoFhirStore.RESOURCE_COLLECTION);
 }
Beispiel #7
0
 private IBlobStorage getBlobStorage()
 {
     return(DependencyCoupler.Inject <IBlobStorage>());
 }