public Pager(IFhirStore store, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer) { this.store = store; this.snapshotstore = snapshotstore; this.localhost = localhost; this.transfer = transfer; }
public Import(ILocalhost localhost, IGenerator generator) { this.localhost = localhost; this.generator = generator; mapper = new Mapper<Key, Key>(); interactions = new List<Interaction>(); }
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 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(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; }
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; }
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 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); }
private static Bundle.HTTPVerb DetermineMethod(ILocalhost localhost, IKey key) { if (key == null) return Bundle.HTTPVerb.DELETE; // probably... switch (localhost.GetKeyKind(key)) { case KeyKind.Foreign: return Bundle.HTTPVerb.POST; case KeyKind.Temporary: return Bundle.HTTPVerb.POST; case KeyKind.Internal: return Bundle.HTTPVerb.PUT; case KeyKind.Local: return Bundle.HTTPVerb.PUT; default: return Bundle.HTTPVerb.PUT; } }
public static Interaction ToInteraction(this ILocalhost localhost, Bundle.EntryComponent bundleEntry) { Key key = localhost.ExtractKey(bundleEntry); Bundle.HTTPVerb method = localhost.ExtrapolateMethod(bundleEntry, key); if (key != null) { return(Interaction.Create(method, key, bundleEntry.Resource)); } else { return(Interaction.Create(method, bundleEntry.Resource)); } }
public static Key ExtractKey(this ILocalhost localhost, Bundle.EntryComponent entry) { if (entry.Request != null && entry.Request.Url != null) { return(localhost.UriToKey(entry.Request.Url)); } else if (entry.Resource != null) { return(entry.Resource.ExtractKey()); } else { return(null); } }
public static async Task <ResourceManipulationOperation> GetManipulationOperation( Bundle.EntryComponent entryComponent, ILocalhost localhost, ISearchService service = null) { var method = localhost.ExtrapolateMethod(entryComponent, null); //CCR: is key needed? Isn't method required? var key = localhost.ExtractKey(entryComponent); var searchUri = GetSearchUri(entryComponent, method); return(await _builders[method]( entryComponent.Resource, key, service, searchUri != null ? ParseQueryString(localhost, searchUri) : null) .ConfigureAwait(false)); }
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. }
public static Key UriToKey(this ILocalhost localhost, Uri uri) { if (uri.IsAbsoluteUri && uri.IsTemporaryUri() == false) { return(localhost.IsBaseOf(uri) ? localhost.LocalUriToKey(uri) : throw new ArgumentException("Cannot create a key from a foreign Uri")); } if (uri.IsTemporaryUri()) { return(Key.Create(null, uri.ToString())); } var path = uri.ToString(); return(Key.ParseOperationPath(path)); }
public static Key UriToKey(this ILocalhost localhost, Uri uri) { if (uri.IsAbsoluteUri) { if (localhost.IsBaseOf(uri)) { return(localhost.LocalUriToKey(uri)); } else { return(ForeignUriToKey(uri)); } } else { string path = uri.ToString(); return(Key.ParseOperationPath(path)); } }
public static Key ExtractKey(this ILocalhost localhost, Bundle.EntryComponent entry) { Key key = null; if (entry.Request != null && entry.Request.Url != null) { key = localhost.UriToKey(entry.Request.Url); } else if (entry.Resource != null) { key = entry.Resource.ExtractKey(); } if (key != null && string.IsNullOrEmpty(key.ResourceId) && entry.FullUrl != null && UriHelper.IsTemporaryUri(entry.FullUrl)) { key.ResourceId = entry.FullUrl; } return(key); }
private static Bundle.HTTPVerb DetermineMethod(ILocalhost localhost, IKey key) { if (key == null) { return(Bundle.HTTPVerb.DELETE); // probably... } switch (localhost.GetKeyKind(key)) { case KeyKind.Foreign: return(Bundle.HTTPVerb.POST); case KeyKind.Temporary: return(Bundle.HTTPVerb.POST); case KeyKind.Internal: return(Bundle.HTTPVerb.PUT); case KeyKind.Local: return(Bundle.HTTPVerb.PUT); default: return(Bundle.HTTPVerb.PUT); } }
public static KeyKind GetKeyKind(this ILocalhost localhost, IKey key) { if (key.IsTemporary()) { return(KeyKind.Temporary); } else if (!key.HasBase()) { return(KeyKind.Internal); } else if (localhost.IsLocal(key)) { return(KeyKind.Local); } else { return(KeyKind.Foreign); } }
public static Key UriToKey(this ILocalhost localhost, Uri uri) { if (uri.IsAbsoluteUri) { if (localhost.IsBaseOf(uri)) { return(localhost.LocalUriToKey(uri)); } else { throw new ArgumentException("Cannot create a key from a foreign Uri"); } } else { string path = uri.ToString(); return(Key.ParseOperationPath(path)); } }
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; }
public static Conformance GetSparkConformance(string sparkVersion, ILocalhost localhost) { string vsn = Hl7.Fhir.Model.ModelInfo.Version; Conformance conformance = CreateServer("Spark", sparkVersion, "Furore", fhirVersion: vsn); conformance.AddAllCoreResources(readhistory: true, updatecreate: true, versioning: Conformance.ResourceVersionPolicy.VersionedUpdate); conformance.AddAllSystemInteractions().AddAllInteractionsForAllResources().AddCoreSearchParamsAllResources(); conformance.AddSummaryForAllResources(); conformance.AddOperation("Fetch Patient Record", new ResourceReference() { Url = localhost.Absolute(new Uri("OperationDefinition/Patient-everything", UriKind.Relative)) }); conformance.AddOperation("Generate a Document", new ResourceReference() { Url = localhost.Absolute(new Uri("OperationDefinition/Composition-document", UriKind.Relative)) }); conformance.AcceptUnknown = Conformance.UnknownContentCode.Both; conformance.Experimental = true; conformance.Kind = Conformance.ConformanceStatementKind.Capability; conformance.Format = new string[] { "xml", "json" }; conformance.Description = "This FHIR SERVER is a reference Implementation server built in C# on HL7.Fhir.Core (nuget) by Furore and others"; return(conformance); }
public Transfer(IGenerator generator, ILocalhost localhost) { this.generator = generator; this.localhost = localhost; }
public MongoSearcher(MongoIndexStore mongoIndexStore, ILocalhost localhost, IFhirModel fhirModel) { _collection = mongoIndexStore.Collection; _localhost = localhost; _fhirModel = fhirModel; }
public static Key UriToKey(this ILocalhost localhost, string uristring) { Uri uri = new Uri(uristring, UriKind.RelativeOrAbsolute); return(localhost.UriToKey(uri)); }
public static Uri GetAbsoluteUri(this ILocalhost localhost, IKey key) { return(key.ToUri(localhost.DefaultBase)); }
//public static string GetOperationPath(this ILocalhost localhost, Uri uri) //{ // Key key = localhost.AnyUriToKey(uri).WithoutBase(); // return key.ToOperationPath(); // //Uri endpoint = localhost.GetBaseOf(uri); // //string _base = endpoint.ToString(); // //string path = uri.ToString().Remove(0, _base.Length); // //return path; //} public static Uri Uri(this ILocalhost localhost, params string[] segments) { return(new RestUrl(localhost.DefaultBase).AddPath(segments).Uri); }
public static bool IsForeign(this ILocalhost localhost, IKey key) { return(!localhost.IsLocal(key)); }
private static Bundle.HTTPVerb ExtrapolateMethod(this ILocalhost localhost, Bundle.BundleEntryComponent entry, IKey key) { return(entry.Transaction.Method ?? DetermineMethod(localhost, key)); }
public static bool IsBaseOf(this ILocalhost localhost, string uristring) { Uri uri = new Uri(uristring, UriKind.RelativeOrAbsolute); return(localhost.IsBaseOf(uri)); }
public static ResourceManipulationOperation GetManipulationOperation(Bundle.EntryComponent entryComponent, ILocalhost localhost, ISearchService service = null) { searchService = service; Bundle.HTTPVerb method = localhost.ExtrapolateMethod(entryComponent, null); //CCR: is key needed? Isn't method required? Key key = localhost.ExtractKey(entryComponent); var searchUri = GetSearchUri(entryComponent, method); return(builders[method](entryComponent.Resource, key, service, searchUri != null? ParseQueryString(localhost, searchUri): null)); }
public Export(ILocalhost localhost) { this.localhost = localhost; interactions = new List <Interaction>(); }
public static Uri Uri(this ILocalhost localhost, IKey key) { return(key.ToUri(localhost.Base)); }
public CapabilityStatementService(ILocalhost localhost) => _localhost = localhost;
public static CapabilityStatement GetSparkCapabilityStatement(string sparkVersion, ILocalhost localhost) { var vsn = FHIRVersion.N4_0_1; var capabilityStatement = CreateServer("Spark", sparkVersion, "Incendi", fhirVersion: vsn); capabilityStatement.AddAllCoreResources( true, true, CapabilityStatement.ResourceVersionPolicy.VersionedUpdate); capabilityStatement.AddAllSystemInteractions() .AddAllInteractionsForAllResources() .AddCoreSearchParamsAllResources(); capabilityStatement.AddSummaryForAllResources(); capabilityStatement.AddOperation( "Fetch Patient Record", localhost.Absolute(new Uri("OperationDefinition/Patient-everything", UriKind.Relative)).ToString()); capabilityStatement.AddOperation( "Generate a Document", localhost.Absolute(new Uri("OperationDefinition/Composition-document", UriKind.Relative)).ToString()); //capabilityStatement.AcceptUnknown = CapabilityStatement.UnknownContentCode.Both; capabilityStatement.Experimental = true; capabilityStatement.Kind = CapabilityStatementKind.Capability; capabilityStatement.Format = new string[] { "xml", "json" }; capabilityStatement.Description = new Markdown("This FHIR SERVER is a reference Implementation server built in C# on HL7.Fhir.Core (nuget) by Firely, Incendi and others"); return(capabilityStatement); }
public static Infrastructure AddLocalhost(this Infrastructure infrastructure, ILocalhost localhost) { infrastructure.Localhost = localhost; return infrastructure; }
public MongoStoreBuilder(string mongoUrl, ILocalhost localhost) { this.mongoUrl = mongoUrl; this.localhost = localhost; }
public Export(ILocalhost localhost) { this.localhost = localhost; entries = new List <Entry>(); }
public ReferenceNormalizationService(ILocalhost localhost) =>
public static Bundle.HTTPVerb ExtrapolateMethod(this ILocalhost localhost, Bundle.EntryComponent entry, IKey key) { return(entry.Request?.Method ?? DetermineMethod(localhost, key)); }
public Export(ILocalhost localhost) { this.localhost = localhost; interactions = new List<Interaction>(); }
public Export(ILocalhost localhost, ExportSettings exportSettings) { this.localhost = localhost; this.exportSettings = exportSettings; entries = new List <Entry>(); }