Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Logs FHIR resource versions on Application startup #3633

Merged
merged 7 commits into from
Dec 19, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ public SystemConformanceProvider(
_urlResolver = urlResolver;
_contextAccessor = contextAccessor;
_searchParameterStatusManager = searchParameterStatusManager;

if (!string.IsNullOrEmpty(_configuration.Value.Versioning.Default))
{
_logger.LogInformation("Default version is:{VersioningDefault}.", _configuration.Value.Versioning.Default);

foreach (var resourcetype in _configuration.Value.Versioning.ResourceTypeOverrides)
{
_logger.LogInformation("{ResourceTypeKey} version overridden to:{ResourceTypeVersioningOverride}.", resourcetype.Key, resourcetype.Value);
}
}
}

public override async Task<ResourceElement> GetCapabilityStatementOnStartup(CancellationToken cancellationToken = default(CancellationToken))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Hl7.Fhir.Model;
using Hl7.Fhir.Serialization;
using Hl7.FhirPath;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -27,6 +28,7 @@
using Microsoft.Health.Fhir.Core.Features.Context;
using Microsoft.Health.Fhir.Core.Features.Persistence;
using Microsoft.Health.Fhir.Core.Features.Security;
using Microsoft.Health.Fhir.Core.Messages.CapabilityStatement;
using Microsoft.Health.Fhir.Core.Models;

namespace Microsoft.Health.Fhir.Api.Modules
Expand Down Expand Up @@ -128,7 +130,8 @@ ResourceElement SetMetadata(Resource resource, string versionId, DateTimeOffset
services.AddSingleton<CorrelationIdProvider>(_ => () => Guid.NewGuid().ToString());

// Add conformance provider for implementation metadata.
services.Add<SystemConformanceProvider>()
services.RemoveServiceTypeExact<SystemConformanceProvider, INotificationHandler<RebuildCapabilityStatement>>()
.Add<SystemConformanceProvider>()
.Singleton()
.AsSelf()
.AsImplementedInterfaces();
Expand Down