Stream: hapi
Topic: Accessing ServerUrl / BaseUrl while writing resources
Josh Collins (Mar 10 2020 at 18:50):
I'm noticing that IDType property of all? resources has a null baseUrl value. If I'm using the HardcodedServerAddressStrategy how would I either have this populate in the baseUrl or access the hardcoded value?
It can be set in the hapi.properties (server_address), but wasn't sure if there was a more elegant way to make use of it.
Thanks!
Josh Collins (Mar 11 2020 at 12:00):
The answer was staring at me in the face. The BaseParser class exposes a getServerBaseUrl() method (https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/parser/BaseParser.html#getServerBaseUrl()).
Last updated: Apr 12 2022 at 19:14 UTC