// Copy this method
        private void FhirSetup(IServiceCollection services)
        {
            var fhirStarterSettings =
                StartupConfigHelper.BuildConfigurationFromJson(AppContext.BaseDirectory, "appsettings.json");

            FhirStarterConfig.SetupFhir(services, fhirStarterSettings, CompatibilityVersion.Version_2_2);

            var detonator  = FhirStarterConfig.GetDetonatorAssembly();
            var instigator = FhirStarterConfig.GetInstigatorAssembly();

            services.Configure <FhirStarterSettings>(fhirStarterSettings.GetSection(nameof(FhirStarterSettings)));
            services.AddMvc(options =>
            {
                options.OutputFormatters.Clear();
                options.RespectBrowserAcceptHeader = true;
                options.OutputFormatters.Add(new XmlFhirSerializerOutputFormatter());
                options.OutputFormatters.Add(new XmlDataContractSerializerOutputFormatter());
                options.OutputFormatters.Add(new JsonFhirFormatter());
            })
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.Formatting = Formatting.Indented;
            })
            .AddApplicationPart(instigator).AddApplicationPart(detonator).AddControllersAsServices()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
        // copy this method to your Startup
        public void FhirDotnet3Setup(IServiceCollection services)
        {
            var appSettings =
                StartupConfigHelper.BuildConfigurationFromJson(AppContext.BaseDirectory, "appsettings.json");

            FhirStarterConfig.SetupFhir(services, appSettings);

            var detonator  = FhirStarterConfig.GetDetonatorAssembly(appSettings["FhirStarterSettings:FhirDetonatorAssembly"]);
            var instigator = FhirStarterConfig.GetInstigatorAssembly(appSettings["FhirStarterSettings:FhirInstigatorAssembly"]);

            services.Configure <FhirStarterSettings>(appSettings.GetSection(nameof(FhirStarterSettings)));
            services.AddRouting();

            services.AddControllers(controller =>
            {
                controller.OutputFormatters.Clear();
                controller.InputFormatters.Clear();
                controller.RespectBrowserAcceptHeader = true;
                // output
                controller.OutputFormatters.Add(new JsonFhirFormatterDotNetCore3());
                controller.OutputFormatters.Add(new XmlFhirSerializerOutputFormatterDotNetCore3());
                controller.OutputFormatters.Add(new XmlDataContractSerializerOutputFormatter());

                // input
                controller.InputFormatters.Add(new JsonFhirInputFormatter());
                controller.InputFormatters.Add(new XmlFhirSerializerInputFormatterDotNetCore3());

                controller.Filters.Add(typeof(FhirExceptionFilter));
            })
            .AddApplicationPart(instigator).AddApplicationPart(detonator).AddControllersAsServices();
            services.AddHttpContextAccessor();
            services.AddMvc(config =>
            {
                config.RespectBrowserAcceptHeader = true;

                config.OutputFormatters.Add(new JsonFhirFormatterDotNetCore3());
                config.OutputFormatters.Add(new XmlFhirSerializerOutputFormatterDotNetCore3());
                config.OutputFormatters.Add(new XmlDataContractSerializerOutputFormatter());
            });
            services.AddSingleton <DiagnosticObserver>();
        }