FHIR Chat · How to change entry url of a bundle resource · dotnet

Stream: dotnet

Topic: How to change entry url of a bundle resource


view this post on Zulip shuhaib k (Dec 13 2021 at 09:22):

I am customizing the Microsoft fhir server based on my DB(faced server). How could I change the 'http://localhost' value to my custom domain name while constructing the bundle resource? Attached screenshot where I need to change. Basically, the bundle elements url and fullUrl has to be replaced with my domain name. any advice, please

image.png .

view this post on Zulip Gino Canessa (Dec 13 2021 at 17:30):

@Brendan Kowitz @Caitlin Voegele

view this post on Zulip Brendan Kowitz (Dec 13 2021 at 17:41):

This depends on how it's hosted. If its inside a container then you should set ASPNETCORE_FORWARDEDHEADERS_ENABLED: true

view this post on Zulip shuhaib k (Dec 14 2021 at 09:11):

We hosted in our own IIS server(on-premises), If that is the case how does it work, anywhere in the code where I can mention about this. we hosted and changed my hostname in IIS and it doesn't work. still, it shows localhost in the URL

image.png

view this post on Zulip Brian Postlethwaite (Dec 14 2021 at 22:19):

If you're not using any of the Microsoft storage code and just using the code as a facade, you could also consider the fhir-net-web-api NuGet package/project.
As that handles all the facade level api controller code, and all you need to do is cover the storage layer.
It has specific code so that you can overload the base url for cases where you're behind reverse proxies or other api management scenarios.

view this post on Zulip Brian Postlethwaite (Dec 14 2021 at 22:22):

This is the demo project that goes along with it
https://github.com/brianpos/fhir-net-web-api/tree/feature/fhir-net-api-3.7.0/src/Hl7.DemoFileSystemFhirServer.AspNetCore

view this post on Zulip Brian Postlethwaite (Dec 14 2021 at 22:23):

And there are 2 partially complete implementations under it to demonstrate storage, a Sqlite one and a file system storage - both are demonstration only.
But the facade layer is in production use at national scale in several projects.

view this post on Zulip shuhaib k (Dec 15 2021 at 12:36):

We had already built an FHIR server using Microsoft Fhir server and facing the only issue to change the localhost to our domain server. If we have some configuration to change this, we are able to solve this issue. see the below example element, URL should be able to change to as value as http://myhealthdomain/Patient/EMR345/DiagnosticReport".

Note: It's a compartment search.

"link": [
    {
        "relation": "self",
        **"url": "http://localhost:9990/Patient/EMR345/DiagnosticReport"**

    }

view this post on Zulip shuhaib k (Dec 21 2021 at 07:00):

@Brendan Kowitz.Thanks for the advice. This is solved.
Resolution :
Added ASPNETCORE_FORWARDEDHEADERS_ENABLED: true in app settings and changed binding in IIS .
image.png


Last updated: Apr 12 2022 at 19:14 UTC